Commit Graph

78658 Commits

Author SHA1 Message Date
yoff
ee1eb199b5 actions: add description of actionsPermissionsDataModel 2025-04-01 17:07:02 +02:00
yoff
bd7c684c6c actions: add test with empty permissions 2025-04-01 17:06:32 +02:00
Taus
8afdf25e9a Actions: Mark helper predicate as noinline. 2025-04-01 14:50:00 +00:00
Asger F
4746cfddf2 JS: Add clarifying comment 2025-04-01 16:26:07 +02:00
Asger F
e1784bb10c JS: Fix handling of spread args on a bound function 2025-04-01 16:20:57 +02:00
Taus
c9fc7882e6 Actions: Fix bad performance in getTargetPath
Seen on `github/codeql`, some queries had very poor performance:
```
 [2/24 eval 36m4s] Evaluation done; writing results to
codeql/actions-queries/Security/CWE-312/ExcessiveSecretsExposure.bqrs
```

Investigating further lead to the following worrying sequence of joins
(after I ran out of patience and cancelled the query):
```
[2025-04-01 12:31:03] Tuple counts for
Yaml::YamlInclude.getTargetPath/0#dispred#32565107#fb#reorder_1_0/2@i6#9f4b2jw1
after 8m40s:
...
    559418    ~33%        {1} r5 = SCAN
`Yaml::YamlNode.getLocation/0#dispred#24555c57#prev_delta` OUTPUT In.1
...
    909345525 ~821%       {3} r7 = JOIN r5 WITH
`Yaml::YamlNode.getLocation/0#dispred#24555c57#prev` CARTESIAN PRODUCT
OUTPUT Rhs.1, Lhs.0 'result', Rhs.0
    909342139 ~779%       {3}    | JOIN WITH
`Locations::Location.getFile/0#dispred#dcf38c8d#prev` ON FIRST 1 OUTPUT
Rhs.1, Lhs.1 'result', Lhs.2
    909338753 ~794%       {3}    | JOIN WITH containerparent_10#join_rhs
ON FIRST 1 OUTPUT Rhs.1, Lhs.1 'result', Lhs.2
    909335367 ~824%       {3}    | JOIN WITH
`FileSystem::Container.getAbsolutePath/0#dispred#d234e6fa` ON FIRST 1
OUTPUT Lhs.2, Lhs.1 'result', Rhs.1
    883246724 ~812%       {3}    | JOIN WITH
`Yaml::YamlNode.getDocument/0#dispred#ee1eb3bf#bf_10#join_rhs` ON FIRST
1 OUTPUT Rhs.1 'this', Lhs.1 'result', Lhs.2
    760047185 ~838%       {5}    | JOIN WITH yaml_scalars ON FIRST 1
OUTPUT Lhs.1 'result', Lhs.0 'this', Rhs.2, _, Lhs.2
    0         ~0%         {4}    | REWRITE WITH Tmp.3 := "/", Out.3 :=
(In.4 ++ Tmp.3 ++ InOut.2), TEST Out.3 = InOut.0 KEEPING 4
                        {4}    | REWRITE WITH NOT [TEST InOut.2
startsWith "/"]
...
```

The culprit turned out to be the following method on class `YamlInclude`
```ql
private string getTargetPath() {
    exists(string path | path = this.getValue() |
    if path.matches("/%")
    then result = path
    else
        result =

this.getDocument().getLocation().getFile().getParentContainer().getAbsolutePath()
+ "/" +
            path
    )
}
```

Basically, in the `else` branch, the evaluator was producing all
possible values of `result` before filtering out the ones where the
`path` component started with a forward slash.

To fix this, I opted to factor out the logic into two helper predicates,
each accounting for whether `this.getValue()` does or does not start
with a `/`. With this, evaluating the original query from a clean cache
takes roughly 3.3s.
2025-04-01 13:59:19 +00:00
Tom Hvitved
ffb25b7aac Merge pull request #19162 from hvitved/rust/to-string-non-rec
Rust: Make `Element.toString` non-recursive
2025-04-01 15:31:18 +02:00
Anders Schack-Mulligen
e1ef56b8bb Swift: Fix accidental cartesian product. 2025-04-01 15:23:16 +02:00
Óscar San José
9b2eff88a6 restore original port 2025-04-01 15:17:52 +02:00
Arthur Baars
0e23b86bf5 Merge pull request #19182 from github/post-release-prep/codeql-cli-2.21.0
Post-release preparation for codeql-cli-2.21.0
2025-04-01 15:12:29 +02:00
Tom Hvitved
dcaeeabad8 Rust: Fix capturedCallRead 2025-04-01 15:11:20 +02:00
Tom Hvitved
9dea9f5046 SSA: Make phiWithoutTwoPriorRefs consistency check more informative 2025-04-01 15:07:46 +02:00
Tom Hvitved
01810cbac9 Rust: Update PhiDefinition.toString 2025-04-01 14:59:05 +02:00
Marco Gario
2419ccf511 Merge pull request #19183 from github/marcogario-patch-1
Update UntrustedCheckoutCritical.ql
2025-04-01 14:43:37 +02:00
Simon Friis Vindum
8acf9ceef4 Rust: Make trait a base type mention of the self type parameter 2025-04-01 14:04:46 +02:00
Marco Gario
d33ce423d8 Update UntrustedCheckoutCritical.ql 2025-04-01 13:58:37 +02:00
Arthur Baars
68690b4615 Merge pull request #19181 from github/aibaars/rust-delete-cargo-lock
Rust: QLTest: delete Cargo.lock files
2025-04-01 13:57:19 +02:00
yoff
3cdd641b81 actions: fix typo 2025-04-01 13:43:00 +02:00
Michael Nebel
f4105ee4af Merge pull request #19089 from michaelnebel/csharp/improvestringinterpolation
C#: Extract string interpolation alignment and format.
2025-04-01 13:40:15 +02:00
github-actions[bot]
10205cb990 Post-release preparation for codeql-cli-2.21.0 2025-04-01 11:30:43 +00:00
Joe Farebrother
0339601ada Merge pull request #19179 from joefarebrother/python-ccr
Python: Add file-not-closed and special-method-wrong-signature to python code-quality suite
2025-04-01 12:26:35 +01:00
yoff
1ec3e8712b Apply suggestions from code review
Co-authored-by: Aditya Sharad <6874315+adityasharad@users.noreply.github.com>
2025-04-01 13:18:30 +02:00
Arthur Baars
626c752a0b Merge pull request #19172 from github/release-prep/2.21.0
Release preparation for version 2.21.0
codeql-cli/v2.21.0
2025-04-01 12:49:25 +02:00
Óscar San José
81a39f380a Change niceness of test server 2025-04-01 12:48:00 +02:00
Arthur Baars
1d49252c03 Rust: QLTest: delete Cargo.lock files 2025-04-01 12:38:57 +02:00
Paolo Tranquilli
01d4c0ff56 Merge pull request #19167 from github/redsun82/rust-upgrades-downgrades
Rust: introduce upgrades/downgrades infrastructure
2025-04-01 12:01:30 +02:00
Paolo Tranquilli
7821fbf576 Merge branch 'main' into redsun82/rust-upgrades-downgrades 2025-04-01 11:38:34 +02:00
Marco Gario
c8299253f1 Merge pull request #19126 from github/marcogario-patch-1
Update UseOfKnownVulnerableAction.ql
2025-04-01 11:36:25 +02:00
Tom Hvitved
f54d8325ae Merge pull request #19133 from hvitved/rust/more-path-resolution
Rust: More path resolution improvements
2025-04-01 11:25:16 +02:00
Anders Schack-Mulligen
7afcd1bbec Swift: Update test output. 2025-04-01 11:07:17 +02:00
Joe Farebrother
73eebcbca6 Python: Add file-not-closed and special-method-wrong-signature to python code-quality suite 2025-04-01 10:05:17 +01:00
Marco Gario
c0d7288696 Merge branch 'main' into marcogario-patch-1 2025-04-01 10:59:03 +02:00
Geoffrey White
86840a78c2 Rust: Update .expected files. 2025-04-01 09:56:56 +01:00
Geoffrey White
cc90ba5836 Rust: Create a less noisy version of the summary stats query, for use in tests. 2025-04-01 09:56:47 +01:00
Geoffrey White
32e2c1912c Rust: Move all summary stats logic into Stats.qll. 2025-04-01 09:56:39 +01:00
Marco Gario
3652d6f258 Merge pull request #19127 from github/marcogario/untrusted_checkout_name
UntrustedCheckout: Try and differentiate between two versions of the query
2025-04-01 10:56:36 +02:00
Idriss Riouak
1ebce01c95 Merge pull request #19159 from github/idrissrio/calling-conventions
C++: Add class representing calling conventions
2025-04-01 10:31:16 +02:00
Tamas Vajk
a570a728bd Fix code quality 2025-04-01 10:29:55 +02:00
Tamás Vajk
398f041464 Update csharp/ql/lib/semmle/code/csharp/frameworks/microsoft/aspnetcore/Components.qll
Co-authored-by: Michael Nebel <michaelnebel@github.com>
2025-04-01 10:18:09 +02:00
Michael Nebel
8bf2ceb942 Merge pull request #19125 from michaelnebel/csharp/updatedotnet9models
C#: Update generated .NET 9 Runtime models.
2025-04-01 10:09:58 +02:00
Anders Schack-Mulligen
887452d202 Swift: Update SSA to reference the new use-use predicates. 2025-04-01 10:05:02 +02:00
Anders Schack-Mulligen
dbd99df85b C#: Update PreSSA to reference the new use-use predicates. 2025-04-01 10:03:20 +02:00
idrissrio
d61d9730c8 C++: add change note for calling conventions 2025-04-01 09:53:36 +02:00
Tom Hvitved
56f4694b38 Swift: Avoid calling Element.toString recursively 2025-04-01 08:48:16 +02:00
Tom Hvitved
c14a2375c3 Swift: Run codegen 2025-04-01 08:48:15 +02:00
Tom Hvitved
4fb138a1a3 Rust: Make Element.toString non-recursive 2025-04-01 08:48:13 +02:00
Anders Schack-Mulligen
efb5ed1030 Merge pull request #19155 from aschackmull/cpp/iterator-ssa
C++: Refactor Iterator SSA flow to use the data flow integration module.
2025-04-01 08:44:10 +02:00
Michael Nebel
3017d42c95 Merge pull request #19173 from github/workflow/coverage/update
Update CSV framework coverage reports
2025-04-01 08:33:35 +02:00
Michael Nebel
de6e3eafb9 C#: Add change note. 2025-04-01 08:32:52 +02:00
Michael Nebel
2f16e3a0c0 C#: Update flowsummaries test expected output. 2025-04-01 08:32:43 +02:00