Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1199 commits
Select commit Hold shift + click to select a range
f882af9
update to invokesink
chanel-y Jun 12, 2025
229914f
PS: Add 'Node.getCallee' predicate on DataFlow::CallNode.
MathiasVP Jun 16, 2025
56977c7
Merge pull request #247 from microsoft/add-get-callee-on-call-nodes
MathiasVP Jun 16, 2025
3ba3b11
PS: Prevent magic on 'getParent'.
MathiasVP Jun 19, 2025
9ed32b1
PS: Add some QLDoc.
MathiasVP Jun 19, 2025
f69cfdc
PS: Autoformat.
MathiasVP Jun 19, 2025
ae83d56
PS: Rename predicate.
MathiasVP Jun 19, 2025
ebc167c
PS: Fix join in 'count'.
MathiasVP Jun 19, 2025
b79f366
PS: Replace a 'forex' with explicit recursion.
MathiasVP Jun 19, 2025
8664842
PS: Remove two more 'forex's.
MathiasVP Jun 19, 2025
9be1f2d
PS: Replace another 'forex' with explicit recursion.
MathiasVP Jun 19, 2025
f513259
PS: Format, add a helper predicate and add an explicit 'this' to sile…
MathiasVP Jun 19, 2025
a38d57f
PS: Fix cartesian product.
MathiasVP Jun 19, 2025
c50b0c6
PS: Prevent join on boolean.
MathiasVP Jun 19, 2025
2d045ea
PS: Prevent join on integer.
MathiasVP Jun 19, 2025
31fbb6f
PS: Prevent bad magic by calling a HOP to compute the transitive clos…
MathiasVP Jun 19, 2025
86cc09b
PS: Start with a SCAN of 'getProcessBlock' as this ensures we start w…
MathiasVP Jun 19, 2025
b82bd2c
PS: Add false positive to 'ps/sql-injection'.
MathiasVP Jun 20, 2025
c18db91
PS: Model 'inputfile' as a sink for SQL injections.
MathiasVP Jun 20, 2025
0912cc3
PS: Accept test changes.
MathiasVP Jun 20, 2025
25d94fa
PS: Add false positive to 'ps/sql-injection'.
MathiasVP Jun 20, 2025
05a7cfd
PS: Don't implicitly read any element. Instead, only read positional …
MathiasVP Jun 20, 2025
72178f0
PS: Accept test changes.
MathiasVP Jun 20, 2025
1ff04d9
PS: Add new false negative.
MathiasVP Jun 20, 2025
1486200
PS: Allow for implicit reads at sinks in 'ps/sql-injection'.
MathiasVP Jun 20, 2025
9032d86
PS: Accept test changes.
MathiasVP Jun 20, 2025
cb89695
PS: Improve alert message.
MathiasVP Jun 20, 2025
6ab05cd
Merge pull request #249 from microsoft/fix-fps-on-sql-injection
LWSimpkins Jun 20, 2025
52f5ac5
Merge branch 'main' into fix-ps-performance
LWSimpkins Jun 21, 2025
849e0b4
Merge pull request #248 from microsoft/fix-ps-performance
LWSimpkins Jun 21, 2025
4122283
Manual merge
ropwareJB Jul 1, 2025
0585c2f
PS: Gets back the previously-lost false negative by making the variab…
MathiasVP Jul 4, 2025
7d07773
PS: Accept test changes.
MathiasVP Jul 4, 2025
eec092c
PS: Mark the BAD results in the test appropriately.
MathiasVP Jul 4, 2025
2a26c43
PS: Cleanup a few manually generated models.
MathiasVP Jul 4, 2025
8aa8dde
Merge branch 'main' into powershell-commandinjection-invokesinkfix
chanel-y Jul 4, 2025
bd90435
PS: Add test with missing remote flow source.
MathiasVP Jul 4, 2025
766cf82
PS: Add more models and accept test changes.
MathiasVP Jul 4, 2025
654bf2f
random newline to reset git latest pusher
chanel-y Jul 4, 2025
52ff5d3
Merge pull request #246 from microsoft/powershell-commandinjection-in…
MathiasVP Jul 4, 2025
2731983
PS: Add query for insecure uses of 'Set-ExecutionPolicy'.
MathiasVP Jul 4, 2025
f7c9899
PS: Add documentation.
MathiasVP Jul 4, 2025
4e524a1
PS: Add tests.
MathiasVP Jul 4, 2025
b6b4df5
PS: Implement 'localExprTaint' instead of leaving it as 'none()'.
MathiasVP Jul 4, 2025
d4571f5
Merge pull request #254 from microsoft/implement-localExprTaint
LWSimpkins Jul 7, 2025
1d64a79
Merge pull request #252 from microsoft/add-more-remote-flow-sources
MathiasVP Jul 7, 2025
28de6ed
PS: Also require '-Force' with a truthy value. Note the 'NOT DETECTED…
MathiasVP Jul 7, 2025
398d27b
PS: Fix missing AST child.
MathiasVP Jul 7, 2025
3101cc8
Merge pull request #253 from microsoft/add-set-execution-policy-bypas…
MathiasVP Jul 7, 2025
1816356
PS: Add test with missing remote flow.
MathiasVP Jul 9, 2025
d198877
PS: Add more flow sources and accept test changes.
MathiasVP Jul 9, 2025
8cd58aa
Merge pull request #255 from microsoft/add-iwr-as-flow-source
MathiasVP Jul 9, 2025
81f9e88
run add-overlay-annotations.py
ropwareJB Jul 10, 2025
87e0b08
Merge branch 'main' into jb1/upstream-zipslip
ropwareJB Jul 10, 2025
4dfa5d2
Merge pull request #251 from microsoft/jb1/upstream-zipslip
ropwareJB Jul 10, 2025
3606679
Terminate p tag
ropwareJB Jul 10, 2025
866977b
Merge pull request #256 from microsoft/jb1/qhelpfix
chanel-y Jul 10, 2025
5fb45c8
Revert "Merge pull request #251 from microsoft/jb1/upstream-zipslip"
ropwareJB Jul 10, 2025
4c5945f
Manual merge
ropwareJB Jul 10, 2025
b1b0892
Merge branch 'main' into jb1/reapply-22.1-tmp
ropwareJB Jul 10, 2025
6d496ee
Merge pull request #257 from microsoft/jb1/reapply-22.1-tmp
ropwareJB Jul 10, 2025
f39d08e
PS: Fix spelling.
MathiasVP Jul 16, 2025
75d37dc
PS: Add false positive.
MathiasVP Jul 16, 2025
5f07641
PS: Fix false positive by fixing the 'getCommand' predicates in 'Call…
MathiasVP Jul 16, 2025
670ad74
PS: Add false negative.
MathiasVP Jul 16, 2025
205d2e5
PS: Add dot sourcing as a sink.
MathiasVP Jul 16, 2025
72af800
PS: Accept test changes.
MathiasVP Jul 16, 2025
5fde177
Merge pull request #258 from microsoft/fix-call-operator-bug
chanel-y Jul 16, 2025
ef3654f
PS: Small cleanup.
MathiasVP Jul 16, 2025
cb8496b
added queries, tests, docs
chanel-y Jul 16, 2025
6ac9354
move logic to qlls
chanel-y Jul 17, 2025
3f4a169
PS: Change the AST so that an 'EnvVariable' is actually a 'Variable',…
MathiasVP Jul 17, 2025
2541bcd
PS: Add test cases.
MathiasVP Jul 17, 2025
6ab6279
PS: Implement global dataflow for environment variable write/reads.
MathiasVP Jul 17, 2025
a95f3b3
PS: Accept test changes.
MathiasVP Jul 17, 2025
b72af27
PS: Add tests showing that there is no flow starting at environment v…
MathiasVP Jul 17, 2025
03a7d3d
Merge pull request #261 from microsoft/global-flow-through-env-variab…
chanel-y Jul 17, 2025
1149d33
updated .expected test file
chanel-y Jul 17, 2025
9266713
Update powershell/ql/src/queries/security/cwe-502/BinaryFormatterDese…
chanel-y Jul 22, 2025
6d62e87
Update powershell/ql/src/queries/security/cwe-502/BinaryFormatterDese…
chanel-y Jul 22, 2025
2e93ec5
Update powershell/ql/src/queries/security/cwe-502/UnsafeDeserializati…
chanel-y Jul 22, 2025
3b90949
Update powershell/ql/src/queries/security/cwe-502/BinaryFormatterDese…
chanel-y Jul 22, 2025
d78280e
Merge branch 'main' into powershell-unsafe-deserialization
chanel-y Jul 22, 2025
c961340
Merge pull request #260 from microsoft/powershell-unsafe-deserialization
chanel-y Jul 22, 2025
4e0ea04
add query, tests
chanel-y Jul 23, 2025
482fda7
formatting
chanel-y Jul 23, 2025
a0dbf93
Update powershell/ql/src/queries/security/cwe-319/UnsafeSMBSettings.ql
chanel-y Jul 23, 2025
7c83d9d
Merge pull request #262 from microsoft/powershell-smb-settings
MathiasVP Jul 23, 2025
95926cb
PS: Remove environment variables as flow sources from 'powershell/mic…
MathiasVP Jul 23, 2025
3ba8799
PS: Unhide some dataflow nodes to make paths more explicit.
MathiasVP Jul 23, 2025
7991eb4
PS: Accept test changes.
MathiasVP Jul 23, 2025
ae4b3e8
Merge pull request #263 from microsoft/remove-env-reads-from-sql-inje…
MathiasVP Jul 24, 2025
e795630
PS: Add false positive.
MathiasVP Jul 24, 2025
f9c3bde
PS: Fix false positive by adding a type-based sanitizer.
MathiasVP Jul 24, 2025
71fec26
PS: Lower case all parameter types.
MathiasVP Jul 24, 2025
3880d9f
PS: More consistent lower casing in the AST classes.
MathiasVP Jul 24, 2025
e3b3f0b
PS: Consistent lower casing in api graphs, control-flow graph, and da…
MathiasVP Jul 24, 2025
b66c99b
PS: Lower casing in frameworks.
MathiasVP Jul 24, 2025
7b4d2a9
PS: Lower casing in command-line injection query.
MathiasVP Jul 24, 2025
ffc53d7
PS: Accept test changes.
MathiasVP Jul 24, 2025
eb15e3b
Add codeql-extractor-iac as submodule in iac/
Jul 24, 2025
cb63c6a
Add 'iac' language support to CodeQL workflow
dilanbhalla Jul 24, 2025
b0d6192
Merge pull request #265 from microsoft/dilan/iac-setup
MathiasVP Jul 25, 2025
f8bdfa4
Merge pull request #264 from microsoft/simple-type-sanitizers
MathiasVP Jul 25, 2025
3829528
PS: Delete stuff we don't actually need.
MathiasVP Aug 8, 2025
1bd93b9
PS: Add missing dataflow predicates related to models.
MathiasVP Aug 8, 2025
9b5897c
PS: Improve api graphs.
MathiasVP Aug 11, 2025
e96e464
PS: Accept test changes.
MathiasVP Aug 11, 2025
337132b
Merge pull request #270 from microsoft/better-api-graphs
chanel-y Aug 11, 2025
f39c114
Revert "Merge pull request #257 from microsoft/jb1/reapply-22.1-tmp"
ropwareJB Aug 11, 2025
0936531
merge upstream v2.22.2
ropwareJB Aug 11, 2025
c6ab941
Merge tag 'codeql-cli/v2.22.3' into jb1/2.22.3
ropwareJB Aug 11, 2025
627ee85
PS: Port changes from #20132 to PowerShell.
MathiasVP Aug 12, 2025
214ca2a
Merge pull request #272 from microsoft/jb1/2.22.3
MathiasVP Aug 12, 2025
05dbec6
Merge tag 'codeql-cli/latest' into auto/sync-main-pr
Aug 21, 2025
5231a1f
Add fialing test cases, whereby there is a call that validates and th…
ropwareJB Aug 22, 2025
1f79f38
Breaking down some logic into primitives, remove dead comment
ropwareJB Aug 22, 2025
3840d92
Barrier node whereby there is a call that performs valid sanitization…
ropwareJB Aug 22, 2025
1bdd366
Remove unused code
ropwareJB Aug 25, 2025
218f79f
Merge pull request #273 from microsoft/auto/sync-main-pr
dilanbhalla Sep 2, 2025
6501d12
PS: Add false positive.
MathiasVP Sep 2, 2025
b5fb6b5
PS: Fix FP by also considering -q and -i parameters.
MathiasVP Sep 2, 2025
cfbde9a
PS: Accept test changes.
MathiasVP Sep 2, 2025
b475871
Merge branch 'main' into powershell-sql-injection-alias-parameter-fp
chanel-y Sep 2, 2025
97170ee
Merge pull request #276 from microsoft/powershell-sql-injection-alias…
MathiasVP Sep 2, 2025
a5a632f
added cmdletbinding case to tests
chanel-y Sep 3, 2025
b3dbe20
adding powershell cmd injection critical query, updated unit test res…
chanel-y Sep 3, 2025
5e0ef92
adding Start-Process as sink
chanel-y Sep 3, 2025
9b6eddb
Merge branch 'main' into jb1/AB#13038-fp
ropwareJB Sep 3, 2025
bf7ebcc
Merge pull request #275 from microsoft/jb1/AB#13038-fp
ropwareJB Sep 3, 2025
5a90fc4
Merge tag 'codeql-cli/latest' into auto/sync-main-pr
Sep 4, 2025
e66ae68
add ValidateAttribute case
chanel-y Sep 4, 2025
72f8680
remove Invoke-WebRequest as source
chanel-y Sep 4, 2025
44ed048
Merge branch 'main' into powershell-cmd-injection-updates
MathiasVP Sep 5, 2025
c8b2fda
Merge pull request #278 from microsoft/powershell-cmd-injection-updates
MathiasVP Sep 5, 2025
2403ce6
PS: Add case insensitive naming to Attributes.
MathiasVP Sep 5, 2025
0a06da0
PS: Fixup queries.
MathiasVP Sep 5, 2025
04872b7
PS: Accept test changes.
MathiasVP Sep 5, 2025
bd3f774
Merge branch 'main' of https://github.com/microsoft/codeql into auto/…
Sep 5, 2025
42104ec
Merge pull request #279 from microsoft/case-insensitive-attribute-nam…
chanel-y Sep 5, 2025
f2f18fe
Merge branch 'main' of https://github.com/microsoft/codeql into auto/…
Sep 5, 2025
2e290d2
PS: Add false positive
MathiasVP Sep 9, 2025
f87f720
PS: Remove 'inputfile' as an SQL injection sink.
MathiasVP Sep 9, 2025
84c3df2
PS: Accept test changes.
MathiasVP Sep 9, 2025
7a96fec
Merge pull request #281 from microsoft/do-not-warn-on-inputfile
MathiasVP Sep 9, 2025
bc99894
Merge branch 'main' of https://github.com/microsoft/codeql into auto/…
Sep 9, 2025
bce32b4
PS: Fixup libraries after github/codeql#20253.
MathiasVP Sep 10, 2025
6df032d
Merge pull request #277 from microsoft/auto/sync-main-pr
dilanbhalla Sep 10, 2025
b85c176
PS: Add a FP to the sql-injection query.
MathiasVP Sep 11, 2025
7f9930e
PS: Add a barrier to block flow on validated parameters.
MathiasVP Sep 11, 2025
9af1306
PS: Accept test changes.
MathiasVP Sep 11, 2025
e8df3cc
PS: Add another FP test.
MathiasVP Sep 11, 2025
a512b5a
PS: Also use the 'query' predicate for implicit reads.
MathiasVP Sep 11, 2025
6a95515
PS: Accept test changes.
MathiasVP Sep 11, 2025
9681711
Merge pull request #282 from microsoft/sql-injection-powershell-more-…
chanel-y Sep 11, 2025
e1efae5
PS: Add another SQL injection FP.
MathiasVP Sep 11, 2025
e566145
PS: Use the same sinks for '&sqlcmd' as we do for 'Invoke-SqlCmd'.
MathiasVP Sep 11, 2025
c8eb734
PS: Accept test changes.
MathiasVP Sep 11, 2025
90999b3
Merge pull request #283 from microsoft/fix-sqlcmd-sink-ps
MathiasVP Sep 11, 2025
3ab33c7
Migrate wilsonLib dir to public
ropwareJB Sep 11, 2025
2cb9f80
Merge branch 'main' into jb1/ab13144-migration
ropwareJB Sep 11, 2025
1990cf8
qhelp guidance update for java xss
5idg5 Sep 22, 2025
d1f1807
Merge pull request #285 from microsoft/java-xss-guidance-update
MathiasVP Sep 22, 2025
805e6c6
PS: Add QLDoc to a bunch of public AST classes.
MathiasVP Sep 22, 2025
1f775b9
PS: Add 'fieldEdge' to ApiGraphs.
MathiasVP Sep 22, 2025
9916bbb
PS: Add ZipSlip query.
MathiasVP Sep 22, 2025
8d3f6b8
PS: Add tests.
MathiasVP Sep 23, 2025
869c613
PS: Add tests for the new summary models.
MathiasVP Sep 23, 2025
ca2cf5e
PS: Add some more summary models.
MathiasVP Sep 23, 2025
831f25d
PS: Add test for forEach.
MathiasVP Sep 23, 2025
2ec78ed
PS: Fix 'getIterableExpr' on 'ForEachStmtCfgNode'.
MathiasVP Sep 22, 2025
4276405
PS: Add a testcase for the new read step.
MathiasVP Sep 23, 2025
e39d9f9
PS: Add some comments to 'readStep'.
MathiasVP Sep 22, 2025
5692eb0
PS: Add read step for 'foreach' statements.
MathiasVP Sep 22, 2025
93a3833
PS: Accept query test changes.
MathiasVP Sep 23, 2025
ca20eb5
PS: Drive-by improvement: Make ObjectCreationNode a CallNode.
MathiasVP Sep 23, 2025
54226ec
PS: Accept test change to internal MAD ids.
MathiasVP Sep 23, 2025
c83268f
Merge tag 'codeql-cli/latest' into auto/sync-main-pr
MathiasVP Sep 23, 2025
3332f70
PS: Mirror the changes from github/codeql#20300.
MathiasVP Sep 23, 2025
6530fac
PS: Accept library test changes.
MathiasVP Sep 23, 2025
4e690b7
Merge pull request #288 from microsoft/auto/sync-main-pr
dilanbhalla Sep 23, 2025
4f21586
Merge branch 'main' into powershell-add-qldoc
chanel-y Sep 24, 2025
7d9a77a
Merge pull request #286 from microsoft/powershell-add-qldoc
MathiasVP Sep 24, 2025
d7a4063
PS: Respond to review comments.
MathiasVP Sep 24, 2025
abf320b
Merge branch 'main' into add-zipslip-query-ps
MathiasVP Sep 24, 2025
a130224
Merge pull request #287 from microsoft/add-zipslip-query-ps
MathiasVP Sep 24, 2025
12107ec
Merge remote-tracking branch 'ms/main' into jb1/ab13144-migration
ropwareJB Sep 30, 2025
5e8514f
Merge branch 'jb1/ab13144-migration' of github.com:microsoft/codeql i…
ropwareJB Sep 30, 2025
a1bd3a5
PS: Convert tests to do string interpolation. Notice the missing result.
MathiasVP Oct 1, 2025
bfb10a2
PS: Add flow through string subexpressions and accept test changes.
MathiasVP Oct 1, 2025
786db34
Move WilsonLib under "Security Features/JWT"
ropwareJB Oct 1, 2025
a0ab6c4
Merge tag 'codeql-cli/latest' into auto/sync-main-pr
Oct 2, 2025
4ab6f5c
Merge pull request #290 from microsoft/require-string-ops-in-sql-inje…
chanel-y Oct 2, 2025
8ab8e67
Merge branch 'main' of https://github.com/microsoft/codeql into auto/…
Oct 2, 2025
9bc74bd
PS: Mirror the changes from github/codeql#20452.
MathiasVP Oct 2, 2025
aa81060
Merge pull request #291 from microsoft/auto/sync-main-pr
dilanbhalla Oct 2, 2025
97f11a1
Merge branch 'main' into jb1/ab13144-migration
ropwareJB Oct 8, 2025
3759158
Merge pull request #284 from microsoft/jb1/ab13144-migration
ropwareJB Oct 8, 2025
1e1e4c6
PS: Prettify.
MathiasVP Oct 15, 2025
2fba40f
PS: Add a test demonstrating missing a variable.
MathiasVP Oct 15, 2025
294af54
PS: Autoformat.
MathiasVP Oct 15, 2025
6a7c1e9
PS: Ensure that variables whose only assignment is behind a conversio…
MathiasVP Oct 15, 2025
0e39139
PS: Accept test changes.
MathiasVP Oct 15, 2025
76ddb40
Merge tag 'codeql-cli/latest' into auto/sync-main-pr
Oct 17, 2025
83b8f89
Merge pull request #292 from microsoft/fix-missing-variables
MathiasVP Oct 20, 2025
13ef779
Merge branch 'main' of https://github.com/microsoft/codeql into auto/…
Oct 20, 2025
2a0a312
Merge pull request #293 from microsoft/auto/sync-main-pr
dilanbhalla Oct 20, 2025
ab8130e
Reduce Type reference complexity using aliases
ropwareJB Oct 29, 2025
641d379
indendation
ropwareJB Oct 29, 2025
a20e093
All types matching up
ropwareJB Oct 30, 2025
d6adad8
Remove code commented out
ropwareJB Oct 30, 2025
ced775a
Removed commented code
ropwareJB Oct 30, 2025
18ff8d2
Parameterize TaintTrackingStack over Global Dataflow implementation
ropwareJB Nov 4, 2025
7eef5ba
Merge pull request #294 from microsoft/jb1/dataflowstack-overlay
dilanbhalla Nov 4, 2025
cfa09c6
csharp taintrackingstack update to interface
ropwareJB Nov 5, 2025
635b32d
Merge pull request #295 from microsoft/jb1/dataflowstack-overlay2
dilanbhalla Nov 5, 2025
f0ffcd0
DataFlowStack updated
ropwareJB Nov 7, 2025
12969dd
Merge pull request #296 from microsoft/jb1/dataflowstack-java
ropwareJB Nov 7, 2025
b179734
Generic FlowStack module covering both DataFlowStack and TaintTrackin…
ropwareJB Nov 13, 2025
4bf4363
Refactor {Data,TaintTracking}FlowStack
ropwareJB Nov 13, 2025
5087c8d
Merge pull request #297 from microsoft/jb1/flowstack-refactor
ropwareJB Nov 14, 2025
a26da74
resolved merge conflicts, accepting incoming change
chanel-y Nov 14, 2025
fe4dc76
Merge pull request #298 from microsoft/resolve-2.23.5-conflict
dilanbhalla Nov 16, 2025
c612fbb
PS: Always show string interpolated expressions in the path graph.
MathiasVP Nov 21, 2025
7935528
PS: Accept query path changes.
MathiasVP Nov 21, 2025
78384ca
Merge branch 'main' into never-hide-string-interpolate-args-in-paths
chanel-y Nov 21, 2025
92e83f9
Merge pull request #300 from microsoft/never-hide-string-interpolate-…
MathiasVP Nov 21, 2025
96b7bf4
PS: Require string concat in the SQL injection query.
MathiasVP Nov 21, 2025
c163416
PS: Accep test changes.
MathiasVP Nov 21, 2025
651cc04
Merge pull request #301 from microsoft/actually-require-string-concat
chanel-y Nov 21, 2025
73b3e02
C++: Add a small library for control-flow reachability.
MathiasVP Dec 2, 2025
f50bce6
C++: Port 'positive' part of the query to the new module.
MathiasVP Dec 2, 2025
c4723c8
C++: Port toe fhrst part of the negation to the new module.
MathiasVP Dec 2, 2025
682ef75
C++: Port the final part of the negation to the new module.
MathiasVP Dec 2, 2025
2515b12
Merge pull request #303 from microsoft/speedup-unchecked-return-value…
MathiasVP Dec 2, 2025
3c8d07b
C++: Add a new library for constructing macro flow.
MathiasVP Dec 2, 2025
eba5208
Merge pull request #304 from microsoft/macro-flow
MathiasVP Dec 2, 2025
c0d29f2
Initial refactor to address false positives in sizeof misuse queries.
bdrodes Dec 2, 2025
dff05eb
C++: Support macro flow when the macro generates a child expression o…
MathiasVP Dec 5, 2025
91b12ae
Additional FP tweaking, removing redundant test cases, not sure why t…
bdrodes Dec 5, 2025
5262824
Update cpp/ql/src/Microsoft/Likely Bugs/SizeOfMisuse/SizeOfConstIntMa…
bdrodes Dec 5, 2025
c6b48c3
updated comment.
bdrodes Dec 5, 2025
3cdeb38
Merge pull request #305 from microsoft/brodes/sizeof_query_fp_fixes
MathiasVP Dec 5, 2025
9ddba14
Update next dependency version to 15.1.9
scovetta Dec 5, 2025
80b6ab1
Merge pull request #307 from scovetta/patch-1
dilanbhalla Dec 5, 2025
1ad548b
Merge pull request #306 from microsoft/macro-flow-partial-expr
MathiasVP Dec 8, 2025
cffde88
Manual merge javascript/ql/lib/semmle/javascript/dataflow/internal/Da…
ropwareJB Dec 15, 2025
1dd488b
Merge pull request #308 from microsoft/jb1/sync-upstream-2-23-8
ropwareJB Dec 15, 2025
d2cefd2
False positive fix regarding common type check idioms.
bdrodes Dec 16, 2025
a412b91
Simplifying sizeof query output messages, and making both consistent …
bdrodes Dec 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,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
152 changes: 152 additions & 0 deletions .github/workflows/microsoft-codeql-pack-publish.yml
Original file line number Diff line number Diff line change
@@ -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 }}

32 changes: 32 additions & 0 deletions .github/workflows/powershell-pr-check.yml
Original file line number Diff line number Diff line change
@@ -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
28 changes: 28 additions & 0 deletions .github/workflows/sync-main-tags.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 91 additions & 0 deletions .github/workflows/sync-main.yml
Original file line number Diff line number Diff line change
@@ -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 }}

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "iac"]
path = iac
url = https://github.com/advanced-security/codeql-extractor-iac
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 41 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -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 -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
category: feature
---
* Added a new class `AdditionalCallTarget` for specifying additional call targets.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ private string normalizeFunctionName(Function f, string algType) {
(result.matches("RSA") implies not f.getName().toUpperCase().matches("%UNIVERSAL%")) and
//rsaz functions deemed to be too low level, and can be ignored
not f.getLocation().getFile().getBaseName().matches("rsaz_exp.c") and
// SHA false positives
(result.matches("SHA") implies not f.getName().toUpperCase().matches("%SHAKE%")) and
// CAST false positives
(result.matches("CAST") implies not f.getName().toUpperCase().matches(["%UPCAST%", "%DOWNCAST%"])) and
// General False positives
// Functions that 'get' do not set an algorithm, and therefore are considered ignorable
not f.getName().toLowerCase().matches("%get%")
Expand Down
1 change: 1 addition & 0 deletions cpp/ql/lib/qlpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies:
codeql/tutorial: ${workspace}
codeql/util: ${workspace}
codeql/xml: ${workspace}
codeql/global-controlflow: ${workspace}
dataExtensions:
- ext/*.model.yml
- ext/generated/**/*.model.yml
Expand Down
Loading
Loading