Commit Graph

1579 Commits

Author SHA1 Message Date
Tom Hvitved
b426d84e1c Merge pull request #20164 from hvitved/rust/fix-bad-join
Rust: Fix bad join
2025-08-05 09:55:51 +02:00
Geoffrey White
dcda6db88b Rust: Lets not try to maintain this list. 2025-08-04 19:51:34 +01:00
Geoffrey White
6c024a5f9e Rust: Remove unnecessary pattern matching in cleartext logging query sinks (probably inherited from another query or language where it is used). 2025-08-04 19:28:40 +01:00
github-actions[bot]
fb4b0aac53 Post-release preparation for codeql-cli-2.22.3 2025-08-04 17:18:08 +00:00
github-actions[bot]
fd82aeb1f8 Release preparation for version 2.22.3 2025-08-04 15:47:57 +00:00
Tom Hvitved
651e1624a6 Rust: Fix bad join
```
Evaluated relational algebra for predicate _Crate::Crate.getSourceFile/0#dispred#e7adf9d7_Crate::Generated::Crate.getName/0#dispred#f4d3b3bf_Pa__#join_rhs@5a04a7t0 with tuple counts:
        34471980   ~0%    {3} r1 = JOIN `PathResolution::isSourceFile/1#803de032` WITH `Crate::Crate.getSourceFile/0#dispred#e7adf9d7` CARTESIAN PRODUCT OUTPUT Rhs.0, Lhs.0, Rhs.1
        34471980  ~37%    {4}    | JOIN WITH `Crate::Generated::Crate.getName/0#dispred#f4d3b3bf` ON FIRST 1 OUTPUT Lhs.1, Lhs.2, Rhs.1, _
                          {3}    | REWRITE WITH NOT [Tmp.3 := "std", TEST InOut.2 != Tmp.3, Tmp.3 := "core", TEST InOut.2 != Tmp.3] KEEPING 3
           93420  ~91%    {3}    | SCAN OUTPUT In.1, _, In.0
           93420  ~87%    {3}    | REWRITE WITH Out.1 := "prelude"
                          return r1
```
2025-08-04 17:33:26 +02:00
Geoffrey White
e368ee4b1b Rust: Accept that sql-injection sinks are sinks for this query, and that the existing sinks created for this query are also new sql-injection sinks. 2025-08-04 15:23:04 +01:00
Tom Hvitved
125a4b9b10 Rust: Fix two bad joins introduced by magic
```
Evaluated relational algebra for predicate TypeInference::closureParameterPath/2#9d0bf423#bbf@ba08cc1s with tuple counts:
           565067    ~172652%    {2} r1 = JOIN `Callable::Callable.getParam/1#dispred#ce0254b3_01#count_range` WITH `Callable::Generated::Callable.getNumberOfParams/0#dispred#abb45996` ON FIRST 1 OUTPUT Rhs.1, Lhs.1
            24684     ~11784%    {3}    | JOIN WITH Type::TTupleTypeParameter#5ca17706 ON FIRST 2 OUTPUT Rhs.2, Lhs.1, Lhs.0
             2970      ~1391%    {3}    | JOIN WITH `TypeInference::TypePath::singleton/1#ee45de3b` ON FIRST 1 OUTPUT Lhs.1, Lhs.2, Rhs.1
              664       ~242%    {4}    | JOIN WITH `Stdlib::FnOnceTrait.getTypeParam/0#dispred#93f20bbc` CARTESIAN PRODUCT OUTPUT Rhs.1, Lhs.0, Lhs.1, Lhs.2
              303        ~49%    {4}    | JOIN WITH Type::TDynTraitTypeParameter#e16268df ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3
              198         ~0%    {8}    | JOIN WITH `TypeInference::TypePath::singleton/1#ee45de3b` ON FIRST 1 OUTPUT Lhs.1, Lhs.2, _, _, Rhs.1, Lhs.3, _, _
                                 {4}    | REWRITE WITH Out.2 := (In.4 ++ In.5), Tmp.3 := (In.4 ++ In.5), Tmp.6 := "[0-9]+", Tmp.7 := "", Out.3 := regexpReplaceAll(Tmp.3,Tmp.6,Tmp.7) KEEPING 4
              198         ~0%    {6}    | SCAN OUTPUT In.0, In.1, In.2, _, In.3, _
                                 {4}    | REWRITE WITH Out.3 := length(In.4), Tmp.5 := 10, TEST Out.3 <= Tmp.5 KEEPING 4
              198         ~0%    {3}    | SCAN OUTPUT In.1, In.0, In.2

           877984   ~1444714%    {1} r2 = SCAN `CallExprBase::CallExprBase.getArg/1#dispred#d775f13d` OUTPUT In.1
           299888     ~83707%    {3}    | JOIN WITH Type::TTupleTypeParameter#5ca17706_102#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.0, Rhs.2
        515462762     ~59140%    {4}    | JOIN WITH `CallExprBase::Generated::CallExprBase.getNumberOfArgs/0#dispred#0975fe12_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.0, Lhs.2
          9429188  ~25728933%    {3}    | JOIN WITH TypeInference::InvokedClosureExpr#24e5dacb_1#join_rhs ON FIRST 1 OUTPUT Lhs.3, Lhs.1, Lhs.2
            53669    ~142315%    {3}    | JOIN WITH `TypeInference::TypePath::singleton/1#ee45de3b` ON FIRST 1 OUTPUT Lhs.1, Lhs.2, Rhs.1
             4003     ~10522%    {4}    | JOIN WITH `Stdlib::FnOnceTrait.getTypeParam/0#dispred#93f20bbc` CARTESIAN PRODUCT OUTPUT Rhs.1, Lhs.0, Lhs.1, Lhs.2
              370       ~910%    {4}    | JOIN WITH Type::TDynTraitTypeParameter#e16268df ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3
              148       ~293%    {8}    | JOIN WITH `TypeInference::TypePath::singleton/1#ee45de3b` ON FIRST 1 OUTPUT Lhs.1, Lhs.2, _, _, Rhs.1, Lhs.3, _, _
                                 {4}    | REWRITE WITH Out.2 := (In.4 ++ In.5), Tmp.3 := (In.4 ++ In.5), Tmp.6 := "[0-9]+", Tmp.7 := "", Out.3 := regexpReplaceAll(Tmp.3,Tmp.6,Tmp.7) KEEPING 4
              148       ~316%    {6}    | SCAN OUTPUT In.0, In.1, In.2, _, In.3, _
                                 {4}    | REWRITE WITH Out.3 := length(In.4), Tmp.5 := 10, TEST Out.3 <= Tmp.5 KEEPING 4
              148       ~293%    {3}    | SCAN OUTPUT In.1, In.0, In.2

              346        ~75%    {3} r3 = r1 UNION r2
                                 return r3
```

and

```
Evaluated relational algebra for predicate TypeInference::fnParameterPath/2#4dea2880#bbf@d56000vi with tuple counts:
                1         ~0%    {1} r1 = SCAN `Stdlib::FnOnceTrait.getTypeParam/0#dispred#93f20bbc` OUTPUT In.1
                1         ~0%    {1}    | JOIN WITH Type::TTypeParamTypeParameter#868c69a5 ON FIRST 1 OUTPUT Rhs.1
                1         ~0%    {1}    | JOIN WITH `TypeInference::TypePath::singleton/1#ee45de3b` ON FIRST 1 OUTPUT Rhs.1
           877984   ~1350201%    {2}    | JOIN WITH `ArgList::Generated::ArgList.getArg/1#dispred#b07adc80` CARTESIAN PRODUCT OUTPUT Rhs.1, Lhs.0
           321252     ~90755%    {4}    | JOIN WITH Type::TTupleTypeParameter#5ca17706_102#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.0, Rhs.2
        553043191     ~65412%    {5}    | JOIN WITH `CallExprBase::Generated::CallExprBase.getNumberOfArgs/0#dispred#0975fe12_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.0, Lhs.3
         10089088  ~26772053%    {4}    | JOIN WITH TypeInference::InvokedClosureExpr#24e5dacb_1#join_rhs ON FIRST 1 OUTPUT Lhs.4, Lhs.1, Lhs.2, Lhs.3
            57729    ~157423%    {8}    | JOIN WITH `TypeInference::TypePath::singleton/1#ee45de3b` ON FIRST 1 OUTPUT Lhs.2, Lhs.3, _, _, Lhs.1, Rhs.1, _, _
                                 {4}    | REWRITE WITH Out.2 := (In.4 ++ In.5), Tmp.3 := (In.4 ++ In.5), Tmp.6 := "[0-9]+", Tmp.7 := "", Out.3 := regexpReplaceAll(Tmp.3,Tmp.6,Tmp.7) KEEPING 4
            57729    ~157423%    {6}    | SCAN OUTPUT In.0, In.1, In.2, _, In.3, _
                                 {4}    | REWRITE WITH Out.3 := length(In.4), Tmp.5 := 10, TEST Out.3 <= Tmp.5 KEEPING 4
            57729    ~157423%    {3}    | SCAN OUTPUT In.1, In.0, In.2
                                 return r1
```
2025-08-04 14:22:50 +02:00
Simon Friis Vindum
3ba285c298 Rust: Implement certain type information for annotation and simple calls 2025-08-04 14:06:38 +02:00
Geoffrey White
01d24c4f83 Merge branch 'main' into sqlx 2025-07-31 16:02:36 +01:00
Simon Friis Vindum
abc58ac8b3 Rust: Add metric and debug predicates for type that reach the length limit 2025-07-31 14:20:32 +02:00
Simon Friis Vindum
3bc1d47738 Merge pull request #20130 from paldepind/rust/type-inference-fn
Rust: Implement type inference for closures and calls to closures
2025-07-30 13:13:57 +02:00
Anders Schack-Mulligen
5ca9c090a8 Merge pull request #20132 from aschackmull/ssa/guardvalue
SSA: Update data flow integration and BarrierGuard interface to use GuardValue.
2025-07-30 12:23:17 +02:00
Geoffrey White
a3110a9091 Rust: Implement query. 2025-07-29 18:19:52 +01:00
Simon Friis Vindum
5540b9df71 Merge branch 'main' into rust/type-inference-fn 2025-07-29 16:43:17 +02:00
Anders Schack-Mulligen
3b8234ecec SSA: Update data flow integration and BarrierGuard interface to use GuardValue. 2025-07-28 11:29:12 +02:00
Simon Friis Vindum
92bce4e432 Rust: Split getFunctionReturnPos into two predicates 2025-07-28 10:45:59 +02:00
Simon Friis Vindum
9761580b7e Merge branch 'main' into rust/type-inference-assoc-type-tp 2025-07-28 10:39:00 +02:00
Simon Friis Vindum
2c758a9842 Rust: Add type inference for closures and calls to first-class functions 2025-07-27 21:28:10 +02:00
Simon Friis Vindum
13d9d8ad3f Merge pull request #20122 from paldepind/rust/type-inference-dyn-assoc
Rust: Fix type inference for trait objects for traits with associated types
2025-07-26 12:40:09 +02:00
Geoffrey White
4b947db0f8 Merge pull request #19804 from geoffw0/dotdot
Rust: Update DotDotCheck to use getCanonicalPath
2025-07-25 15:50:29 +01:00
Simon Friis Vindum
b2ee625268 Rust: Expand doc and make predicate private 2025-07-25 15:22:10 +02:00
Geoffrey White
2192ed04be Rust: Add clone MaD trait model. 2025-07-25 09:43:34 +01:00
Geoffrey White
4140579dd6 Rust: Remove QL model for clone. 2025-07-25 08:17:52 +01:00
Geoffrey White
7f659804e4 Rust: Fix the canonical path. 2025-07-24 17:24:29 +01:00
Geoffrey White
cfe25593ee Merge branch 'main' into dotdot 2025-07-24 16:32:36 +01:00
Geoffrey White
67c170ffc1 Merge branch 'main' into sqlx 2025-07-24 15:25:35 +01:00
Simon Friis Vindum
466bf85a67 Rust: Fix type inference for trait objects for traits with associated types 2025-07-24 16:07:39 +02:00
Simon Friis Vindum
39f602c032 Rust: Create injective ids for impl trait type parameters 2025-07-24 12:07:11 +02:00
Simon Friis Vindum
9a0c5877ea Rust: Support impl trait types in return position with function type parameters 2025-07-24 11:00:01 +02:00
Simon Friis Vindum
82387461ee Merge pull request #20084 from paldepind/rust/type-inference-trait-object
Rust: Implement type inference for trait objects/`dyn` types
2025-07-24 10:17:23 +02:00
Simon Friis Vindum
b3dc6cba78 Rust: Use getATypeParam for consistency 2025-07-23 20:56:45 +02:00
Geoffrey White
199f2473e5 Merge pull request #20024 from geoffw0/moresensitive2
Shared: Improve sensitive data heuristics
2025-07-23 15:38:24 +01:00
Simon Friis Vindum
12942667bf Rust: Add type inference for dyn types 2025-07-23 14:08:15 +02:00
copilot-swe-agent[bot]
defd4a1d08 Add change note for removal of deprecated dataflow predicates
Co-authored-by: geoffw0 <40627776+geoffw0@users.noreply.github.com>
2025-07-23 10:41:31 +00:00
copilot-swe-agent[bot]
2cc732e235 Apply QL autoformatter to ModelsAsData.qll
Co-authored-by: geoffw0 <40627776+geoffw0@users.noreply.github.com>
2025-07-23 09:38:10 +00:00
copilot-swe-agent[bot]
0245cd872c Remove deprecated Rust dataflow predicates and associated classes
Co-authored-by: geoffw0 <40627776+geoffw0@users.noreply.github.com>
2025-07-23 08:49:24 +00:00
Geoffrey White
4f6b698ca3 Merge branch 'main' into moresensitive2 2025-07-23 08:50:25 +01:00
Simon Friis Vindum
f432cf9c4d Merge pull request #20041 from paldepind/rust/type-inference-tuples
Rust: Type inference for tuples
2025-07-23 08:21:27 +02:00
Geoffrey White
6efc19daac Merge pull request #18943 from geoffw0/constcrypto
Rust: new query rust/hardcoded-crytographic-value
2025-07-22 13:36:14 +01:00
Nick Rolfe
96a32c0179 Merge pull request #20103 from github/post-release-prep/codeql-cli-2.22.2
Post-release preparation for codeql-cli-2.22.2
2025-07-22 06:01:34 -04:00
github-actions[bot]
deb035cf4e Post-release preparation for codeql-cli-2.22.2 2025-07-22 09:36:07 +00:00
Simon Friis Vindum
6b366d8384 Merge branch 'main' into rust/type-inference-tuples 2025-07-22 10:45:41 +02:00
Simon Friis Vindum
79cc7318ba Merge pull request #20096 from paldepind/rust/path-resolution-associated-type-fix
Rust: Path resolution associated type fix
2025-07-22 10:12:07 +02:00
Geoffrey White
d53dada67f Rust: Update barrier logic to use getCanonicalPath. 2025-07-21 20:56:48 +01:00
Geoffrey White
ec3ad85504 Rust: Add another test case for barriers (that still functions). 2025-07-21 20:53:37 +01:00
github-actions[bot]
c8632b70b7 Release preparation for version 2.22.2 2025-07-21 16:45:45 +00:00
Geoffrey White
fc8a662f0d Rust: Update the models. 2025-07-21 17:24:07 +01:00
Nick Rolfe
ad9b637bec Revert "Merge pull request #19994 from github/post-release-prep/codeql-cli-2.22.2"
This reverts commit e5b4a15e35, reversing
changes made to 33e63109bb.
2025-07-21 15:18:59 +01:00
Geoffrey White
0ec10e5c30 Rust: Corrections after the merge. 2025-07-21 12:12:23 +01:00