Compare commits

..

1063 Commits

Author SHA1 Message Date
Mathias Vorreiter Pedersen
214ca2a535 Merge pull request #272 from microsoft/jb1/2.22.3
Merge upstream `codeql-cli-2.22.3`
2025-08-12 16:33:08 +02:00
Mathias Vorreiter Pedersen
627ee8536c PS: Port changes from #20132 to PowerShell. 2025-08-12 14:52:12 +01:00
Josh Brown
c6ab9412b6 Merge tag 'codeql-cli/v2.22.3' into jb1/2.22.3
Compatible with CodeQL CLI 2.22.3
2025-08-11 12:56:34 -07:00
Josh Brown
09365313ef merge upstream v2.22.2 2025-08-11 12:45:33 -07:00
Josh Brown
f39c1141d8 Revert "Merge pull request #257 from microsoft/jb1/reapply-22.1-tmp"
This reverts commit 6d496ee073, reversing
changes made to 866977b6c5.
2025-08-11 12:45:01 -07:00
Chanel
337132b5e0 Merge pull request #270 from microsoft/better-api-graphs
PS: Better usability when working with nested classes
2025-08-11 08:03:50 -07:00
Mathias Vorreiter Pedersen
e96e464855 PS: Accept test changes. 2025-08-11 14:22:19 +01:00
Mathias Vorreiter Pedersen
9b5897ca3a PS: Improve api graphs. 2025-08-11 14:22:17 +01:00
Mathias Vorreiter Pedersen
1bd93b9849 PS: Add missing dataflow predicates related to models. 2025-08-08 17:08:15 +01:00
Mathias Vorreiter Pedersen
3829528467 PS: Delete stuff we don't actually need. 2025-08-08 17:07:43 +01:00
Mathias Vorreiter Pedersen
f8bdfa4666 Merge pull request #264 from microsoft/simple-type-sanitizers
PS: Add simple type-based sanitizer to SQL injection query
2025-07-25 11:41:01 +01:00
Mathias Vorreiter Pedersen
b0d61928bf Merge pull request #265 from microsoft/dilan/iac-setup
CodeQL for IaC (infrastructure as code) Setup
2025-07-25 11:40:21 +01:00
dilanbhalla
cb63c6aed0 Add 'iac' language support to CodeQL workflow
Added 'iac' to the list of supported languages for CodeQL.
2025-07-24 12:55:38 -07:00
Dilan Bhalla
eb15e3bcc9 Add codeql-extractor-iac as submodule in iac/ 2025-07-24 12:43:16 -07:00
Mathias Vorreiter Pedersen
ffc53d7764 PS: Accept test changes. 2025-07-24 20:03:59 +01:00
Mathias Vorreiter Pedersen
7b4d2a9edf PS: Lower casing in command-line injection query. 2025-07-24 20:03:48 +01:00
Mathias Vorreiter Pedersen
b66c99ba76 PS: Lower casing in frameworks. 2025-07-24 20:03:27 +01:00
Mathias Vorreiter Pedersen
e3b3f0b343 PS: Consistent lower casing in api graphs, control-flow graph, and dataflow nodes. 2025-07-24 20:03:10 +01:00
Mathias Vorreiter Pedersen
3880d9fa8d PS: More consistent lower casing in the AST classes. 2025-07-24 20:02:03 +01:00
Mathias Vorreiter Pedersen
71fec26542 PS: Lower case all parameter types. 2025-07-24 18:07:59 +01:00
Mathias Vorreiter Pedersen
f9c3bde6d5 PS: Fix false positive by adding a type-based sanitizer. 2025-07-24 18:06:06 +01:00
Mathias Vorreiter Pedersen
e7956301a4 PS: Add false positive. 2025-07-24 18:00:49 +01:00
Mathias Vorreiter Pedersen
ae4b3e8542 Merge pull request #263 from microsoft/remove-env-reads-from-sql-injection
PS: Remove environment variables from `powershell/microsoft/public/sql-injection`
2025-07-24 16:33:05 +01:00
Mathias Vorreiter Pedersen
7991eb4919 PS: Accept test changes. 2025-07-24 00:16:20 +01:00
Mathias Vorreiter Pedersen
3ba87996e3 PS: Unhide some dataflow nodes to make paths more explicit. 2025-07-24 00:11:45 +01:00
Mathias Vorreiter Pedersen
95926cbc70 PS: Remove environment variables as flow sources from 'powershell/microsoft/public/sql-injection'. 2025-07-24 00:11:31 +01:00
Mathias Vorreiter Pedersen
7c83d9d54b Merge pull request #262 from microsoft/powershell-smb-settings
Powershell SMB settings
2025-07-23 19:58:04 +01:00
Chanel
a0dbf930a2 Update powershell/ql/src/queries/security/cwe-319/UnsafeSMBSettings.ql
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2025-07-23 11:30:30 -07:00
Chanel Young
482fda7541 formatting 2025-07-23 11:22:12 -07:00
Chanel Young
4e0ea04d3b add query, tests 2025-07-23 11:16:11 -07:00
Chanel
c961340f54 Merge pull request #260 from microsoft/powershell-unsafe-deserialization
Powershell Unsafe Deserialize query
2025-07-22 10:49:10 -07:00
Chanel
d78280ea0f Merge branch 'main' into powershell-unsafe-deserialization 2025-07-22 10:07:10 -07:00
Chanel
3b90949d4d Update powershell/ql/src/queries/security/cwe-502/BinaryFormatterDeserialization.qhelp
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2025-07-22 10:06:59 -07:00
Chanel
2e93ec5490 Update powershell/ql/src/queries/security/cwe-502/UnsafeDeserialization.qhelp
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2025-07-22 10:06:52 -07:00
Chanel
6d62e8717a Update powershell/ql/src/queries/security/cwe-502/BinaryFormatterDeserialization.qhelp
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2025-07-22 10:06:46 -07:00
Chanel
9266713d19 Update powershell/ql/src/queries/security/cwe-502/BinaryFormatterDeserialization.qhelp
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2025-07-22 10:06:39 -07:00
Chanel Young
1149d33691 updated .expected test file 2025-07-17 13:19:07 -07:00
Chanel
03a7d3d243 Merge pull request #261 from microsoft/global-flow-through-env-variables-2
PS: Global flow through environment variables
2025-07-17 12:30:14 -07:00
Mathias Vorreiter Pedersen
b72af27e81 PS: Add tests showing that there is no flow starting at environment variables, but we still have flow through them. 2025-07-17 20:05:21 +01:00
Mathias Vorreiter Pedersen
a95f3b3f47 PS: Accept test changes. 2025-07-17 19:01:09 +01:00
Mathias Vorreiter Pedersen
6ab627955f PS: Implement global dataflow for environment variable write/reads. 2025-07-17 18:59:25 +01:00
Mathias Vorreiter Pedersen
2541bcdf5e PS: Add test cases. 2025-07-17 18:59:19 +01:00
Mathias Vorreiter Pedersen
3f4a16978e PS: Change the AST so that an 'EnvVariable' is actually a 'Variable', and make it possible for a 'VarAccess' to target a read/write of an environment variable. 2025-07-17 18:48:11 +01:00
Chanel Young
6ac935469f move logic to qlls 2025-07-17 08:27:36 -07:00
Chanel Young
cb8496bbfe added queries, tests, docs 2025-07-16 14:27:23 -07:00
Mathias Vorreiter Pedersen
ef3654f9cf PS: Small cleanup. 2025-07-16 20:21:08 +01:00
Chanel
5fde17736b Merge pull request #258 from microsoft/fix-call-operator-bug
PS: Fix bug in `CallOperator::getCommand`
2025-07-16 09:50:46 -07:00
Mathias Vorreiter Pedersen
72af800101 PS: Accept test changes. 2025-07-16 14:33:02 +01:00
Mathias Vorreiter Pedersen
205d2e58ff PS: Add dot sourcing as a sink. 2025-07-16 14:33:01 +01:00
Mathias Vorreiter Pedersen
670ad745ca PS: Add false negative. 2025-07-16 14:32:42 +01:00
Mathias Vorreiter Pedersen
5f07641bd3 PS: Fix false positive by fixing the 'getCommand' predicates in 'CallOperatorCfgNode' and 'CallOperator'. Also fix 'DotSourcingOperator::getPath' while here. 2025-07-16 14:31:51 +01:00
Mathias Vorreiter Pedersen
75d37dcead PS: Add false positive. 2025-07-16 13:46:44 +01:00
Mathias Vorreiter Pedersen
f39d08ecfa PS: Fix spelling. 2025-07-16 13:45:09 +01:00
Josh Brown
6d496ee073 Merge pull request #257 from microsoft/jb1/reapply-22.1-tmp
Revert #251, Reapply `codeql-cli/v2.22.1`
2025-07-10 16:08:14 -07:00
Josh Brown
b1b0892ae6 Merge branch 'main' into jb1/reapply-22.1-tmp 2025-07-10 15:15:45 -07:00
Josh Brown
4c5945f4aa Manual merge 2025-07-10 15:08:14 -07:00
Josh Brown
5fb45c89e9 Revert "Merge pull request #251 from microsoft/jb1/upstream-zipslip"
This reverts commit 4dfa5d2858, reversing
changes made to 8cd58aa6e8.
2025-07-10 14:57:38 -07:00
Chanel
866977b6c5 Merge pull request #256 from microsoft/jb1/qhelpfix
QHelp: Terminate p tag
2025-07-10 10:51:18 -07:00
Josh Brown
3606679eee Terminate p tag 2025-07-10 10:35:09 -07:00
Josh Brown
4dfa5d2858 Merge pull request #251 from microsoft/jb1/upstream-zipslip
Manual merge upstream
2025-07-10 09:48:55 -07:00
Josh Brown
87e0b08531 Merge branch 'main' into jb1/upstream-zipslip 2025-07-10 09:35:03 -07:00
Josh Brown
81f9e88040 run add-overlay-annotations.py 2025-07-09 22:37:51 -07:00
Mathias Vorreiter Pedersen
8cd58aa6e8 Merge pull request #255 from microsoft/add-iwr-as-flow-source
PS: Add more flow sources
2025-07-09 14:56:43 +01:00
Mathias Vorreiter Pedersen
d1988774a3 PS: Add more flow sources and accept test changes. 2025-07-09 12:22:33 +01:00
Mathias Vorreiter Pedersen
1816356515 PS: Add test with missing remote flow. 2025-07-09 12:20:41 +01:00
Mathias Vorreiter Pedersen
3101cc81e6 Merge pull request #253 from microsoft/add-set-execution-policy-bypass-query
PS: Add query for insecure uses of `Set-ExecutionPolicy`
2025-07-07 19:33:06 +01:00
Mathias Vorreiter Pedersen
398d27b779 PS: Fix missing AST child. 2025-07-07 19:15:18 +01:00
Mathias Vorreiter Pedersen
28de6ede04 PS: Also require '-Force' with a truthy value. Note the 'NOT DETECTED' test. We will fix that in the next commit. 2025-07-07 19:14:01 +01:00
Mathias Vorreiter Pedersen
1d64a7949b Merge pull request #252 from microsoft/add-more-remote-flow-sources
PS: Add flow sources from `System.Net.WebClient`
2025-07-07 14:50:03 +01:00
Lindsay Simpkins
d4571f5b95 Merge pull request #254 from microsoft/implement-localExprTaint
PS: Actually implement `localExprTaint`
2025-07-07 08:23:11 -04:00
Mathias Vorreiter Pedersen
b6b4df5ce0 PS: Implement 'localExprTaint' instead of leaving it as 'none()'. 2025-07-04 20:24:22 +01:00
Mathias Vorreiter Pedersen
4e524a189d PS: Add tests. 2025-07-04 19:44:49 +01:00
Mathias Vorreiter Pedersen
f7c9899450 PS: Add documentation. 2025-07-04 19:44:39 +01:00
Mathias Vorreiter Pedersen
2731983fbe PS: Add query for insecure uses of 'Set-ExecutionPolicy'. 2025-07-04 19:44:15 +01:00
Mathias Vorreiter Pedersen
52ff5d3fbc Merge pull request #246 from microsoft/powershell-commandinjection-invokesinkfix
InvokeSink fix
2025-07-04 18:17:09 +01:00
Chanel Young
654bf2f42f random newline to reset git latest pusher 2025-07-04 10:07:57 -07:00
Mathias Vorreiter Pedersen
766cf826bb PS: Add more models and accept test changes. 2025-07-04 18:01:45 +01:00
Mathias Vorreiter Pedersen
bd9043576d PS: Add test with missing remote flow source. 2025-07-04 18:00:19 +01:00
Chanel
8aa8dde439 Merge branch 'main' into powershell-commandinjection-invokesinkfix 2025-07-04 09:59:15 -07:00
Mathias Vorreiter Pedersen
2a26c43c19 PS: Cleanup a few manually generated models. 2025-07-04 17:01:25 +01:00
Mathias Vorreiter Pedersen
eec092c4c4 PS: Mark the BAD results in the test appropriately. 2025-07-04 11:13:15 +01:00
Mathias Vorreiter Pedersen
7d07773a33 PS: Accept test changes. 2025-07-04 11:12:55 +01:00
Mathias Vorreiter Pedersen
0585c2f9e5 PS: Gets back the previously-lost false negative by making the variable property name expression the sink when there is a call to 'Invoke'. 2025-07-04 11:12:31 +01:00
Josh Brown
4122283ec8 Manual merge 2025-07-01 16:10:55 -07:00
Lindsay Simpkins
849e0b4e1f Merge pull request #248 from microsoft/fix-ps-performance
PS: Fix lots of performance problems
2025-06-20 23:14:39 -04:00
Lindsay Simpkins
52f5ac528c Merge branch 'main' into fix-ps-performance 2025-06-20 23:01:38 -04:00
Lindsay Simpkins
6ab05cd387 Merge pull request #249 from microsoft/fix-fps-on-sql-injection
PS: Fix FPs on `powershell/microsoft/public/sql-injection`
2025-06-20 16:36:54 -04:00
Mathias Vorreiter Pedersen
cb89695c1d PS: Improve alert message. 2025-06-20 20:40:53 +01:00
Mathias Vorreiter Pedersen
9032d863bd PS: Accept test changes. 2025-06-20 16:40:44 +01:00
Mathias Vorreiter Pedersen
1486200146 PS: Allow for implicit reads at sinks in 'ps/sql-injection'. 2025-06-20 16:34:16 +01:00
Mathias Vorreiter Pedersen
1ff04d9f94 PS: Add new false negative. 2025-06-20 16:30:49 +01:00
Mathias Vorreiter Pedersen
72178f0a36 PS: Accept test changes. 2025-06-20 14:54:39 +01:00
Mathias Vorreiter Pedersen
05a7cfd264 PS: Don't implicitly read any element. Instead, only read positional contents. 2025-06-20 14:54:15 +01:00
Mathias Vorreiter Pedersen
25d94fabcc PS: Add false positive to 'ps/sql-injection'. 2025-06-20 14:51:17 +01:00
Mathias Vorreiter Pedersen
0912cc337f PS: Accept test changes. 2025-06-20 14:25:58 +01:00
Mathias Vorreiter Pedersen
c18db919c9 PS: Model 'inputfile' as a sink for SQL injections. 2025-06-20 14:25:45 +01:00
Mathias Vorreiter Pedersen
b82bd2cd2f PS: Add false positive to 'ps/sql-injection'. 2025-06-20 14:23:55 +01:00
Mathias Vorreiter Pedersen
86cc09b622 PS: Start with a SCAN of 'getProcessBlock' as this ensures we start with a small pipeline. 2025-06-19 22:11:26 +01:00
Mathias Vorreiter Pedersen
31fbb6fd55 PS: Prevent bad magic by calling a HOP to compute the transitive closure. 2025-06-19 22:11:25 +01:00
Mathias Vorreiter Pedersen
2d045ea345 PS: Prevent join on integer. 2025-06-19 22:11:24 +01:00
Mathias Vorreiter Pedersen
c50b0c6323 PS: Prevent join on boolean. 2025-06-19 22:11:22 +01:00
Mathias Vorreiter Pedersen
a38d57f080 PS: Fix cartesian product. 2025-06-19 22:11:20 +01:00
Mathias Vorreiter Pedersen
f513259f24 PS: Format, add a helper predicate and add an explicit 'this' to silence a warning. 2025-06-19 22:11:19 +01:00
Mathias Vorreiter Pedersen
9be1f2d1d1 PS: Replace another 'forex' with explicit recursion. 2025-06-19 22:11:17 +01:00
Mathias Vorreiter Pedersen
8664842f91 PS: Remove two more 'forex's. 2025-06-19 22:11:16 +01:00
Mathias Vorreiter Pedersen
b79f3666a9 PS: Replace a 'forex' with explicit recursion. 2025-06-19 22:11:14 +01:00
Mathias Vorreiter Pedersen
ebc167c529 PS: Fix join in 'count'. 2025-06-19 22:11:13 +01:00
Mathias Vorreiter Pedersen
ae83d56df1 PS: Rename predicate. 2025-06-19 22:11:00 +01:00
Mathias Vorreiter Pedersen
f69cfdcd5a PS: Autoformat. 2025-06-19 22:03:40 +01:00
Mathias Vorreiter Pedersen
9ed32b14a2 PS: Add some QLDoc. 2025-06-19 22:02:45 +01:00
Mathias Vorreiter Pedersen
3ba3b11207 PS: Prevent magic on 'getParent'. 2025-06-19 22:02:22 +01:00
Mathias Vorreiter Pedersen
56977c76f8 Merge pull request #247 from microsoft/add-get-callee-on-call-nodes
PS: Add `Node.getCallee` predicate on `DataFlow::CallNode`
2025-06-16 15:48:41 +01:00
Mathias Vorreiter Pedersen
229914f7f3 PS: Add 'Node.getCallee' predicate on DataFlow::CallNode. 2025-06-16 15:24:26 +01:00
Chanel Young
f882af95d8 update to invokesink 2025-06-12 14:30:46 -07:00
dilanbhalla
8e09d96df5 Merge pull request #240 from microsoft/auto/sync-main-pr
Sync Main (autogenerated)
2025-06-12 11:07:49 -07:00
dilanbhalla
dae058250b Merge branch 'main' into auto/sync-main-pr 2025-06-12 10:55:48 -07:00
dilanbhalla
ed8cc6afff Merge pull request #245 from microsoft/fix-extensional-warnings-powershell
PS: Remove unnecessary data extension pattern to fix warning
2025-06-12 10:55:36 -07:00
Mathias Vorreiter Pedersen
b88ed68499 PS: Remove unnecessary data extension pattern. All the models are matched by the other two patterns. 2025-06-12 11:41:25 +01:00
dilanbhalla
7bfefefbf7 Merge tag 'codeql-cli/latest' into auto/sync-main-pr
Compatible with the latest released version of the CodeQL CLI
2025-06-11 17:00:14 +00:00
dilanbhalla
b8a78f79eb Merge branch 'main' of https://github.com/microsoft/codeql into auto/sync-main-pr 2025-06-10 18:59:32 +00:00
dilanbhalla
64bc3ed473 Merge pull request #244 from microsoft/lwsimpkins/fix-qhelp
fix failing qhelp files
2025-06-10 11:02:12 -07:00
Lindsay Simpkins
7668175804 Merge branch 'main' into lwsimpkins/fix-qhelp 2025-06-09 17:56:59 -04:00
dilanbhalla
9521d06424 Merge branch 'main' of https://github.com/microsoft/codeql into auto/sync-main-pr 2025-06-09 19:59:12 +00:00
Lindsay Simpkins
077549da16 fix failing qhelp files 2025-06-09 15:31:19 -04:00
dilanbhalla
3d84e5ac3b Merge pull request #243 from microsoft/lwsimpkins/fix-qhelp
fix powershell qhelp files
2025-06-09 12:06:45 -07:00
Lindsay Simpkins
25fb1aabd2 fix powershell qhelp files 2025-06-09 14:01:54 -04:00
dilanbhalla
58acb60b47 Merge branch 'main' of https://github.com/microsoft/codeql into auto/sync-main-pr 2025-06-03 19:32:15 +00:00
dilanbhalla
06448780ed Merge pull request #242 from microsoft/powershell-guardpredicate-fix
added hasbranchedge
2025-06-03 12:31:26 -07:00
Chanel Young
0d11efc5cb added hasbranchedge 2025-06-03 11:53:29 -07:00
dilanbhalla
464558688d Merge tag 'codeql-cli/latest' into auto/sync-main-pr
Compatible with the latest released version of the CodeQL CLI
2025-06-02 22:04:24 +00:00
Chanel
8ef818cd8d Merge pull request #239 from microsoft/dilan/sync-main-auth-2
Sync Main: Auth Bug (fix attempt 2)
2025-06-02 15:03:25 -07:00
dilanbhalla
8aa10995ba Update sync-main.yml 2025-06-02 14:40:39 -07:00
dilanbhalla
126ddf9271 Merge pull request #238 from microsoft/dilan/sync-repo-auth
Auth Bug: Sync Main
2025-06-02 10:31:30 -07:00
dilanbhalla
8ef8210327 Update sync-main.yml 2025-06-02 10:26:22 -07:00
Mathias Vorreiter Pedersen
10a886325d Merge pull request #237 from microsoft/fix-fps-in-tainted-path
C#: Fix FPs (and a small FN) in `cs/path-injection`
2025-05-30 14:51:01 +01:00
Mathias Vorreiter Pedersen
2186fef8bf C#: Accept test changes. 2025-05-27 18:44:59 +01:00
Mathias Vorreiter Pedersen
4dfa88626a C#: Recognize more path-normalization steps. 2025-05-27 18:44:57 +01:00
Mathias Vorreiter Pedersen
db7119c29f C#: Add a false positive. 2025-05-27 18:44:56 +01:00
Mathias Vorreiter Pedersen
a2d4c20068 C#: Fix FN by blocking flow out of the function call instead of out of the argument (which is incorrect when there is use-use flow). 2025-05-27 18:44:54 +01:00
Mathias Vorreiter Pedersen
03e671aff1 C#: Add a false negative. 2025-05-27 18:44:53 +01:00
Mathias Vorreiter Pedersen
b40a43701c C#: Small optimization. Avoid a small CP between sinks and states. 2025-05-27 18:44:51 +01:00
Mathias Vorreiter Pedersen
0e887d8697 Merge pull request #235 from microsoft/update-typegen-2
PS: Restructure generated files
2025-05-21 17:43:10 +01:00
Chanel
a17f10d4a9 Merge branch 'main' into update-typegen-2 2025-05-21 09:27:44 -07:00
Mathias Vorreiter Pedersen
a410e85d85 PS: Accept test changes. 2025-05-21 16:35:07 +01:00
Mathias Vorreiter Pedersen
8875962f9b PS: Fix pack name in data extension files. 2025-05-21 16:35:06 +01:00
Mathias Vorreiter Pedersen
b409cbddf1 PS: Add back the manual models. 2025-05-21 16:35:01 +01:00
Mathias Vorreiter Pedersen
1a7908cd57 PS: Add generated models for .NET runtime. 2025-05-21 16:35:00 +01:00
Mathias Vorreiter Pedersen
61021b6d6f PS: Regenerate models. 2025-05-21 16:34:47 +01:00
Mathias Vorreiter Pedersen
2f0b064ee2 Merge pull request #234 from microsoft/share-global-cfg-library
C++/C#/Shared: Convert the global control-flow library to a shared parameterize module and make it available in C#
2025-05-19 19:24:14 +01:00
Mathias Vorreiter Pedersen
f00c370204 C#: Instantiate the (now shared) global control-flow library. 2025-05-19 19:04:20 +01:00
Mathias Vorreiter Pedersen
7cc091912f C++/Shared: Convert the global control-flow library to a shared parameterized module. 2025-05-19 19:03:59 +01:00
Mathias Vorreiter Pedersen
198a594b7a Merge pull request #149 from microsoft/interprocedural-controlflow
C++: Add an interprocedural control-flow library
2025-05-19 15:52:17 +01:00
Mathias Vorreiter Pedersen
bac9c7d30d Merge branch 'main' into interprocedural-controlflow 2025-05-19 15:30:24 +01:00
Mathias Vorreiter Pedersen
c3b0c2d924 PS: Update typegen script and documentation. 2025-05-16 12:08:54 +01:00
dilanbhalla
60ca4964ad Merge pull request #233 from microsoft/dilan/powershell-dotnet-publish-flags
PowerShell: .NET Publish Flags
2025-05-15 12:26:02 -07:00
dilanbhalla
5127ace92c Update build-win64.ps1 2025-05-15 12:18:19 -07:00
dilanbhalla
77e6056665 Update build-osx64.ps1 2025-05-15 12:18:07 -07:00
dilanbhalla
50622e529e Update build-linux64.ps1 2025-05-15 12:16:53 -07:00
dilanbhalla
dd965dd646 Merge pull request #232 from microsoft/dilan/powershell-osx-specific-buildscripts
PowerShell: OS-specific buildscripts
2025-05-15 12:07:22 -07:00
dilanbhalla
0d38a98bad Update powershell-pr-check.yml 2025-05-15 12:00:45 -07:00
dilanbhalla
e250f9b6ce Create build-linux64.ps1 2025-05-15 11:59:37 -07:00
dilanbhalla
0fab231c33 Update build-win64.ps1 2025-05-15 11:58:26 -07:00
dilanbhalla
c632477eb3 Create build-osx64.ps1 2025-05-15 11:57:58 -07:00
dilanbhalla
5be20a0d10 Rename build.ps1 to build-win64.ps1 2025-05-15 11:52:25 -07:00
dilanbhalla
d1c2fa0266 Merge pull request #230 from microsoft/auto/sync-main-pr
Sync Main (autogenerated)
2025-05-15 10:50:21 -07:00
Dilan Bhalla
ae515a4b5f Merge tag 'codeql-cli/latest' into auto/sync-main-pr
Compatible with the latest released version of the CodeQL CLI
2025-05-15 10:20:16 -07:00
dilanbhalla
2ef6dd9cbc Merge pull request #225 from microsoft/cleanup-upgrade-downgrade-story-2
PS: Cleanup upgrade/downgrade chains
2025-05-14 10:50:34 -07:00
Mathias Vorreiter Pedersen
2bf076df49 PS: Also include the downgrade scripts when building the PowerShell extractor and injecting it into the CLI. 2025-05-13 18:58:26 +01:00
Mathias Vorreiter Pedersen
07d723291b PS: Add a single upgrade script that upgrades the old dbscheme to the current dbscheme, and add a single downgrade script that downgrades the current dbscheme to the old dbscheme. IMPORTANT: the .gitattributes ensure that we keep CLRF (i.e., windows) line-endings on the old dbscheme scripts so that they match what is produced by the extractor. 2025-05-13 18:50:13 +01:00
Mathias Vorreiter Pedersen
a489bfd125 PS: Delete all the existing upgrade and downgrade scripts. 2025-05-13 18:46:45 +01:00
Denis Levin
a1bfbb37e7 Two more modules and an update to some cached refs for GO (#224)
Co-authored-by: Denis Levin <denisl@microsoft.com>
2025-05-08 11:59:28 -07:00
Josh Brown
c87545ee12 Merge pull request #223 from microsoft/denisl/afewmissedCGChanges
Looks like I've missed a few CG changes - checking in
2025-05-07 19:19:53 -07:00
Denis Levin
526f161e97 Merge branch 'main' into denisl/afewmissedCGChanges 2025-05-07 16:40:32 -07:00
Denis Levin
b87431ac35 Looks like I've missed a few CG changes - checking in 2025-05-07 14:53:37 -07:00
dilanbhalla
c31abb7f0f Merge pull request #222 from microsoft/revert-218-update-csharp-stub-models
Revert "Update the C# stub models"
2025-05-02 16:23:19 -07:00
dilanbhalla
0ec0f5ce35 Revert "Update the C# stub models" 2025-05-02 14:44:25 -07:00
dilanbhalla
0d7e5faa0e Merge pull request #219 from microsoft/ps-run-tests-on-prs
PS: Run tests on PRs
2025-05-02 12:10:16 -07:00
dilanbhalla
e70d9ff4ca Merge branch 'main' into ps-run-tests-on-prs 2025-05-02 10:56:01 -07:00
dilanbhalla
d76de83121 Merge pull request #218 from microsoft/update-csharp-stub-models
Update the C# stub models
2025-05-01 14:35:21 -07:00
Sid Gawri
43ab8cb98e Merge branch 'main' of https://github.com/microsoft/codeql into update-csharp-stub-models 2025-05-01 17:31:54 -04:00
Josh Brown
f0e0d76ca6 Merge pull request #220 from microsoft/auto/sync-main-pr
Sync Main (autogenerated)
2025-05-01 11:07:26 -07:00
dilanbhalla
63884ff714 Merge tag 'codeql-cli/latest' into auto/sync-main-pr
Compatible with the latest released version of the CodeQL CLI
2025-05-01 13:06:40 +00:00
Mathias Vorreiter Pedersen
3dc74e9fdb PS: Harden the build script so that you can run it from any folder. 2025-05-01 12:36:11 +01:00
Mathias Vorreiter Pedersen
337cb8b308 PS: Make it possible to run the build script from a command prompt that is running from %SYSTEMROOT%. See https://learn.microsoft.com/en-us/answers/questions/574694/msbuild-error-msb1009-project-file-does-not-exist 2025-05-01 12:31:11 +01:00
Mathias Vorreiter Pedersen
3cca0a6ec0 Update powershell-pr-check.yml 2025-05-01 12:25:04 +01:00
Mathias Vorreiter Pedersen
f029d2a494 Update powershell-pr-check.yml 2025-05-01 12:21:18 +01:00
Mathias Vorreiter Pedersen
3bea9e5693 Update powershell-pr-check.yml 2025-05-01 12:18:59 +01:00
Mathias Vorreiter Pedersen
7c37c54b03 Update powershell-pr-check.yml 2025-05-01 12:07:59 +01:00
Mathias Vorreiter Pedersen
1724948f75 Update powershell-pr-check.yml 2025-05-01 12:06:01 +01:00
Mathias Vorreiter Pedersen
3b2057b148 Update powershell-pr-check.yml 2025-05-01 12:01:06 +01:00
Mathias Vorreiter Pedersen
d6c6015558 PS: Run tests on PRs 2025-05-01 11:58:55 +01:00
Sid Gawri
d824bdf8d2 system.web + system.net 2025-04-30 18:37:42 -04:00
Mathias Vorreiter Pedersen
f7d081874b Merge pull request #217 from microsoft/accept-parent-test-changes
PS: Accept missing test changes
2025-04-30 20:25:05 +01:00
Mathias Vorreiter Pedersen
2f03911b45 PS: Accept test changes. 2025-04-30 20:20:07 +01:00
Chanel
f6aec284d1 Merge pull request #216 from microsoft/ps-string-literals
PS: Lift string literals to the public AST
2025-04-30 10:09:38 -07:00
Mathias Vorreiter Pedersen
dbfd07024d PS: Add some tests for string literals. 2025-04-30 13:46:43 +01:00
Mathias Vorreiter Pedersen
a7c0305430 PS: Lift StringLiterals to the public AST from the raw AST. 2025-04-30 13:46:32 +01:00
Chanel
64dd13d4eb Merge pull request #215 from microsoft/ps-add-sql-injection-query
PS: Add SQL injection query
2025-04-29 10:31:55 -07:00
Mathias Vorreiter Pedersen
c6678949b9 PS: Add query test for the new SQL injection query. 2025-04-29 17:57:59 +01:00
Mathias Vorreiter Pedersen
e4d5b1e65e PS: Add a query for SQL injection. 2025-04-29 17:57:43 +01:00
Mathias Vorreiter Pedersen
c015c746b8 PS: Lower case more predicate results for consistency. 2025-04-29 17:45:04 +01:00
Denis Levin
aee5b23207 Merge pull request #212 from microsoft/denisl/goreferenceupdate
Update go references in mod and sum files
2025-04-28 16:26:21 -07:00
Josh Brown
b672950baf Merge branch 'main' into denisl/goreferenceupdate 2025-04-25 09:14:05 +10:00
Mathias Vorreiter Pedersen
4d00aa39ea Merge pull request #213 from microsoft/powershell-better-api-for-normalizednames
PS: Better API for normalizing names + get rid of warnings
2025-04-24 12:09:24 +01:00
Chanel
1930059e77 Merge pull request #214 from microsoft/dilan/powershell-lib-pack-org
PowerShell Lib Pack: Change microsoft-sdl to microsoft
2025-04-23 11:24:22 -07:00
Dilan Bhalla
084c75c8cf changing microsoft-sdl/powershell-all to microsoft/powershell-all 2025-04-23 10:45:45 -07:00
dilanbhalla
c3926d3cba Update qlpack.yml 2025-04-23 10:26:27 -07:00
dilanbhalla
a3b32af3dc Update qlpack.yml 2025-04-23 10:25:20 -07:00
Chanel
b1cd6721e0 Merge branch 'main' into powershell-better-api-for-normalizednames 2025-04-23 09:52:53 -07:00
Mathias Vorreiter Pedersen
0a1f89b8eb PS: Delete more stuff that's being deprecated and replace with non-deprecated versions. 2025-04-23 16:00:20 +01:00
Mathias Vorreiter Pedersen
06fd1c6513 PS: Delete deprecated unnecessary predicates. 2025-04-23 16:00:19 +01:00
Mathias Vorreiter Pedersen
5ec59c3b34 PS: Get rid of unnecessary module. 2025-04-23 16:00:18 +01:00
Mathias Vorreiter Pedersen
9e83dee8fe PS: Accept test changes. 2025-04-23 15:16:29 +01:00
Mathias Vorreiter Pedersen
f5e7af1df6 PS: Fix tests. 2025-04-23 15:16:26 +01:00
Mathias Vorreiter Pedersen
b65d41b498 PS: Cleanup and autoformat. 2025-04-23 12:36:48 +01:00
Mathias Vorreiter Pedersen
2e0560119c PS: Add matchesName and getAName to make it easier to match case insensitively. 2025-04-23 12:34:08 +01:00
Mathias Vorreiter Pedersen
7360d800f2 PS: Rename getName to getLowerCaseName. 2025-04-23 12:31:46 +01:00
Denis Levin
42776fb2fe Merge branch 'main' into denisl/goreferenceupdate 2025-04-22 16:49:28 -07:00
dilanbhalla
2f62351116 Merge pull request #211 from microsoft/dilan/publish-pack-bug-2
Pack Publish Bug
2025-04-22 16:12:19 -07:00
dilanbhalla
ba58c012cd Update microsoft-codeql-pack-publish.yml 2025-04-22 15:48:09 -07:00
Chanel
e669dc651b Merge pull request #210 from microsoft/dilan/pack-publish-typo
Pack Publish Typo
2025-04-22 15:33:16 -07:00
dilanbhalla
9efbecc677 Update microsoft-codeql-pack-publish.yml 2025-04-22 15:30:11 -07:00
Denis Levin
47fc9f2d10 Update go language references in mod and sum files to prevent vulnerable reference warining for CVE-2024-45337
in golang.org/x/crypto
2025-04-22 15:10:47 -07:00
Chanel
3126366768 Merge pull request #170 from microsoft/dilan/publish-opensource-packs
Publish Public Packs
2025-04-22 12:49:30 -07:00
dilanbhalla
b1129475d7 Merge branch 'main' into dilan/publish-opensource-packs 2025-04-22 12:46:24 -07:00
dilanbhalla
a3c5e48738 Update microsoft-codeql-pack-publish.yml 2025-04-22 12:45:26 -07:00
dilanbhalla
082141e40d Update microsoft-codeql-pack-publish.yml 2025-04-22 12:28:37 -07:00
dilanbhalla
054434365c Merge pull request #209 from microsoft/dilan/workflow-bugs
Fix Sync-Main Workflow Bugs
2025-04-22 11:37:25 -07:00
dilanbhalla
358862e9bd Update sync-main.yml 2025-04-22 11:30:41 -07:00
dilanbhalla
916b264e1b Update sync-main-tags.yml 2025-04-22 11:29:32 -07:00
dilanbhalla
4b3c612833 Merge branch 'main' into dilan/publish-opensource-packs 2025-04-22 11:27:46 -07:00
dilanbhalla
d3c6c3bcc6 Merge pull request #208 from microsoft/auto/sync-main-pr
Sync Main (autogenerated)
2025-04-22 10:15:07 -07:00
dilanbhalla
b28b84fad6 Merge branch 'main' of https://github.com/microsoft/codeql into auto/sync-main-pr 2025-04-22 16:59:08 +00:00
Chanel
12db85ad9c Merge pull request #206 from microsoft/psscriptanalyzer-port
Psscriptanalyzer port
2025-04-22 09:35:05 -07:00
Chanel Young
f375b81272 remove reference to command injection owasp 2025-04-22 09:26:48 -07:00
Chanel
3a66e8e71a Update powershell/ql/src/experimental/UsernameOrPasswordParameter.qhelp
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2025-04-22 09:20:45 -07:00
Chanel
f82cfc7bd4 Update powershell/ql/src/experimental/UsernameOrPasswordParameter.qhelp
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2025-04-22 09:20:31 -07:00
Chanel
6419794f3b Update powershell/ql/src/experimental/HardcodedComputerName.qhelp
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2025-04-22 09:18:31 -07:00
Chanel Young
faa47f9bfb ConvertToSecureStringAsPlainText 2025-04-22 09:17:57 -07:00
Chanel Young
2898910c04 Merge branch 'psscriptanalyzer-port' of https://github.com/microsoft/codeql into psscriptanalyzer-port 2025-04-22 09:12:04 -07:00
Chanel Young
7432884af0 Merge branch 'main' into psscriptanalyzer-port 2025-04-22 09:00:08 -07:00
dilanbhalla
9f44cb23f1 Merge branch 'main' of https://github.com/microsoft/codeql into auto/sync-main-pr 2025-04-22 15:59:07 +00:00
Mathias Vorreiter Pedersen
bfb7b0b9d0 Merge branch 'main' into psscriptanalyzer-port 2025-04-22 16:42:23 +01:00
Mathias Vorreiter Pedersen
6a5d0877c4 Merge pull request #207 from microsoft/switch-parameters
PS: Proper AST support for switch arguments
2025-04-22 16:41:40 +01:00
Chanel
a98a7b8e97 Merge branch 'main' into switch-parameters 2025-04-22 08:13:25 -07:00
dilanbhalla
ff154b11d0 Merge tag 'codeql-cli/latest' into auto/sync-main-pr
Compatible with the latest released version of the CodeQL CLI
2025-04-22 14:59:21 +00:00
Mathias Vorreiter Pedersen
09ebc76a23 PS: Accept test changes. 2025-04-22 15:32:35 +01:00
Mathias Vorreiter Pedersen
e9fd50b67c PS: Handle switch arguments by synthesizing a boolean true literal and represent them as named arguments. 2025-04-22 15:28:43 +01:00
Mathias Vorreiter Pedersen
72266cb000 PS: Drive-by cleanup in Constant.qll 2025-04-22 15:12:14 +01:00
Mathias Vorreiter Pedersen
b9fdc78c16 PS: Add argument tests. 2025-04-22 15:12:00 +01:00
Chanel Young
43954b7262 removed irrelevant tags 2025-04-21 17:01:12 -07:00
Chanel Young
e91912e30d cleanup 2025-04-21 16:50:36 -07:00
Chanel Young
7359f912c5 added initial psscriptanalyzer rules, docs, tests 2025-04-21 16:44:52 -07:00
dilanbhalla
7462e4003f Merge pull request #204 from microsoft/dilan/sync-main-tags
Sync Upstream Tags
2025-04-21 14:55:28 -07:00
dilanbhalla
7e32709574 Merge branch 'main' into dilan/sync-main-tags 2025-04-21 14:54:14 -07:00
dilanbhalla
2007479e56 Merge pull request #205 from microsoft/LWSimpkins/rust-module-import-fix
Update DataFlowImpl.qll
2025-04-21 14:07:10 -07:00
Lindsay Simpkins
57f060beed Update DataFlowImpl.qll 2025-04-21 16:41:36 -04:00
Dilan Bhalla
7553e14873 sync upstream tags to main 2025-04-21 12:21:23 -07:00
Chanel
03bce1c59f Merge pull request #202 from microsoft/fix-to-string-on-unknown-static-read
PS: Fix `toString` on unknown static field access
2025-04-18 09:23:02 -07:00
Chanel
37a6b0460e Merge branch 'main' into fix-to-string-on-unknown-static-read 2025-04-18 09:21:15 -07:00
Mathias Vorreiter Pedersen
21210c6cb3 Merge pull request #203 from microsoft/add-missing-downgrade-and-upgrade-scripts
PS: Add missing downgrade and upgrade scripts
2025-04-18 13:34:18 +01:00
Mathias Vorreiter Pedersen
4518f18b9f PS: Delete a cycle in the upgrade script. 2025-04-18 12:41:13 +01:00
Mathias Vorreiter Pedersen
e7e88d3946 PS: Add upgrade script from some unknown dbscheme to the dbscheme that existed when Mathias joined Microsoft 2025-04-18 12:40:58 +01:00
Chanel
fe7d8ff61f Merge pull request #201 from microsoft/powershell-injectionhunter-port
Powershell Command Injection query updates
2025-04-17 11:03:19 -07:00
Chanel Young
12b918e900 pr feedback: removed toString, updated .expected 2025-04-17 10:39:42 -07:00
Mathias Vorreiter Pedersen
b70f7e219c PS: Fix missing toString and accept test changes. 2025-04-17 17:01:33 +01:00
Mathias Vorreiter Pedersen
7d7268349d PS: Add an example with a missing toString. 2025-04-17 16:53:26 +01:00
Mathias Vorreiter Pedersen
b09d9f6772 PS: Autoformat. 2025-04-17 16:49:47 +01:00
Chanel Young
ed553d393b merged work into CommandInjection query 2025-04-16 14:32:30 -07:00
Chanel Young
2266cd2eb8 moved folder, added tests/docs 2025-04-16 12:13:07 -07:00
Chanel Young
50a771edee Merge branch 'main' into powershell-injectionhunter-port 2025-04-16 11:19:26 -07:00
Chanel Young
5f643509f0 added script block, expandstring sinks, moved sanitizers to separate file 2025-04-16 11:18:02 -07:00
Chanel
c9b1356853 Merge pull request #200 from microsoft/files-reads-as-flow-sources
PS: Handle more flow sources
2025-04-16 10:03:44 -07:00
Mathias Vorreiter Pedersen
396a283da9 PS: Add tests for flow sources. 2025-04-15 22:43:21 +01:00
Mathias Vorreiter Pedersen
826e6a9ee8 PS: Add an inline expectations test library for flow sources. 2025-04-15 22:43:19 +01:00
Mathias Vorreiter Pedersen
dcc127832e PS: Make remote flow sources flow sources. 2025-04-15 22:43:18 +01:00
Mathias Vorreiter Pedersen
fa3fc4a0c3 PS: Fix more problems in MaD rows for sources. 2025-04-15 22:43:16 +01:00
Mathias Vorreiter Pedersen
a146630a09 PS: Delete redundant files. 2025-04-15 22:43:14 +01:00
Mathias Vorreiter Pedersen
43d9c701f8 PS: Rename Field and Property to Member. 2025-04-15 22:43:03 +01:00
Mathias Vorreiter Pedersen
f38948764c PS: Make type names lower case. 2025-04-15 22:36:31 +01:00
Mathias Vorreiter Pedersen
993511735a PS: Make method names lower case. 2025-04-15 22:02:46 +01:00
Chanel Young
b4d8673a38 Merge branch 'main' of https://github.com/microsoft/codeql into powershell-injectionhunter-port 2025-04-14 15:18:37 -07:00
Mathias Vorreiter Pedersen
6455992402 PS: Add two more flow sources. 2025-04-10 20:44:11 +01:00
Mathias Vorreiter Pedersen
3d18175885 PS: Make it possible to specify a named argument that must be present in MaD. 2025-04-10 20:42:50 +01:00
Mathias Vorreiter Pedersen
43de3a131b PS: Use the existing MaD rows to model file reads as flow sources. 2025-04-10 20:25:17 +01:00
Chanel
1637df0a3f Merge pull request #199 from microsoft/fix-top-level-arguments
PS: Fix a couple of missing local flow sources
2025-04-10 11:18:31 -07:00
Mathias Vorreiter Pedersen
4aa9f85b5d PS: Accept test changes. 2025-04-10 19:02:54 +01:00
Mathias Vorreiter Pedersen
9adf028d41 PS: Fix environment variables. 2025-04-10 19:02:07 +01:00
Mathias Vorreiter Pedersen
bf9ed3bcb7 PS: Accept test changes. 2025-04-10 18:52:27 +01:00
Mathias Vorreiter Pedersen
6084789f09 PS: Fix the top level arguments after the AST cleanup. 2025-04-10 18:50:06 +01:00
Mathias Vorreiter Pedersen
793fd5eb7e PS: Delete a redundant file. 2025-04-10 18:49:45 +01:00
dilanbhalla
5abde74f0c Merge pull request #198 from microsoft/dilan/sync-main-bugs-7
Sync Main Error Handling Improvement
2025-04-10 10:34:55 -07:00
dilanbhalla
4628c187bd Update sync-main.yml 2025-04-10 10:26:00 -07:00
Chanel
419de4fd22 Merge pull request #196 from microsoft/autogenerate-lots-of-models
PS: Add autogenerated summary models
2025-04-09 11:16:36 -07:00
Mathias Vorreiter Pedersen
b55ee68a99 Merge branch 'main' into autogenerate-lots-of-models 2025-04-09 11:12:09 -07:00
dilanbhalla
89ddb30a96 Merge pull request #197 from microsoft/auto/sync-main-pr
Sync Main (autogenerated)
2025-04-09 10:46:13 -07:00
dilanbhalla
0f034b32e0 Merge pull request #194 from microsoft/dilan/sync-main-bugs-6
Sync Main: More Misc Bugs
2025-04-09 10:46:07 -07:00
dilanbhalla
c5b024a9dd Update sync-main.yml 2025-04-09 10:26:10 -07:00
dilanbhalla
b8b4e44e81 Update sync-main.yml 2025-04-09 10:24:00 -07:00
dilanbhalla
86b3eaeb64 Merge branch 'main' into dilan/sync-main-bugs-6 2025-04-09 10:18:16 -07:00
dilanbhalla
0d97cd6be6 Merge branch 'main' of https://github.com/microsoft/codeql into auto/sync-main-pr 2025-04-09 17:17:29 +00:00
dilanbhalla
88a7c3a63d Update sync-main.yml 2025-04-09 10:16:42 -07:00
dilanbhalla
e7edf1bab9 Update sync-main.yml 2025-04-09 10:13:45 -07:00
dilanbhalla
a93d65b2d1 Update sync-main.yml 2025-04-09 10:11:23 -07:00
Mathias Vorreiter Pedersen
f8207fa92a PS: Add a testcase to demonstrate flow through Join-String. 2025-04-09 15:20:41 +01:00
Mathias Vorreiter Pedersen
ebb91dceb7 PS: Add a few more models after fixing MaD for Element content. 2025-04-09 15:20:39 +01:00
Mathias Vorreiter Pedersen
6de4765fe6 PS: Support implicit imports in API graphs. 2025-04-09 15:20:38 +01:00
Mathias Vorreiter Pedersen
a5afc3c582 PS: Flow through pipelines. 2025-04-09 15:20:36 +01:00
Mathias Vorreiter Pedersen
5f12d7c970 PS: Taint flow through all calls to 'toString'. 2025-04-09 15:20:35 +01:00
Mathias Vorreiter Pedersen
763effb50d PS: Add more models and support pipeline parameters in MaD. 2025-04-09 15:20:33 +01:00
Mathias Vorreiter Pedersen
f38c5f5b4f PS: Add lots of models. 2025-04-09 15:20:32 +01:00
Mathias Vorreiter Pedersen
02c027d9f6 Merge pull request #183 from microsoft/hashcons-for-csharp
C#: Add a hash-cons library for C#
2025-04-09 04:21:50 -07:00
Mathias Vorreiter Pedersen
7612ef922f Merge pull request #186 from microsoft/powershell-automatic-variables-as-member-edges
PS: Fix more Chanel-reported PowerShell issues
2025-04-09 04:21:38 -07:00
dilanbhalla
79909e93a2 Update sync-main.yml 2025-04-08 16:34:50 -07:00
dilanbhalla
70f9401ba2 Update sync-main.yml 2025-04-08 16:31:56 -07:00
github-actions[bot]
1e24627de3 Merge tag 'codeql-cli/latest' into auto/sync-main-pr
Compatible with the latest released version of the CodeQL CLI
2025-04-08 23:27:08 +00:00
dilanbhalla
a7dcc9fa6f Update sync-main.yml 2025-04-08 16:26:10 -07:00
dilanbhalla
3d57ea9d8c Update sync-main.yml 2025-04-08 16:22:18 -07:00
dilanbhalla
98338fe6c8 Update sync-main.yml 2025-04-08 16:16:34 -07:00
dilanbhalla
2a8c8dbdb7 Update sync-main.yml 2025-04-08 16:12:47 -07:00
dilanbhalla
d2eadbffad Update sync-main.yml 2025-04-08 16:07:41 -07:00
dilanbhalla
87d55921c6 Update sync-main.yml 2025-04-08 16:01:38 -07:00
dilanbhalla
9f2b3eb95e Update sync-main.yml 2025-04-08 15:53:16 -07:00
dilanbhalla
826d43da88 Update sync-main.yml 2025-04-08 15:50:41 -07:00
dilanbhalla
544f0ca81d Update sync-main.yml 2025-04-08 15:43:31 -07:00
dilanbhalla
7a168b0d5c Update sync-main.yml 2025-04-08 15:37:42 -07:00
dilanbhalla
be4f1f1482 Update sync-main.yml 2025-04-08 15:34:53 -07:00
dilanbhalla
eb41d97d48 Update sync-main.yml 2025-04-08 15:28:59 -07:00
dilanbhalla
9bbffb6fd8 Update sync-main.yml 2025-04-08 15:09:55 -07:00
dilanbhalla
9a59b1c807 Update sync-main.yml 2025-04-08 14:57:47 -07:00
dilanbhalla
d92e61eeff Update sync-main.yml 2025-04-08 14:47:57 -07:00
dilanbhalla
3a630ad276 Update sync-main.yml 2025-04-08 14:22:13 -07:00
dilanbhalla
7259356af1 Update sync-main.yml 2025-04-08 14:21:33 -07:00
dilanbhalla
71ccc9675a Update sync-main.yml 2025-04-08 14:05:42 -07:00
dilanbhalla
bc8220f76b Update sync-main.yml 2025-04-08 13:21:17 -07:00
dilanbhalla
d384e41953 Update sync-main.yml 2025-04-08 12:49:03 -07:00
dilanbhalla
3324c30a71 Update sync-main.yml 2025-04-08 12:48:34 -07:00
dilanbhalla
9442bf39eb Update sync-main.yml 2025-04-08 12:47:13 -07:00
dilanbhalla
0d40476820 Update sync-main.yml 2025-04-08 12:28:52 -07:00
dilanbhalla
e2bac165fe Update sync-main.yml 2025-04-08 11:58:41 -07:00
dilanbhalla
ed31f43cfd Update sync-main.yml 2025-04-08 11:51:21 -07:00
dilanbhalla
d81989f345 Update sync-main.yml 2025-04-08 11:48:02 -07:00
dilanbhalla
75fb343e38 Update sync-main.yml 2025-04-08 11:41:29 -07:00
dilanbhalla
b6762463f7 Update sync-main.yml 2025-04-08 11:33:40 -07:00
dilanbhalla
dc9fdb596e Update sync-main.yml 2025-04-08 11:29:26 -07:00
dilanbhalla
c1665fdc0f Update sync-main.yml 2025-04-08 11:26:20 -07:00
dilanbhalla
db6d82c9b2 Update sync-main.yml 2025-04-08 11:17:22 -07:00
dilanbhalla
7e90d99c28 Update sync-main.yml 2025-04-08 11:14:08 -07:00
dilanbhalla
e098dd3d50 Merge pull request #193 from microsoft/dilan/sync-main-bugs-5
Sync Main: More Bugs (Failed PR Creation)
2025-04-08 10:26:50 -07:00
dilanbhalla
ae5709d894 Update sync-main.yml 2025-04-04 18:55:57 -07:00
dilanbhalla
41406d1b16 Merge pull request #192 from microsoft/dilan/sync-main-bugs-4
Sync Main: More Misc Bugs (token related bugs)
2025-04-04 15:58:20 -07:00
dilanbhalla
3c92f6b74d Update sync-main.yml 2025-04-04 15:41:21 -07:00
dilanbhalla
fb938abfd9 Merge pull request #191 from microsoft/dilan/sync-main-bugs-3
Sync Main: More Misc Token Bugs
2025-04-04 15:34:45 -07:00
dilanbhalla
e0a6a4edc6 Update sync-main.yml 2025-04-04 15:03:01 -07:00
dilanbhalla
52ceda1e40 Merge pull request #190 from microsoft/dilan/sync-main-bugs-2
Sync Main Various Bugs (permissions/tokens, git debugging, etc.)
2025-04-04 14:58:43 -07:00
dilanbhalla
856826019d Merge branch 'main' into dilan/sync-main-bugs-2 2025-04-04 14:55:31 -07:00
dilanbhalla
cda36a8550 Update sync-main.yml 2025-04-04 14:53:52 -07:00
dilanbhalla
13e53055a5 Merge pull request #189 from microsoft/dilan/sync-main-bugs-1
Sync Main Misc Git Bugs
2025-04-04 14:40:02 -07:00
dilanbhalla
157c57a3d4 Update sync-main.yml 2025-04-04 14:22:39 -07:00
dilanbhalla
452f56fa7f Merge pull request #188 from microsoft/dilan/sync-main-trigger
Adding push trigger to sync-main
2025-04-04 14:13:23 -07:00
dilanbhalla
3c4592591b Update sync-main.yml 2025-04-04 14:11:00 -07:00
dilanbhalla
6cbc80a69b Merge pull request #187 from microsoft/dilan/sync-main-createpr
Policy update: Sync-Main Create PR (instead of direct push)
2025-04-04 14:08:35 -07:00
dilanbhalla
2af55138da Update sync-main.yml 2025-04-04 14:00:05 -07:00
dilanbhalla
e0b8e20f9b Update sync-main.yml 2025-04-04 13:57:18 -07:00
dilanbhalla
6da7e4cb84 Update sync-main.yml 2025-04-04 13:53:14 -07:00
Chanel Young
6db354e82d Merge branch 'main' of https://github.com/microsoft/codeql into powershell-injectionhunter-port 2025-04-04 09:20:29 -07:00
Chanel Young
38f0f07d57 modeled some user input, sanitizers 2025-04-04 09:03:39 -07:00
Chanel
a2d4296329 Merge branch 'main' into powershell-automatic-variables-as-member-edges 2025-04-04 09:03:09 -07:00
Mathias Vorreiter Pedersen
8a58af8f84 PS: Add a model for 'EscapeSingleQuotedStringContent' and add a test. 2025-04-04 15:48:19 +01:00
Mathias Vorreiter Pedersen
65abf48ad6 PS: Add missing taint-flow and dataflow dispatch from models. 2025-04-04 15:40:35 +01:00
Mathias Vorreiter Pedersen
f482c9dba7 PS: Make the implementation of 'getExtraNodeFromType' more complete. This is still not good enough, but it's enough to get the flow we need for now. 2025-04-04 15:39:56 +01:00
Mathias Vorreiter Pedersen
03f356188b PS: Accept test changes. 2025-04-04 12:33:15 +01:00
Mathias Vorreiter Pedersen
cdd68b3951 PS: Improve the location of synthesized variables. 2025-04-04 12:33:13 +01:00
Mathias Vorreiter Pedersen
ebc732756f PS: Get rid of the pipelineVARIABLE and only have pipelinePARAMETER (and similarly for the by-propertyname versions). 2025-04-04 12:33:12 +01:00
Mathias Vorreiter Pedersen
16348b5484 PS: Consistently use the pipeline parameter as the parameter when it supplied in the program. 2025-04-04 12:33:11 +01:00
Josh Brown
c5c3236f99 Merge branch 'main' into hashcons-for-csharp 2025-04-04 07:30:49 +11:00
Mathias Vorreiter Pedersen
22bdcf0af2 PS: Force lower casing on method edges. 2025-04-03 20:33:04 +01:00
Mathias Vorreiter Pedersen
4df449d4b0 PS: Add an edge from the root node to automatic variables, and from a member read qualifier to a read. 2025-04-03 20:30:52 +01:00
Mathias Vorreiter Pedersen
4b14e5e7ec PS: Lift automatic variables to the cfg and dataflow layers. 2025-04-03 20:30:15 +01:00
Mathias Vorreiter Pedersen
50c57c2cb2 PS: Drive-by: Assign a location to top-level functions. 2025-04-03 20:29:44 +01:00
dilanbhalla
6873ebae16 Merge pull request #185 from microsoft/fix-ssa-for-powershell-2
PS: Fixup SSA after GitHub's 2.21.0 changes
2025-04-03 12:05:43 -07:00
Josh Brown
e261510528 Merge branch 'main' into hashcons-for-csharp 2025-04-04 05:52:23 +11:00
Mathias Vorreiter Pedersen
2f215c1e0f PS: Accept test changes. 2025-04-03 19:48:13 +01:00
Mathias Vorreiter Pedersen
403c182dc9 PS: Fixup SSA after GitHub's recent changes. 2025-04-03 19:48:06 +01:00
Chanel Young
22ff3a3e01 Merge branch 'main' of https://github.com/microsoft/codeql into powershell-injectionhunter-port 2025-04-03 11:24:31 -07:00
Chanel Young
656b734391 initial query 2025-04-03 11:23:49 -07:00
Chanel
7c59a748a8 Merge pull request #184 from microsoft/fix-parameter-by-name-flow-3
PS: Fix the last remaining missing flows after AST prettification
2025-04-03 11:20:23 -07:00
Mathias Vorreiter Pedersen
38536a9e38 PS: Accept test changes. 2025-04-03 18:46:12 +01:00
Mathias Vorreiter Pedersen
5151eb3b64 PS: Add dataflow for pipeline-by-property-name variables. 2025-04-03 18:46:11 +01:00
Mathias Vorreiter Pedersen
86ec291145 PS: Improve toString on phi nodes. 2025-04-03 18:46:10 +01:00
Mathias Vorreiter Pedersen
3acbd83297 PS: Drive-by fix: The variable access in a foreach loop implicitly writes to the variable. 2025-04-03 18:46:09 +01:00
Mathias Vorreiter Pedersen
4d04b11468 PS: Add some implicit reads at process blocks, and fix CFG for process blocks so that these reads appear in the CFG. 2025-04-03 18:46:08 +01:00
Mathias Vorreiter Pedersen
cd8e5e6d8d PS: Subclass AnyElement into positional or key-ional. 2025-04-03 18:46:06 +01:00
Mathias Vorreiter Pedersen
70ca6868aa C#: Make a few more modules private. 2025-04-03 18:18:46 +01:00
Mathias Vorreiter Pedersen
61259735fd C#: Add a hash-cons library for C#. 2025-04-03 18:13:01 +01:00
Chanel
b452339b23 Merge pull request #182 from microsoft/fix-parameter-by-name-flow-2
PS: Fix parameter/argument name mapping for named parameters
2025-04-01 11:29:01 -07:00
Mathias Vorreiter Pedersen
5fa3beb13d PS: Normalize parameter keywords and accept test changes. 2025-04-01 19:21:42 +01:00
Mathias Vorreiter Pedersen
1c380fb7fb PS: Add another missing flow found by Chanel. 2025-04-01 19:21:41 +01:00
Chanel
898297b542 Merge pull request #181 from microsoft/powershell-ast-modernization-follow-up
PS: Fix more taint-tracking/dataflow regressions
2025-04-01 09:46:48 -07:00
Mathias Vorreiter Pedersen
8ae92a5cdb PS: Accept test changes. 2025-04-01 15:08:36 +01:00
Mathias Vorreiter Pedersen
129b7876d7 PS: Allow shadowing of automatic variables. 2025-04-01 15:08:35 +01:00
Mathias Vorreiter Pedersen
08dc8183e0 PS: Add Chanel's missing flow example. 2025-04-01 15:08:33 +01:00
Mathias Vorreiter Pedersen
0b9720c908 PS: Accept test changes. 2025-03-31 20:12:51 +01:00
Mathias Vorreiter Pedersen
88f638dc5c PS: Fix more pipeline flow. 2025-03-31 20:12:43 +01:00
Mathias Vorreiter Pedersen
ee4104b78c PS: Fix parent-child mapping for iterator pipeline access synthesis. 2025-03-29 11:51:33 +00:00
Mathias Vorreiter Pedersen
a6a17344ff PS: Easier debugging with strings for child indices. 2025-03-29 11:18:23 +00:00
Mathias Vorreiter Pedersen
e17a169b8b Merge pull request #180 from microsoft/powershell-ast-modernization-follow-up
PS: Fix PowerShell dataflow/taint-tracking failures
2025-03-28 13:19:00 -07:00
Mathias Vorreiter Pedersen
7102ebbcf7 PS: Accept test changes. 2025-03-28 19:39:54 +00:00
Mathias Vorreiter Pedersen
3643b93033 fixup! PS: Define pre-return node and implicit-wrapping nodes using the script block instead of the individual elements. 2025-03-28 19:36:18 +00:00
Mathias Vorreiter Pedersen
5d5448df62 PS: Also use the new library to handle array expressions. 2025-03-28 19:36:06 +00:00
Mathias Vorreiter Pedersen
b2cf155ff5 PS: Define pre-return node and implicit-wrapping nodes using the script block instead of the individual elements. 2025-03-28 19:35:41 +00:00
Mathias Vorreiter Pedersen
ee8c586200 PS: Use the new library to calculate returned expressions. 2025-03-28 19:34:50 +00:00
Mathias Vorreiter Pedersen
a9861e13e9 PS: Add a library that calculated escaping values much more efficiently using the forward/reverse pruning technique. 2025-03-28 19:33:23 +00:00
Mathias Vorreiter Pedersen
f85767f47e PS: add a super class for all loop-related CFG nodes. 2025-03-28 19:32:36 +00:00
Mathias Vorreiter Pedersen
19454a50e9 PS: Small additions to the CFG classes and a small bugfix. 2025-03-28 19:32:07 +00:00
Mathias Vorreiter Pedersen
18d94f2078 PS: Don't include the variable in the IPA definition for variable accesses. 2025-03-28 19:31:15 +00:00
Mathias Vorreiter Pedersen
2da8da0777 PS: Add helper predicates for if statements. 2025-03-28 19:30:16 +00:00
Mathias Vorreiter Pedersen
ee0a21e67f PS: Make child mapping classes private. 2025-03-28 19:29:45 +00:00
Mathias Vorreiter Pedersen
7b9a41aa92 PS: Handle this parameters in a few more places. 2025-03-27 18:03:06 +00:00
Mathias Vorreiter Pedersen
dcb98ab5a1 PS: Don't include the this parameter in getParameter. 2025-03-27 18:01:28 +00:00
Mathias Vorreiter Pedersen
cea435cf1f Merge pull request #178 from microsoft/powershell-ipa-the-ast
PS: Simplify the AST in Powershell
2025-03-27 09:37:38 -07:00
Mathias Vorreiter Pedersen
0fc57789bf PS: Accept dataflow/taint-tracking/type-tracking regressions. 2025-03-27 16:01:42 +00:00
Mathias Vorreiter Pedersen
c840f86707 PS: Accept CFG test changes. 2025-03-27 16:01:41 +00:00
Mathias Vorreiter Pedersen
655d80ee7b PS: Repair tests and accept test changes in syntax tests. 2025-03-27 16:01:39 +00:00
Mathias Vorreiter Pedersen
7551cce537 PS: Make API graphs compile again. There is still some TODOs here, but at least it compiles. 2025-03-27 16:01:38 +00:00
Mathias Vorreiter Pedersen
8092345fee PS: Make type-tracking and taint-tracking compile again. 2025-03-27 16:01:36 +00:00
Mathias Vorreiter Pedersen
8f9bc1e4b2 PS: Make SSA compile again. 2025-03-27 16:01:35 +00:00
Mathias Vorreiter Pedersen
c2e24ea3a4 PS: Make CFG construction compile again. 2025-03-27 16:01:33 +00:00
Mathias Vorreiter Pedersen
9efc3ec380 PS: Make dataflow compile again. 2025-03-27 16:01:30 +00:00
Mathias Vorreiter Pedersen
cc13922206 PS: Make the experimental query compile again. 2025-03-27 16:01:28 +00:00
Mathias Vorreiter Pedersen
171f5ca698 PS: Inside a process block the name of a pipeline parameter actually refers to the individual elements in the pipeline. Add a synthesized variable access that represents this. 2025-03-27 16:01:26 +00:00
Mathias Vorreiter Pedersen
9f4d1c624d PS: PowerShell doesn't have a notion of true, false, null, etc. In the extracted AST these are just variables with special names. We insert synthesized AST elements that represent these special variables. 2025-03-27 16:01:24 +00:00
Mathias Vorreiter Pedersen
7adb020977 PS: Remove arguments that are just names for a named argument. 2025-03-27 16:01:23 +00:00
Mathias Vorreiter Pedersen
3bb6021cb2 PS: Remove the CmdExpr AST elements and synthesize StmtExpr instead where needed. 2025-03-27 16:01:21 +00:00
Mathias Vorreiter Pedersen
8eb5e65ac4 PS: Synthesize Function and Type classes instead of relying on the statement that defines them. 2025-03-27 16:01:20 +00:00
Mathias Vorreiter Pedersen
17661342f8 PS: expr-to-stmt conversions. 2025-03-27 16:01:18 +00:00
Mathias Vorreiter Pedersen
0b4a7f9436 PS: Synthesize a simpler notion of parameters. 2025-03-27 16:01:17 +00:00
Mathias Vorreiter Pedersen
5bc0a263ec PS: A call to set-variable is an explicit assignment. 2025-03-27 16:01:15 +00:00
Mathias Vorreiter Pedersen
faa94735bf PS: Add an implicit this parameter to all methods. 2025-03-27 16:01:14 +00:00
Mathias Vorreiter Pedersen
31f14ba99a PS: Add synthesis framework for cleaning up the AST. 2025-03-27 16:01:11 +00:00
Mathias Vorreiter Pedersen
0dd756d72d PS: Add support for variables. 2025-03-27 16:01:10 +00:00
Mathias Vorreiter Pedersen
11c84ccaf4 PS: Add the IPA type representing the AST. 2025-03-27 16:01:09 +00:00
Mathias Vorreiter Pedersen
b52c6ea4ba PS: Add control-flow node version of all the user-facing ast classes. 2025-03-27 16:01:07 +00:00
Mathias Vorreiter Pedersen
a207c8008b PS: Add 'raw' AST classes coming directly from the extractor. 2025-03-27 16:01:06 +00:00
Mathias Vorreiter Pedersen
665202195c PS: Add user-facing AST classes. 2025-03-27 16:01:04 +00:00
Mathias Vorreiter Pedersen
d79eb013c8 PS: Delete the old AST. 2025-03-26 18:00:10 +00:00
Mathias Vorreiter Pedersen
44e4e3eb54 PS: Extract more powershell files and fix off-by-one error in locations. 2025-03-25 16:59:28 +00:00
Dilan
4c138212bc Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2025-03-18 13:06:17 +00:00
Dilan
0869a11411 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2025-03-06 15:59:15 +00:00
Mathias Vorreiter Pedersen
4ddc425156 Merge pull request #175 from gfs/gfs/PowershellExtractorNetUpgrade
Update .NET Version for Powershell Extractor to Net 9.0
2025-02-27 18:05:34 +00:00
Mathias Vorreiter Pedersen
faa51c17e1 Merge branch 'main' into gfs/PowershellExtractorNetUpgrade 2025-02-27 17:59:31 +00:00
Mathias Vorreiter Pedersen
2172ced0be Merge pull request #176 from microsoft/dilan/powershell-pr-token
Fix PowerShell PR Token
2025-02-27 17:58:41 +00:00
dilanbhalla
17ae251137 Update powershell-pr-check.yml 2025-02-27 09:34:15 -08:00
Gabe Stocco
b018fb9c8f Add gitignore for build artifacts from powershell extractor 2025-02-26 12:40:27 -08:00
Gabe Stocco
43cdff9725 Update dependencies.
Update projects to use NET 9.0 (required by System.Management 7.5 and later)
2025-02-26 12:36:35 -08:00
Gabe Stocco
ee2688fbcb Update project to net 8. 2025-02-26 12:30:05 -08:00
Mathias Vorreiter Pedersen
4e6f4639f7 Merge pull request #174 from microsoft/revert-ps-module-extraction
PS: Revert extraction of code found via `PSModulePath`
2025-02-26 12:29:39 +00:00
Mathias Vorreiter Pedersen
abc23e038a Merge branch 'main' into revert-ps-module-extraction 2025-02-26 12:26:17 +00:00
Mathias Vorreiter Pedersen
29c11a4a5e PS: Add upgrade and downgrade scripts. 2025-02-24 14:23:49 +00:00
Mathias Vorreiter Pedersen
5b5b15361a PS: Make the prepare db script work on the Microsoft repo. 2025-02-24 14:23:47 +00:00
Mathias Vorreiter Pedersen
4bfd6fd345 PS: Revert psmodule path file extraction. 2025-02-24 14:23:46 +00:00
Mathias Vorreiter Pedersen
1978e10c05 PS: Remove extractor option to skip psmodule extraction. 2025-02-24 14:23:35 +00:00
Dilan
0628e4990b Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2025-02-21 18:59:16 +00:00
dilanbhalla
d76e438a90 Merge pull request #173 from microsoft/powershell-update-basic-block-library-for-2.20.5
PS: Match the changes from #18696
2025-02-21 10:13:16 -08:00
Mathias Vorreiter Pedersen
6909792627 PS: Also get rid of an easy-to-fix SSA warning. 2025-02-21 12:22:06 +00:00
Mathias Vorreiter Pedersen
efb43bca3e PS: Match the changes from #18696. 2025-02-21 12:16:00 +00:00
Mathias Vorreiter Pedersen
61796da374 Merge pull request #171 from microsoft/ps-add-dotnet-type-models
PS: Add .NET and PowerShell SDK type models.
2025-02-19 18:37:43 +00:00
Mathias Vorreiter Pedersen
3dbe7f4fa6 PS: Add the type model generation script and add a short readme. 2025-02-19 14:10:28 +00:00
Mathias Vorreiter Pedersen
6ef09412a9 PS: Add .NET and PowerShell SDK type models. 2025-02-19 00:05:51 +00:00
dilanbhalla
c39c091690 Update microsoft-codeql-pack-publish.yml 2025-02-14 11:06:14 -08:00
dilanbhalla
8c466139cb Update microsoft-codeql-pack-publish.yml 2025-02-14 11:05:16 -08:00
dilanbhalla
e79d4c9123 Update microsoft-codeql-pack-publish.yml 2025-02-14 10:50:32 -08:00
dilanbhalla
c4fa83bea8 Update microsoft-codeql-pack-publish.yml 2025-02-14 10:47:33 -08:00
dilanbhalla
4e0bfa3f66 Merge branch 'main' into dilan/publish-opensource-packs 2025-02-14 10:42:11 -08:00
Raul Garcia
5c54c81907 Merge pull request #169 from microsoft/dilan/metadata-bug-cpp
Metadata Bug in C++ Query
2025-02-12 16:46:26 -08:00
dilanbhalla
9ba49adc04 Update ArgumentIsSizeofOrOperation.ql 2025-02-12 15:15:17 -08:00
dilanbhalla
ad3299124c Merge pull request #168 from microsoft/dilan/reduce-pr-check-perms
Reduce GitHub Workflow Perms
2025-02-10 13:16:37 -08:00
dilanbhalla
6ccedebd12 Update sync-main.yml 2025-02-10 13:13:34 -08:00
dilanbhalla
898e4ff8af reduce powershell pr check perms 2025-02-10 12:52:03 -08:00
dilanbhalla
d5f75d49d8 Merge pull request #167 from microsoft/update-ruby-internal-dataflow-files
Ruby: Update internal dataflow files.
2025-02-10 09:24:09 -08:00
Mathias Vorreiter Pedersen
6ed2eb1478 Ruby: Update internal dataflow files. 2025-02-10 12:43:07 +00:00
dilanbhalla
233c0cfda0 Merge pull request #166 from microsoft/dilan/resolve-ruby-df-error
resolving ruby df error
2025-02-07 16:00:23 -08:00
Dilan Bhalla
41b5d19137 resolving ruby df error 2025-02-07 14:10:07 -08:00
dilanbhalla
e7bb37a18f Merge pull request #165 from microsoft/dilan/microsoft-namespace-edit
Microsoft Public Namespace Fix
2025-02-07 10:19:42 -08:00
dilanbhalla
e200aa5cdd Merge branch 'main' into dilan/microsoft-namespace-edit 2025-02-07 10:11:06 -08:00
Dilan Bhalla
414feffcaa microsoft-public -> public 2025-02-07 10:09:34 -08:00
Mathias Vorreiter Pedersen
7f7e9348e9 Merge pull request #164 from microsoft/dilan/include-microsoft-public-tests
Include Tests for Microsoft Open Source Queries
2025-02-07 14:46:48 +00:00
Mathias Vorreiter Pedersen
642780e7d6 C++: Accept more test changes. 2025-02-07 14:41:47 +00:00
Dilan Bhalla
ba97b92148 microsoft public namespace edit 2025-02-06 23:41:09 -08:00
Dilan Bhalla
312bc523a6 adding msft open source tests 2025-02-06 17:11:09 -08:00
Dilan
b0c11b5a78 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2025-02-06 21:05:28 +00:00
dilanbhalla
9be5b3c344 Merge pull request #163 from microsoft/update-powershell-cfg-library-after-2.20.4
PS: Fixup CFG library in preparation for 2.20.4
2025-02-06 13:03:57 -08:00
dilanbhalla
c749c19db4 Update CommandInjection.ql 2025-02-06 12:04:51 -08:00
dilanbhalla
fa74d05211 Update CommandInjection.ql 2025-02-06 12:04:39 -08:00
dilanbhalla
14ab30ce1f Update DoNotUseInvokeExpression.ql 2025-02-06 12:04:29 -08:00
Mathias Vorreiter Pedersen
c43b682862 PS: Ensure that the PowerShell CFG library compiles with CodeQL version 2.20.4. 2025-02-06 19:55:29 +00:00
Raul Garcia
cd9a0f1776 Merge pull request #161 from microsoft/dilan/query-id-msft-namespace
Add Microsoft-Public Namespace to Query IDs
2025-02-04 12:05:42 -08:00
Dilan Bhalla
54f0bc1afb adding msft namespace to msft query ids 2025-02-04 11:54:38 -08:00
Dilan Bhalla
405a4f545b working for first version, updating to autoincrementing logic 2025-02-02 23:12:13 -08:00
Dilan Bhalla
c8077a5117 minor fix 2025-02-02 22:58:46 -08:00
Dilan Bhalla
d6da994507 minor fix 2025-02-02 22:46:15 -08:00
Dilan Bhalla
d09d8c83ed minor fix 2025-02-02 22:37:43 -08:00
Dilan Bhalla
dd9e87c777 minor fix 2025-02-02 22:35:44 -08:00
Dilan Bhalla
d59576e55b minor fix 2025-02-02 22:30:34 -08:00
Dilan Bhalla
9c7dca6774 minor fix 2025-01-31 16:30:58 -08:00
Dilan Bhalla
19ea28c7d5 minor fix 2025-01-31 16:26:11 -08:00
Dilan Bhalla
472a51e3b5 minor fix 2025-01-31 16:02:17 -08:00
Dilan Bhalla
c3a0bc25f9 minor fix 2025-01-31 16:00:11 -08:00
Dilan Bhalla
1eb5e9bc87 accidentally removed codeql install step 2025-01-31 15:56:38 -08:00
Dilan Bhalla
efe01c151e first time publish, hardcode to 0.0.1 2025-01-31 15:49:10 -08:00
Dilan Bhalla
4e24f3231f minor fix 2025-01-31 15:46:10 -08:00
Dilan Bhalla
c99146a041 minor fix 2025-01-31 15:39:04 -08:00
Dilan Bhalla
cc4ce3b8d1 minor fix 2025-01-31 15:37:48 -08:00
Dilan Bhalla
6958dff31f minor fix 2025-01-31 15:36:35 -08:00
Dilan Bhalla
d1b30ef13d minor fix 2025-01-31 15:34:47 -08:00
Dilan Bhalla
a6fe1b5ed1 open source package publish 2025-01-31 15:33:54 -08:00
dilanbhalla
a88f3ce16d Merge pull request #160 from microsoft/dilan/remove-js-dataflow-deprecation-labels
TEMPORARY: Remove JavaScript Deprecation Labels
2025-01-31 14:18:55 -08:00
Dilan Bhalla
34a577de00 missed deprecation label removal for code injection query 2025-01-31 14:17:51 -08:00
Dilan Bhalla
714036110c removing javascript dataflow deprecations 2025-01-31 11:17:08 -08:00
Mathias Vorreiter Pedersen
29d07ae059 Merge pull request #159 from microsoft/dataflow-stack-cleanup-3
Java: Update file that was forgotten in #157
2025-01-31 18:04:25 +00:00
Mathias Vorreiter Pedersen
403ad3c7bd Shared: Add missing transitive closure. 2025-01-31 12:04:34 +00:00
Mathias Vorreiter Pedersen
712d8aa322 Java: Update file that was forgotten in the dataflow-stack PR. 2025-01-31 10:19:21 +00:00
Mathias Vorreiter Pedersen
df06d34625 Merge branch 'main' into interprocedural-controlflow 2025-01-30 18:40:23 +00:00
dilanbhalla
3237b2c3f7 Merge pull request #158 from microsoft/dataflow-stack-cleanup-2
Java/C#: Add missing files from #157
2025-01-30 10:07:50 -08:00
Mathias Vorreiter Pedersen
d144c26c04 Java/C#: Add missing files. 2025-01-30 17:44:32 +00:00
dilanbhalla
ee6624a425 Merge pull request #157 from microsoft/dataflow-stack-cleanup
Shared: Refactor `DataFlowStack`
2025-01-30 09:29:13 -08:00
Mathias Vorreiter Pedersen
c825ca8ec6 Shared: Refactor DataFlowStack so that we don't depend on our own modifications to the shared dataflow library files. 2025-01-30 16:21:21 +00:00
Mathias Vorreiter Pedersen
464ae8baf1 Shared: Autoformat. 2025-01-30 16:19:20 +00:00
Mathias Vorreiter Pedersen
e4378b26b8 All languages: Get rid of the Microsoft modifications to the GitHub dataflow files. 2025-01-30 15:40:52 +00:00
dilanbhalla
81fa6fcd2a Merge pull request #155 from microsoft/brodes/open_source_query_transition
Brodes/open source query transition
2025-01-29 01:29:16 -08:00
Ben Rodes
350742abc8 Merge branch 'main' into brodes/open_source_query_transition 2025-01-28 14:41:39 -05:00
Dilan
25a46a882b Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2025-01-28 19:01:55 +00:00
dilanbhalla
fee6373fa8 Merge pull request #156 from microsoft/update-powershell-dataflow-after-shared-changes
Powershell: Fix dataflow library after GitHub changes
2025-01-28 11:00:45 -08:00
dilanbhalla
273738e47c Merge branch 'main' into update-powershell-dataflow-after-shared-changes 2025-01-28 11:00:32 -08:00
Ben Rodes
da10292d8f Merge branch 'main' into brodes/open_source_query_transition 2025-01-28 12:18:18 -05:00
dilanbhalla
547b56223f Update sync-main.yml 2025-01-27 11:31:54 -08:00
dilanbhalla
e3494af9e0 Update sync-main.yml 2025-01-27 11:29:44 -08:00
dilanbhalla
70e27a4add Update sync-main.yml 2025-01-27 11:23:18 -08:00
Josh Brown
2fa64d0db5 Accept test case changed lines 2025-01-23 14:04:26 -08:00
Josh Brown
a09847f518 Merge new versions of cpp leap year queries 2025-01-23 12:47:40 -08:00
Mathias Vorreiter Pedersen
25f8f049c3 Powershell: Update changes to remain in sync with GitHub's shared libraries. 2025-01-23 18:06:22 +00:00
REDMOND\brodes
1376b0c355 Deprecated and hardcoded protocol queries and help 2025-01-15 16:26:55 -05:00
REDMOND\brodes
69cbbffd8f Adding UncheckedBoundsEnumAsIndex ql, help and example 2025-01-15 16:20:04 -05:00
REDMOND\brodes
34fe60dbfb KDF ql and qhelp 2025-01-15 16:18:33 -05:00
REDMOND\brodes
5d3f35bc8f HardcodedIVCNG qhelp and ql 2025-01-15 16:13:13 -05:00
REDMOND\brodes
4eb92afd25 Banned Modes ql and qhelp 2025-01-15 16:10:31 -05:00
REDMOND\brodes
9f09e67693 Adding BannedEncryption qhelp, ql, cap and cng qll, cryptofilters qll and misc. crypto example files 2025-01-15 13:16:57 -05:00
REDMOND\brodes
9668fb3875 SizeOfConstIntMacro qhelp, ql, examples and related qll. 2025-01-15 13:03:29 -05:00
REDMOND\brodes
ad626acbd3 Adding ArgumentIsSizeofOrOperation.qhelp, ql, and example files. 2025-01-15 13:01:08 -05:00
REDMOND\brodes
0f8f96c62e Adding IncorrectUsageOfRtlCompareMemory.qhelp, ql and example files. 2025-01-15 12:59:34 -05:00
REDMOND\brodes
7edf552023 Adding BadOverflowGuard qhelp, example code for help, and ql file. 2025-01-15 12:56:36 -05:00
REDMOND\brodes
936ecfc4cd All remaining leap year ql and qhelp files. 2025-01-15 12:37:21 -05:00
REDMOND\brodes
7eee4f2ea5 Adding LeapYear.qll and Adding365DaysPerYear ql and help. 2025-01-15 12:25:41 -05:00
REDMOND\brodes
99fa75b818 Leap Year Examples 2025-01-15 12:11:01 -05:00
Chanel
0bb0031802 Merge pull request #154 from microsoft/invoke-expression-ps-query
invoke expression powershell query
2025-01-09 15:43:37 -08:00
Chanel
6d55972f67 Merge branch 'main' into invoke-expression-ps-query 2025-01-09 15:37:53 -08:00
Dilan
4fd7aec87f Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2025-01-09 21:59:09 +00:00
Chanel
7f5e5ffa37 Apply suggestions from code review
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2025-01-09 10:41:16 -08:00
Chanel Young
17f9c9a0b5 invoke expression powershell query 2025-01-09 10:22:32 -08:00
dilanbhalla
faa5554ea7 Merge pull request #153 from microsoft/revert-152-dilan/rust-exclude-broken-queries
Revert "Remove Broken Rust Queries" + Stub DataflowStack required Interface
2024-12-19 10:21:08 -08:00
Josh Brown
2d97d0f629 WIP stubbing for DataFlowStack 2024-12-18 23:18:25 -08:00
Josh Brown
618732228d WIP stubbing for DataFlowStack 2024-12-18 23:16:23 -08:00
Josh Brown
5a17608c12 WIP stubbing for DataFlowStack 2024-12-18 23:13:25 -08:00
Josh Brown
fa1013ad15 Remove deprecated zipslip DataFlow configuration class, update test case 2024-12-18 22:03:31 -08:00
Josh Brown
00b556cc54 Revert "Remove Broken Rust Queries" 2024-12-19 16:39:08 +11:00
dilanbhalla
aec5d89621 Merge pull request #152 from microsoft/dilan/rust-exclude-broken-queries
Remove Broken Rust Queries
2024-12-17 17:11:04 -08:00
Dilan Bhalla
9575c0ed2a excluding broken queries 2024-12-17 17:07:36 -08:00
Dilan
2e6d9e7ca5 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2024-12-10 18:26:05 +00:00
dilanbhalla
46cbe2f260 Merge pull request #151 from microsoft/dilan/remove-deprecated-dataflow
Remove Deprecated DataFlow Libs
2024-12-10 10:24:48 -08:00
Dilan Bhalla
f91c91e4e2 resolve dataflow conflict 2024-12-09 13:36:44 -08:00
Mathias Vorreiter Pedersen
57f5b9748c C++: Instantiate the new shared library for C++. 2024-12-05 19:26:42 +00:00
Mathias Vorreiter Pedersen
f514753d63 C++: Add a 'shared' interprocedural control-flow library. I am keeping it in the cpp directory now to avoid qlpack headache. 2024-12-05 19:26:12 +00:00
dilanbhalla
58f8523276 Merge pull request #147 from microsoft/revert-146-dilan/msft-extractor-queries
Revert "Failed Extraction Queries"
2024-12-03 10:51:11 -08:00
dilanbhalla
a7cdda7a5b Revert "Failed Extraction Queries" 2024-12-03 10:50:15 -08:00
Dilan
0e25de1af0 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2024-12-02 13:59:17 +00:00
Mathias Vorreiter Pedersen
029fb0bcf2 Merge pull request #145 from microsoft/jb1/isLibraryFile-nomagic
No magic on `ClassifyFiles::isLibraryFile`
2024-11-26 11:50:19 +00:00
Josh Brown
52d7a3bb99 Merge remote-tracking branch 'origin/main' into jb1/isLibraryFile-nomagic 2024-11-26 03:43:07 -08:00
Mathias Vorreiter Pedersen
2d66955750 Merge pull request #146 from microsoft/dilan/msft-extractor-queries
Failed Extraction Queries
2024-11-25 13:19:24 +00:00
Dilan Bhalla
eb56cb94b0 metadata fixes 2024-11-22 14:29:43 -08:00
Dilan Bhalla
e3a04757d7 msft extractor queries 2024-11-22 14:11:02 -08:00
Josh Brown
e60df2c50e Merge branch 'main' into jb1/isLibraryFile-nomagic 2024-11-22 14:56:11 +11:00
Josh Brown
15f92fcda8 No magic isLibraryFile 2024-11-21 19:52:03 -08:00
dilanbhalla
54d9eda50a Update powershell-pr-check.yml 2024-11-20 14:09:27 -08:00
dilanbhalla
6fb39c65c5 Update powershell-pr-check.yml 2024-11-20 14:09:06 -08:00
dilanbhalla
b22ee5752d Update powershell-pr-check.yml 2024-11-20 13:28:52 -08:00
dilanbhalla
ac868f412c Update powershell-pr-check.yml 2024-11-20 13:21:15 -08:00
dilanbhalla
5dca7cd175 Merge pull request #143 from microsoft/dilan/powershell-pr-check
PowerShell PR Check
2024-11-20 12:35:22 -08:00
dilanbhalla
44e48a7588 Update powershell-pr-check.yml 2024-11-20 12:17:06 -08:00
dilanbhalla
514285c2fc Update sync-main.yml 2024-11-20 12:16:38 -08:00
dilanbhalla
105f7395d7 Delete powershell/ql/src/queries/security/cwe-078/test.ql 2024-11-20 12:14:08 -08:00
dilanbhalla
147784a102 Create test.ql 2024-11-20 12:11:39 -08:00
dilanbhalla
7257b4a0a2 Update powershell-pr-check.yml 2024-11-20 12:08:15 -08:00
dilanbhalla
1dd5e34e0e Create powershell-pr-check.yml 2024-11-20 12:04:11 -08:00
Lindsay Simpkins
861ae8abc4 Merge pull request #142 from microsoft/lsimpkins/powershell-buildmodes
PS: support buildmode none in extractor
2024-11-20 14:11:51 -05:00
Lindsay Simpkins
ff03d6c22a PS: support buildmode none in extractor 2024-11-19 19:38:55 -05:00
Mathias Vorreiter Pedersen
e9b7925432 Merge pull request #141 from microsoft/powershell-cmd-injection-fewer-sinks
PS: Improve sinks in `powershell/command-injection`
2024-11-12 20:25:17 +00:00
Mathias Vorreiter Pedersen
ba8a37c625 PS: Add more injetion sinks and type models. 2024-11-12 20:12:57 +00:00
Mathias Vorreiter Pedersen
308afb996b PS: Add common GAC (global assembly cache) assemblies and all automatic varibles. 2024-11-12 20:12:54 +00:00
Mathias Vorreiter Pedersen
f103fed6de PS: Use ! to mark static members/methods. 2024-11-12 20:12:52 +00:00
Mathias Vorreiter Pedersen
50c05517d2 PS: Include implicit qualifiers. 2024-11-12 20:05:20 +00:00
Mathias Vorreiter Pedersen
a382d08915 PS: Don't raise an alert on all call operator node arguments. 2024-11-11 15:25:18 +00:00
Mathias Vorreiter Pedersen
5b5f6ec3c3 Merge pull request #140 from microsoft/powershell-storestep-avoid-cp
PS: Remove accidental CP
2024-11-11 12:28:43 +00:00
Mathias Vorreiter Pedersen
446b3ea0e1 PS: Accept test changes. 2024-11-11 12:28:00 +00:00
Mathias Vorreiter Pedersen
7fe9cce53f PS: Avoid CP. 2024-11-11 12:19:46 +00:00
Mathias Vorreiter Pedersen
50188a2175 PS: Drive-by: Fix toString on Cmd. 2024-11-11 12:19:33 +00:00
Mathias Vorreiter Pedersen
86a40b9b0b Merge pull request #138 from microsoft/powershell-tainted-command-query
PS: Add the first non-experimental query
2024-11-08 20:44:15 +01:00
Mathias Vorreiter Pedersen
87cbfd191f Merge pull request #139 from microsoft/powershell-fix-multiple-cfg-successors
PS: Fix multiple CFG successors
2024-11-08 20:43:59 +01:00
Mathias Vorreiter Pedersen
40f50dd472 PS: Ensure the parameter has the right enclosing function. 2024-11-08 19:41:52 +00:00
Mathias Vorreiter Pedersen
b3de6a23ea PS: Add tests. 2024-11-08 16:07:12 +00:00
Mathias Vorreiter Pedersen
40cf8dd387 PS: Add test dependency on powereshell-queries. 2024-11-08 16:07:11 +00:00
Mathias Vorreiter Pedersen
e8274a66a5 PS: Add qhelp. 2024-11-08 16:07:09 +00:00
Mathias Vorreiter Pedersen
299c3e9eed PS: Add 'powershell/command-injection' query. 2024-11-08 16:07:07 +00:00
Mathias Vorreiter Pedersen
0fb75afd33 Merge pull request #137 from microsoft/powershell-taint-through-string-interpolation
PS: Taint-flow through string interpolation
2024-11-08 17:06:23 +01:00
Mathias Vorreiter Pedersen
f16b2cbd76 PS: Accept test changes. 2024-11-08 16:04:10 +00:00
Mathias Vorreiter Pedersen
5a715c7d11 PS: Flow through string interpolation. 2024-11-08 16:01:23 +00:00
Mathias Vorreiter Pedersen
d5d3712db4 PS: Add taint test. 2024-11-08 15:59:26 +00:00
Mathias Vorreiter Pedersen
16aacd87e0 Merge pull request #136 from microsoft/powershell-first-query-preps
PS: Add AST and CFG classes for operator `&` and add environment variable reads as local flow sources
2024-11-08 16:07:08 +01:00
Mathias Vorreiter Pedersen
4a2fd527ed PS: Add reads of environment variables as local flow sources. 2024-11-08 15:01:18 +00:00
Mathias Vorreiter Pedersen
9f0f0ca8a4 PS: Add placeholder for speculative flow now that this has been merged on the GitHub side. 2024-11-08 15:00:37 +00:00
Mathias Vorreiter Pedersen
aaa01820e0 PS: Add AST and CFG nodes for operator &. 2024-11-08 14:59:56 +00:00
Dilan
1e1fd4566c Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2024-11-07 17:59:18 +00:00
Mathias Vorreiter Pedersen
f96a984b1f Merge pull request #135 from microsoft/api-graphs-qualified-calls
PS: Allow `Instance` on explicit module uses
2024-11-07 14:03:34 +01:00
Mathias Vorreiter Pedersen
2255fda9e6 PS: Accept test changes. These are all from the changes to 'toString' from the previous commit. 2024-11-07 12:59:06 +00:00
Mathias Vorreiter Pedersen
a086d63f31 PS: Drive-by fix: Better toString on Cmd. 2024-11-07 12:47:58 +00:00
Mathias Vorreiter Pedersen
7531d88f6d PS: Allow explicit module qualifiers to be selected with the 'instance' path. 2024-11-07 12:47:23 +00:00
Mathias Vorreiter Pedersen
689a34b823 PS: Add a public dataflow node class for TypeNames. 2024-11-07 12:46:08 +00:00
Mathias Vorreiter Pedersen
938069d5ba PS: Include more module IPA nodes. 2024-11-07 12:45:06 +00:00
Mathias Vorreiter Pedersen
8550178112 Merge pull request #134 from microsoft/powershell-mad
PS: Add API graphs and models-as-data libraries
2024-11-06 15:05:36 +01:00
Mathias Vorreiter Pedersen
18d8de1fc8 PS: Add a bunch of source models. 2024-11-06 13:43:18 +00:00
Mathias Vorreiter Pedersen
d02ad25aaa PS: Add (empty) model-related files. 2024-11-06 13:43:16 +00:00
Mathias Vorreiter Pedersen
4344e70543 PS: Include certain statements as local source nodes. 2024-11-06 13:43:14 +00:00
Mathias Vorreiter Pedersen
4f58b19217 PS: Add wrapper classes for local and remote flow sources. 2024-11-06 13:43:13 +00:00
Mathias Vorreiter Pedersen
2ffbf179d8 PS: Dataflow additions to support api graphs. 2024-11-06 13:43:10 +00:00
Mathias Vorreiter Pedersen
9a03d10eb1 PS: Add API graph files. 2024-11-06 13:43:07 +00:00
Mathias Vorreiter Pedersen
314951779d PS: Add shared files for API graphs. 2024-11-06 13:43:03 +00:00
Mathias Vorreiter Pedersen
5852fe40d8 PS: Add a concept of 'source call' vs. 'library call' to avoid non-monotonic recursion in the next commits. 2024-11-06 13:43:01 +00:00
Mathias Vorreiter Pedersen
cfde677eb2 PS: AST and control-flow additions required for MaD and Api graphs. 2024-11-06 13:42:58 +00:00
Mathias Vorreiter Pedersen
68c729f8cd PS: Models-as-data skeleton. 2024-11-06 13:41:05 +00:00
Mathias Vorreiter Pedersen
9fb5711cc6 PS: Drive-by fix: Match Ruby's implementation of 'getAMatchingContent'. 2024-11-06 13:41:04 +00:00
Mathias Vorreiter Pedersen
94220ec26b PS: Make use of static type information in dataflow dispatch. 2024-11-06 13:41:03 +00:00
Mathias Vorreiter Pedersen
92a8c84ce6 PS: Add predicates for getting the static type of a parameter. 2024-11-06 13:41:02 +00:00
Mathias Vorreiter Pedersen
ef36d6b03c Merge pull request #133 from microsoft/powershell-extract-implicit-models-followup
PS: #132 follow-up
2024-11-06 12:53:49 +01:00
Mathias Vorreiter Pedersen
a2158e2b68 PS: Add an extractor option to control whether to extract PSModulePath files and use that new option when running ql tests. 2024-11-06 11:52:27 +00:00
Mathias Vorreiter Pedersen
43f986c8c8 Merge pull request #132 from microsoft/powershell-extract-implicit-models
PS: Extract source files found via `PSModulePath`
2024-11-06 11:19:20 +01:00
Mathias Vorreiter Pedersen
a56cbfe425 PS: Upgrade and downgrade scripts. 2024-11-06 10:14:33 +00:00
Mathias Vorreiter Pedersen
28ddb9aa5b PS: Mark which files are from the PSModulePath environment variable. 2024-11-06 10:14:31 +00:00
Mathias Vorreiter Pedersen
261d7d7679 PS: Also extract .psd1 files. 2024-11-06 10:14:28 +00:00
Mathias Vorreiter Pedersen
df962d7626 PS: Also extract files from the PSModulePath environment variable. 2024-11-06 10:14:26 +00:00
Mathias Vorreiter Pedersen
e6f8df7f96 Merge pull request #131 from microsoft/powershell-splitting
PS: Use the new shared control-flow splitting library
2024-11-04 14:57:55 +00:00
Mathias Vorreiter Pedersen
faf3d7c943 PS: Accept test changes. 2024-11-04 14:49:52 +00:00
Mathias Vorreiter Pedersen
38451a8285 PS: Implement conditional splitting in the Powershell CFG. 2024-11-04 14:49:36 +00:00
dilanbhalla
7a252e4089 Merge pull request #130 from microsoft/dilan/powershell-suites
Adding powershell suites
2024-11-01 14:15:08 -07:00
Dilan Bhalla
027e01d18c adding powershell suites 2024-11-01 14:13:38 -07:00
dilanbhalla
fcd875d75f Merge pull request #129 from microsoft/dilan/powershell-splitting-fix
commenting out problematic powershell qll code
2024-10-30 11:05:06 -07:00
Dilan Bhalla
4ff362fdb6 commenting out problematic powershell qll code 2024-10-30 11:03:10 -07:00
Raul Garcia
490957ad86 Merge pull request #117 from microsoft/SqlConnFP_fix
Fixing a false positive in cs/insecure-sql-connection
2024-10-22 10:03:14 -07:00
Raul Garcia
97bfc5dad7 Update csharp/ql/src/Security Features/CWE-327/InsecureSQLConnectionInitializerGood.cs
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2024-10-22 09:20:19 -07:00
Raul Garcia
8b9139f18b Update csharp/ql/src/Security Features/CWE-327/InsecureSQLConnectionInitializerBad.cs
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2024-10-22 09:20:12 -07:00
Raul Garcia
0662013ef5 Update csharp/ql/src/Security Features/CWE-327/InsecureSQLConnection.ql
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2024-10-22 09:20:01 -07:00
Dilan
7ad49cf3ff Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2024-10-21 17:59:16 +00:00
Mathias Vorreiter Pedersen
2f835e5f19 Merge pull request #128 from microsoft/powershell-taint-through-operations
PS: Taint through operations
2024-10-17 17:03:01 +01:00
Mathias Vorreiter Pedersen
d70d40913c PS: Accept test changes. 2024-10-17 16:52:17 +01:00
Mathias Vorreiter Pedersen
d0febd7aae PS: Add taint flow through all operations. 2024-10-17 16:52:16 +01:00
Mathias Vorreiter Pedersen
cd017db09f PS: Add taint versions of local flow tests. 2024-10-17 16:52:14 +01:00
Mathias Vorreiter Pedersen
c728c7dba5 PS: Add helper predicates and classes to operations. 2024-10-17 16:52:13 +01:00
Mathias Vorreiter Pedersen
34781b8730 PS: Add test with missing flow. 2024-10-17 16:52:11 +01:00
Mathias Vorreiter Pedersen
0890b22048 Merge pull request #127 from microsoft/powershell-fix-if-extraction
PS: Fix if statement clause extraction
2024-10-17 14:08:59 +01:00
Mathias Vorreiter Pedersen
e6c7ac2b21 PS: Accept test changes. 2024-10-17 14:07:11 +01:00
Mathias Vorreiter Pedersen
cc1348516f PS: Don't double increment when looping through if clauses. 2024-10-17 14:06:39 +01:00
Mathias Vorreiter Pedersen
e55c718a5e Merge pull request #126 from microsoft/powershell-global-parameter-positions
PS: Include parameter positions for top level functions
2024-10-17 11:53:25 +01:00
Mathias Vorreiter Pedersen
6bb859dab0 PS: Accept test changes. 2024-10-17 11:52:34 +01:00
Mathias Vorreiter Pedersen
9278f03753 PS: Include parameter positions for top levels. 2024-10-17 11:52:31 +01:00
Mathias Vorreiter Pedersen
97d5af7b6b PS: Add failing test. 2024-10-17 11:42:29 +01:00
Mathias Vorreiter Pedersen
c93daeb99f Merge pull request #125 from microsoft/global-parameters
PS: Global parameter support
2024-10-16 20:17:16 +01:00
Mathias Vorreiter Pedersen
dec3e7191c PS: Add test and accept test changes. 2024-10-16 20:15:01 +01:00
Mathias Vorreiter Pedersen
b426c1fc62 PS: Make top level a function as well. 2024-10-16 20:12:10 +01:00
Mathias Vorreiter Pedersen
56c703ec80 PS: Move a bunch of predicates into ScriptBlock. 2024-10-16 20:11:49 +01:00
Mathias Vorreiter Pedersen
d3b9e139c4 PS: Extend the set of sources in tests. 2024-10-16 18:54:24 +01:00
Mathias Vorreiter Pedersen
3c18124faf PS: Add taint-tracking files. 2024-10-16 18:26:34 +01:00
Mathias Vorreiter Pedersen
4cd37d63d7 Merge pull request #124 from microsoft/powershell-more-correct-value-from-property-name
PS: Allow for `ValueFromPipelineByPropertyName` to also read off an `ElementContent`
2024-10-16 16:47:51 +01:00
Mathias Vorreiter Pedersen
ef75ffef56 PS: Accept test changes. 2024-10-16 16:43:02 +01:00
Mathias Vorreiter Pedersen
a8de859dfb PS: Add a failing test. 2024-10-16 16:41:06 +01:00
Mathias Vorreiter Pedersen
7836a09e8a fixup! PS: Rename a few classes and tests. 2024-10-16 16:40:32 +01:00
Mathias Vorreiter Pedersen
70bc32a542 PS: Make sure we handle pipeline-value-from-property-name variables when passed an array. 2024-10-16 16:39:30 +01:00
Mathias Vorreiter Pedersen
b66f3b02aa PS: Rename a few classes and tests. 2024-10-16 16:26:51 +01:00
Mathias Vorreiter Pedersen
bfa9210b4b Merge pull request #123 from microsoft/flow-through-ValueFromPipelineByPropertyName
PS: Flow through `ValueFromPipelineByPropertyName` parameters
2024-10-15 16:11:42 +01:00
Mathias Vorreiter Pedersen
34c821fd2d PS: Drive-by fix. 2024-10-15 16:09:42 +01:00
Mathias Vorreiter Pedersen
3c38133bf3 PS: Drive-by fix. 2024-10-15 16:09:40 +01:00
Mathias Vorreiter Pedersen
fb74de4860 PS: Accept test changes. 2024-10-15 16:09:36 +01:00
Mathias Vorreiter Pedersen
fad9133343 PS: Add a read step out of property name parameter nodes. 2024-10-15 16:09:32 +01:00
Mathias Vorreiter Pedersen
87cc9cd88a PS: Also ignore pipeline property name parameters in the pipeline-related predicates. 2024-10-15 15:48:05 +01:00
Mathias Vorreiter Pedersen
1dcd3180b1 PS: Add test with missing flow. 2024-10-15 15:43:39 +01:00
Mathias Vorreiter Pedersen
a16b51a0bb Merge pull request #122 from microsoft/powershell-flow-through-conversions
PS: Flow through conversions
2024-10-15 13:39:28 +01:00
Mathias Vorreiter Pedersen
0e298a80e8 PS: Flow through parentheses. 2024-10-15 13:37:20 +01:00
Mathias Vorreiter Pedersen
e683f04e7b PS: Rename getExpr to getBase on ParenExpr. 2024-10-15 13:37:03 +01:00
Mathias Vorreiter Pedersen
959cbd7467 PS: Add another failing test with parentheses. 2024-10-15 13:36:17 +01:00
Mathias Vorreiter Pedersen
72e18ac135 PS: Flow through conversions. 2024-10-15 13:26:39 +01:00
Mathias Vorreiter Pedersen
43fcbcaffb PS: Rename getExpr to getBase on ConvertExpr. 2024-10-15 13:26:18 +01:00
Mathias Vorreiter Pedersen
97672f9e91 PS: Add test. 2024-10-15 13:21:43 +01:00
Mathias Vorreiter Pedersen
91d3f11bcc Merge pull request #121 from microsoft/flow-through-hashtables
PS: Flow through hash table creation, reads, and writes
2024-10-15 12:58:44 +01:00
Mathias Vorreiter Pedersen
2aacb580e2 PS: Accept test changes. 2024-10-15 12:54:17 +01:00
Mathias Vorreiter Pedersen
96de8111b5 PS: Dataflow through hash table creation, reads and writes. 2024-10-15 12:53:34 +01:00
Mathias Vorreiter Pedersen
656f98d361 PS: AST and CFG improvements to hash tables. 2024-10-15 12:53:07 +01:00
Mathias Vorreiter Pedersen
37c12639ed PS: Improve constant expression AST hierachy. 2024-10-15 12:52:41 +01:00
Mathias Vorreiter Pedersen
c8d70470a0 PS: Add tests with missing flow. 2024-10-15 12:46:54 +01:00
Mathias Vorreiter Pedersen
8aa119b6dc Merge pull request #120 from microsoft/flow-through-array-expr
PS: Flow through arrays
2024-10-14 20:15:07 +01:00
Mathias Vorreiter Pedersen
bc7c893006 PS: Accept test changes. 2024-10-14 20:10:51 +01:00
Mathias Vorreiter Pedersen
8bed9536bf PS: Flow through array expressions. 2024-10-14 20:09:19 +01:00
Mathias Vorreiter Pedersen
e63778a009 PS: CFG and AST helpers. 2024-10-14 20:08:54 +01:00
Mathias Vorreiter Pedersen
efee104f3d PS: Generalize the current ReturnContainer computation. 2024-10-14 20:06:46 +01:00
Mathias Vorreiter Pedersen
eb0f094e0b Merge pull request #119 from microsoft/powershell-unwrapping
PS: Flow through pipelines
2024-10-14 20:02:01 +01:00
Mathias Vorreiter Pedersen
1b454ed3e1 PS: add tests and accept test changes. 2024-10-14 18:14:52 +01:00
Mathias Vorreiter Pedersen
0aa6670247 PS: Model underscore parameters as pipeline parameters. 2024-10-14 18:14:50 +01:00
Mathias Vorreiter Pedersen
a0e17ee37b PS: Implicitly read any element content at sinks when doing taint flow. 2024-10-14 18:14:47 +01:00
Mathias Vorreiter Pedersen
1ec0f53a18 PS: Don't perform store steps and (and index removal, and all the othe complex return business) when there is only a single returned expression. 2024-10-14 18:14:45 +01:00
Mathias Vorreiter Pedersen
b2225fe7b5 PS: Drive-by performance fix: Don't generate N store steps when storing into an unknown index. 2024-10-14 18:14:43 +01:00
Mathias Vorreiter Pedersen
01a556e583 PS: Ensure the constants 0 .. 10 always exists. 2024-10-14 18:14:42 +01:00
Mathias Vorreiter Pedersen
51269633b0 PS: Pipeline flow. 2024-10-14 18:14:40 +01:00
Mathias Vorreiter Pedersen
cc995b1059 PS: Generalize getARead. 2024-10-14 18:14:38 +01:00
Mathias Vorreiter Pedersen
950a10be90 PS: Fix CFG ordering on CmdExpr. 2024-10-14 18:14:35 +01:00
Mathias Vorreiter Pedersen
830bf57d3a PS: Pipeline parameter and argument positions. 2024-10-14 18:14:33 +01:00
Mathias Vorreiter Pedersen
cbf9496202 PS: Helper predicates and classes. 2024-10-14 18:14:31 +01:00
Mathias Vorreiter Pedersen
3c19578e89 PS: Hide the new nodes and enure that we still show the old return node. 2024-10-14 18:14:28 +01:00
Mathias Vorreiter Pedersen
93a48646e6 PS: Accept test changes. 2024-10-14 18:14:26 +01:00
Mathias Vorreiter Pedersen
6797f8f729 PS: Add flow into, and out of, the new implicit unwrapping nodes. 2024-10-14 18:14:23 +01:00
Mathias Vorreiter Pedersen
15a22e5746 PS: Make the new return node an acual return node. 2024-10-14 18:14:21 +01:00
Mathias Vorreiter Pedersen
91a6dce01b PS: Add read step when we need unwrapping. 2024-10-14 18:14:17 +01:00
Mathias Vorreiter Pedersen
ea2f155a1f PS: Add two new kinds of nodes: A node that represents implicit unwrapping and a new node to hold the final return value of a function. 2024-10-14 16:51:55 +01:00
Mathias Vorreiter Pedersen
706eff2b14 PS: Us control-flow nodes in 'ReturnContainer' instead of dataflow nodes. 2024-10-11 11:59:44 +01:00
Mathias Vorreiter Pedersen
76bd4150b4 PS: Drive-by fix: '' is the same thing as '' 2024-10-11 11:17:37 +01:00
REDMOND\brodes
e0ee60f3dd Updated expected file. 2024-10-10 13:31:53 -04:00
Mathias Vorreiter Pedersen
8a575c4d20 Merge pull request #118 from microsoft/powershell-add-return-and-out-nodes
PS: Add flow out of functions
2024-10-10 12:28:56 +01:00
Raul Garcia
c1f7422f0e Fixing test cases 2024-10-09 16:53:33 -07:00
Raul Garcia
a179fa021f Fixing Test cases 2024-10-09 14:44:48 -07:00
Mathias Vorreiter Pedersen
1527479518 PS: Accept test changes. 2024-10-09 19:29:04 +01:00
Mathias Vorreiter Pedersen
a6b256371f PS: Add return and out nodes. 2024-10-09 19:29:03 +01:00
Mathias Vorreiter Pedersen
54521ad54d PS: Add a 'CallNode' helper class. 2024-10-09 19:29:02 +01:00
Mathias Vorreiter Pedersen
b34e36984d PS: Add failing tests. 2024-10-09 19:29:01 +01:00
REDMOND\brodes
b95b275136 qlref's were incorrect. 2024-10-09 13:55:28 -04:00
Mathias Vorreiter Pedersen
0814a90668 Merge pull request #116 from microsoft/powershell-add-empty-completion
PS: Add `Emptiness` completion to get rid of CFG inconsistencies
2024-10-08 20:02:08 +02:00
Mathias Vorreiter Pedersen
31f232d205 PS: Accept test changes. 2024-10-08 18:57:16 +01:00
Mathias Vorreiter Pedersen
7eb98c1122 PS: Add an emptiness successor to get rid of CFG inconsistencies. 2024-10-08 18:57:00 +01:00
Mathias Vorreiter Pedersen
a4e1860d4f Merge pull request #115 from microsoft/powershell-fix-dead-end-for-stmt
Powershell fix dead end for stmt
2024-10-08 16:47:57 +02:00
Mathias Vorreiter Pedersen
7ef8bfa8d7 PS: Don't interpret Cfg.ql as a graph. 2024-10-08 15:45:01 +01:00
Mathias Vorreiter Pedersen
6557081a96 PS: Accept test changes. 2024-10-08 15:39:10 +01:00
Mathias Vorreiter Pedersen
892b038565 PS: Support missing elements in for statements. 2024-10-08 15:38:46 +01:00
Mathias Vorreiter Pedersen
7e66dc3481 Merge pull request #114 from microsoft/powershell-flow-into-this
PS: Support flow through `this`
2024-10-08 16:38:08 +02:00
Mathias Vorreiter Pedersen
fb8d67f64f PS: Accept test changes. 2024-10-08 15:20:39 +01:00
Mathias Vorreiter Pedersen
455e56d804 PS: Support 'this' as a parameter in SSA and dataflow. 2024-10-08 15:20:36 +01:00
Mathias Vorreiter Pedersen
61d5f4412c PS: AST support for 'this'. 2024-10-08 15:20:33 +01:00
Mathias Vorreiter Pedersen
a429485b56 PS: Create an internal class to model 'Arguments'. 2024-10-08 15:20:31 +01:00
Mathias Vorreiter Pedersen
597147be71 PS: Refactor the way we do 'internal' AST related classes. 2024-10-08 15:20:29 +01:00
Mathias Vorreiter Pedersen
ca1c9120b5 PS: Add test with missing flow. 2024-10-08 15:20:27 +01:00
Mathias Vorreiter Pedersen
68b74f8af2 PS: Accept changes that hadn't been accepted before. 2024-10-08 15:20:24 +01:00
Dilan
878bd5b098 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2024-10-04 20:59:08 +00:00
Mathias Vorreiter Pedersen
78a1d069bc Merge pull request #113 from microsoft/powershell-element-content
PS: Add `ElementContent` for tracking flow through arrays
2024-10-04 21:18:58 +02:00
Mathias Vorreiter Pedersen
494ef7a44c PS: Fix missing flow. 2024-10-04 20:08:20 +01:00
Mathias Vorreiter Pedersen
4d8809a808 PS: Add another class of missing flow. 2024-10-04 20:06:22 +01:00
Mathias Vorreiter Pedersen
1de38e2cbc PS: Accept test changes. 2024-10-04 19:48:44 +01:00
Mathias Vorreiter Pedersen
3c80652b91 PS: Autoformat and silence 'unused paramter' warning. 2024-10-04 19:33:29 +01:00
Mathias Vorreiter Pedersen
cbfd0b363b PS: Add element content flow for reads and writes into arrays. 2024-10-04 19:33:28 +01:00
Mathias Vorreiter Pedersen
1f558a0b7f PS: Add CFG classes for array literals. 2024-10-04 19:33:27 +01:00
Mathias Vorreiter Pedersen
28b654df46 PS: Add helper clases for index expression. 2024-10-04 19:33:26 +01:00
Mathias Vorreiter Pedersen
22e508b85b PS: Introduce a class for constant values. 2024-10-04 19:33:23 +01:00
Mathias Vorreiter Pedersen
820f4b2575 PS: Add tests with arrays. 2024-10-04 19:33:22 +01:00
Raul Garcia
64aca2632b Fixing a false positive in cs/insecure-sql-connection, and adding a new query to remediate a false negative 2024-10-03 18:37:33 -07:00
Mathias Vorreiter Pedersen
421258b8f9 Merge pull request #112 from microsoft/powershell-more-type-flow
PS: Add more type-tracking flow
2024-10-03 20:47:01 +02:00
Mathias Vorreiter Pedersen
b622e09fe7 PS: Accept test changes. 2024-10-03 19:43:55 +01:00
Mathias Vorreiter Pedersen
e38f6301a6 PS: Also support type tracking of objects constructed with New-Object. 2024-10-03 19:43:54 +01:00
Mathias Vorreiter Pedersen
32f7f1b7e4 PS: Merge the non-member function and member function classes. Also rename member function to 'Method' since that's the name used by Powershell documentation. 2024-10-03 19:43:51 +01:00
Mathias Vorreiter Pedersen
5103d34dbf PS: Add tests. 2024-10-03 19:07:21 +01:00
Mathias Vorreiter Pedersen
46ead0d7f7 Merge pull request #111 from microsoft/powershell-more-control-flow
PS: More control flow
2024-10-03 12:30:51 +02:00
Mathias Vorreiter Pedersen
bcbb1bbce0 PS: Accept tests. 2024-10-03 11:25:26 +01:00
Mathias Vorreiter Pedersen
52129a981f PS: Add lots of missing control flow. We're now complete on 'fleschutz/PowerShell'. 2024-10-03 11:25:15 +01:00
Mathias Vorreiter Pedersen
c7976d5090 Merge pull request #110 from microsoft/powershell-dataflow-fixes
Powershell: Fix dataflow/SSA consistency errors.
2024-10-03 12:17:51 +02:00
Mathias Vorreiter Pedersen
7eac066118 Powershell: Fix dataflow/SSA consistency errors. 2024-10-03 11:11:44 +01:00
Mathias Vorreiter Pedersen
c7850b141d Merge pull request #109 from microsoft/powershell-call-target-resolution
PS: Resolve function calls
2024-10-02 17:56:21 +02:00
Mathias Vorreiter Pedersen
953bd09c1c Merge pull request #106 from microsoft/tainted-path-barrier-with-state
C#: Make `StartsWith` and `EndsWith` sanitizers on normalized paths
2024-10-02 17:32:56 +02:00
Mathias Vorreiter Pedersen
816aa79a45 PS: Add helper predicate on 'Call' for getting a runtime target. 2024-10-02 15:37:19 +01:00
Mathias Vorreiter Pedersen
b05409380a PS: Resolve non-member function calls using the dataflow's lambda call resolution features. 2024-10-02 15:36:39 +01:00
Mathias Vorreiter Pedersen
f6a5b4b182 PS: Resolve member function calls using the shared type-tracking library. 2024-10-02 15:34:45 +01:00
Mathias Vorreiter Pedersen
b6dfbc3182 PS: Instantiate most of the shared type-tracking library. 2024-10-02 15:30:50 +01:00
Mathias Vorreiter Pedersen
9049407fb4 PS: More AST cleanup. 2024-10-02 14:45:20 +01:00
Mathias Vorreiter Pedersen
655cb8ef9a PS: Fix 'getEnclosingScope' and add 'getEnclosingFunction'. 2024-10-02 14:44:09 +01:00
Mathias Vorreiter Pedersen
43c75504e1 PS: Also support method calls as calls. 2024-10-02 12:56:36 +01:00
Mathias Vorreiter Pedersen
e36e6175dd Merge pull request #108 from microsoft/fix-powershell-compilation
PS: Fix compile errors and warnings.
2024-10-02 13:38:21 +02:00
Mathias Vorreiter Pedersen
32502a5be7 PS: Fix compile errors and warnings. 2024-10-02 12:31:51 +01:00
Ben Rodes
939b2181d4 Wchar fp fixes (#107)
* Adding tests and updated expected file with false positives to correct.

(cherry picked from commit 26e58532ee)

* Modifications to the query to address false positives.

(cherry picked from commit cc24f1ed9f)

* Updating expected file, false positives now resolved.

(cherry picked from commit 92c8d39ba3)

* Correct comment.

(cherry picked from commit 338ab96593)

* Changing from hasIntermediateType to getABaseType.

(cherry picked from commit c4737c7fbb)

* Switching to looking for explicit declaration of unsigned char, to avoid cases where unsigned char is the default char width for `char`.

(cherry picked from commit 51e787b316)

* Altering ordering for exists statement to be clearer.

(cherry picked from commit 31324fc778)

* Altering exists predicate ordering to be clearer.

(cherry picked from commit c91f7f4918)

* Changing name of predicate to be clearer, and removing an unused parameter.

(cherry picked from commit 318e75c094)

* Removing unnecessary bracket/singleton set literal.

(cherry picked from commit 162519185d)

* Formatting.

(cherry picked from commit c496503053)
2024-10-01 09:51:10 -04:00
Mathias Vorreiter Pedersen
758196ed8d C#: Accept test changes. 2024-10-01 12:40:49 +01:00
Mathias Vorreiter Pedersen
89bdcfb53d C#: Allow 'StartsWith' and 'EndsWith' to be barriers when the path is normalized. 2024-10-01 12:34:40 +01:00
Mathias Vorreiter Pedersen
9457e5305e C#: Add a flow state to represent whether the path is normalized. 2024-10-01 12:33:04 +01:00
Mathias Vorreiter Pedersen
864bde242f C#: Add a FP testcase. 2024-10-01 12:26:58 +01:00
Mathias Vorreiter Pedersen
60cda950dc Merge pull request #105 from microsoft/powershell-argument-parameter-matching
PS: Implement argument/parameter matching in dataflow
2024-09-27 12:30:26 +01:00
Mathias Vorreiter Pedersen
b6019655ce PS: Use named sets to model parameter and argument matching. 2024-09-26 18:53:31 +01:00
Mathias Vorreiter Pedersen
e4c702ef14 PS: Represent sets of parameter names. 2024-09-26 18:53:30 +01:00
Mathias Vorreiter Pedersen
7f25caf3f6 PS: Add various helper predicates. 2024-09-26 18:53:29 +01:00
Mathias Vorreiter Pedersen
5e2051bdea PS: Add test. 2024-09-26 18:53:28 +01:00
Mathias Vorreiter Pedersen
5803e0611e Merge pull request #104 from microsoft/powershell-field-flow
PS: Add field flow
2024-09-26 11:31:12 +01:00
Mathias Vorreiter Pedersen
1ce4c2fcbf PS: Add tests. 2024-09-24 16:53:56 +01:00
Mathias Vorreiter Pedersen
f51e0b0133 PS: Add field flow. 2024-09-24 16:53:48 +01:00
Mathias Vorreiter Pedersen
3fa466efa9 Merge pull request #102 from microsoft/powershell-very-basic-flow-steps
PS: Add very basic dataflow steps
2024-09-23 18:23:58 +01:00
Mathias Vorreiter Pedersen
f2d89a24f8 PS: Add flow steps from SSA and from right-hand of assignment to assignment. 2024-09-23 17:24:29 +01:00
Mathias Vorreiter Pedersen
dd2c5ef897 Merge pull request #101 from microsoft/add-inline-expectations-test-for-dataflow
PS: Add `InineExpectationsTest` library for dataflow tests
2024-09-23 16:29:35 +01:00
Mathias Vorreiter Pedersen
6beb8ee576 PS: Autoformat. 2024-09-23 16:27:42 +01:00
Mathias Vorreiter Pedersen
15b33ee612 PS: Add tests. 2024-09-23 16:27:39 +01:00
Mathias Vorreiter Pedersen
7fc82194e8 PS: Add inline expectations test library. 2024-09-23 16:27:37 +01:00
Mathias Vorreiter Pedersen
ccbfe0f168 PS: Prepare AST and other libraries for inline expectations tests. 2024-09-23 16:27:36 +01:00
Mathias Vorreiter Pedersen
67631e2d36 PS: Update AST hierachy after #100. 2024-09-23 16:27:34 +01:00
Mathias Vorreiter Pedersen
be8a76335b Merge pull request #100 from microsoft/powershell-fewer-pipelines-in-db
PS: Remove spurious `Pipeline`s in the DB
2024-09-23 13:24:17 +01:00
Mathias Vorreiter Pedersen
974017bb70 PS: Accept test changes. 2024-09-23 13:12:35 +01:00
Mathias Vorreiter Pedersen
0e606e69f7 PS: Add up and downgrade scripts. 2024-09-23 13:12:31 +01:00
Mathias Vorreiter Pedersen
18dd6d0b48 Add Powershell to the upgrade script prepation script. 2024-09-23 12:59:21 +01:00
Mathias Vorreiter Pedersen
26a75da26f PS: Don't generate a 'Pipeline' element when the pipeline wraps a single element. 2024-09-23 12:58:17 +01:00
dilanbhalla
ba1646fe90 Merge pull request #99 from microsoft/dilan/2.19.0-upgrade-conflict
Dilan/2.19.0 upgrade conflict
2024-09-22 02:05:31 -07:00
Dilan Bhalla
a763263cbd resolving merge conflict 2024-09-22 02:04:29 -07:00
dilanbhalla
2ee42cbc3b Merge pull request #98 from microsoft/dilan/2.19.0-upgrade
2.19.0 upgrade
2024-09-18 15:04:52 -07:00
Dilan Bhalla
e370fa2dec 2.19.0 upgrade fix 2024-09-18 14:48:55 -07:00
Dilan Bhalla
14ce258807 2.19.0 upgrade 2024-09-18 14:28:42 -07:00
Mathias Vorreiter Pedersen
8fd89829cc Merge pull request #97 from microsoft/powershell-integrate-ssa-into-dataflow
PS: Integrate SSA computations into dataflow
2024-09-17 10:02:52 +01:00
Mathias Vorreiter Pedersen
f14e1cc782 PS: Add more expression classes and a helper class for calls. 2024-09-16 20:32:25 +01:00
Mathias Vorreiter Pedersen
d616506f23 PS: Integrate SSA computations into dataflow. 2024-09-16 19:36:39 +01:00
Mathias Vorreiter Pedersen
c87873bd26 PS: Add more cfg classes and helper predicats. 2024-09-16 19:36:37 +01:00
Mathias Vorreiter Pedersen
88e32ba3e1 PS: Add local-flow test. 2024-09-16 19:16:23 +01:00
Mathias Vorreiter Pedersen
9bdfaa07b2 Merge pull request #96 from microsoft/powershell-param-def-class
PS: Place parameter definitions in the SSA graph
2024-09-16 18:41:44 +01:00
Mathias Vorreiter Pedersen
fbcac1020f PS: Add some simple SSA tests. 2024-09-16 13:36:57 +01:00
Mathias Vorreiter Pedersen
0312dce009 PS: Fix the scope of parameters. 2024-09-16 13:34:04 +01:00
Mathias Vorreiter Pedersen
a6a157a476 PS: Add initial parameter definitions. 2024-09-16 13:33:56 +01:00
Mathias Vorreiter Pedersen
f0429fa0f3 Merge pull request #95 from microsoft/powershell-ssa-consistency
PS: Add SSA consistency queries and include parameter read/writes as SSA read/writes
2024-09-13 13:51:13 +01:00
Mathias Vorreiter Pedersen
cf59c60495 PS: Shorter names. 2024-09-13 13:47:39 +01:00
Mathias Vorreiter Pedersen
3cebf8ba75 PS: Also include parameter reads and writes as SSA reads and writes. 2024-09-13 13:47:15 +01:00
Mathias Vorreiter Pedersen
ec6422c1b6 PS: Add a concept of a local scope variable (which includes both parameters and local variables). 2024-09-13 13:43:45 +01:00
Mathias Vorreiter Pedersen
dfeb667b8a PS: Add SSA consistency query file. 2024-09-13 13:43:17 +01:00
Mathias Vorreiter Pedersen
3459440a3c Merge pull request #94 from microsoft/add-more-cfg-tests
PS: Add more CFG tests
2024-09-13 13:40:21 +01:00
Mathias Vorreiter Pedersen
e12fd07074 PS: Add more tests. 2024-09-13 13:37:03 +01:00
Mathias Vorreiter Pedersen
4343d6b592 Merge pull request #93 from microsoft/powershell-ssa-skeleton
PS: SSA skeleton and various fixes
2024-09-13 12:20:45 +01:00
Mathias Vorreiter Pedersen
9499972878 PS: Run tests and accept test changes. 2024-09-13 12:14:30 +01:00
Mathias Vorreiter Pedersen
c26fdc3103 PS: A few CFG bugfixes. 2024-09-13 12:14:11 +01:00
Mathias Vorreiter Pedersen
645db5bc90 PS: Add SSA library. 2024-09-12 18:26:42 +01:00
Mathias Vorreiter Pedersen
8b4e065fa2 PS: Port the Ruby framework for lifting parent/child relations at the AST level to parent/child relations at the CFG level. 2024-09-12 18:26:41 +01:00
Mathias Vorreiter Pedersen
9107075f41 PS: Fixup CFG after the introduction of variables into the AST. 2024-09-12 18:26:39 +01:00
Mathias Vorreiter Pedersen
810978d3ab PS: Create an entity that represents a local variable and a parameter and introduce those into the AST. 2024-09-12 18:26:38 +01:00
Mathias Vorreiter Pedersen
e99404a051 PS: Fix missing parent relation for block statements. 2024-09-12 18:26:36 +01:00
Dilan
f63c2b071d Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2024-09-12 14:59:27 +00:00
Mathias Vorreiter Pedersen
b5950b0d3f Merge pull request #92 from microsoft/powershell-dataflow-skeleton
PS: Add dataflow skeleton
2024-09-11 11:35:35 +01:00
Mathias Vorreiter Pedersen
faf774f79b PS: Add dataflow skeleton 2024-09-10 18:25:58 +01:00
Mathias Vorreiter Pedersen
198ece98ce Merge pull request #91 from microsoft/powershell-cfg-for-if-and-match
PS: CFG for `if`, `match`, exceptions
2024-09-09 18:11:25 +01:00
Mathias Vorreiter Pedersen
dbbb9b32f8 Merge branch 'main' into powershell-cfg-for-if-and-match 2024-09-09 18:09:19 +01:00
Mathias Vorreiter Pedersen
e133b5cedb Merge pull request #88 from microsoft/more-specific-dbscheme-column-types
PS: Small dbscheme updates
2024-09-09 17:52:08 +01:00
Mathias Vorreiter Pedersen
5e4f52a52b Merge pull request #90 from microsoft/powershell-even-more-ast-classes
PS: Add more AST classes
2024-09-09 17:51:56 +01:00
Mathias Vorreiter Pedersen
3bb5582ffe Merge pull request #89 from microsoft/powershell-consistency-query
PS: Add consistency queries
2024-09-09 17:51:46 +01:00
Mathias Vorreiter Pedersen
f51a486c1c PS: CFG for try/catch and throw. 2024-09-06 10:48:19 +01:00
Mathias Vorreiter Pedersen
4c59de4fde PS: Implement CFG for if statements and switches. 2024-09-06 10:33:21 +01:00
Mathias Vorreiter Pedersen
fd29c470c0 PS: More cleanup of AST by fixing up toStrings and adding helper predicates. 2024-09-06 10:00:43 +01:00
Mathias Vorreiter Pedersen
830de2c904 PS: Add more AST classes. 2024-09-05 23:12:56 +01:00
Mathias Vorreiter Pedersen
084c868c8f PS: Add consistency queries. 2024-09-05 18:21:43 +01:00
Mathias Vorreiter Pedersen
3f98f372a0 PS: Add an en try in the library qlpack to point to the upgrade folder. 2024-09-03 20:03:35 +01:00
Mathias Vorreiter Pedersen
b9774d20d9 PS: Fill in properties scripts. Since we didn't change anything these are basically noopts in this case. 2024-09-03 20:03:19 +01:00
Mathias Vorreiter Pedersen
cac0500d57 PS: Add upgrade and downgrade files. This is automatically done by running the script in 'github/codeql/blob/main/misc/scripts/prepare-db-upgrade.sh' (after adding powershell to line 83). 2024-09-03 20:02:34 +01:00
Mathias Vorreiter Pedersen
2f7545cee8 PS: Fixup the corresponding QL to match the state of the dbscheme. 2024-09-03 19:59:28 +01:00
Mathias Vorreiter Pedersen
581254e06f PS: A couple of small dbscheme changes.
1. Flip the name of the child and parent column for 'parent' to reflect
how this is actually populated by the extractor.
2. Make some of the coumns more specific to the actual data type.
3. Make `@named_attribute_argument` an `@ast` branch.
2024-09-03 19:55:39 +01:00
Mathias Vorreiter Pedersen
20e76b39b3 Merge pull request #85 from microsoft/powershell-cfg-for-function-bodies-and-loops
PS: Control-flow for function bodies and loops
2024-09-03 19:51:22 +01:00
Mathias Vorreiter Pedersen
435ee53054 Merge pull request #87 from microsoft/powershell-port-injection-query
PS: Port `powershell/command-injection` from the internal repo
2024-09-03 18:39:07 +01:00
Mathias Vorreiter Pedersen
105e19e8e1 PS: New id to avoid overlapping with the internal query. 2024-09-03 18:36:08 +01:00
Mathias Vorreiter Pedersen
1cb059c381 PS: Fixup 'powershell/command-injection' so that it compiles after all the AST name changes. 2024-09-03 18:18:16 +01:00
Mathias Vorreiter Pedersen
c2bdc7aa52 PS: Add experimental query from the internal repo. 2024-09-03 18:18:15 +01:00
dilanbhalla
2fe3cee812 Merge pull request #86 from microsoft/dilan/2.18.3-upgrade
2.18.3 upgrade
2024-09-03 00:07:09 -07:00
Dilan Bhalla
db7c90d3dd 2.18.3 upgrade 2024-09-03 00:02:09 -07:00
Mathias Vorreiter Pedersen
39cdf0d896 PS: Accept test changes. 2024-08-30 16:15:20 +01:00
Mathias Vorreiter Pedersen
177fbccb61 PS: Add control-flow for loops. 2024-08-30 16:15:18 +01:00
Mathias Vorreiter Pedersen
41ba97b05c PS: Specify when a completion should be a boolan completion. 2024-08-30 16:15:17 +01:00
Mathias Vorreiter Pedersen
5dee69bc33 PS: Add loop CFG tests. 2024-08-30 16:15:16 +01:00
Mathias Vorreiter Pedersen
f00f55f460 PS: Accept test changes. 2024-08-30 16:15:14 +01:00
Mathias Vorreiter Pedersen
b3332da759 PS: Implement more control-flow trees. 2024-08-30 16:15:13 +01:00
Mathias Vorreiter Pedersen
a70cf44acb PS: Convert ScriptBlockTree to an abstract class and have TopLevel script blocks extend it. 2024-08-30 16:11:46 +01:00
Mathias Vorreiter Pedersen
1fa2cdf8a8 Add testcases with functions. 2024-08-30 16:11:45 +01:00
Mathias Vorreiter Pedersen
94a740f6b9 PS: Add continue completion and successor. 2024-08-30 16:11:44 +01:00
Mathias Vorreiter Pedersen
2d8a8c00ca PS: Shorter predicate names for statement blocks. 2024-08-30 16:11:42 +01:00
Mathias Vorreiter Pedersen
7ad60ca59c PS: Proper subclassing of binary expressions. 2024-08-30 16:11:41 +01:00
Mathias Vorreiter Pedersen
4e915f70d0 PS: Add unary expression AST class. 2024-08-30 16:11:40 +01:00
Mathias Vorreiter Pedersen
8575c53447 PS: Move 'getBody' up to the parent class. 2024-08-30 16:11:39 +01:00
Mathias Vorreiter Pedersen
844216afdc PS: Better toString in a couple of classes. 2024-08-30 16:11:37 +01:00
Mathias Vorreiter Pedersen
c2f0c01f19 PS: Create a common subclass for non-member and member functions. 2024-08-30 16:11:36 +01:00
Mathias Vorreiter Pedersen
04f80108ea Merge pull request #84 from microsoft/powershell-cfg-skeleton
PS: Initial CFG skeleton
2024-08-30 16:03:59 +01:00
Mathias Vorreiter Pedersen
f21cde2365 PS: Implement _just enough_ control flow to make the first example work. 2024-08-28 15:31:49 +01:00
Mathias Vorreiter Pedersen
626328c014 PS: Flip the parent child relation. 2024-08-28 15:02:51 +01:00
Mathias Vorreiter Pedersen
db46ca0bbf PS: Add parent-child test that demonstrates that the relation is flipped. 2024-08-28 15:02:50 +01:00
Mathias Vorreiter Pedersen
8d59e09216 PS: Shorter predicate names and better toString messages. 2024-08-28 15:02:48 +01:00
Mathias Vorreiter Pedersen
c69d70a97f PS: Add CFG test skeleton. 2024-08-28 15:02:45 +01:00
Mathias Vorreiter Pedersen
d29cb30ba5 PS: Add CFG skeleton. 2024-08-27 17:57:51 +01:00
Mathias Vorreiter Pedersen
b38c34ac58 PS: Accept test changes that I forgot to accept. 2024-08-27 17:52:25 +01:00
Mathias Vorreiter Pedersen
33ccf3f7f9 Merge pull request #82 from microsoft/powershell-index-files-options
PS: More fine-grained file indexing support
2024-08-27 17:47:48 +01:00
Mathias Vorreiter Pedersen
22a30ab952 Merge pull request #83 from microsoft/powershell-more-ast-classes
PS: Copy existing AST classes from internal repo
2024-08-27 00:28:24 +01:00
Mathias Vorreiter Pedersen
fd4b2b2c89 PS: Warn on implicit this to make CI happy. 2024-08-26 19:37:29 +01:00
Mathias Vorreiter Pedersen
c30feab8ac PS: Port existing tests from internal repo. 2024-08-26 19:21:31 +01:00
Mathias Vorreiter Pedersen
71349afae7 PS: Add more AST classes. 2024-08-26 19:21:28 +01:00
Mathias Vorreiter Pedersen
023c88a073 PS: Use shorter and more standard names. 2024-08-26 18:54:51 +01:00
Mathias Vorreiter Pedersen
efba031745 PS: Fixup AST by adding missing imports. Also use extends instead of instanceof in AST classes. 2024-08-26 18:54:47 +01:00
Mathias Vorreiter Pedersen
0c4a3f4871 Add lib files from the internal repo. 2024-08-26 18:54:43 +01:00
Mathias Vorreiter Pedersen
98a098c5fa PS: Support LGTM_INDEX_INCLUDE in the extractor. 2024-08-26 17:20:54 +01:00
Mathias Vorreiter Pedersen
8473678995 PS: Support --file-list option in the extractor. 2024-08-26 15:08:53 +01:00
dilanbhalla
9ba4ffdb14 Merge pull request #81 from microsoft/open-source-powershell-extractor
PS: Open source the powershell extractor
2024-08-23 12:26:22 -07:00
Mathias Vorreiter Pedersen
95d02e68c8 PS: Add readme with slight modifications from the internal repo. 2024-08-14 18:11:06 +01:00
Mathias Vorreiter Pedersen
4f8a94b4e8 PS: Add simple build script. 2024-08-14 18:11:04 +01:00
Mathias Vorreiter Pedersen
58fc649657 PS: Copy extractor and various scripts from internal repo to public repo. 2024-08-14 18:11:02 +01:00
Dilan
0550ff1040 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2024-08-13 14:59:34 +00:00
Ben Rodes
d4c0c4059d Brodes/overflow buffer fixes (#79)
* Addreessing false positive due to incorrect use of getType

* Addressing false positive with strncpy.

* BufferAccess must be reachable. False positives observed where accesses occur in dead code.

* Formatting and updating tests.
2024-08-12 16:00:11 -04:00
dilanbhalla
fd512d2a2d Merge pull request #80 from microsoft/more-2.18.1-upgrade-fixes
C#: More merge conflict fixes
2024-08-12 12:02:12 -07:00
Mathias Vorreiter Pedersen
fe6655b0d9 C#: More merge conflict fixes. 2024-08-12 19:23:07 +01:00
Lindsay Simpkins
aeaca1de7d Merge pull request #78 from microsoft/fix-join-order-in-zipslip-query
C#: Fix join order in `cs/zipslip`
2024-08-09 10:27:04 -07:00
Mathias Vorreiter Pedersen
a826163cb4 C#: Fix join order in 'getFilePathArgument'. 2024-08-09 15:20:30 +01:00
Mathias Vorreiter Pedersen
be175aa1a0 C#: Prevent bad magic in a few predicates. 2024-08-09 15:19:54 +01:00
dilanbhalla
24517e3034 Merge pull request #77 from microsoft/dilan/2.18.1-upgrade-2
2.18.1 Upgrade Fix (DataFlowPrivate libraries)
2024-08-02 15:56:56 -07:00
Dilan Bhalla
ed8ada30e8 apply Mathias patch 2024-08-02 15:45:35 -07:00
dilanbhalla
be7fce57c2 Merge pull request #76 from microsoft/dilan/2.18.1-upgrade-2
2.18.1 Upgrade
2024-07-31 15:31:13 -07:00
Dilan Bhalla
73ee8ef664 2.18.1 merge conflict 2024-07-31 14:53:08 -07:00
Dilan Bhalla
db6fb7b5a3 2.18.1 merge 2024-07-31 14:52:51 -07:00
Dilan
7bc16a378d Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2024-07-11 09:59:18 +00:00
Chanel
471d4672c1 Merge pull request #74 from microsoft/users/chanely/insecure-sql-connection-versioncheck
Update to insecure sql connection to check for version
2024-06-27 12:14:53 -07:00
Dilan
ee338e3caa Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2024-06-27 17:59:08 +00:00
Josh Brown
5dd5e80d6e autoformat 2024-06-26 13:23:23 -07:00
Chanel Young
f12f74ec77 delete unused predicate 2024-06-26 12:58:21 -07:00
Chanel Young
72d31c82aa check if using version > 4.0, where encrypt true by default 2024-06-26 12:57:25 -07:00
Ben Rodes
9401ab219e Update WeakEncryption.ql 2024-06-14 10:01:05 -04:00
dilanbhalla
f98735d499 Merge pull request #73 from microsoft/dilan/2.17.5-upgrade-revised
2.17.5 Upgrade
2024-06-12 13:44:58 -07:00
Dilan Bhalla
c01daaa40e upgrading to 2.17.5 2024-06-12 12:35:56 -07:00
Josh Brown
cccbdf25c7 Merge pull request #72 from microsoft/jb1/v2.17.4-2
Import v2.17.4 commit history
2024-06-05 04:57:00 +10:00
Josh Brown
28fdf7bf53 Merge tag 'codeql-cli/v2.17.4' into jb1/v2.17.4-2
Compatible with CodeQL CLI 2.17.4
2024-06-04 11:54:03 -07:00
Josh Brown
959f3fa97c Manual Merge DataFlowStack changes 2024-06-04 11:46:21 -07:00
Josh Brown
3f4156ced6 Merge pull request #71 from microsoft/jb1/v2.17.4
Merge upstream/v2.17.4
2024-06-05 04:38:10 +10:00
Josh Brown
e9a6ddab04 Manual merge, accept cs/zipslip test diff 2024-06-04 11:18:22 -07:00
Chanel
3b91979b14 Merge pull request #70 from microsoft/users/chanely-insecure-sql-connection
Fixing FP case for Insecure SQL connection
2024-05-16 14:44:44 -07:00
Chanel Young
300d048dbb fp case if encrypt set in initializer 2024-05-16 13:30:26 -07:00
Lindsay Simpkins
651031b15e python crypto update hmac module library (#69) 2024-05-16 09:35:27 -04:00
Ben Rodes
d548e47010 False positive workaround for incorrectly identified OpenSSL functions. (#67) 2024-05-14 14:55:51 -04:00
dilanbhalla
e1949c7d69 Merge pull request #64 from microsoft/jb1/v2.17.2
Merge upstream codeql-cli/v2.17.2
2024-05-09 15:06:11 -07:00
Josh Brown
d0329609e3 Manual merge v2.17.2 2024-05-09 13:23:42 -07:00
Dilan
7d944ccd43 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2024-04-24 15:59:16 +00:00
Josh Brown
5d2aa8b1ca Merge pull request #49 from microsoft/jb1/zipslip-performance-fix
Zipslip performance fix
2024-04-19 03:24:42 +10:00
Josh Brown
20033b9b04 Merge pull request #58 from microsoft/jb1/improper-array-index
Jb1/improper array index
2024-04-19 03:24:27 +10:00
Josh Brown
db49d95e77 Filter out tests directories 2024-04-17 11:47:23 -07:00
Josh Brown
88e77ade8e False positive test case 2024-04-09 16:25:09 -07:00
dilanbhalla
9709ebb2a3 Merge pull request #62 from microsoft/jb1/dfs-patch
DFS CPP + Java Compile Error patch
2024-04-09 16:05:51 -07:00
Josh Brown
7d8abf0eef DataflowStack Signature fix 2024-04-09 15:28:49 -07:00
dilanbhalla
f99d2b0f78 Merge pull request #61 from microsoft/upstream-test
Merge upstream/main
2024-04-05 15:45:16 -07:00
Josh Brown
30bf0a7c8b manual merge 2024-04-05 15:30:56 -07:00
Josh Brown
37d5c69e18 minor formatting 2024-04-05 14:53:07 -07:00
Josh Brown
31a1f43bba constrain TT for SanitizedGuardTaintTrackingconfiguration to be only sourced from methods where there is a rootsanitizerMethodCall wihtin it 2024-03-28 10:50:59 -07:00
Josh Brown
f5197d75d8 autoformat + update hasQualifiedName 2024-03-28 10:50:59 -07:00
Josh Brown
80dc5f0d27 revert to enhanced version with performance issue 2024-03-28 10:50:58 -07:00
Denis Levin
baee3a3db3 Extendign password variable detection with patterns and antipatterns from C# query (#59) 2024-03-27 12:50:52 -04:00
Dilan
3325cb9ec6 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2024-03-26 12:59:35 +00:00
Josh Brown
720285f724 Filter out sources from test directories 2024-03-25 11:10:13 -07:00
Josh Brown
a3eecc33a8 Filter our sources in test folders 2024-03-22 14:47:14 -07:00
Dilan
955fd2cc5a Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2024-03-21 13:00:21 +00:00
dilanbhalla
ebb37ac0c2 Merge pull request #57 from microsoft/dilan/2.16.4-merge
2.16.4 Upgrade + ZipSlip Expected File Conflict
2024-03-11 14:29:53 -07:00
Dilan Bhalla
dfdb5c9c9d merging 2.16.4, resolving zipslip .expected file conflict 2024-03-11 14:12:21 -07:00
Chanel
bbdf97e8f3 Merge pull request #55 from microsoft/dilan/chanel-sql-tedious
Chanel PR (SQL Tedious Package)
2024-02-28 11:13:22 -08:00
dilanbhalla
8e05f2a1f0 Update SQL.qll 2024-02-27 13:38:39 -08:00
dilanbhalla
134010ac7e Update SQL.qll 2024-02-27 13:30:38 -08:00
dilanbhalla
fd51a7dbc1 Update README.md (test) 2024-02-26 14:56:15 -08:00
dilanbhalla
fb78b0dc93 Update README.md (test) 2024-02-26 14:36:02 -08:00
dilanbhalla
3d25260891 Update README.md (test) 2024-02-26 14:33:56 -08:00
dilanbhalla
47c41bd3e2 Update README.md (test) 2024-02-26 14:29:39 -08:00
Dilan Bhalla
87fd2fc067 upgrading to 2.16.3, resolving zipslip merge conflict 2024-02-22 15:24:05 -08:00
Josh Brown
98fb82fd10 Merge pull request #53 from microsoft/jb1/dataflowstack/java
DataFlowStack - Java Impl
2024-02-17 05:30:34 +11:00
Josh Brown
ba1eab32ba Merge remote-tracking branch 'origin/main' into jb1/dataflowstack/java 2024-02-15 17:34:46 -08:00
Josh Brown
34cec001b6 java DataFlowStack impl 2024-02-14 10:57:40 -08:00
Dilan
50dad18134 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2024-02-12 18:59:04 +00:00
Josh Brown
5e9826a345 Merge pull request #26 from microsoft/jb1/lib/dataflowstack
DataFlowStack Common Library Init
2024-02-09 10:00:33 +11:00
Josh Brown
c92c212ea0 fix syntax errors introduced 2024-02-08 14:17:16 -08:00
Josh Brown
df915dc60c Merge commit '737dd9d4c1' into jb1/lib/dataflowstack 2024-02-08 08:18:04 -08:00
Josh Brown
9147b9dd21 Merge branch 'jb1/lib/dataflowstack' of github.com:microsoft/codeql into jb1/lib/dataflowstack 2024-02-07 12:56:08 -08:00
Josh Brown
beed67ad23 Address PR Comments 2024-02-07 12:56:00 -08:00
Josh Brown
c0fd03499a Update shared/dataflowstack/codeql/dataflowstack/DataFlowStack.qll 2024-02-08 06:15:29 +11:00
Josh Brown
3056e8cdab Remove getNode as required interface 2024-01-29 16:15:57 -08:00
Josh Brown
2314d3be16 stubs 2024-01-29 16:14:20 -08:00
Josh Brown
151d001713 stub predicates for DataFlowCall 2024-01-27 18:18:43 -08:00
Josh Brown
39500b1965 getAnArgumentNode 2024-01-26 18:59:41 -08:00
Dilan
737dd9d4c1 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2024-01-25 14:59:06 +00:00
Josh Brown
bba946a06e filling out further definitions, and code comments 2024-01-18 18:10:55 -08:00
Dilan
6c2c786571 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2024-01-16 14:59:23 +00:00
Josh Brown
9c1e33e66d FlowStackFrame class working, TODO: getSucceedingTerminalStateFrame() 2024-01-12 15:13:37 -08:00
Josh Brown
e4a30bf791 BiStackAnalysisInit 2024-01-03 17:29:43 -08:00
Josh Brown
4e84c84e2d Manual merge main 2023-12-29 17:01:56 -08:00
Josh Brown
f661529122 Merge pull request #37 from microsoft/jb1/df-java-isSource
MethodCallInsecureFileCreation isSource
2023-12-29 09:37:06 +11:00
Josh Brown
2f163b070a MethodCallInsecureFileCreation isSource 2023-12-28 10:08:50 -08:00
Josh Brown
0f48db2694 Merge pull request #36 from microsoft/jb1/upgrade-shared-df-pathnode
Upgrade Shared DataFlow PathNode Signature
2023-12-28 05:15:22 +11:00
Josh Brown
5a8185dcaf Syntax fix - extra or 2023-12-22 11:47:31 -08:00
Josh Brown
f57a5d7650 Upgrade shared DataFlow PathNode signature to include getASuccessor(), isSource() 2023-12-22 10:45:16 -08:00
Dilan
ff202c9e88 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2023-12-20 19:59:37 +00:00
Josh Brown
59732036b2 cpp getARuntimeTarget 2023-12-15 12:18:47 -08:00
Josh Brown
079f0fdbb5 StackFrameAnalysis example 2023-12-14 15:27:21 -08:00
Josh Brown
d1b1650cdd StackFrameAnalysis module 2023-12-14 14:26:26 -08:00
Josh Brown
09bc54b644 Merge commit '2bc9039d8486ec0be727ae3836237e97ec791e85' into jb1/lib/dataflowstack 2023-12-13 10:38:13 -08:00
Josh Brown
5750c8df72 Removing comment 2023-12-13 10:09:41 -08:00
Dilan
2bc9039d84 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2023-12-11 16:59:07 +00:00
Josh Brown
d9aac53ec0 Merge remote-tracking branch 'origin/main' into jb1/lib/dataflowstack 2023-12-06 08:34:02 -08:00
Dilan
9214f63b5f Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2023-11-30 18:37:51 +00:00
dilanbhalla
e83425813b Merge pull request #33 from microsoft/dilan/revert-printf-qll
Revert Printf.qll
2023-11-30 10:36:49 -08:00
dilanbhalla
b6b67b35ce Update Printf.qll 2023-11-30 10:36:03 -08:00
Josh Brown
3559a5a5a1 Merge pull request #31 from microsoft/jb1/performance/revert-zipslip
Revert Zipslip to upstream
2023-11-28 05:34:04 +11:00
Josh Brown
c06ae12d58 Revert Zipslip to upstream 2023-11-16 10:47:57 -08:00
Dilan
954d489613 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2023-11-13 13:01:39 +00:00
Ben Rodes
b6eaf2fa61 Adding missing strsafe sprintf variants. (#30)
(cherry picked from commit bdae2af0e2)
2023-11-08 14:46:09 -05:00
Josh Brown
c161ed42e1 dataflowstack init 2023-11-02 17:18:08 -07:00
Ben Rodes
d9364c060e Merge pull request #14482 from MathiasVP/additional-call-targets-for-cpp (#23)
C++: Add an abstract class that can be used to extend `viableCallable`

Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2023-10-23 10:12:11 -04:00
Dilan Bhalla
1cdf4aafb0 manual merge for 2.15.1, resolve zipslip conflict 2023-10-19 12:51:03 -07:00
dilanbhalla
90b7fd52c0 Update ZipSlipQuery.qll 2023-10-19 12:24:39 -07:00
dilanbhalla
6066e82071 Merge pull request #22 from microsoft/brodes/additional_target_cherry_pick
Brodes/additional target cherry pick
2023-10-18 11:15:35 -07:00
Benjamin Rodes
075e992ebe Revert "Cherry picking commit bbf9bcde2a (#21)"
This reverts commit d4e5b27969.
2023-10-18 10:32:58 -04:00
Benjamin Rodes
1026d89158 Merge branch 'main' into brodes/additional_target_cherry_pick 2023-10-18 10:23:06 -04:00
Benjamin Rodes
f19919bb52 Revert "Cherry picking commit bbf9bcde2a (#21)"
d4e5b27969
This reverts commit d4e5b27969.
2023-10-18 10:17:53 -04:00
Ben Rodes
d4e5b27969 Cherry picking commit bbf9bcde2a (#21)
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2023-10-17 13:46:36 -04:00
Mathias Vorreiter Pedersen
ab827a5acd Cherry picking commit bbf9bcde2a 2023-10-17 13:43:06 -04:00
Dilan
8555600c44 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2023-10-11 13:02:07 +00:00
Josh Brown
ea63fc03d5 Merge pull request #14289 from microsoft/jb1/16-cryptography-models-libraries-and-queries-migration (#19)
16 cryptography models libraries and queries migration

Co-authored-by: Rasmus Wriedt Larsen <rasmuswl@github.com>
2023-10-04 13:34:09 -04:00
Dilan
2bc3e28b18 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2023-09-26 13:59:31 +00:00
dilanbhalla
e5f74ddf8f Update sync-main.yml 2023-09-14 11:56:27 -07:00
Dilan
4d77490444 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2023-09-14 16:13:35 +00:00
dilanbhalla
73a4cc89e3 Update sync-main.yml 2023-09-13 19:03:40 -07:00
dilanbhalla
c2fee6758f Update sync-main.yml 2023-09-13 19:03:25 -07:00
dilanbhalla
c30661e1c1 Update CONTRIBUTING.md 2023-09-13 18:50:16 -07:00
dilanbhalla
3a75325ecb Update README.md 2023-09-13 18:49:48 -07:00
dilanbhalla
d185c94549 Update sync-main.yml 2023-09-13 18:45:37 -07:00
dilanbhalla
4e656de043 Update CONTRIBUTING.md 2023-09-13 18:38:11 -07:00
dilanbhalla
fc00da801f Update README.md 2023-09-12 21:19:42 -07:00
Dilan
bc2bb19491 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2023-09-12 16:13:57 +00:00
Dilan Bhalla
cd16271a56 Merge branch 'main' of https://github.com/github/codeql 2023-08-30 10:48:32 -07:00
Dilan Bhalla
3d7e6792e5 modifying gh libs instead of creating msft copies 2023-08-28 18:59:16 -07:00
Dilan Bhalla
76cec33ba8 Microsoft 2.14.3 resolving taintflow warning 2023-08-28 16:46:52 -07:00
Dilan Bhalla
7f61bfe155 fixing tainttracking module 2.14.3 2023-08-28 15:37:36 -07:00
Dilan
eb0e2c48ea Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2023-08-28 22:03:51 +00:00
Dilan Bhalla
d9b45c817d Merge branch 'main' of https://github.com/microsoft/codeql 2023-08-27 23:53:31 -07:00
Dilan Bhalla
5ee67421b7 microsoft dataflow fix for 2.14.3 2023-08-27 23:53:25 -07:00
Dilan Bhalla
6b23eeebc5 Merge branch 'main' of https://github.com/github/codeql 2023-08-27 23:45:53 -07:00
Dilan
019cff2fc0 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2023-08-25 17:41:23 +00:00
dilanbhalla
0a9fc79525 Update sync-main.yml 2023-08-25 10:40:26 -07:00
dilanbhalla
f2994e70d0 Update DataFlow.qll 2023-08-25 10:39:28 -07:00
Dilan Bhalla
da08e0b4bd Reverting temp dataflow from 2.14.3 to 2.14.1 2023-08-24 00:51:51 -07:00
Dilan Bhalla
8a9fd3539e Adding internal C++ dataflow library 2023-08-23 00:05:19 -07:00
Dilan Bhalla
7acd76dc4c temporarily disable sync main until 2.14.3 2023-08-22 09:56:49 -07:00
Dilan
08147f08df Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2023-07-28 12:01:37 +00:00
Dilan
d3e36cb49e Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2023-07-13 18:33:38 +00:00
Dilan
acda5fd88b Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2023-07-06 12:01:35 +00:00
dilanbhalla
72471f6993 Ben update to iterator.qll 2023-06-26 10:09:42 -07:00
Dilan
eb7a6667d7 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2023-06-19 20:49:44 +00:00
microsoft-github-policy-service[bot]
7b1c964869 Auto merge mandatory file pr
This pr is auto merged as it contains a mandatory file and is opened for more than 10 days.
2023-06-12 18:05:12 +00:00
microsoft-github-policy-service[bot]
c8f19d6ef0 Microsoft mandatory file 2023-06-02 16:20:00 +00:00
Dilan
7976cf8e77 Merge tag 'codeql-cli/latest'
Compatible with the latest released version of the CodeQL CLI
2023-05-31 17:57:24 +00:00
dilanbhalla
cb47517020 Update sync-main.yml 2023-05-31 10:56:29 -07:00
dilanbhalla
4b0d2b972f Update sync-main.yml 2023-05-31 10:45:25 -07:00
dilanbhalla
4e5a095e1c Merge pull request #9 from microsoft/jb1/zipslip-fix
Manual Merge: C# ZipSlip Conflict
2023-05-24 11:19:13 -07:00
Josh Brown
56b1047f66 Manual merge + updated test case of C# ZipSlip 2023-05-23 17:23:56 +10:00
Dilan Bhalla
6fbc070aaf sync with upstream repository 2023-04-26 17:10:42 -07:00
Dilan Bhalla
b3cd535bdd removing dead code test 2023-04-24 15:46:38 -07:00
Dilan Bhalla
bc51aee6ec removing debugging git log line 2023-04-24 15:27:05 -07:00
Dilan Bhalla
9c72cba7e2 removing unshallow 2023-04-24 15:16:50 -07:00
Dilan Bhalla
8ce078ef2c unshallow fetch 2023-04-24 15:14:27 -07:00
Dilan Bhalla
54716a84cf remove allow unrelated histories on git merge 2023-04-24 15:04:49 -07:00
Dilan Bhalla
4fb30f35b3 test predicate 2023-04-24 14:59:43 -07:00
Dilan Bhalla
fd05c130d4 allow unrelated histories on merge 2023-04-24 14:55:18 -07:00
Dilan Bhalla
b0e4305c95 josh zipslip improvements 2023-04-24 14:49:27 -07:00
Dilan Bhalla
885d2491d8 merge instead of rebase 2023-04-24 14:46:35 -07:00
6447 changed files with 260515 additions and 131133 deletions

View File

@@ -30,9 +30,6 @@ common --registry=https://bcr.bazel.build
common --@rules_dotnet//dotnet/settings:strict_deps=false
# we only configure a nightly toolchain
common --@rules_rust//rust/toolchain/channel=nightly
# Reduce this eventually to empty, once we've fixed all our usages of java, and https://github.com/bazel-contrib/rules_go/issues/4193 is fixed
common --incompatible_autoload_externally="+@rules_java,+@rules_shell"

5
.gitattributes vendored
View File

@@ -88,3 +88,8 @@
# swift prebuilt resources
/swift/third_party/resources/*.zip filter=lfs diff=lfs merge=lfs -text
/swift/third_party/resources/*.tar.zst filter=lfs diff=lfs merge=lfs -text
# This upgrade script must use windows line-endings to be compatible with old
# databases.
/powershell/ql/lib/upgrades/ce269c61feda10a8ca0d16519085f7e55741a694/old.dbscheme eol=crlf
/powershell/downgrades/802d5b9f407fb0dac894df1c0b4584f2215e1512/semmlecode.powershell.dbscheme eol=crlf

View File

@@ -20,7 +20,7 @@ jobs:
os: [ubuntu-22.04, macos-13, windows-2022]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
with:
repository: google/ripunzip
ref: ${{ inputs.ripunzip-version }}
@@ -28,7 +28,7 @@ jobs:
# see https://github.com/sfackler/rust-openssl/issues/183
- if: runner.os == 'Linux'
name: checkout openssl
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
repository: openssl/openssl
path: openssl

View File

@@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: Check bazel formatting
uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507
with:

View File

@@ -16,7 +16,7 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Check that implicit this warnings is enabled for all packs
shell: bash
run: |

View File

@@ -17,7 +17,7 @@ jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Check overlay annotations
run: python config/add-overlay-annotations.py --check java

View File

@@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
with:
fetch-depth: 2

View File

@@ -19,6 +19,6 @@ jobs:
name: Check query IDs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Check for duplicate query IDs
run: python3 misc/scripts/check-query-ids.py

View File

@@ -34,10 +34,10 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.300
dotnet-version: 9.0.100
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL

View File

@@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest-xl
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Setup CodeQL
uses: ./.github/actions/fetch-codeql
with:

View File

@@ -28,7 +28,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL

View File

@@ -39,23 +39,23 @@ jobs:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.300
dotnet-version: 9.0.100
- name: Extractor unit tests
run: |
dotnet tool restore
dotnet test -p:RuntimeFrameworkVersion=9.0.5 extractor/Semmle.Util.Tests
dotnet test -p:RuntimeFrameworkVersion=9.0.5 extractor/Semmle.Extraction.Tests
dotnet test -p:RuntimeFrameworkVersion=9.0.5 autobuilder/Semmle.Autobuild.CSharp.Tests
dotnet test -p:RuntimeFrameworkVersion=9.0.5 autobuilder/Semmle.Autobuild.Cpp.Tests
dotnet test -p:RuntimeFrameworkVersion=9.0.0 extractor/Semmle.Util.Tests
dotnet test -p:RuntimeFrameworkVersion=9.0.0 extractor/Semmle.Extraction.Tests
dotnet test -p:RuntimeFrameworkVersion=9.0.0 autobuilder/Semmle.Autobuild.CSharp.Tests
dotnet test -p:RuntimeFrameworkVersion=9.0.0 autobuilder/Semmle.Autobuild.Cpp.Tests
shell: bash
stubgentest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- uses: ./csharp/actions/create-extractor-pack
- name: Run stub generator tests
run: |

View File

@@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: Setup CodeQL
uses: ./.github/actions/fetch-codeql
- name: Create empty database
@@ -51,7 +51,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: Setup CodeQL
uses: ./.github/actions/fetch-codeql
- name: Create empty database

View File

@@ -35,11 +35,11 @@ jobs:
GITHUB_CONTEXT: ${{ toJSON(github.event) }}
run: echo "$GITHUB_CONTEXT"
- name: Clone self (github/codeql) - MERGE
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
path: merge
- name: Clone self (github/codeql) - BASE
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
fetch-depth: 2
path: base

View File

@@ -24,7 +24,7 @@ jobs:
GITHUB_CONTEXT: ${{ toJSON(github.event) }}
run: echo "$GITHUB_CONTEXT"
- name: Clone self (github/codeql)
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:

View File

@@ -12,11 +12,11 @@ jobs:
steps:
- name: Clone self (github/codeql)
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
path: script
- name: Clone self (github/codeql) for analysis
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
path: codeqlModels
fetch-depth: 0

View File

@@ -21,7 +21,7 @@ jobs:
GITHUB_CONTEXT: ${{ toJSON(github.event) }}
run: echo "$GITHUB_CONTEXT"
- name: Clone self (github/codeql)
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
path: ql
fetch-depth: 0

View File

@@ -16,11 +16,11 @@ jobs:
steps:
- name: Clone self (github/codeql)
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
path: script
- name: Clone self (github/codeql) for analysis
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
path: codeqlModels
ref: ${{ github.event.inputs.qlModelShaOverride || github.ref }}

View File

@@ -26,7 +26,7 @@ jobs:
exit 1
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: Git config
shell: bash

View File

@@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest-xl
steps:
- name: Check out code
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: Run tests
uses: ./go/actions/test
with:

View File

@@ -20,7 +20,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- run: |
bazel query //java/kotlin-extractor/...
# only build the default version as a quick check that we can build from `codeql`

View File

@@ -28,12 +28,12 @@ jobs:
slug: ${{fromJson(github.event.inputs.projects || '["apache/commons-codec", "apache/commons-io", "apache/commons-beanutils", "apache/commons-logging", "apache/commons-fileupload", "apache/commons-lang", "apache/commons-validator", "apache/commons-csv", "apache/dubbo"]' )}}
steps:
- name: Clone github/codeql from PR
uses: actions/checkout@v5
uses: actions/checkout@v4
if: github.event.pull_request
with:
path: codeql-pr
- name: Clone github/codeql from main
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
path: codeql-main
ref: main

View File

@@ -30,11 +30,11 @@ jobs:
ref: "placeholder"
steps:
- name: Clone self (github/codeql)
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: Setup CodeQL binaries
uses: ./.github/actions/fetch-codeql
- name: Clone repositories
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
path: repos/${{ matrix.ref }}
ref: ${{ matrix.ref }}

View File

@@ -0,0 +1,152 @@
name: Microsoft CodeQL Pack Publish
on:
workflow_dispatch:
jobs:
check-branch:
runs-on: ubuntu-latest
steps:
- name: Fail if not on main branch
run: |
if [ "$GITHUB_REF" != "refs/heads/main" ]; then
echo "This workflow can only run on the 'main' branch."
exit 1
fi
codeqlversion:
needs: check-branch
runs-on: ubuntu-latest
outputs:
codeql_version: ${{ steps.set_codeql_version.outputs.codeql_version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set CodeQL Version
id: set_codeql_version
run: |
git fetch
git fetch --tags
CURRENT_COMMIT=$(git rev-list -1 HEAD)
CURRENT_TAG=$(git describe --tags --abbrev=0 --match 'codeql-cli/v*' $CURRENT_COMMIT)
CODEQL_VERSION="${CURRENT_TAG#codeql-cli/}"
echo "CODEQL_VERSION=$CODEQL_VERSION" >> $GITHUB_OUTPUT
publishlibs:
environment: secure-publish
needs: codeqlversion
runs-on: ubuntu-latest
strategy:
matrix:
language: ['powershell']
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install CodeQL
shell: bash
run: |
gh extension install github/gh-codeql
gh codeql download "${{ needs.codeqlversion.outputs.codeql_version }}"
gh codeql set-version "${{ needs.codeqlversion.outputs.codeql_version }}"
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Publish OS Microsoft CodeQL Lib Pack
shell: bash
run: |
# Download latest qlpack
gh codeql pack download "microsoft/$LANGUAGE-all"
PACK_DIR="$HOME/.codeql/packages/microsoft/$LANGUAGE-all"
VERSION_COUNT=$(ls -d "$PACK_DIR"/*/ | wc -l)
[[ "$VERSION_COUNT" -ne 1 ]] && { echo "Expected exactly one version in $PACK_DIR, but found $VERSION_COUNT. Exiting."; exit 1; }
# Increment version
CURRENT_VERSION=$(ls -v "$PACK_DIR" | tail -n 1)
MAJOR=$(echo "$CURRENT_VERSION" | cut -d. -f1)
MINOR=$(echo "$CURRENT_VERSION" | cut -d. -f2)
PATCH=$(echo "$CURRENT_VERSION" | cut -d. -f3)
NEXT_VERSION="$MAJOR.$MINOR.$((PATCH + 1))"
# Extract dependencies from the existing qlpack.yml before deleting
DEPENDENCIES=$(yq 'select(has("dependencies")) | .dependencies | {"dependencies": .}' "$LANGUAGE/ql/lib/qlpack.yml" 2>/dev/null)
DATAEXTENSIONS=$(yq 'select(has("dataExtensions")) | .dataExtensions | {"dataExtensions": .}' "$LANGUAGE/ql/lib/qlpack.yml" 2>/dev/null)
rm -f "$LANGUAGE/ql/lib/qlpack.yml" "$LANGUAGE/ql/lib/qlpack.lock"
# Create new qlpack.yml with modified content
cat <<EOF > "$LANGUAGE/ql/lib/qlpack.yml"
name: microsoft/$LANGUAGE-all
version: $NEXT_VERSION
extractor: $LANGUAGE
groups:
- $LANGUAGE
- microsoft-all
dbscheme: semmlecode.$LANGUAGE.dbscheme
extractor: $LANGUAGE
library: true
upgrades: upgrades
$DEPENDENCIES
$DATAEXTENSIONS
warnOnImplicitThis: true
EOF
# Publish pack
cat "$LANGUAGE/ql/lib/qlpack.yml"
gh codeql pack publish "$LANGUAGE/ql/lib"
env:
LANGUAGE: ${{ matrix.language }}
GITHUB_TOKEN: ${{ secrets.PACKAGE_PUBLISH }}
publish:
environment: secure-publish
needs: codeqlversion
runs-on: ubuntu-latest
strategy:
matrix:
language: ['csharp', 'cpp', 'java', 'javascript', 'python', 'ruby', 'go', 'rust', 'swift', 'powershell', 'iac']
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install CodeQL
shell: bash
run: |
gh extension install github/gh-codeql
gh codeql download "${{ needs.codeqlversion.outputs.codeql_version }}"
gh codeql set-version "${{ needs.codeqlversion.outputs.codeql_version }}"
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Publish OS Microsoft CodeQL Pack
shell: bash
run: |
# Download latest qlpack
gh codeql pack download "microsoft/$LANGUAGE-queries"
PACK_DIR="$HOME/.codeql/packages/microsoft/$LANGUAGE-queries"
VERSION_COUNT=$(ls -d "$PACK_DIR"/*/ | wc -l)
[[ "$VERSION_COUNT" -ne 1 ]] && { echo "Expected exactly one version in $PACK_DIR, but found $VERSION_COUNT. Exiting."; exit 1; }
# Increment version
CURRENT_VERSION=$(ls -v "$PACK_DIR" | tail -n 1)
MAJOR=$(echo "$CURRENT_VERSION" | cut -d. -f1)
MINOR=$(echo "$CURRENT_VERSION" | cut -d. -f2)
PATCH=$(echo "$CURRENT_VERSION" | cut -d. -f3)
NEXT_VERSION="$MAJOR.$MINOR.$((PATCH + 1))"
# Extract dependencies from the existing qlpack.yml before deleting
DEPENDENCIES=$(yq 'select(has("dependencies")) | .dependencies | {"dependencies": .}' "$LANGUAGE/ql/src/qlpack.yml" 2>/dev/null)
rm -f "$LANGUAGE/ql/src/qlpack.yml" "$LANGUAGE/ql/src/qlpack.lock"
# Create new qlpack.yml with modified content
cat <<EOF > "$LANGUAGE/ql/src/qlpack.yml"
name: microsoft/$LANGUAGE-queries
version: $NEXT_VERSION
extractor: $LANGUAGE
groups:
- $LANGUAGE
- queries
$DEPENDENCIES
EOF
# Publish pack
cat "$LANGUAGE/ql/src/qlpack.yml"
gh codeql pack publish "$LANGUAGE/ql/src"
env:
LANGUAGE: ${{ matrix.language }}
GITHUB_TOKEN: ${{ secrets.PACKAGE_PUBLISH }}

View File

@@ -0,0 +1,32 @@
name: PowerShell PR Check
on:
pull_request:
branches:
- main
workflow_dispatch:
jobs:
powershell-pr-check:
name: powershell-pr-check
runs-on: windows-latest
if: github.repository == 'microsoft/codeql'
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ github.token }}
- name: Setup CodeQL
uses: ./.github/actions/fetch-codeql
with:
channel: release
- name: Install PowerShell
run: |
$path = Split-Path (Get-Command codeql).Source
./powershell/build-win64.ps1 $path
- name: Run QL tests
run: |
codeql test run --threads=0 powershell/ql/test

View File

@@ -21,7 +21,7 @@ jobs:
check-python-tooling:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'

View File

@@ -43,7 +43,7 @@ jobs:
if-no-files-found: error
retention-days: 1
- uses: actions/checkout@v5
- uses: actions/checkout@v4
with:
fetch-depth: 2
persist-credentials: false

View File

@@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest-xl
steps:
### Build the queries ###
- uses: actions/checkout@v5
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Find codeql

View File

@@ -25,7 +25,7 @@ jobs:
- github/codeql
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Find codeql
id: find-codeql
@@ -46,7 +46,7 @@ jobs:
env:
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
- name: Checkout ${{ matrix.repo }}
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
repository: ${{ matrix.repo }}
path: ${{ github.workspace }}/repo
@@ -75,7 +75,7 @@ jobs:
runs-on: ubuntu-latest
needs: measure
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: measurements

View File

@@ -24,7 +24,7 @@ jobs:
qltest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Find codeql
id: find-codeql
uses: github/codeql-action/init@main
@@ -64,7 +64,7 @@ jobs:
needs: [qltest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Install GNU tar
if: runner.os == 'macOS'
run: |

View File

@@ -23,7 +23,7 @@ jobs:
steps:
- name: Clone self (github/codeql)
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
path: codeql
- name: Set up Python 3.8
@@ -31,7 +31,7 @@ jobs:
with:
python-version: 3.8
- name: Download CodeQL CLI
# Look under the `codeql` directory, as this is where we checked out the `github/codeql` repo
# Look under the `codeql` directory, as this is where we checked out the `github/codeql` repo
uses: ./codeql/.github/actions/fetch-codeql
- name: Build code scanning query list
run: |

View File

@@ -47,7 +47,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Install GNU tar
if: runner.os == 'macOS'
run: |
@@ -113,7 +113,7 @@ jobs:
if: github.repository_owner == 'github'
runs-on: ubuntu-latest-xl
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Fetch CodeQL
uses: ./.github/actions/fetch-codeql
- name: Cache compilation cache
@@ -146,7 +146,7 @@ jobs:
runs-on: ubuntu-latest
needs: [build, compile-queries]
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: ruby.dbscheme
@@ -209,7 +209,7 @@ jobs:
runs-on: ${{ matrix.os }}
needs: [package]
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Fetch CodeQL
uses: ./.github/actions/fetch-codeql

View File

@@ -30,14 +30,14 @@ jobs:
repo: [rails/rails, discourse/discourse, spree/spree, ruby/ruby]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- uses: ./.github/actions/fetch-codeql
- uses: ./ruby/actions/create-extractor-pack
- name: Checkout ${{ matrix.repo }}
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
repository: ${{ matrix.repo }}
path: ${{ github.workspace }}/repo
@@ -62,7 +62,7 @@ jobs:
runs-on: ubuntu-latest
needs: measure
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: stats

View File

@@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- uses: ./.github/actions/fetch-codeql
- uses: ./ruby/actions/create-extractor-pack
- name: Cache compilation cache

View File

@@ -36,7 +36,7 @@ jobs:
qlupgrade:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- uses: ./.github/actions/fetch-codeql
- name: Check DB upgrade scripts
run: |
@@ -58,7 +58,7 @@ jobs:
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- uses: ./.github/actions/fetch-codeql
- uses: ./ruby/actions/create-extractor-pack
- name: Cache compilation cache

View File

@@ -35,7 +35,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: Query latest nightly CodeQL bundle
shell: bash

View File

@@ -30,7 +30,7 @@ jobs:
working-directory: rust/ast-generator
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: Inject sources
shell: bash
run: |
@@ -53,7 +53,7 @@ jobs:
working-directory: rust/extractor
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: Format
shell: bash
run: |
@@ -69,7 +69,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: Install CodeQL
uses: ./.github/actions/fetch-codeql
- name: Code generation

View File

@@ -36,7 +36,7 @@ jobs:
fail-fast: false
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Setup (Linux)
if: runner.os == 'Linux'
run: |
@@ -53,7 +53,7 @@ jobs:
clang-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507
name: Check that python code is properly formatted
with:
@@ -61,7 +61,7 @@ jobs:
codegen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- uses: ./.github/actions/fetch-codeql
- uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507
name: Check that QL generated code was checked in
@@ -77,6 +77,6 @@ jobs:
check-no-override:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Check that no override is present in load.bzl
run: bazel test ... --test_tag_filters=override --test_output=errors

View File

@@ -17,7 +17,7 @@ jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Check synchronized files
run: python config/sync-files.py
- name: Check dbscheme fragments

28
.github/workflows/sync-main-tags.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: Sync Main Tags
on:
pull_request:
types:
- closed
branches:
- main
jobs:
sync-main-tags:
name: Sync Main Tags
runs-on: ubuntu-latest
if: github.repository == 'microsoft/codeql' && github.event.pull_request.merged == true && github.event.pull_request.head.ref == 'auto/sync-main-pr'
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Push Tags
run: |
git remote add upstream https://github.com/github/codeql.git
git fetch upstream --tags --force
git push --force origin --tags
env:
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}

91
.github/workflows/sync-main.yml vendored Normal file
View File

@@ -0,0 +1,91 @@
name: Sync Main
on:
push:
branches:
- main
paths:
- .github/workflows/sync-main.yml
schedule:
- cron: '55 * * * *'
jobs:
sync-main:
name: Sync-main
runs-on: ubuntu-latest
if: github.repository == 'microsoft/codeql'
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.WORKFLOW_TOKEN }}
- name: Git config
shell: bash
run: |
git config user.name "dilanbhalla"
git config user.email "dilanbhalla@microsoft.com"
- name: Git checkout auto/sync-main-pr
shell: bash
run: |
git fetch origin
if git ls-remote --exit-code --heads origin auto/sync-main-pr > /dev/null; then
echo "Branch exists remotely. Checking it out."
git checkout -B auto/sync-main-pr origin/auto/sync-main-pr
else
echo "Branch does not exist remotely. Creating from main."
git checkout -B auto/sync-main-pr origin/main
git push -u origin auto/sync-main-pr
fi
- name: Sync origin/main
shell: bash
run: |
echo "::group::Sync with main branch"
git pull origin auto/sync-main-pr; exitCode=$?; if [ $exitCode -ne 0 ]; then exitCode=0; fi
git pull origin main --no-rebase
git push --force origin auto/sync-main-pr
echo "::endgroup::"
- name: Sync upstream/codeql-cli/latest
shell: bash
run: |
echo "::group::Set up remote"
git remote add upstream https://github.com/github/codeql.git
git fetch upstream --tags --force
echo "::endgroup::"
echo "::group::Merge codeql-cli/latest"
set -x
git merge codeql-cli/latest
set +x
echo "::endgroup::"
- name: Push sync branch
run: |
git push origin auto/sync-main-pr
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
- name: Create PR if it doesn't exist
shell: bash
run: |
pr_number=$(gh pr list --repo microsoft/codeql --head auto/sync-main-pr --base main --json number --jq '.[0].number')
if [ -n "$pr_number" ]; then
echo "PR from auto/sync-main-pr to main already exists (PR #$pr_number). Exiting gracefully."
else
if git fetch origin main auto/sync-main-pr && [ -n "$(git rev-list origin/main..origin/auto/sync-main-pr)" ]; then
echo "PR does not exist. Creating one..."
gh pr create --repo microsoft/codeql --fill -B main -H auto/sync-main-pr \
--label 'autogenerated' \
--title 'Sync Main (autogenerated)' \
--body "This PR syncs the latest changes from \`codeql-cli/latest\` into \`main\`." \
--reviewer 'MathiasVP' \
--reviewer 'ropwareJB'
else
echo "No changes to sync from auto/sync-main-pr to main. Exiting gracefully."
fi
fi
env:
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}

View File

@@ -30,7 +30,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Check formatting
run: cargo fmt -- --check
- name: Run tests
@@ -38,12 +38,12 @@ jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Check formatting
run: cargo fmt --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Run clippy
run: cargo clippy -- --no-deps -D warnings -A clippy::new_without_default -A clippy::too_many_arguments

View File

@@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: Setup CodeQL
uses: ./.github/actions/fetch-codeql

View File

@@ -18,6 +18,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- run: |
bazel test //misc/bazel/internal/zipmerge:test --test_output=all

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "iac"]
path = iac
url = https://github.com/advanced-security/codeql-extractor-iac

762
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -14,8 +14,8 @@ local_path_override(
# see https://registry.bazel.build/ for a list of available packages
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_go", version = "0.56.1")
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "rules_go", version = "0.50.1")
bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "rules_nodejs", version = "6.2.0-codeql.1")
bazel_dep(name = "rules_python", version = "0.40.0")
@@ -26,9 +26,9 @@ bazel_dep(name = "nlohmann_json", version = "3.11.3", repo_name = "json")
bazel_dep(name = "fmt", version = "10.0.0")
bazel_dep(name = "rules_kotlin", version = "2.1.3-codeql.1")
bazel_dep(name = "gazelle", version = "0.40.0")
bazel_dep(name = "rules_dotnet", version = "0.19.2-codeql.1")
bazel_dep(name = "rules_dotnet", version = "0.17.4")
bazel_dep(name = "googletest", version = "1.14.0.bcr.1")
bazel_dep(name = "rules_rust", version = "0.63.0")
bazel_dep(name = "rules_rust", version = "0.58.0")
bazel_dep(name = "zstd", version = "1.5.5.bcr.1")
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
@@ -38,10 +38,7 @@ bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True
RUST_EDITION = "2024"
# run buildutils-internal/scripts/fill-rust-sha256s.py when updating (internal repo)
# a nightly toolchain is required to enable experimental_use_cc_common_link, which we require internally
# we prefer to run the same version as internally, even if experimental_use_cc_common_link is not really
# required in this repo
RUST_VERSION = "nightly/2025-08-01"
RUST_VERSION = "1.86.0"
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
@@ -53,26 +50,26 @@ rust.toolchain(
],
# generated by buildutils-internal/scripts/fill-rust-sha256s.py (internal repo)
sha256s = {
"2025-08-01/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz": "9bbeaf5d3fc7247d31463a9083aa251c995cc50662c8219e7a2254d76a72a9a4",
"2025-08-01/rustc-nightly-x86_64-apple-darwin.tar.xz": "c9ea539a8eff0d5d162701f99f9e1aabe14dd0dfb420d62362817a5d09219de7",
"2025-08-01/rustc-nightly-aarch64-apple-darwin.tar.xz": "ae83feebbc39cfd982e4ecc8297731fe79c185173aee138467b334c5404b3773",
"2025-08-01/rustc-nightly-x86_64-pc-windows-msvc.tar.xz": "9f170c30d802a349be60cf52ec46260802093cb1013ad667fc0d528b7b10152f",
"2025-08-01/clippy-nightly-x86_64-unknown-linux-gnu.tar.xz": "9ae5f3cd8f557c4f6df522597c69d14398cf604cfaed2b83e767c4b77a7eaaf6",
"2025-08-01/clippy-nightly-x86_64-apple-darwin.tar.xz": "983cb9ee0b6b968188e04ab2d33743d54764b2681ce565e1b3f2b9135c696a3e",
"2025-08-01/clippy-nightly-aarch64-apple-darwin.tar.xz": "ed2219dbc49d088225e1b7c5c4390fa295066e071fddaa2714018f6bb39ddbf0",
"2025-08-01/clippy-nightly-x86_64-pc-windows-msvc.tar.xz": "911f40ab5cbdd686f40e00965271fe47c4805513a308ed01f30eafb25b448a50",
"2025-08-01/cargo-nightly-x86_64-unknown-linux-gnu.tar.xz": "106463c284e48e4904c717471eeec2be5cc83a9d2cae8d6e948b52438cad2e69",
"2025-08-01/cargo-nightly-x86_64-apple-darwin.tar.xz": "6ad35c40efc41a8c531ea43235058347b6902d98a9693bf0aed7fc16d5590cef",
"2025-08-01/cargo-nightly-aarch64-apple-darwin.tar.xz": "dd28c365e9d298abc3154c797720ad36a0058f131265c9978b4c8e4e37012c8a",
"2025-08-01/cargo-nightly-x86_64-pc-windows-msvc.tar.xz": "7b431286e12d6b3834b038f078389a00cac73f351e8c3152b2504a3c06420b3b",
"2025-08-01/llvm-tools-nightly-x86_64-unknown-linux-gnu.tar.xz": "e342e305d7927cc288d386983b2bc253cfad3776b113386e903d0b302648ef47",
"2025-08-01/llvm-tools-nightly-x86_64-apple-darwin.tar.xz": "e44dd3506524d85c37b3a54bcc91d01378fd2c590b2db5c5974d12f05c1b84d1",
"2025-08-01/llvm-tools-nightly-aarch64-apple-darwin.tar.xz": "0c1b5f46dd81be4a9227b10283a0fcaa39c14fea7e81aea6fd6d9887ff6cdc41",
"2025-08-01/llvm-tools-nightly-x86_64-pc-windows-msvc.tar.xz": "423e5fd11406adccbc31b8456ceb7375ce055cdf45e90d2c3babeb2d7f58383f",
"2025-08-01/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz": "3c0ceb46a252647a1d4c7116d9ccae684fa5e42aaf3296419febd2c962c3b41d",
"2025-08-01/rust-std-nightly-x86_64-apple-darwin.tar.xz": "3be416003cab10f767390a753d1d16ae4d26c7421c03c98992cf1943e5b0efe8",
"2025-08-01/rust-std-nightly-aarch64-apple-darwin.tar.xz": "4046ac0ef951cb056b5028a399124f60999fa37792eab69d008d8d7965f389b4",
"2025-08-01/rust-std-nightly-x86_64-pc-windows-msvc.tar.xz": "191ed9d8603c3a4fe5a7bbbc2feb72049078dae2df3d3b7d5dedf3abbf823e6e",
"rustc-1.86.0-x86_64-unknown-linux-gnu.tar.xz": "4438b809ce4a083af31ed17aeeedcc8fc60ccffc0625bef1926620751b6989d7",
"rustc-1.86.0-x86_64-apple-darwin.tar.xz": "42b76253626febb7912541a30d3379f463dec89581aad4cb72c6c04fb5a71dc5",
"rustc-1.86.0-aarch64-apple-darwin.tar.xz": "23b8f52102249a47ab5bc859d54c9a3cb588a3259ba3f00f557d50edeca4fde9",
"rustc-1.86.0-x86_64-pc-windows-msvc.tar.xz": "fdde839fea274529a31e51eb85c6df1782cc8479c9d1bc24e2914d66a0de41ab",
"clippy-1.86.0-x86_64-unknown-linux-gnu.tar.xz": "02aaff2c1407d2da8dba19aa4970dd873e311902b120a66cbcdbe51eb8836edf",
"clippy-1.86.0-x86_64-apple-darwin.tar.xz": "bb85efda7bbffaf124867f5ca36d50932b1e8f533c62ee923438afb32ff8fe9a",
"clippy-1.86.0-aarch64-apple-darwin.tar.xz": "239fa3a604b124f0312f2af08537874a1227dba63385484b468cca62e7c4f2f2",
"clippy-1.86.0-x86_64-pc-windows-msvc.tar.xz": "d00498f47d49219f032e2c5eeebdfc3d32317c0dc3d3fd7125327445bc482cb4",
"cargo-1.86.0-x86_64-unknown-linux-gnu.tar.xz": "c5c1590f7e9246ad9f4f97cfe26ffa92707b52a769726596a9ef81565ebd908b",
"cargo-1.86.0-x86_64-apple-darwin.tar.xz": "af163eb02d1a178044d1b4f2375960efd47130f795f6e33d09e345454bb26f4e",
"cargo-1.86.0-aarch64-apple-darwin.tar.xz": "3cb13873d48c3e1e4cc684d42c245226a11fba52af6b047c3346ed654e7a05c0",
"cargo-1.86.0-x86_64-pc-windows-msvc.tar.xz": "e57a9d89619b5604899bac443e68927bdd371e40f2e03e18950b6ceb3eb67966",
"llvm-tools-1.86.0-x86_64-unknown-linux-gnu.tar.xz": "282145ab7a63c98b625856f44b905b4dc726b497246b824632a5790debe95a78",
"llvm-tools-1.86.0-x86_64-apple-darwin.tar.xz": "b55706e92f7da989207c50c13c7add483a9fedd233bc431b106eca2a8f151ec9",
"llvm-tools-1.86.0-aarch64-apple-darwin.tar.xz": "04d3618c686845853585f036e3211eb9e18f2d290f4610a7a78bdc1fcce1ebd9",
"llvm-tools-1.86.0-x86_64-pc-windows-msvc.tar.xz": "721a17cc8dc219177e4277a3592253934ef08daa1e1b12eda669a67d15fad8dd",
"rust-std-1.86.0-x86_64-unknown-linux-gnu.tar.xz": "67be7184ea388d8ce0feaf7fdea46f1775cfc2970930264343b3089898501d37",
"rust-std-1.86.0-x86_64-apple-darwin.tar.xz": "3b1140d54870a080080e84700143f4a342fbd02a410a319b05d9c02e7dcf44cc",
"rust-std-1.86.0-aarch64-apple-darwin.tar.xz": "0fb121fb3b8fa9027d79ff598500a7e5cd086ddbc3557482ed3fdda00832c61b",
"rust-std-1.86.0-x86_64-pc-windows-msvc.tar.xz": "3d5354b7b9cb950b58bff3fce18a652aa374bb30c8f70caebd3bd0b43cb41a33",
},
versions = [RUST_VERSION],
)
@@ -98,49 +95,49 @@ use_repo(
tree_sitter_extractors_deps = use_extension("//misc/bazel/3rdparty:tree_sitter_extractors_extension.bzl", "r")
use_repo(
tree_sitter_extractors_deps,
"vendor_ts__anyhow-1.0.99",
"vendor_ts__anyhow-1.0.98",
"vendor_ts__argfile-0.2.1",
"vendor_ts__chalk-ir-0.104.0",
"vendor_ts__chalk-ir-0.103.0",
"vendor_ts__chrono-0.4.41",
"vendor_ts__clap-4.5.44",
"vendor_ts__clap-4.5.40",
"vendor_ts__dunce-1.0.5",
"vendor_ts__either-1.15.0",
"vendor_ts__encoding-0.2.33",
"vendor_ts__figment-0.10.19",
"vendor_ts__flate2-1.1.0",
"vendor_ts__glob-0.3.3",
"vendor_ts__glob-0.3.2",
"vendor_ts__globset-0.4.15",
"vendor_ts__itertools-0.14.0",
"vendor_ts__lazy_static-1.5.0",
"vendor_ts__mustache-0.9.0",
"vendor_ts__num-traits-0.2.19",
"vendor_ts__num_cpus-1.17.0",
"vendor_ts__proc-macro2-1.0.97",
"vendor_ts__proc-macro2-1.0.95",
"vendor_ts__quote-1.0.40",
"vendor_ts__ra_ap_base_db-0.0.300",
"vendor_ts__ra_ap_cfg-0.0.300",
"vendor_ts__ra_ap_hir-0.0.300",
"vendor_ts__ra_ap_hir_def-0.0.300",
"vendor_ts__ra_ap_hir_expand-0.0.300",
"vendor_ts__ra_ap_hir_ty-0.0.300",
"vendor_ts__ra_ap_ide_db-0.0.300",
"vendor_ts__ra_ap_intern-0.0.300",
"vendor_ts__ra_ap_load-cargo-0.0.300",
"vendor_ts__ra_ap_parser-0.0.300",
"vendor_ts__ra_ap_paths-0.0.300",
"vendor_ts__ra_ap_project_model-0.0.300",
"vendor_ts__ra_ap_span-0.0.300",
"vendor_ts__ra_ap_stdx-0.0.300",
"vendor_ts__ra_ap_syntax-0.0.300",
"vendor_ts__ra_ap_vfs-0.0.300",
"vendor_ts__rand-0.9.2",
"vendor_ts__ra_ap_base_db-0.0.288",
"vendor_ts__ra_ap_cfg-0.0.288",
"vendor_ts__ra_ap_hir-0.0.288",
"vendor_ts__ra_ap_hir_def-0.0.288",
"vendor_ts__ra_ap_hir_expand-0.0.288",
"vendor_ts__ra_ap_hir_ty-0.0.288",
"vendor_ts__ra_ap_ide_db-0.0.288",
"vendor_ts__ra_ap_intern-0.0.288",
"vendor_ts__ra_ap_load-cargo-0.0.288",
"vendor_ts__ra_ap_parser-0.0.288",
"vendor_ts__ra_ap_paths-0.0.288",
"vendor_ts__ra_ap_project_model-0.0.288",
"vendor_ts__ra_ap_span-0.0.288",
"vendor_ts__ra_ap_stdx-0.0.288",
"vendor_ts__ra_ap_syntax-0.0.288",
"vendor_ts__ra_ap_vfs-0.0.288",
"vendor_ts__rand-0.9.1",
"vendor_ts__rayon-1.10.0",
"vendor_ts__regex-1.11.1",
"vendor_ts__serde-1.0.219",
"vendor_ts__serde_json-1.0.142",
"vendor_ts__serde_with-3.14.0",
"vendor_ts__syn-2.0.104",
"vendor_ts__toml-0.9.5",
"vendor_ts__serde_json-1.0.140",
"vendor_ts__serde_with-3.13.0",
"vendor_ts__syn-2.0.103",
"vendor_ts__toml-0.8.23",
"vendor_ts__tracing-0.1.41",
"vendor_ts__tracing-flame-0.2.0",
"vendor_ts__tracing-subscriber-0.3.19",
@@ -172,7 +169,7 @@ http_archive(
)
dotnet = use_extension("@rules_dotnet//dotnet:extensions.bzl", "dotnet")
dotnet.toolchain(dotnet_version = "9.0.300")
dotnet.toolchain(dotnet_version = "9.0.100")
use_repo(dotnet, "dotnet_toolchains")
register_toolchains("@dotnet_toolchains//:all")
@@ -263,7 +260,7 @@ use_repo(
)
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.25.0")
go_sdk.download(version = "1.24.0")
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//go/extractor:go.mod")

View File

@@ -29,3 +29,5 @@ You can install the [CodeQL for Visual Studio Code](https://marketplace.visualst
### Tasks
The `.vscode/tasks.json` file defines custom tasks specific to working in this repository. To invoke one of these tasks, select the `Terminal | Run Task...` menu option, and then select the desired task from the dropdown. You can also invoke the `Tasks: Run Task` command from the command palette.

41
SECURITY.md Normal file
View File

@@ -0,0 +1,41 @@
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.8 BLOCK -->
## Security
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
## Reporting Security Issues
**Please do not report security vulnerabilities through public GitHub issues.**
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue
This information will help us triage your report more quickly.
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
## Preferred Languages
We prefer all communications to be in English.
## Policy
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
<!-- END MICROSOFT SECURITY.MD BLOCK -->

View File

@@ -1,17 +1,14 @@
name: "actions"
aliases: []
display_name: "GitHub Actions"
version: 0.0.1
column_kind: "utf16"
unicode_newlines: true
build_modes:
- none
default_queries:
- codeql/actions-queries
# Actions workflows are not reported separately by the GitHub API, so we can't
# associate them with a specific language.
file_coverage_languages: []
github_api_languages: []
scc_languages:
- YAML
scc_languages: []
file_types:
- name: workflow
display_name: GitHub Actions workflow files

View File

@@ -1,10 +0,0 @@
{
"paths": [
".github/workflows/*.yml",
".github/workflows/*.yaml",
".github/reusable_workflows/**/*.yml",
".github/reusable_workflows/**/*.yaml",
"**/action.yml",
"**/action.yaml"
]
}

View File

@@ -1,2 +0,0 @@
@echo off
type "%CODEQL_EXTRACTOR_ACTIONS_ROOT%\tools\baseline-config.json"

View File

@@ -1,3 +0,0 @@
#!/bin/sh
cat "$CODEQL_EXTRACTOR_ACTIONS_ROOT/tools/baseline-config.json"

View File

@@ -1,4 +1,3 @@
ql/actions/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql
ql/actions/ql/src/Security/CWE-077/EnvPathInjectionCritical.ql
ql/actions/ql/src/Security/CWE-077/EnvVarInjectionCritical.ql
ql/actions/ql/src/Security/CWE-094/CodeInjectionCritical.ql

View File

@@ -1,5 +1,4 @@
ql/actions/ql/src/Debug/SyntaxError.ql
ql/actions/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql
ql/actions/ql/src/Security/CWE-077/EnvPathInjectionCritical.ql
ql/actions/ql/src/Security/CWE-077/EnvPathInjectionMedium.ql
ql/actions/ql/src/Security/CWE-077/EnvVarInjectionCritical.ql

View File

@@ -1,4 +1,3 @@
ql/actions/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql
ql/actions/ql/src/Security/CWE-077/EnvPathInjectionCritical.ql
ql/actions/ql/src/Security/CWE-077/EnvPathInjectionMedium.ql
ql/actions/ql/src/Security/CWE-077/EnvVarInjectionCritical.ql

View File

@@ -1,15 +1,3 @@
## 0.4.17
No user-facing changes.
## 0.4.16
No user-facing changes.
## 0.4.15
No user-facing changes.
## 0.4.14
No user-facing changes.

View File

@@ -1,3 +0,0 @@
## 0.4.15
No user-facing changes.

View File

@@ -1,3 +0,0 @@
## 0.4.16
No user-facing changes.

View File

@@ -1,3 +0,0 @@
## 0.4.17
No user-facing changes.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 0.4.17
lastReleaseVersion: 0.4.14

View File

@@ -70,8 +70,8 @@ class Location extends TLocation, TBaseLocation {
/**
* Holds if this element is at the specified location.
* The location spans column `sc` of line `sl` to
* column `ec` of line `el` in file `p`.
* The location spans column `startcolumn` of line `startline` to
* column `endcolumn` of line `endline` in file `filepath`.
* For more information, see
* [Providing locations in CodeQL queries](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
*/

View File

@@ -261,7 +261,7 @@ class If extends AstNode instanceof IfImpl {
}
/**
* An Environment node representing a deployment environment.
* An Environemnt node representing a deployment environment.
*/
class Environment extends AstNode instanceof EnvironmentImpl {
string getName() { result = super.getName() }

View File

@@ -125,11 +125,12 @@ abstract class AstNodeImpl extends TAstNode {
* Gets the enclosing Step.
*/
StepImpl getEnclosingStep() {
this instanceof StepImpl and
result = this
or
this instanceof ScalarValueImpl and
result.getAChildNode*() = this.getParentNode()
if this instanceof StepImpl
then result = this
else
if this instanceof ScalarValueImpl
then result.getAChildNode*() = this.getParentNode()
else none()
}
/**
@@ -1415,8 +1416,9 @@ class ExternalJobImpl extends JobImpl, UsesImpl {
override string getVersion() {
exists(YamlString name |
n.lookup("uses") = name and
not name.getValue().matches("\\.%") and
result = name.getValue().regexpCapture(repoUsesParser(), 4)
if not name.getValue().matches("\\.%")
then result = name.getValue().regexpCapture(repoUsesParser(), 4)
else none()
)
}
}

View File

@@ -286,7 +286,7 @@ private module Cached {
/**
* Holds if `cfn` is the `i`th node in basic block `bb`.
*
* In other words, `i` is the shortest distance from a node `bbStart`
* In other words, `i` is the shortest distance from a node `bb`
* that starts a basic block to `cfn` along the `intraBBSucc` relation.
*/
cached

View File

@@ -3,8 +3,6 @@ private import codeql.controlflow.Cfg as CfgShared
private import codeql.Locations
module Completion {
import codeql.controlflow.SuccessorType
private newtype TCompletion =
TSimpleCompletion() or
TBooleanCompletion(boolean b) { b in [false, true] } or
@@ -27,7 +25,7 @@ module Completion {
override predicate isValidFor(AstNode e) { not any(Completion c).isValidForSpecific(e) }
override DirectSuccessor getAMatchingSuccessorType() { any() }
override NormalSuccessor getAMatchingSuccessorType() { any() }
}
class BooleanCompletion extends NormalCompletion, TBooleanCompletion {
@@ -51,6 +49,34 @@ module Completion {
override ReturnSuccessor getAMatchingSuccessorType() { any() }
}
cached
private newtype TSuccessorType =
TNormalSuccessor() or
TBooleanSuccessor(boolean b) { b in [false, true] } or
TReturnSuccessor()
class SuccessorType extends TSuccessorType {
string toString() { none() }
}
class NormalSuccessor extends SuccessorType, TNormalSuccessor {
override string toString() { result = "successor" }
}
class BooleanSuccessor extends SuccessorType, TBooleanSuccessor {
boolean value;
BooleanSuccessor() { this = TBooleanSuccessor(value) }
override string toString() { result = value.toString() }
boolean getValue() { result = value }
}
class ReturnSuccessor extends SuccessorType, TReturnSuccessor {
override string toString() { result = "return" }
}
}
module CfgScope {
@@ -101,8 +127,14 @@ private module Implementation implements CfgShared::InputSig<Location> {
last(scope.(CompositeAction), e, c)
}
predicate successorTypeIsSimple(SuccessorType t) { t instanceof NormalSuccessor }
predicate successorTypeIsCondition(SuccessorType t) { t instanceof BooleanSuccessor }
SuccessorType getAMatchingSuccessorType(Completion c) { result = c.getAMatchingSuccessorType() }
predicate isAbnormalExitType(SuccessorType t) { none() }
int idOfAstNode(AstNode node) { none() }
int idOfCfgScope(CfgScope scope) { none() }

View File

@@ -63,10 +63,10 @@ predicate madSource(DataFlow::Node source, string kind, string fieldName) {
(
if fieldName.trim().matches("env.%")
then source.asExpr() = uses.getInScopeEnvVarExpr(fieldName.trim().replaceAll("env.", ""))
else (
fieldName.trim().matches("output.%") and
source.asExpr() = uses
)
else
if fieldName.trim().matches("output.%")
then source.asExpr() = uses
else none()
)
)
}

View File

@@ -31,14 +31,14 @@ abstract class RemoteFlowSource extends SourceNode {
class GitHubCtxSource extends RemoteFlowSource {
string flag;
string event;
GitHubExpression e;
GitHubCtxSource() {
exists(GitHubExpression e |
this.asExpr() = e and
// github.head_ref
e.getFieldName() = "head_ref" and
flag = "branch"
|
this.asExpr() = e and
// github.head_ref
e.getFieldName() = "head_ref" and
flag = "branch" and
(
event = e.getATriggerEvent().getName() and
event = "pull_request_target"
or
@@ -148,6 +148,7 @@ class GhCLICommandSource extends RemoteFlowSource, CommandSource {
class GitHubEventPathSource extends RemoteFlowSource, CommandSource {
string cmd;
string flag;
string access_path;
Run run;
// Examples
@@ -162,7 +163,7 @@ class GitHubEventPathSource extends RemoteFlowSource, CommandSource {
run.getScript().getACommand() = cmd and
cmd.matches("jq%") and
cmd.matches("%GITHUB_EVENT_PATH%") and
exists(string regexp, string access_path |
exists(string regexp |
untrustedEventPropertiesDataModel(regexp, flag) and
not flag = "json" and
access_path = "github.event" + cmd.regexpCapture(".*\\s+([^\\s]+)\\s+.*", 1) and

View File

@@ -1,7 +1,6 @@
private import actions
private import codeql.actions.TaintTracking
private import codeql.actions.dataflow.ExternalFlow
private import codeql.actions.security.ControlChecks
import codeql.actions.dataflow.FlowSources
import codeql.actions.DataFlow
@@ -19,6 +18,7 @@ abstract class ArgumentInjectionSink extends DataFlow::Node {
*/
class ArgumentInjectionFromEnvVarSink extends ArgumentInjectionSink {
string command;
string argument;
ArgumentInjectionFromEnvVarSink() {
exists(Run run, string var |
@@ -27,7 +27,7 @@ class ArgumentInjectionFromEnvVarSink extends ArgumentInjectionSink {
exists(run.getInScopeEnvVarExpr(var)) or
var = "GITHUB_HEAD_REF"
) and
run.getScript().getAnEnvReachingArgumentInjectionSink(var, command, _)
run.getScript().getAnEnvReachingArgumentInjectionSink(var, command, argument)
)
}
@@ -43,12 +43,13 @@ class ArgumentInjectionFromEnvVarSink extends ArgumentInjectionSink {
*/
class ArgumentInjectionFromCommandSink extends ArgumentInjectionSink {
string command;
string argument;
ArgumentInjectionFromCommandSink() {
exists(CommandSource source, Run run |
run = source.getEnclosingRun() and
this.asExpr() = run.getScript() and
run.getScript().getACmdReachingArgumentInjectionSink(source.getCommand(), command, _)
run.getScript().getACmdReachingArgumentInjectionSink(source.getCommand(), command, argument)
)
}
@@ -64,16 +65,6 @@ class ArgumentInjectionFromMaDSink extends ArgumentInjectionSink {
override string getCommand() { result = "unknown" }
}
/**
* Gets the event that is relevant for the given node in the context of argument injection.
*
* This is used to highlight the event in the query results when an alert is raised.
*/
Event getRelevantEventInPrivilegedContext(DataFlow::Node node) {
inPrivilegedContext(node.asExpr(), result) and
not exists(ControlCheck check | check.protects(node.asExpr(), result, "argument-injection"))
}
/**
* A taint-tracking configuration for unsafe user input
* that is used to construct and evaluate a code script.
@@ -97,16 +88,6 @@ private module ArgumentInjectionConfig implements DataFlow::ConfigSig {
run.getScript().getAnEnvReachingArgumentInjectionSink(var, _, _)
)
}
predicate observeDiffInformedIncrementalMode() { any() }
Location getASelectedSourceLocation(DataFlow::Node source) { none() }
Location getASelectedSinkLocation(DataFlow::Node sink) {
result = sink.getLocation()
or
result = getRelevantEventInPrivilegedContext(sink).getLocation()
}
}
/** Tracks flow of unsafe user input that is used to construct and evaluate a code script. */

View File

@@ -4,7 +4,6 @@ import codeql.actions.DataFlow
import codeql.actions.dataflow.FlowSources
import codeql.actions.security.PoisonableSteps
import codeql.actions.security.UntrustedCheckoutQuery
import codeql.actions.security.ControlChecks
string unzipRegexp() { result = "(unzip|tar)\\s+.*" }
@@ -125,6 +124,8 @@ class LegitLabsDownloadArtifactActionStep extends UntrustedArtifactDownloadStep,
}
class ActionsGitHubScriptDownloadStep extends UntrustedArtifactDownloadStep, UsesStep {
string script;
ActionsGitHubScriptDownloadStep() {
// eg:
// - uses: actions/github-script@v6
@@ -147,14 +148,12 @@ class ActionsGitHubScriptDownloadStep extends UntrustedArtifactDownloadStep, Use
// var fs = require('fs');
// fs.writeFileSync('${{github.workspace}}/test-results.zip', Buffer.from(download.data));
this.getCallee() = "actions/github-script" and
exists(string script |
this.getArgument("script") = script and
script.matches("%listWorkflowRunArtifacts(%") and
script.matches("%downloadArtifact(%") and
script.matches("%writeFileSync(%") and
// Filter out artifacts that were created by pull-request.
not script.matches("%exclude_pull_requests: true%")
)
this.getArgument("script") = script and
script.matches("%listWorkflowRunArtifacts(%") and
script.matches("%downloadArtifact(%") and
script.matches("%writeFileSync(%") and
// Filter out artifacts that were created by pull-request.
not script.matches("%exclude_pull_requests: true%")
}
override string getPath() {
@@ -171,10 +170,10 @@ class ActionsGitHubScriptDownloadStep extends UntrustedArtifactDownloadStep, Use
.getScript()
.getACommand()
.regexpCapture(unzipRegexp() + unzipDirArgRegexp(), 3)))
else (
this.getAFollowingStep().(Run).getScript().getACommand().regexpMatch(unzipRegexp()) and
result = "GITHUB_WORKSPACE/"
)
else
if this.getAFollowingStep().(Run).getScript().getACommand().regexpMatch(unzipRegexp())
then result = "GITHUB_WORKSPACE/"
else none()
}
}
@@ -207,13 +206,12 @@ class GHRunArtifactDownloadStep extends UntrustedArtifactDownloadStep, Run {
.getScript()
.getACommand()
.regexpCapture(unzipRegexp() + unzipDirArgRegexp(), 3)))
else (
(
else
if
this.getAFollowingStep().(Run).getScript().getACommand().regexpMatch(unzipRegexp()) or
this.getScript().getACommand().regexpMatch(unzipRegexp())
) and
result = "GITHUB_WORKSPACE/"
)
then result = "GITHUB_WORKSPACE/"
else none()
}
}
@@ -260,15 +258,15 @@ class DirectArtifactDownloadStep extends UntrustedArtifactDownloadStep, Run {
class ArtifactPoisoningSink extends DataFlow::Node {
UntrustedArtifactDownloadStep download;
PoisonableStep poisonable;
ArtifactPoisoningSink() {
exists(PoisonableStep poisonable |
download.getAFollowingStep() = poisonable and
// excluding artifacts downloaded to the temporary directory
not download.getPath().regexpMatch("^/tmp.*") and
not download.getPath().regexpMatch("^\\$\\{\\{\\s*runner\\.temp\\s*}}.*") and
not download.getPath().regexpMatch("^\\$RUNNER_TEMP.*")
|
download.getAFollowingStep() = poisonable and
// excluding artifacts downloaded to the temporary directory
not download.getPath().regexpMatch("^/tmp.*") and
not download.getPath().regexpMatch("^\\$\\{\\{\\s*runner\\.temp\\s*}}.*") and
not download.getPath().regexpMatch("^\\$RUNNER_TEMP.*") and
(
poisonable.(Run).getScript() = this.asExpr() and
(
// Check if the poisonable step is a local script execution step
@@ -294,16 +292,6 @@ class ArtifactPoisoningSink extends DataFlow::Node {
string getPath() { result = download.getPath() }
}
/**
* Gets the event that is relevant for the given node in the context of artifact poisoning.
*
* This is used to highlight the event in the query results when an alert is raised.
*/
Event getRelevantEventInPrivilegedContext(DataFlow::Node node) {
inPrivilegedContext(node.asExpr(), result) and
not exists(ControlCheck check | check.protects(node.asExpr(), result, "artifact-poisoning"))
}
/**
* A taint-tracking configuration for unsafe artifacts
* that is used may lead to artifact poisoning
@@ -330,16 +318,6 @@ private module ArtifactPoisoningConfig implements DataFlow::ConfigSig {
exists(run.getScript().getAFileReadCommand())
)
}
predicate observeDiffInformedIncrementalMode() { any() }
Location getASelectedSourceLocation(DataFlow::Node source) { none() }
Location getASelectedSinkLocation(DataFlow::Node sink) {
result = sink.getLocation()
or
result = getRelevantEventInPrivilegedContext(sink).getLocation()
}
}
/** Tracks flow of unsafe artifacts that is used in an insecure way. */

View File

@@ -3,8 +3,6 @@ private import codeql.actions.TaintTracking
private import codeql.actions.dataflow.ExternalFlow
import codeql.actions.dataflow.FlowSources
import codeql.actions.DataFlow
import codeql.actions.security.ControlChecks
import codeql.actions.security.CachePoisoningQuery
class CodeInjectionSink extends DataFlow::Node {
CodeInjectionSink() {
@@ -13,46 +11,6 @@ class CodeInjectionSink extends DataFlow::Node {
}
}
/**
* Get the relevant event for the sink in CodeInjectionCritical.ql.
*/
Event getRelevantCriticalEventForSink(DataFlow::Node sink) {
inPrivilegedContext(sink.asExpr(), result) and
not exists(ControlCheck check | check.protects(sink.asExpr(), result, "code-injection")) and
// exclude cases where the sink is a JS script and the expression uses toJson
not exists(UsesStep script |
script.getCallee() = "actions/github-script" and
script.getArgumentExpr("script") = sink.asExpr() and
exists(getAToJsonReferenceExpression(sink.asExpr().(Expression).getExpression(), _))
)
}
/**
* Get the relevant event for the sink in CachePoisoningViaCodeInjection.ql.
*/
Event getRelevantCachePoisoningEventForSink(DataFlow::Node sink) {
exists(LocalJob job |
job = sink.asExpr().getEnclosingJob() and
job.getATriggerEvent() = result and
// job can be triggered by an external user
result.isExternallyTriggerable() and
// excluding privileged workflows since they can be exploited in easier circumstances
// which is covered by `actions/code-injection/critical`
not job.isPrivilegedExternallyTriggerable(result) and
(
// the workflow runs in the context of the default branch
runsOnDefaultBranch(result)
or
// the workflow caller runs in the context of the default branch
result.getName() = "workflow_call" and
exists(ExternalJob caller |
caller.getCallee() = job.getLocation().getFile().getRelativePath() and
runsOnDefaultBranch(caller.getATriggerEvent())
)
)
)
}
/**
* A taint-tracking configuration for unsafe user input
* that is used to construct and evaluate a code script.
@@ -77,18 +35,6 @@ private module CodeInjectionConfig implements DataFlow::ConfigSig {
exists(run.getScript().getAFileReadCommand())
)
}
predicate observeDiffInformedIncrementalMode() { any() }
Location getASelectedSourceLocation(DataFlow::Node source) { none() }
Location getASelectedSinkLocation(DataFlow::Node sink) {
result = sink.getLocation()
or
result = getRelevantCriticalEventForSink(sink).getLocation()
or
result = getRelevantCachePoisoningEventForSink(sink).getLocation()
}
}
/** Tracks flow of unsafe user input that is used to construct and evaluate a code script. */

View File

@@ -3,20 +3,11 @@ private import codeql.actions.TaintTracking
private import codeql.actions.dataflow.ExternalFlow
import codeql.actions.dataflow.FlowSources
import codeql.actions.DataFlow
import codeql.actions.security.ControlChecks
private class CommandInjectionSink extends DataFlow::Node {
CommandInjectionSink() { madSink(this, "command-injection") }
}
/** Get the relevant event for the sink in CommandInjectionCritical.ql. */
Event getRelevantEventInPrivilegedContext(DataFlow::Node sink) {
inPrivilegedContext(sink.asExpr(), result) and
not exists(ControlCheck check |
check.protects(sink.asExpr(), result, ["command-injection", "code-injection"])
)
}
/**
* A taint-tracking configuration for unsafe user input
* that is used to construct and evaluate a system command.
@@ -25,16 +16,6 @@ private module CommandInjectionConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
predicate isSink(DataFlow::Node sink) { sink instanceof CommandInjectionSink }
predicate observeDiffInformedIncrementalMode() { any() }
Location getASelectedSourceLocation(DataFlow::Node source) { none() }
Location getASelectedSinkLocation(DataFlow::Node sink) {
result = sink.getLocation()
or
result = getRelevantEventInPrivilegedContext(sink).getLocation()
}
}
/** Tracks flow of unsafe user input that is used to construct and evaluate a system command. */

View File

@@ -159,8 +159,11 @@ abstract class CommentVsHeadDateCheck extends ControlCheck {
/* Specific implementations of control checks */
class LabelIfCheck extends LabelCheck instanceof If {
string condition;
LabelIfCheck() {
exists(string condition | condition = normalizeExpr(this.getCondition()) |
condition = normalizeExpr(this.getCondition()) and
(
// eg: contains(github.event.pull_request.labels.*.name, 'safe to test')
condition.regexpMatch(".*(^|[^!])contains\\(\\s*github\\.event\\.pull_request\\.labels\\b.*")
or

View File

@@ -72,25 +72,6 @@ class EnvPathInjectionFromMaDSink extends EnvPathInjectionSink {
EnvPathInjectionFromMaDSink() { madSink(this, "envpath-injection") }
}
/**
* Get the relevant event for a sink in EnvPathInjectionCritical.ql where the source type is "artifact".
*/
Event getRelevantArtifactEventInPrivilegedContext(DataFlow::Node sink) {
inPrivilegedContext(sink.asExpr(), result) and
not exists(ControlCheck check |
check.protects(sink.asExpr(), result, ["untrusted-checkout", "artifact-poisoning"])
) and
sink instanceof EnvPathInjectionFromFileReadSink
}
/**
* Get the relevant event for a sink in EnvPathInjectionCritical.ql where the source type is not "artifact".
*/
Event getRelevantNonArtifactEventInPrivilegedContext(DataFlow::Node sink) {
inPrivilegedContext(sink.asExpr(), result) and
not exists(ControlCheck check | check.protects(sink.asExpr(), result, "code-injection"))
}
/**
* A taint-tracking configuration for unsafe user input
* that is used to construct and evaluate an environment variable.
@@ -127,18 +108,6 @@ private module EnvPathInjectionConfig implements DataFlow::ConfigSig {
exists(run.getScript().getAFileReadCommand())
)
}
predicate observeDiffInformedIncrementalMode() { any() }
Location getASelectedSourceLocation(DataFlow::Node source) { none() }
Location getASelectedSinkLocation(DataFlow::Node sink) {
result = sink.getLocation()
or
result = getRelevantArtifactEventInPrivilegedContext(sink).getLocation()
or
result = getRelevantNonArtifactEventInPrivilegedContext(sink).getLocation()
}
}
/** Tracks flow of unsafe user input that is used to construct and evaluate the PATH environment variable. */

View File

@@ -55,8 +55,12 @@ class EnvVarInjectionFromFileReadSink extends EnvVarInjectionSink {
* echo "COMMIT_MESSAGE=${COMMIT_MESSAGE}" >> $GITHUB_ENV
*/
class EnvVarInjectionFromCommandSink extends EnvVarInjectionSink {
CommandSource inCommand;
string injectedVar;
string command;
EnvVarInjectionFromCommandSink() {
exists(Run run, CommandSource inCommand, string injectedVar, string command |
exists(Run run |
this.asExpr() = inCommand.getEnclosingRun().getScript() and
run = inCommand.getEnclosingRun() and
run.getScript().getACmdReachingGitHubEnvWrite(inCommand.getCommand(), injectedVar) and
@@ -82,8 +86,12 @@ class EnvVarInjectionFromCommandSink extends EnvVarInjectionSink {
* echo "FOO=$BODY" >> $GITHUB_ENV
*/
class EnvVarInjectionFromEnvVarSink extends EnvVarInjectionSink {
string inVar;
string injectedVar;
string command;
EnvVarInjectionFromEnvVarSink() {
exists(Run run, string inVar, string injectedVar, string command |
exists(Run run |
run.getScript() = this.asExpr() and
exists(run.getInScopeEnvVarExpr(inVar)) and
run.getScript().getAnEnvReachingGitHubEnvWrite(inVar, injectedVar) and
@@ -118,32 +126,6 @@ class EnvVarInjectionFromMaDSink extends EnvVarInjectionSink {
EnvVarInjectionFromMaDSink() { madSink(this, "envvar-injection") }
}
/**
* Get the relevant event for a sink in EnvVarInjectionCritical.ql where the source type is "artifact".
*/
Event getRelevantArtifactEventInPrivilegedContext(DataFlow::Node sink) {
inPrivilegedContext(sink.asExpr(), result) and
not exists(ControlCheck check |
check
.protects(sink.asExpr(), result,
["envvar-injection", "untrusted-checkout", "artifact-poisoning"])
) and
(
sink instanceof EnvVarInjectionFromFileReadSink or
madSink(sink, "envvar-injection")
)
}
/**
* Get the relevant event for a sink in EnvVarInjectionCritical.ql where the source type is not "artifact".
*/
Event getRelevantNonArtifactEventInPrivilegedContext(DataFlow::Node sink) {
inPrivilegedContext(sink.asExpr(), result) and
not exists(ControlCheck check |
check.protects(sink.asExpr(), result, ["envvar-injection", "code-injection"])
)
}
/**
* A taint-tracking configuration for unsafe user input
* that is used to construct and evaluate an environment variable.
@@ -181,18 +163,6 @@ private module EnvVarInjectionConfig implements DataFlow::ConfigSig {
exists(run.getScript().getAFileReadCommand())
)
}
predicate observeDiffInformedIncrementalMode() { any() }
Location getASelectedSourceLocation(DataFlow::Node source) { none() }
Location getASelectedSinkLocation(DataFlow::Node sink) {
result = sink.getLocation()
or
result = getRelevantArtifactEventInPrivilegedContext(sink).getLocation()
or
result = getRelevantNonArtifactEventInPrivilegedContext(sink).getLocation()
}
}
/** Tracks flow of unsafe user input that is used to construct and evaluate an environment variable. */

View File

@@ -99,14 +99,18 @@ class OutputClobberingFromEnvVarSink extends OutputClobberingSink {
* echo $BODY
*/
class WorkflowCommandClobberingFromEnvVarSink extends OutputClobberingSink {
string clobbering_var;
string clobbered_value;
WorkflowCommandClobberingFromEnvVarSink() {
exists(Run run, string workflow_cmd_stmt, string clobbering_stmt, string clobbering_var |
exists(Run run, string workflow_cmd_stmt, string clobbering_stmt |
run.getScript() = this.asExpr() and
run.getScript().getAStmt() = clobbering_stmt and
clobbering_stmt.regexpMatch("echo\\s+(-e\\s+)?(\"|')?\\$(\\{)?" + clobbering_var + ".*") and
exists(run.getInScopeEnvVarExpr(clobbering_var)) and
run.getScript().getAStmt() = workflow_cmd_stmt and
exists(trimQuotes(workflow_cmd_stmt.regexpCapture(".*::set-output\\s+name=.*::(.*)", 1)))
clobbered_value =
trimQuotes(workflow_cmd_stmt.regexpCapture(".*::set-output\\s+name=.*::(.*)", 1))
)
}
}

View File

@@ -1,8 +1,10 @@
import actions
class UnversionedImmutableAction extends UsesStep {
string immutable_action;
UnversionedImmutableAction() {
isImmutableAction(this, _) and
isImmutableAction(this, immutable_action) and
not isSemVer(this.getVersion())
}
}

View File

@@ -1,5 +1,5 @@
name: codeql/actions-all
version: 0.4.17
version: 0.4.14
library: true
warnOnImplicitThis: true
dependencies:

View File

@@ -1,17 +1,3 @@
## 0.6.9
### Minor Analysis Improvements
* Actions analysis now reports file coverage information on the CodeQL status page.
## 0.6.8
No user-facing changes.
## 0.6.7
No user-facing changes.
## 0.6.6
No user-facing changes.

View File

@@ -1,13 +0,0 @@
/**
* @id actions/diagnostics/successfully-extracted-files
* @name Extracted files
* @description List all files that were extracted.
* @kind diagnostic
* @tags successfully-extracted-files
*/
private import codeql.Locations
from File f
where exists(f.getRelativePath())
select f, ""

View File

@@ -21,12 +21,18 @@ import codeql.actions.security.ControlChecks
from EnvPathInjectionFlow::PathNode source, EnvPathInjectionFlow::PathNode sink, Event event
where
EnvPathInjectionFlow::flowPath(source, sink) and
inPrivilegedContext(sink.getNode().asExpr(), event) and
(
not source.getNode().(RemoteFlowSource).getSourceType() = "artifact" and
event = getRelevantNonArtifactEventInPrivilegedContext(sink.getNode())
not exists(ControlCheck check |
check.protects(sink.getNode().asExpr(), event, "code-injection")
)
or
source.getNode().(RemoteFlowSource).getSourceType() = "artifact" and
event = getRelevantArtifactEventInPrivilegedContext(sink.getNode())
not exists(ControlCheck check |
check.protects(sink.getNode().asExpr(), event, ["untrusted-checkout", "artifact-poisoning"])
) and
sink.getNode() instanceof EnvPathInjectionFromFileReadSink
)
select sink.getNode(), source, sink,
"Potential PATH environment variable injection in $@, which may be controlled by an external user ($@).",

View File

@@ -22,15 +22,26 @@ import codeql.actions.security.ControlChecks
from EnvVarInjectionFlow::PathNode source, EnvVarInjectionFlow::PathNode sink, Event event
where
EnvVarInjectionFlow::flowPath(source, sink) and
inPrivilegedContext(sink.getNode().asExpr(), event) and
// exclude paths to file read sinks from non-artifact sources
(
// source is text
not source.getNode().(RemoteFlowSource).getSourceType() = "artifact" and
event = getRelevantNonArtifactEventInPrivilegedContext(sink.getNode())
not exists(ControlCheck check |
check.protects(sink.getNode().asExpr(), event, ["envvar-injection", "code-injection"])
)
or
// source is an artifact or a file from an untrusted checkout
source.getNode().(RemoteFlowSource).getSourceType() = "artifact" and
event = getRelevantArtifactEventInPrivilegedContext(sink.getNode())
not exists(ControlCheck check |
check
.protects(sink.getNode().asExpr(), event,
["envvar-injection", "untrusted-checkout", "artifact-poisoning"])
) and
(
sink.getNode() instanceof EnvVarInjectionFromFileReadSink or
madSink(sink.getNode(), "envvar-injection")
)
)
select sink.getNode(), source, sink,
"Potential environment variable injection in $@, which may be controlled by an external user ($@).",

View File

@@ -22,8 +22,15 @@ import codeql.actions.security.ControlChecks
from CodeInjectionFlow::PathNode source, CodeInjectionFlow::PathNode sink, Event event
where
CodeInjectionFlow::flowPath(source, sink) and
event = getRelevantCriticalEventForSink(sink.getNode()) and
source.getNode().(RemoteFlowSource).getEventName() = event.getName()
inPrivilegedContext(sink.getNode().asExpr(), event) and
source.getNode().(RemoteFlowSource).getEventName() = event.getName() and
not exists(ControlCheck check | check.protects(sink.getNode().asExpr(), event, "code-injection")) and
// exclude cases where the sink is a JS script and the expression uses toJson
not exists(UsesStep script |
script.getCallee() = "actions/github-script" and
script.getArgumentExpr("script") = sink.getNode().asExpr() and
exists(getAToJsonReferenceExpression(sink.getNode().asExpr().(Expression).getExpression(), _))
)
select sink.getNode(), source, sink,
"Potential code injection in $@, which may be controlled by an external user ($@).", sink,
sink.getNode().asExpr().(Expression).getRawExpression(), event, event.getName()

View File

@@ -18,13 +18,30 @@ import codeql.actions.security.CachePoisoningQuery
import CodeInjectionFlow::PathGraph
import codeql.actions.security.ControlChecks
from CodeInjectionFlow::PathNode source, CodeInjectionFlow::PathNode sink, Event event
from CodeInjectionFlow::PathNode source, CodeInjectionFlow::PathNode sink, LocalJob job, Event event
where
CodeInjectionFlow::flowPath(source, sink) and
event = getRelevantCachePoisoningEventForSink(sink.getNode()) and
job = sink.getNode().asExpr().getEnclosingJob() and
job.getATriggerEvent() = event and
// job can be triggered by an external user
event.isExternallyTriggerable() and
// the checkout is not controlled by an access check
not exists(ControlCheck check |
check.protects(source.getNode().asExpr(), event, "code-injection")
) and
// excluding privileged workflows since they can be exploited in easier circumstances
// which is covered by `actions/code-injection/critical`
not job.isPrivilegedExternallyTriggerable(event) and
(
// the workflow runs in the context of the default branch
runsOnDefaultBranch(event)
or
// the workflow caller runs in the context of the default branch
event.getName() = "workflow_call" and
exists(ExternalJob caller |
caller.getCallee() = job.getLocation().getFile().getRelativePath() and
runsOnDefaultBranch(caller.getATriggerEvent())
)
)
select sink.getNode(), source, sink,
"Unprivileged code injection in $@, which may lead to cache poisoning ($@).", sink,

View File

@@ -19,7 +19,10 @@ import codeql.actions.security.ControlChecks
from ArtifactPoisoningFlow::PathNode source, ArtifactPoisoningFlow::PathNode sink, Event event
where
ArtifactPoisoningFlow::flowPath(source, sink) and
event = getRelevantEventInPrivilegedContext(sink.getNode())
inPrivilegedContext(sink.getNode().asExpr(), event) and
not exists(ControlCheck check |
check.protects(sink.getNode().asExpr(), event, "artifact-poisoning")
)
select sink.getNode(), source, sink,
"Potential artifact poisoning in $@, which may be controlled by an external user ($@).", sink,
sink.getNode().toString(), event, event.getName()

View File

@@ -1,6 +1,6 @@
## Overview
GitHub workflows can be triggered through various repository events, including incoming pull requests (PRs) or comments on Issues/PRs. A potentially dangerous misuse of the triggers such as `pull_request_target` or `issue_comment` followed by an explicit checkout of untrusted code (Pull Request HEAD) may lead to repository compromise if untrusted code gets executed (e.g., due to a modified build script) in a privileged job.
GitHub workflows can be triggered through various repository events, including incoming pull requests (PRs) or comments on Issues/PRs. A potentially dangerous misuse of the triggers such as `pull_request_target` or `issue_comment` followed by an explicit checkout of untrusted code (Pull Request HEAD) may lead to repository compromise if untrusted code gets executed in a privileged job.
## Recommendation
@@ -32,7 +32,7 @@ jobs:
- uses: actions/setup-node@v1
- run: |
npm install # scripts in package.json from PR would be executed here
npm install
npm build
- uses: completely/fakeaction@v2

View File

@@ -1,6 +1,6 @@
## Overview
GitHub workflows can be triggered through various repository events, including incoming pull requests (PRs) or comments on Issues/PRs. A potentially dangerous misuse of the triggers such as `pull_request_target` or `issue_comment` followed by an explicit checkout of untrusted code (Pull Request HEAD) may lead to repository compromise if untrusted code gets executed (e.g., due to a modified build script) in a privileged job.
GitHub workflows can be triggered through various repository events, including incoming pull requests (PRs) or comments on Issues/PRs. A potentially dangerous misuse of the triggers such as `pull_request_target` or `issue_comment` followed by an explicit checkout of untrusted code (Pull Request HEAD) may lead to repository compromise if untrusted code gets executed in a privileged job.
## Recommendation
@@ -32,7 +32,7 @@ jobs:
- uses: actions/setup-node@v1
- run: |
npm install # scripts in package.json from PR would be executed here
npm install
npm build
- uses: completely/fakeaction@v2

View File

@@ -1,6 +1,6 @@
## Overview
GitHub workflows can be triggered through various repository events, including incoming pull requests (PRs) or comments on Issues/PRs. A potentially dangerous misuse of the triggers such as `pull_request_target` or `issue_comment` followed by an explicit checkout of untrusted code (Pull Request HEAD) may lead to repository compromise if untrusted code gets executed (e.g., due to a modified build script) in a privileged job.
GitHub workflows can be triggered through various repository events, including incoming pull requests (PRs) or comments on Issues/PRs. A potentially dangerous misuse of the triggers such as `pull_request_target` or `issue_comment` followed by an explicit checkout of untrusted code (Pull Request HEAD) may lead to repository compromise if untrusted code gets executed in a privileged job.
## Recommendation
@@ -32,7 +32,7 @@ jobs:
- uses: actions/setup-node@v1
- run: |
npm install # scripts in package.json from PR would be executed here
npm install
npm build
- uses: completely/fakeaction@v2

View File

@@ -1,3 +0,0 @@
## 0.6.7
No user-facing changes.

View File

@@ -1,3 +0,0 @@
## 0.6.8
No user-facing changes.

View File

@@ -1,5 +0,0 @@
## 0.6.9
### Minor Analysis Improvements
* Actions analysis now reports file coverage information on the CodeQL status page.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 0.6.9
lastReleaseVersion: 0.6.6

View File

@@ -21,7 +21,10 @@ import codeql.actions.security.ControlChecks
from CommandInjectionFlow::PathNode source, CommandInjectionFlow::PathNode sink, Event event
where
CommandInjectionFlow::flowPath(source, sink) and
event = getRelevantEventInPrivilegedContext(sink.getNode())
inPrivilegedContext(sink.getNode().asExpr(), event) and
not exists(ControlCheck check |
check.protects(sink.getNode().asExpr(), event, ["command-injection", "code-injection"])
)
select sink.getNode(), source, sink,
"Potential command injection in $@, which may be controlled by an external user ($@).", sink,
sink.getNode().asExpr().(Expression).getRawExpression(), event, event.getName()

View File

@@ -20,7 +20,10 @@ import codeql.actions.security.ControlChecks
from ArgumentInjectionFlow::PathNode source, ArgumentInjectionFlow::PathNode sink, Event event
where
ArgumentInjectionFlow::flowPath(source, sink) and
event = getRelevantEventInPrivilegedContext(sink.getNode())
inPrivilegedContext(sink.getNode().asExpr(), event) and
not exists(ControlCheck check |
check.protects(sink.getNode().asExpr(), event, "argument-injection")
)
select sink.getNode(), source, sink,
"Potential argument injection in $@ command, which may be controlled by an external user ($@).",
sink, sink.getNode().(ArgumentInjectionSink).getCommand(), event, event.getName()

View File

@@ -37,6 +37,8 @@ where
)
or
// upload artifact is not used in the same workflow
not download.getEnclosingWorkflow().getAJob().(LocalJob).getAStep() instanceof UsesStep
not exists(UsesStep upload |
download.getEnclosingWorkflow().getAJob().(LocalJob).getAStep() = upload
)
)
select download, "Potential artifact poisoning"

View File

@@ -1,5 +1,5 @@
name: codeql/actions-queries
version: 0.6.9
version: 0.6.6
library: false
warnOnImplicitThis: true
groups: [actions, queries]

View File

@@ -177,12 +177,6 @@ def insert_overlay_caller_annotations(lines):
out_lines.append(line)
return out_lines
explicitly_global = set([
"java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll",
"java/ql/lib/semmle/code/java/dispatch/DispatchFlow.qll",
"java/ql/lib/semmle/code/java/dispatch/ObjFlow.qll",
"java/ql/lib/semmle/code/java/dispatch/internal/Unification.qll",
])
def annotate_as_appropriate(filename, lines):
'''
@@ -202,9 +196,6 @@ def annotate_as_appropriate(filename, lines):
((filename.endswith("Query.qll") or filename.endswith("Config.qll")) and
any("implements DataFlow::ConfigSig" in line for line in lines))):
return None
elif filename in explicitly_global:
# These files are explicitly global and should not be annotated.
return None
elif not any(line for line in lines if line.strip()):
return None

View File

@@ -1,4 +0,0 @@
description: Link PCH creations and uses
compatibility: full
pch_uses.rel: delete
pch_creations.rel: delete

Some files were not shown because too many files have changed in this diff Show More