Commit Graph

84768 Commits

Author SHA1 Message Date
Simon Friis Vindum
815af34c66 Rust: Add additional barriers to queries 2025-11-26 14:54:11 +01:00
Simon Friis Vindum
081ab499c2 Rust: Add barrier for fieldless enum types 2025-11-26 14:46:58 +01:00
Simon Friis Vindum
6050a0e1a8 Rust: Split boolean from number barriers 2025-11-26 14:45:31 +01:00
yoff
2c835dc33c python: add changenote 2025-11-26 14:03:15 +01:00
yoff
24e55c0691 python: update MAD expectations 2025-11-26 14:00:22 +01:00
Jeroen Ketema
33c7057066 C++: Remove incorrect tests
`__has_feature` is not available in GCC versions before GCC 14.

Our frontend was exposing `__has_feature` when emulating earlier versions of
GCC. This will be fixed with the latest major frontend update though.
2025-11-26 13:42:43 +01:00
yoff
ebe29dd143 python: model urllib.ParseResult 2025-11-26 13:36:05 +01:00
yoff
a878bc61e1 python: add model for urllib.urlparse 2025-11-26 13:32:54 +01:00
yoff
d59f721341 python: add test for header injection 2025-11-26 13:32:54 +01:00
Taus
5b47fcbfa4 Python: Remove dependence on Builtins from attribute module
The `Builtins` module is deeply entwined with points-to, so it would be
nice to not have this dependence. Happily, the only thing we used
`Builtin` for was to get the names of known builtins, and for this we
already maintain such a set of names in
`dataflow.new.internal.Builtins`.
2025-11-26 12:30:31 +00:00
Taus
9dc774aaa3 Python: Remove points-to dependency from parts of SSA
For whatever reason, the CFG node for exceptions and exception groups
was placed with the points-to code. (Probably because a lot of the
predicates depended on points-to.)

However, as it turned out, two of the SSA modules only depended on
non-points-to properties of these nodes, and so it was fairly
straightforward to remove the imports of `LegacyPointsTo` for those
modules.

In the process, I moved the aforementioned CFG node types into
`Flow.qll`, and changed the classes in the `Exceptions` module to the
`...WithPointsTo` form that we introduced elsewhere.
2025-11-26 12:30:31 +00:00
Taus
e09840426c Python: Get rid of points-to from Definitions.qll
Turns out the `ImportTime` module (despite living in
`semmle.python.types` does not actually depend on points-to, so some of
the `LegacyPointsTo` imports could be replaced or removed.
2025-11-26 12:30:31 +00:00
Taus
7328f26311 Python: Fix reachability-related test failures 2025-11-26 12:30:31 +00:00
Taus
21e74a3f01 Python: Fully remove points-to from Flow.qll
Gets rid of a bunch of predicates relating to reachability (which
depended on the modelling of exceptions, which uses points-to), moving
them to `LegacyPointsTo`. In the process, we gained a new class
`BasicBlockWithPointsTo`.
2025-11-26 12:30:31 +00:00
Taus
7176898503 Python: Fix library tests 2025-11-26 12:30:31 +00:00
Taus
b3b87c968b Python: Fix extractor/experimental tests 2025-11-26 12:30:31 +00:00
Taus
665104e626 Python: Fix Python 3 tests 2025-11-26 12:30:31 +00:00
Taus
85029bd77d Python: Fix Python 2 tests 2025-11-26 12:30:30 +00:00
Taus
5b63b4957c Python: Fix query tests
Mostly just adding `private import LegacyPointsTo`. Sometimes getting
rid of other imports that are superceded by that module.
2025-11-26 12:30:30 +00:00
Taus
2732a652ab Python: Fix example snippets
One might argue that these should be rewritten entirely to use more
modern APIs, but for now I'll be content with just having them compile
properly.
2025-11-26 12:30:30 +00:00
Taus
0a4ec2ca10 Python: Move some non-points-to methods out of points-to
These methods were in `pointsto.Base` but did not actually interact with
the points-to machinery directly, so they were easy to move out.
2025-11-26 12:30:30 +00:00
Taus
f0465f441f Python: Get rid of some get...Object methods
This frees `Class.qll`, `Exprs.qll`, and `Function.qll` from the
clutches of points-to. For the somewhat complicated setup with
`getLiteralObject` (an abstract method), I opted for a slightly ugly but
workable solution of just defining a predicate on `ImmutableLiteral`
that inlines each predicate body, special-cased to the specific instance
to which it applies.
2025-11-26 12:30:30 +00:00
Taus
78c33ab55a Python: Remove points-to references from python.qll
For now, these have just been made into `private` imports. After doing
this, I went through all of the (now not compiling) files and added in
private imports to the modules that they actually depended on.

I also added an explicit import of `LegacyPointsTo` (even though it may
be unnecessary) in cases where the points-to dependency was somewhat
surprising (and one we want to get rid of). This was primarily inside
the various SSA layers.

For modules inside `semmle.python.{types, objects, pointsto}` I did not
bother, as these are fairly clearly related to points-to.
2025-11-26 12:30:30 +00:00
Simon Friis Vindum
1c8cc39a6a Merge pull request #20906 from paldepind/rust/enum-fieldless
Rust: Add predicates for fieldless and unit-only enums
2025-11-26 12:52:28 +01:00
Owen Mansel-Chan
1d0fcd77d8 Add change note 2025-11-26 11:24:04 +00:00
Joe Farebrother
8d313ff85b qldoc fixes 2025-11-26 11:23:04 +00:00
Joe Farebrother
6207137ef0 Add changenote 2025-11-26 11:21:05 +00:00
Owen Mansel-Chan
eca9ec59c4 Add exclusions to data flow consistency checks 2025-11-26 11:12:44 +00:00
Owen Mansel-Chan
a2e68487ea Shared: allow exclusions to localFlowIsLocal 2025-11-26 11:00:30 +00:00
Owen Mansel-Chan
916fe69e65 Accept data flow consistency test results 2025-11-26 11:00:25 +00:00
Joe Farebrother
eb7fe71557 Fix namespace instances and update tests 2025-11-26 10:51:16 +00:00
Tom Hvitved
7e5131891c Rust: Special-case Self::AssocType in path resolution 2025-11-26 11:50:35 +01:00
Asger F
dbf14c190a Factor XML discard predicates into OverlayXml.qll 2025-11-26 11:48:32 +01:00
Owen Mansel-Chan
7cd04e346e Move existing consistency query to new place 2025-11-26 10:44:59 +00:00
Owen Mansel-Chan
fba53b58f8 Run data flow consistency tests in CI 2025-11-26 10:44:56 +00:00
Asger F
b33af5b377 JS: Fix typo 2025-11-26 11:40:41 +01:00
Tom Hvitved
0d46dc0461 Rust: More path resolution tests 2025-11-26 11:33:17 +01:00
Owen Mansel-Chan
0414555e43 Merge pull request #20741 from aegilops/java-kotlin-sensitive-logging-substring-barriers
java: Added Java/Kotlin Sensitive Logging barriers (substrings)
2025-11-26 09:55:14 +00:00
Asger F
0245b9d609 Merge pull request #20911 from asgerf/js/next-folders
JS: Fix project layout detection for Next.js apps
2025-11-26 09:09:54 +01:00
Simon Friis Vindum
7278bc75ca Rust: Remove unused function in XSS tests 2025-11-26 08:57:47 +01:00
Owen Mansel-Chan
f0dec21b9b Merge branch 'main' into java-kotlin-sensitive-logging-substring-barriers 2025-11-25 23:24:58 +00:00
Joe Farebrother
83eadbad60 Add namespace models 2025-11-25 16:56:36 +00:00
Joe Farebrother
85cb3e026c Merge pull request #20762 from joefarebrother/go-insecure-cookie
Go: Promote non-httponly cookie query, and add insecure cookie query
2025-11-25 16:39:45 +00:00
Mathias Vorreiter Pedersen
295dc6971f Merge branch 'main' into ignore-non-type-template-params 2025-11-25 15:37:25 +00:00
Simon Friis Vindum
7c7663629e Rust: Fix typo in change note for XSS query
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2025-11-25 16:13:11 +01:00
Asger F
5b4e114955 JS: Add test 2025-11-25 16:04:30 +01:00
Mathias Vorreiter Pedersen
73b6fa69a9 C++: Fix Code Scanning alert. 2025-11-25 15:03:26 +00:00
Mathias Vorreiter Pedersen
0deac833e4 C++: Accept test changes. 2025-11-25 14:59:09 +00:00
Asger F
a91969b7e1 JS: Change note 2025-11-25 15:58:11 +01:00
Mathias Vorreiter Pedersen
05737af165 C++: Only support non-type template parameters in tail position. 2025-11-25 14:55:44 +00:00