Skip to content

Sync Upstream Tags #19342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 780 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
780 commits
Select commit Hold shift + click to select a range
350742a
Merge branch 'main' into brodes/open_source_query_transition
bdrodes Jan 28, 2025
81fa6fc
Merge pull request #155 from microsoft/brodes/open_source_query_trans…
dilanbhalla Jan 29, 2025
e4378b2
All languages: Get rid of the Microsoft modifications to the GitHub d…
MathiasVP Jan 30, 2025
464ae8b
Shared: Autoformat.
MathiasVP Jan 30, 2025
c825ca8
Shared: Refactor DataFlowStack so that we don't depend on our own mod…
MathiasVP Jan 30, 2025
ee6624a
Merge pull request #157 from microsoft/dataflow-stack-cleanup
dilanbhalla Jan 30, 2025
d144c26
Java/C#: Add missing files.
MathiasVP Jan 30, 2025
3237b2c
Merge pull request #158 from microsoft/dataflow-stack-cleanup-2
dilanbhalla Jan 30, 2025
712d8aa
Java: Update file that was forgotten in the dataflow-stack PR.
MathiasVP Jan 31, 2025
403ad3c
Shared: Add missing transitive closure.
MathiasVP Jan 31, 2025
29d07ae
Merge pull request #159 from microsoft/dataflow-stack-cleanup-3
MathiasVP Jan 31, 2025
7140361
removing javascript dataflow deprecations
Jan 31, 2025
34a577d
missed deprecation label removal for code injection query
Jan 31, 2025
a88f3ce
Merge pull request #160 from microsoft/dilan/remove-js-dataflow-depre…
dilanbhalla Jan 31, 2025
54f0bc1
adding msft namespace to msft query ids
Feb 4, 2025
cd9a0f1
Merge pull request #161 from microsoft/dilan/query-id-msft-namespace
raulgarciamsft Feb 4, 2025
c43b682
PS: Ensure that the PowerShell CFG library compiles with CodeQL versi…
MathiasVP Feb 6, 2025
14ab30c
Update DoNotUseInvokeExpression.ql
dilanbhalla Feb 6, 2025
fa74d05
Update CommandInjection.ql
dilanbhalla Feb 6, 2025
c749c19
Update CommandInjection.ql
dilanbhalla Feb 6, 2025
9be5b3c
Merge pull request #163 from microsoft/update-powershell-cfg-library-…
dilanbhalla Feb 6, 2025
b0c11b5
Merge tag 'codeql-cli/latest'
Feb 6, 2025
312bc52
adding msft open source tests
Feb 7, 2025
ba97b92
microsoft public namespace edit
Feb 7, 2025
642780e
C++: Accept more test changes.
MathiasVP Feb 7, 2025
7f7e934
Merge pull request #164 from microsoft/dilan/include-microsoft-public…
MathiasVP Feb 7, 2025
414feff
microsoft-public -> public
Feb 7, 2025
e200aa5
Merge branch 'main' into dilan/microsoft-namespace-edit
dilanbhalla Feb 7, 2025
e7bb37a
Merge pull request #165 from microsoft/dilan/microsoft-namespace-edit
dilanbhalla Feb 7, 2025
41b5d19
resolving ruby df error
Feb 7, 2025
233c0cf
Merge pull request #166 from microsoft/dilan/resolve-ruby-df-error
dilanbhalla Feb 8, 2025
6ed2eb1
Ruby: Update internal dataflow files.
MathiasVP Feb 10, 2025
d5f75d4
Merge pull request #167 from microsoft/update-ruby-internal-dataflow-…
dilanbhalla Feb 10, 2025
898e4ff
reduce powershell pr check perms
dilanbhalla Feb 10, 2025
6ccedeb
Update sync-main.yml
dilanbhalla Feb 10, 2025
ad32991
Merge pull request #168 from microsoft/dilan/reduce-pr-check-perms
dilanbhalla Feb 10, 2025
9ba49ad
Update ArgumentIsSizeofOrOperation.ql
dilanbhalla Feb 12, 2025
5c54c81
Merge pull request #169 from microsoft/dilan/metadata-bug-cpp
raulgarciamsft Feb 13, 2025
6ef0941
PS: Add .NET and PowerShell SDK type models.
MathiasVP Feb 19, 2025
3dbe7f4
PS: Add the type model generation script and add a short readme.
MathiasVP Feb 19, 2025
61796da
Merge pull request #171 from microsoft/ps-add-dotnet-type-models
MathiasVP Feb 19, 2025
efb43bc
PS: Match the changes from #18696.
MathiasVP Feb 21, 2025
6909792
PS: Also get rid of an easy-to-fix SSA warning.
MathiasVP Feb 21, 2025
d76e438
Merge pull request #173 from microsoft/powershell-update-basic-block-…
dilanbhalla Feb 21, 2025
0628e49
Merge tag 'codeql-cli/latest'
Feb 21, 2025
1978e10
PS: Remove extractor option to skip psmodule extraction.
MathiasVP Feb 24, 2025
4bfd6fd
PS: Revert psmodule path file extraction.
MathiasVP Feb 24, 2025
5b5b153
PS: Make the prepare db script work on the Microsoft repo.
MathiasVP Feb 24, 2025
29c11a4
PS: Add upgrade and downgrade scripts.
MathiasVP Feb 24, 2025
abc23e0
Merge branch 'main' into revert-ps-module-extraction
MathiasVP Feb 26, 2025
4e6f463
Merge pull request #174 from microsoft/revert-ps-module-extraction
MathiasVP Feb 26, 2025
ee2688f
Update project to net 8.
gfs Feb 26, 2025
43cdff9
Update dependencies.
gfs Feb 26, 2025
b018fb9
Add gitignore for build artifacts from powershell extractor
gfs Feb 26, 2025
17ae251
Update powershell-pr-check.yml
dilanbhalla Feb 27, 2025
2172ced
Merge pull request #176 from microsoft/dilan/powershell-pr-token
MathiasVP Feb 27, 2025
faa51c1
Merge branch 'main' into gfs/PowershellExtractorNetUpgrade
MathiasVP Feb 27, 2025
4ddc425
Merge pull request #175 from gfs/gfs/PowershellExtractorNetUpgrade
MathiasVP Feb 27, 2025
0869a11
Merge tag 'codeql-cli/latest'
Mar 6, 2025
4c13821
Merge tag 'codeql-cli/latest'
Mar 18, 2025
44e4e3e
PS: Extract more powershell files and fix off-by-one error in locations.
MathiasVP Mar 25, 2025
d79eb01
PS: Delete the old AST.
MathiasVP Mar 26, 2025
6652021
PS: Add user-facing AST classes.
MathiasVP Mar 26, 2025
a207c80
PS: Add 'raw' AST classes coming directly from the extractor.
MathiasVP Mar 26, 2025
b52c6ea
PS: Add control-flow node version of all the user-facing ast classes.
MathiasVP Mar 26, 2025
11c84cc
PS: Add the IPA type representing the AST.
MathiasVP Mar 26, 2025
0dd756d
PS: Add support for variables.
MathiasVP Mar 26, 2025
31f14ba
PS: Add synthesis framework for cleaning up the AST.
MathiasVP Mar 26, 2025
faa9473
PS: Add an implicit this parameter to all methods.
MathiasVP Mar 26, 2025
5bc0a26
PS: A call to set-variable is an explicit assignment.
MathiasVP Mar 26, 2025
0b4a7f9
PS: Synthesize a simpler notion of parameters.
MathiasVP Mar 26, 2025
1766134
PS: expr-to-stmt conversions.
MathiasVP Mar 26, 2025
8eb5e65
PS: Synthesize Function and Type classes instead of relying on the st…
MathiasVP Mar 26, 2025
3bb6021
PS: Remove the CmdExpr AST elements and synthesize StmtExpr instead w…
MathiasVP Mar 26, 2025
7adb020
PS: Remove arguments that are just names for a named argument.
MathiasVP Mar 26, 2025
9f4d1c6
PS: PowerShell doesn't have a notion of true, false, null, etc. In th…
MathiasVP Mar 26, 2025
171f5ca
PS: Inside a process block the name of a pipeline parameter actually …
MathiasVP Mar 26, 2025
cc13922
PS: Make the experimental query compile again.
MathiasVP Mar 26, 2025
9efc3ec
PS: Make dataflow compile again.
MathiasVP Mar 25, 2025
c2e24ea
PS: Make CFG construction compile again.
MathiasVP Mar 25, 2025
8f9bc1e
PS: Make SSA compile again.
MathiasVP Mar 25, 2025
8092345
PS: Make type-tracking and taint-tracking compile again.
MathiasVP Mar 25, 2025
7551cce
PS: Make API graphs compile again. There is still some TODOs here, bu…
MathiasVP Mar 25, 2025
655d80e
PS: Repair tests and accept test changes in syntax tests.
MathiasVP Mar 26, 2025
c840f86
PS: Accept CFG test changes.
MathiasVP Mar 26, 2025
0fc5778
PS: Accept dataflow/taint-tracking/type-tracking regressions.
MathiasVP Mar 27, 2025
cea435c
Merge pull request #178 from microsoft/powershell-ipa-the-ast
MathiasVP Mar 27, 2025
dcb98ab
PS: Don't include the this parameter in getParameter.
MathiasVP Mar 27, 2025
7b9a41a
PS: Handle this parameters in a few more places.
MathiasVP Mar 27, 2025
ee0a21e
PS: Make child mapping classes private.
MathiasVP Mar 28, 2025
2da8da0
PS: Add helper predicates for if statements.
MathiasVP Mar 28, 2025
18d94f2
PS: Don't include the variable in the IPA definition for variable acc…
MathiasVP Mar 28, 2025
19454a5
PS: Small additions to the CFG classes and a small bugfix.
MathiasVP Mar 28, 2025
f85767f
PS: add a super class for all loop-related CFG nodes.
MathiasVP Mar 28, 2025
a9861e1
PS: Add a library that calculated escaping values much more efficient…
MathiasVP Mar 28, 2025
ee8c586
PS: Use the new library to calculate returned expressions.
MathiasVP Mar 28, 2025
b2cf155
PS: Define pre-return node and implicit-wrapping nodes using the scri…
MathiasVP Mar 28, 2025
5d5448d
PS: Also use the new library to handle array expressions.
MathiasVP Mar 28, 2025
3643b93
fixup! PS: Define pre-return node and implicit-wrapping nodes using t…
MathiasVP Mar 28, 2025
7102ebb
PS: Accept test changes.
MathiasVP Mar 28, 2025
e17a169
Merge pull request #180 from microsoft/powershell-ast-modernization-f…
MathiasVP Mar 28, 2025
a6a1734
PS: Easier debugging with strings for child indices.
MathiasVP Mar 29, 2025
ee4104b
PS: Fix parent-child mapping for iterator pipeline access synthesis.
MathiasVP Mar 29, 2025
88f638d
PS: Fix more pipeline flow.
MathiasVP Mar 31, 2025
0b9720c
PS: Accept test changes.
MathiasVP Mar 31, 2025
08dc818
PS: Add Chanel's missing flow example.
MathiasVP Apr 1, 2025
129b787
PS: Allow shadowing of automatic variables.
MathiasVP Apr 1, 2025
8ae92a5
PS: Accept test changes.
MathiasVP Apr 1, 2025
898297b
Merge pull request #181 from microsoft/powershell-ast-modernization-f…
chanel-y Apr 1, 2025
1c380fb
PS: Add another missing flow found by Chanel.
MathiasVP Apr 1, 2025
5fa3beb
PS: Normalize parameter keywords and accept test changes.
MathiasVP Apr 1, 2025
b452339
Merge pull request #182 from microsoft/fix-parameter-by-name-flow-2
chanel-y Apr 1, 2025
6125973
C#: Add a hash-cons library for C#.
MathiasVP Apr 3, 2025
70ca686
C#: Make a few more modules private.
MathiasVP Apr 3, 2025
cd8e5e6
PS: Subclass AnyElement into positional or key-ional.
MathiasVP Apr 1, 2025
4d04b11
PS: Add some implicit reads at process blocks, and fix CFG for proces…
MathiasVP Apr 3, 2025
3acbd83
PS: Drive-by fix: The variable access in a foreach loop implicitly wr…
MathiasVP Apr 3, 2025
86ec291
PS: Improve toString on phi nodes.
MathiasVP Apr 3, 2025
5151eb3
PS: Add dataflow for pipeline-by-property-name variables.
MathiasVP Apr 3, 2025
38536a9
PS: Accept test changes.
MathiasVP Apr 3, 2025
7c59a74
Merge pull request #184 from microsoft/fix-parameter-by-name-flow-3
chanel-y Apr 3, 2025
656b734
initial query
chanel-y Apr 3, 2025
22ff3a3
Merge branch 'main' of https://github.com/microsoft/codeql into power…
chanel-y Apr 3, 2025
403c182
PS: Fixup SSA after GitHub's recent changes.
MathiasVP Apr 3, 2025
2f215c1
PS: Accept test changes.
MathiasVP Apr 3, 2025
e261510
Merge branch 'main' into hashcons-for-csharp
ropwareJB Apr 3, 2025
6873eba
Merge pull request #185 from microsoft/fix-ssa-for-powershell-2
dilanbhalla Apr 3, 2025
50c57c2
PS: Drive-by: Assign a location to top-level functions.
MathiasVP Apr 3, 2025
4b14e5e
PS: Lift automatic variables to the cfg and dataflow layers.
MathiasVP Apr 3, 2025
4df449d
PS: Add an edge from the root node to automatic variables, and from a…
MathiasVP Apr 3, 2025
22bdcf0
PS: Force lower casing on method edges.
MathiasVP Apr 3, 2025
c5c3236
Merge branch 'main' into hashcons-for-csharp
ropwareJB Apr 3, 2025
16348b5
PS: Consistently use the pipeline parameter as the parameter when it …
MathiasVP Apr 4, 2025
ebc7327
PS: Get rid of the pipelineVARIABLE and only have pipelinePARAMETER (…
MathiasVP Apr 4, 2025
cdd68b3
PS: Improve the location of synthesized variables.
MathiasVP Apr 4, 2025
03f3561
PS: Accept test changes.
MathiasVP Apr 4, 2025
f482c9d
PS: Make the implementation of 'getExtraNodeFromType' more complete. …
MathiasVP Apr 4, 2025
65abf48
PS: Add missing taint-flow and dataflow dispatch from models.
MathiasVP Apr 4, 2025
8a58af8
PS: Add a model for 'EscapeSingleQuotedStringContent' and add a test.
MathiasVP Apr 4, 2025
a2d4296
Merge branch 'main' into powershell-automatic-variables-as-member-edges
chanel-y Apr 4, 2025
38f0f07
modeled some user input, sanitizers
chanel-y Apr 4, 2025
6db354e
Merge branch 'main' of https://github.com/microsoft/codeql into power…
chanel-y Apr 4, 2025
6da7e4c
Update sync-main.yml
dilanbhalla Apr 4, 2025
e0b8e20
Update sync-main.yml
dilanbhalla Apr 4, 2025
2af5513
Update sync-main.yml
dilanbhalla Apr 4, 2025
6cbc80a
Merge pull request #187 from microsoft/dilan/sync-main-createpr
dilanbhalla Apr 4, 2025
3c45925
Update sync-main.yml
dilanbhalla Apr 4, 2025
452f56f
Merge pull request #188 from microsoft/dilan/sync-main-trigger
dilanbhalla Apr 4, 2025
157c57a
Update sync-main.yml
dilanbhalla Apr 4, 2025
13e5305
Merge pull request #189 from microsoft/dilan/sync-main-bugs-1
dilanbhalla Apr 4, 2025
cda36a8
Update sync-main.yml
dilanbhalla Apr 4, 2025
8568260
Merge branch 'main' into dilan/sync-main-bugs-2
dilanbhalla Apr 4, 2025
52ceda1
Merge pull request #190 from microsoft/dilan/sync-main-bugs-2
dilanbhalla Apr 4, 2025
e0a6a4e
Update sync-main.yml
dilanbhalla Apr 4, 2025
fb938ab
Merge pull request #191 from microsoft/dilan/sync-main-bugs-3
dilanbhalla Apr 4, 2025
3c92f6b
Update sync-main.yml
dilanbhalla Apr 4, 2025
41406d1
Merge pull request #192 from microsoft/dilan/sync-main-bugs-4
dilanbhalla Apr 4, 2025
ae5709d
Update sync-main.yml
dilanbhalla Apr 5, 2025
e098dd3
Merge pull request #193 from microsoft/dilan/sync-main-bugs-5
dilanbhalla Apr 8, 2025
7e90d99
Update sync-main.yml
dilanbhalla Apr 8, 2025
db6d82c
Update sync-main.yml
dilanbhalla Apr 8, 2025
c1665fd
Update sync-main.yml
dilanbhalla Apr 8, 2025
dc9fdb5
Update sync-main.yml
dilanbhalla Apr 8, 2025
b676246
Update sync-main.yml
dilanbhalla Apr 8, 2025
75fb343
Update sync-main.yml
dilanbhalla Apr 8, 2025
d81989f
Update sync-main.yml
dilanbhalla Apr 8, 2025
ed31f43
Update sync-main.yml
dilanbhalla Apr 8, 2025
e2bac16
Update sync-main.yml
dilanbhalla Apr 8, 2025
0d40476
Update sync-main.yml
dilanbhalla Apr 8, 2025
9442bf3
Update sync-main.yml
dilanbhalla Apr 8, 2025
3324c30
Update sync-main.yml
dilanbhalla Apr 8, 2025
d384e41
Update sync-main.yml
dilanbhalla Apr 8, 2025
bc8220f
Update sync-main.yml
dilanbhalla Apr 8, 2025
71ccc96
Update sync-main.yml
dilanbhalla Apr 8, 2025
7259356
Update sync-main.yml
dilanbhalla Apr 8, 2025
3a630ad
Update sync-main.yml
dilanbhalla Apr 8, 2025
d92e61e
Update sync-main.yml
dilanbhalla Apr 8, 2025
9a59b1c
Update sync-main.yml
dilanbhalla Apr 8, 2025
9bbffb6
Update sync-main.yml
dilanbhalla Apr 8, 2025
eb41d97
Update sync-main.yml
dilanbhalla Apr 8, 2025
be4f1f1
Update sync-main.yml
dilanbhalla Apr 8, 2025
7a168b0
Update sync-main.yml
dilanbhalla Apr 8, 2025
544f0ca
Update sync-main.yml
dilanbhalla Apr 8, 2025
826d43d
Update sync-main.yml
dilanbhalla Apr 8, 2025
9f2b3eb
Update sync-main.yml
dilanbhalla Apr 8, 2025
87d5592
Update sync-main.yml
dilanbhalla Apr 8, 2025
d2eadbf
Update sync-main.yml
dilanbhalla Apr 8, 2025
2a8c8db
Update sync-main.yml
dilanbhalla Apr 8, 2025
98338fe
Update sync-main.yml
dilanbhalla Apr 8, 2025
3d57ea9
Update sync-main.yml
dilanbhalla Apr 8, 2025
a7dcc9f
Update sync-main.yml
dilanbhalla Apr 8, 2025
1e24627
Merge tag 'codeql-cli/latest' into auto/sync-main-pr
github-actions[bot] Apr 8, 2025
70f9401
Update sync-main.yml
dilanbhalla Apr 8, 2025
79909e9
Update sync-main.yml
dilanbhalla Apr 8, 2025
7612ef9
Merge pull request #186 from microsoft/powershell-automatic-variables…
MathiasVP Apr 9, 2025
02c027d
Merge pull request #183 from microsoft/hashcons-for-csharp
MathiasVP Apr 9, 2025
f38c5f5
PS: Add lots of models.
MathiasVP Apr 4, 2025
763effb
PS: Add more models and support pipeline parameters in MaD.
MathiasVP Apr 8, 2025
5f12d7c
PS: Taint flow through all calls to 'toString'.
MathiasVP Apr 8, 2025
a5afc3c
PS: Flow through pipelines.
MathiasVP Apr 8, 2025
6de4765
PS: Support implicit imports in API graphs.
MathiasVP Apr 8, 2025
ebb91dc
PS: Add a few more models after fixing MaD for Element content.
MathiasVP Apr 8, 2025
f8207fa
PS: Add a testcase to demonstrate flow through Join-String.
MathiasVP Apr 8, 2025
a93d65b
Update sync-main.yml
dilanbhalla Apr 9, 2025
e7edf1b
Update sync-main.yml
dilanbhalla Apr 9, 2025
88a7c3a
Update sync-main.yml
dilanbhalla Apr 9, 2025
0d97cd6
Merge branch 'main' of https://github.com/microsoft/codeql into auto/…
Apr 9, 2025
86b3eae
Merge branch 'main' into dilan/sync-main-bugs-6
dilanbhalla Apr 9, 2025
b8b4e44
Update sync-main.yml
dilanbhalla Apr 9, 2025
c5b024a
Update sync-main.yml
dilanbhalla Apr 9, 2025
0f034b3
Merge pull request #194 from microsoft/dilan/sync-main-bugs-6
dilanbhalla Apr 9, 2025
89ddb30
Merge pull request #197 from microsoft/auto/sync-main-pr
dilanbhalla Apr 9, 2025
b55ee68
Merge branch 'main' into autogenerate-lots-of-models
MathiasVP Apr 9, 2025
419de4f
Merge pull request #196 from microsoft/autogenerate-lots-of-models
chanel-y Apr 9, 2025
4628c18
Update sync-main.yml
dilanbhalla Apr 10, 2025
5abde74
Merge pull request #198 from microsoft/dilan/sync-main-bugs-7
dilanbhalla Apr 10, 2025
793fd5e
PS: Delete a redundant file.
MathiasVP Apr 10, 2025
6084789
PS: Fix the top level arguments after the AST cleanup.
MathiasVP Apr 10, 2025
bf9ed3b
PS: Accept test changes.
MathiasVP Apr 10, 2025
9adf028
PS: Fix environment variables.
MathiasVP Apr 10, 2025
4aa9f85
PS: Accept test changes.
MathiasVP Apr 10, 2025
1637df0
Merge pull request #199 from microsoft/fix-top-level-arguments
chanel-y Apr 10, 2025
43de3a1
PS: Use the existing MaD rows to model file reads as flow sources.
MathiasVP Apr 10, 2025
3d18175
PS: Make it possible to specify a named argument that must be present…
MathiasVP Apr 10, 2025
6455992
PS: Add two more flow sources.
MathiasVP Apr 10, 2025
b4d8673
Merge branch 'main' of https://github.com/microsoft/codeql into power…
chanel-y Apr 14, 2025
9935117
PS: Make method names lower case.
MathiasVP Apr 15, 2025
f389487
PS: Make type names lower case.
MathiasVP Apr 15, 2025
43d9c70
PS: Rename Field and Property to Member.
MathiasVP Apr 15, 2025
a146630
PS: Delete redundant files.
MathiasVP Apr 15, 2025
fa3fc4a
PS: Fix more problems in MaD rows for sources.
MathiasVP Apr 15, 2025
dcc1278
PS: Make remote flow sources flow sources.
MathiasVP Apr 15, 2025
826e6a9
PS: Add an inline expectations test library for flow sources.
MathiasVP Apr 15, 2025
396a283
PS: Add tests for flow sources.
MathiasVP Apr 15, 2025
c9b1356
Merge pull request #200 from microsoft/files-reads-as-flow-sources
chanel-y Apr 16, 2025
5f64350
added script block, expandstring sinks, moved sanitizers to separate …
chanel-y Apr 16, 2025
50a771e
Merge branch 'main' into powershell-injectionhunter-port
chanel-y Apr 16, 2025
2266cd2
moved folder, added tests/docs
chanel-y Apr 16, 2025
ed553d3
merged work into CommandInjection query
chanel-y Apr 16, 2025
b09d9f6
PS: Autoformat.
MathiasVP Apr 17, 2025
7d72683
PS: Add an example with a missing toString.
MathiasVP Apr 17, 2025
b70f7e2
PS: Fix missing toString and accept test changes.
MathiasVP Apr 17, 2025
12b918e
pr feedback: removed toString, updated .expected
chanel-y Apr 17, 2025
fe7d8ff
Merge pull request #201 from microsoft/powershell-injectionhunter-port
chanel-y Apr 17, 2025
e7e88d3
PS: Add upgrade script from some unknown dbscheme to the dbscheme tha…
MathiasVP Apr 18, 2025
4518f18
PS: Delete a cycle in the upgrade script.
MathiasVP Apr 18, 2025
21210c6
Merge pull request #203 from microsoft/add-missing-downgrade-and-upgr…
MathiasVP Apr 18, 2025
37a6b04
Merge branch 'main' into fix-to-string-on-unknown-static-read
chanel-y Apr 18, 2025
03bce1c
Merge pull request #202 from microsoft/fix-to-string-on-unknown-stati…
chanel-y Apr 18, 2025
7553e14
sync upstream tags to main
Apr 21, 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
  •  
  •  
  •  
28 changes: 28 additions & 0 deletions .github/workflows/powershell-pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: PowerShell PR Check

on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
powershell-pr-check:
name: powershell-pr-check
runs-on: ubuntu-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: Compile PowerShell Queries
run: |
codeql query compile --check-only --keep-going powershell/ql/src
27 changes: 27 additions & 0 deletions .github/workflows/sync-main-tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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 fetch upstream --tags --force
git push --force origin --tags
env:
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
88 changes: 88 additions & 0 deletions .github/workflows/sync-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
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
- 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
Copy link
Preview

Copilot AI Apr 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider replacing the custom exit code handling with a more standard approach (such as appending '|| true' to the git pull command) to improve readability and maintainability.

Suggested change
git pull origin auto/sync-main-pr; exitCode=$?; if [ $exitCode -ne 0 ]; then exitCode=0; fi
git pull origin auto/sync-main-pr || true

Copilot uses AI. Check for mistakes.

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:
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 }}
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
21 changes: 13 additions & 8 deletions cpp/ql/lib/semmle/code/cpp/models/implementations/Iterator.qll
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ private class IteratorTraits extends Class {
}

Type getIteratorType() { result = this.getTemplateArgument(0) }

Type getValueType() {
exists(TypedefType t |
this.getAMember() = t and
t.getName() = "value_type" and
result = t.getUnderlyingType()
)
}
}

/**
Expand All @@ -34,16 +42,13 @@ private class IteratorTraits extends Class {
*/
private class IteratorByTraits extends Iterator {
IteratorTraits trait;
IteratorByTraits() {
trait.getIteratorType() = this and
not trait.getValueType() = this
}

IteratorByTraits() { trait.getIteratorType() = this }
override Type getValueType() { result = trait.getValueType() }

override Type getValueType() {
exists(TypedefType t |
trait.getAMember() = t and
t.getName() = "value_type" and
result = t.getUnderlyingType()
)
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It is not safe to assume that a year is 365 days long.</p>

<recommendation>
<p>Determine whether the time span in question contains a leap day, then perform the calculation using the correct number
of days. Alternatively, use an established library routine that already contains correct leap year logic.</p>
of days. Alternatively, use an established library routine that already contains correct leap year logic.</p>
</recommendation>

<references>
Expand Down
10 changes: 6 additions & 4 deletions cpp/ql/src/Likely Bugs/Leap Year/Adding365DaysPerYear.ql
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@
* value of 365, it may be a sign that leap years are not taken
* into account.
* @kind problem
* @problem.severity warning
* @id cpp/leap-year/adding-365-days-per-year
* @problem.severity error
* @id cpp/microsoft/public/leap-year/adding-365-days-per-year
* @precision medium
* @tags leap-year
* correctness
*/

import cpp
import LeapYear
import semmle.code.cpp.dataflow.new.DataFlow

from Expr source, Expr sink
where
PossibleYearArithmeticOperationCheckFlow::flow(DataFlow::exprNode(source),
DataFlow::exprNode(sink))
select sink,
"An arithmetic operation $@ that uses a constant value of 365 ends up modifying this date/time, without considering leap year scenarios.",
source, source.toString()
"$@: This arithmetic operation $@ uses a constant value of 365 ends up modifying the date/time located at $@, without considering leap year scenarios.",
sink.getEnclosingFunction(), sink.getEnclosingFunction().toString(), source, source.toString(),
sink, sink.toString()
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @name Leap Year Invalid Check (AntiPattern 5)
* @description An expression is used to check a year is presumably a leap year, but the conditions used are insufficient.
* @kind problem
* @problem.severity warning
* @id cpp/microsoft/public/leap-year/invalid-leap-year-check
* @precision medium
* @tags leap-year
* correctness
*/

import cpp
import LeapYear

from Mod4CheckedExpr exprMod4
where not exists(ExprCheckLeapYear lyCheck | lyCheck.getAChild*() = exprMod4)
select exprMod4, "Possible Insufficient Leap Year check (AntiPattern 5)"
Loading
Loading