Compare commits

...

2914 Commits

Author SHA1 Message Date
Dave Bartolomeo
b7f0b7afb5 Merge pull request #16489 from github/release-prep/2.17.3
Release preparation for version 2.17.3
2024-05-14 15:43:46 -04:00
github-actions[bot]
100166fa53 Release preparation for version 2.17.3 2024-05-14 19:23:18 +00:00
Chris Smowton
d76182b945 Merge pull request #16468 from smowton/smowton/admin/add-buildless-timeout-tests
Java: add test cases for Maven and Gradle stalling in buildless mode
2024-05-14 19:13:03 +01:00
Chris Smowton
829707528b Merge pull request #16488 from smowton/smowton/admin/document-test-servers
Java: Add comments to tests that spawn an HTTP/S server
2024-05-14 18:11:20 +01:00
Chris Smowton
cf134331a9 Java: Add comments to tests that spawn an HTTP/S server 2024-05-14 17:48:35 +01:00
Chris Smowton
61cd93fcf3 Switch to a different black-hole IP, because Windows blocks 240.0.0.0/24 2024-05-14 17:36:50 +01:00
Chris Smowton
e699b18928 Java: add test cases for Maven and Gradle stalling in buildless mode 2024-05-14 17:36:49 +01:00
Chris Smowton
1b1367eec0 Merge pull request #16479 from smowton/smowton/admin/test-java-trust-store-inheritence
Java: Add test case for a custom Java trust store
2024-05-14 17:35:26 +01:00
Chris Smowton
8814e6e2bd Replace deprecated ssl.wrap_socket method 2024-05-14 15:14:27 +01:00
Chuan-kai Lin
99335e5f29 Merge pull request #16421 from github/cklin/java-entities-reorder
Java: Use entities in reorder directives
2024-05-14 06:03:52 -07:00
Joe Farebrother
027e5e7291 Merge pull request #16300 from joefarebrother/python-pyramid
Python: Model the Pyramid framework
2024-05-14 13:24:19 +01:00
Joe Farebrother
904799b674 Merge pull request #16105 from joefarebrother/python-promote-header-injection
Python: Promote Header Injection query from experimental
2024-05-14 13:23:58 +01:00
Michael Nebel
79c6834aa3 Merge pull request #16374 from michaelnebel/java/narrowsuperimpl
Java: Improve finding best type for models and lifting.
2024-05-14 13:12:04 +02:00
Óscar San José
e65a62c727 Merge pull request #16485 from github/oscarsj/fix-lfs-probe-auth-in-cs
make sure GITHUB_TOKEN exists and is not empty before using it in auth headers
2024-05-14 11:49:20 +02:00
Óscar San José
9105faa3fd make sure GITHUB_TOKEN exists and is not empty before using it in auth headers 2024-05-14 11:22:07 +02:00
Óscar San José
faa2dcee24 test GITHUB_TOKEN non-emptyness before using it in auth headers 2024-05-14 11:18:18 +02:00
Joe Farebrother
a62ce4c51d Merge pull request #16461 from joefarebrother/csharp-missing-cwe-metadata
C#: Add missing CWE tags
2024-05-14 09:32:06 +01:00
Óscar San José
5b572a2c2a make GITHUB_TOKEN in lfs_probe a fallback rather than an override 2024-05-14 10:24:02 +02:00
Anders Schack-Mulligen
ed0717af96 Merge pull request #16478 from aschackmull/java/hasqualifiedname
Java: Clean up some instances of getQualifiedName.
2024-05-14 09:19:25 +02:00
Joe Farebrother
513a319149 Change cwe to 348 2024-05-13 22:38:47 +01:00
Chuan-kai Lin
b34fb7c26b Merge pull request #16423 from github/cklin/python-entities-reorder
Python: Use entities in reorder directives
2024-05-13 10:26:55 -07:00
Chuan-kai Lin
1758a1e04b Merge pull request #16422 from github/cklin/javascript-entities-reorder
JS: Use entities in reorder directives
2024-05-13 10:26:41 -07:00
Chuan-kai Lin
9456eaf5d3 Merge pull request #16420 from github/cklin/go-entities-reorder
Go: Use entities in reorder directives
2024-05-13 10:26:04 -07:00
Chuan-kai Lin
372746ffd4 Merge pull request #16419 from github/cklin/csharp-entities-reorder
C#: Use entities in reorder directives
2024-05-13 10:25:50 -07:00
Chris Smowton
10e1bfcee5 Add test case for a custom Java trust store 2024-05-13 12:43:06 +01:00
Anders Schack-Mulligen
76e740bc1d Java: Clean up some instances of getQualifiedName. 2024-05-13 13:06:44 +02:00
Paolo Tranquilli
5eaaf02bf5 Merge pull request #16472 from github/redsun82/go-pre-commit
Go: disable pre-commit hook
2024-05-13 09:49:40 +02:00
Paolo Tranquilli
f125e732b0 Go: disable pre-commit hook 2024-05-13 09:27:35 +02:00
Paolo Tranquilli
c30ca4d9f6 Merge pull request #16398 from github/redsun82/go-make
Go: update `make` and CI to use `bazel`
2024-05-13 08:37:52 +02:00
Erik Krogh Kristensen
0d814e0e20 Merge pull request #16220 from erik-krogh/domainAnc
Go: Add an example specific to domain names in missing-regexp-anchor
2024-05-11 07:52:13 +02:00
Erik Krogh Kristensen
462e564c19 apply suggestion from code review
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2024-05-10 18:59:55 +02:00
Ian Lynagh
e7092b403b Merge pull request #16401 from igfoo/igfoo/vars
Java/Kotlin: Remove support for some deprecated environment variables
2024-05-10 13:37:55 +01:00
Erik Krogh Kristensen
bcddef8f32 Merge pull request #16131 from erik-krogh/cpp-path
C++: Improve the cpp/path-injection qhelp
2024-05-09 22:21:51 +02:00
Owen Mansel-Chan
e721399eec Merge pull request #16464 from owen-mc/go/fix-broken-test
Go: Fix test expectations
2024-05-09 16:46:04 +01:00
Owen Mansel-Chan
674e65e134 Fix test expectations 2024-05-09 16:26:30 +01:00
Ian Lynagh
4d54c09a6f Java: Add changenote for dropping support for some old variables 2024-05-09 15:59:47 +01:00
Ian Lynagh
b5d6bb9097 Kotlin: Remove unused var SEMMLE_PLATFORM_TOOLS 2024-05-09 15:59:47 +01:00
Ian Lynagh
cfc419b639 Kotlin: Remove unused ODASA_HOME variable 2024-05-09 15:59:47 +01:00
Ian Lynagh
304ad33837 Kotlin: Remove unused ODASA_TOOLS variable 2024-05-09 15:59:47 +01:00
Ian Lynagh
231918f612 Kotlin: Remove redundant variable ODASA_JAVA_LAYOUT 2024-05-09 15:59:47 +01:00
Owen Mansel-Chan
526204dc43 Merge pull request #16458 from owen-mc/go/fix-mad-for-builtin-functions
Go: fix `hasQualifiedName` and models-as-data for built-in functions
2024-05-09 15:06:07 +01:00
Joe Farebrother
20a1e22c44 Add missing CWE tags 2024-05-09 10:33:48 +01:00
Jeroen Ketema
4dfcdbccd7 Merge pull request #16459 from jketema/handler-fix
C++: Fix destructor translation for handlers
2024-05-09 10:23:07 +02:00
Sarita Iyer
aab5da0435 Merge pull request #16320 from github/subatoi/deprecate-codeql-for-vs-code
[8th May 2024] Add deprecation notices to CodeQL for VS Code documentation
2024-05-08 17:00:42 -04:00
Jeroen Ketema
9e09c5a6cf C++: Fix copy and paste error in comment 2024-05-08 22:11:19 +02:00
Owen Mansel-Chan
279b2c7a95 Merge pull request #16457 from owen-mc/go/fix-implicitvarargsslice-type
Go: Fix `getType` on `ImplicitVarArgsSlice`
2024-05-08 20:52:01 +01:00
erik-krogh
811c175556 add example for domain names with sub-domains to missing-regexp-anchor 2024-05-08 20:50:43 +02:00
erik-krogh
a51d24cbab apply suggestions from code review, and the examples to the test 2024-05-08 19:34:50 +02:00
Jeroen Ketema
d68d2cca41 C++: Fix destructor translation for handlers 2024-05-08 19:26:56 +02:00
Jeroen Ketema
0cbedfb28c Merge pull request #16455 from jketema/if-fix
C++: Ensure destructors for ifs are called after both branches and for both if and constexpr if
2024-05-08 19:15:28 +02:00
Geoffrey White
49aba25852 Merge pull request #16445 from geoffw0/qhelp4
C++: Improve qhelp for DoubleFree.
2024-05-08 18:02:12 +01:00
Geoffrey White
53d4a10108 Update cpp/ql/src/Critical/DoubleFree.qhelp
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
2024-05-08 17:15:08 +01:00
Mathias Vorreiter Pedersen
59fb9cc862 Merge pull request #16299 from MathiasVP/remove-base-address-as-ipa-key
C++: Remove an unnecessary column
2024-05-08 16:43:30 +01:00
Owen Mansel-Chan
4f10cb5fa0 Local flow tests: do not list summary models
This is so that when we don't change the test results every time we add
a summary model for a built-in function.
2024-05-08 16:13:37 +01:00
Owen Mansel-Chan
57ff30c5f3 Update tests: built-in models now work 2024-05-08 16:07:02 +01:00
Owen Mansel-Chan
1ccea884ff Add change note 2024-05-08 15:37:25 +01:00
Owen Mansel-Chan
f6f594e4b5 parse empty string as package name 2024-05-08 15:33:19 +01:00
Owen Mansel-Chan
fb74a2a170 Use "" in qualified name for entities without a package 2024-05-08 15:33:19 +01:00
Owen Mansel-Chan
4d42a88c3c Add change note 2024-05-08 15:31:22 +01:00
Owen Mansel-Chan
9842445b52 Fix getType on ImplicitVarArgsSlice
It was not defined for built-in functions or for functions called via
a function variable.
2024-05-08 15:22:27 +01:00
Rasmus Wriedt Larsen
694b3b0fce Merge pull request #16452 from RasmusWL/fix-warning
misc: Fix docstring warning
2024-05-08 16:07:10 +02:00
Michael B. Gale
8cba06a25c Merge pull request #16454 from github/mbg/go/fix/shadowed-variable 2024-05-08 14:13:18 +01:00
Geoffrey White
088f8297b6 C++: Use nullptr. 2024-05-08 14:04:21 +01:00
Joe Farebrother
ab23d0ad23 Merge branch 'main' into python-promote-header-injection 2024-05-08 13:49:00 +01:00
Jeroen Ketema
1a53b923a6 C++: Ensure destructors for ifs are called after both branches 2024-05-08 14:48:28 +02:00
Michael Nebel
64145cf181 Java: Make it evident that we print signature of the lifted callable. 2024-05-08 14:42:53 +02:00
Michael Nebel
f00ad7c0e7 C#/Java: Invert api filtering logic. 2024-05-08 14:42:53 +02:00
Michael Nebel
5e2e224c9c Java: Updated expected test output. 2024-05-08 14:42:53 +02:00
Michael Nebel
e8120afef9 Java: Improve super implementation and ensure that lift produces a result. 2024-05-08 14:42:52 +02:00
Paolo Tranquilli
e359744b8b Go: bring back qhelp in action 2024-05-08 14:31:00 +02:00
Michael B. Gale
896fb87d1d Go: Fix err being shadowed in RunListWithEnv 2024-05-08 13:29:28 +01:00
Michael B. Gale
724d026238 Go: Move go list functions to toolchain package 2024-05-08 13:29:28 +01:00
Jeroen Ketema
52db1c1253 C++: Introduce abstract class to share code between if and constexpr if 2024-05-08 14:16:19 +02:00
Jeroen Ketema
fa06d88642 C++: Add forgotten getLastChild to TranslatedConstExprIfStmt 2024-05-08 14:07:29 +02:00
Rasmus Wriedt Larsen
24f8b5f203 misc: Fix docstring warning
When using a sufficiently new version of Python, it will give a warning
about the escape sequence `\_` in `¯\_(ツ)_/¯` not being a valid escape
:D fix is to make the docstring a raw string.

Thanks @owen-mc
2024-05-08 13:56:11 +02:00
Jeroen Ketema
7b89c6c7f7 Merge pull request #16450 from jketema/inconsistent
C++: Add IR tests demonstrating some inconsistencies that may occur
2024-05-08 13:32:01 +02:00
Jeroen Ketema
9bc04e7591 Merge pull request #16447 from jketema/destructors-loc
C++: Update test results after extractor changes
2024-05-08 13:03:46 +02:00
Michael Nebel
2a40a2a57f Java: Add some inheritance test cases for the model generator and updated expected test output. 2024-05-08 13:01:41 +02:00
Michael Nebel
c5403f4249 Merge pull request #16431 from michaelnebel/java/madinlinetest
Java: Models as Data inline like test.
2024-05-08 12:59:41 +02:00
Geoffrey White
3fd6bc9b5c C++: Fix qhelp format. 2024-05-08 11:46:07 +01:00
Geoffrey White
486226814a C++: Add a second example. 2024-05-08 11:40:29 +01:00
Paolo Tranquilli
12c28f3f68 Go: reorganize CI steps 2024-05-08 12:32:57 +02:00
Geoffrey White
871fd9aba3 Merge pull request #16405 from geoffw0/qhelp3
C++: Improve qhelp for StrncpyFlippedArgs.
2024-05-08 11:23:41 +01:00
Paolo Tranquilli
5b1b30a171 Apply suggestions from code review
Co-authored-by: Michael B. Gale <mbg@github.com>
2024-05-08 12:23:16 +02:00
Geoffrey White
880d56c576 Merge pull request #16404 from geoffw0/qhelp2
C++: Improve qhelp for WrongTypeFormatArguments.
2024-05-08 11:22:57 +01:00
Geoffrey White
9c8945f626 Merge pull request #16403 from geoffw0/qhelp1
C++: Improve qhelp for IncorrectNotOperatorUsage.
2024-05-08 11:22:15 +01:00
Jeroen Ketema
6575927630 C++: Add IR tests demonstrating some inconsistencies that may occur 2024-05-08 11:43:58 +02:00
Jeroen Ketema
2dcb55cc42 C++: Add bool operator to IR test 2024-05-08 11:38:50 +02:00
Mathias Vorreiter Pedersen
65645821be C++: Remove the 'BaseSourceVariableInstruction' column as it's functionally determined by the address column. 2024-05-08 10:00:48 +01:00
Owen Mansel-Chan
0338ffd125 Merge pull request #16444 from owen-mc/shared/update-summary-through-step-value
Shared data flow: Make summaryThroughStepValue include param outputs
2024-05-08 09:53:30 +01:00
Jeroen Ketema
61580da14d C++: Update test results after extractor changes 2024-05-08 08:43:20 +02:00
erik-krogh
3989717878 Merge branch 'main' into cpp-path 2024-05-07 23:01:52 +02:00
erik-krogh
336c7de643 updates based on review 2024-05-07 22:58:49 +02:00
Erik Krogh Kristensen
8b91914826 Merge pull request #16417 from erik-krogh/dummyPass
JS: Remove some FPs from the hardcoded-credentials query
2024-05-07 18:00:58 +02:00
Geoffrey White
575b66a054 C++: Clarify the recommendation and example. 2024-05-07 16:52:50 +01:00
Geoffrey White
dd95a2abab C++: Move qhelp. 2024-05-07 16:35:21 +01:00
Owen Mansel-Chan
aab43afd81 Swift: accept test changes 2024-05-07 15:36:48 +01:00
Mathias Vorreiter Pedersen
99940a6084 Merge pull request #16440 from MathiasVP/fix-iterator-to-expired-container-fp-2
C++: Fix location of SSA def for local variable addresses
2024-05-07 14:39:13 +01:00
Owen Mansel-Chan
c11fac81fd Make summaryThroughStepValue include param outputs
This matches summaryThroughStepTaint.
2024-05-07 13:55:42 +01:00
Mathias Vorreiter Pedersen
85e71c30dc Merge pull request #16442 from MathiasVP/add-uninitialized-local-fp
C++: Add `cpp/uninitialized-local` FP
2024-05-07 13:35:02 +01:00
Ben Ahmady
c529988b43 Update README.md
Co-authored-by: James Fletcher <42464962+jf205@users.noreply.github.com>
2024-05-07 13:09:08 +01:00
Mathias Vorreiter Pedersen
8e95395382 C++: Accept more test changes. 2024-05-07 12:55:42 +01:00
Mathias Vorreiter Pedersen
61fb89721a C++: Add 'cpp/uninitialized-local' FP. 2024-05-07 12:19:06 +01:00
Jeroen Ketema
8198b1a6ef Merge pull request #16426 from jketema/destructors-ranged-based-cleanup
C++: Update test results after extractor changes
2024-05-07 13:11:00 +02:00
Paolo Tranquilli
ab3d21ce7e Merge pull request #16441 from github/redsun82/lfs
Bazel: make `git_lfs_probe.py` compatible with python 3.8
2024-05-07 13:04:43 +02:00
Paolo Tranquilli
9f27eb3eda Bazel: make git_lfs_probe.py compatible with python 3.8 2024-05-07 12:44:28 +02:00
Joe Farebrother
efda63d37a Update test output 2024-05-07 10:49:55 +01:00
Jeroen Ketema
4eea214cb4 C++: Update test results after extractor changes 2024-05-07 11:10:07 +02:00
Jeroen Ketema
b8f62ae4d5 Merge pull request #16436 from jketema/jketema/throw-wrong
C++: Add test case that shows that no destructors are attached to unwinds
2024-05-07 11:07:24 +02:00
Joe Farebrother
0f7325ec68 Rename test directory and add comment to clarity on the purpose of splitting them. 2024-05-07 09:40:55 +01:00
Michael Nebel
5fe3ab7890 Java: Prepare for inline test sharing with C#. 2024-05-07 10:38:24 +02:00
Mathias Vorreiter Pedersen
53c2d2f1e7 C++: Accept test changes. 2024-05-07 09:10:58 +01:00
Mathias Vorreiter Pedersen
07d51a55fd C++: Assign a meaningful definition location to the address of an SSA variable when it's available. 2024-05-07 09:10:58 +01:00
Mathias Vorreiter Pedersen
41b95a1938 Merge pull request #16416 from MathiasVP/add-iterator-to-expired-container-fp-2
C++: Add `cpp/iterator-to-expired-container` FP
2024-05-07 09:10:38 +01:00
Michael Nebel
cfb0a862c1 Merge pull request #16356 from michaelnebel/csharp/aligntelemetryimplementation
C#: Base telemetry Api Source/Sink nodes on abstract classes.
2024-05-07 09:16:38 +02:00
Jeroen Ketema
9b23635d0a C++: Add test case that shows that no destructors are attached to unwinds 2024-05-06 17:47:55 +02:00
Paolo Tranquilli
bbdc2752ac Merge branch 'main' into redsun82/go-make 2024-05-06 17:43:48 +02:00
Paolo Tranquilli
5c74bebe6c Merge pull request #16317 from github/redsun82/go
Go: add bazel build
2024-05-06 16:55:58 +02:00
Michael Nebel
757cf8d43a C#: Fix a comment typo. 2024-05-06 16:48:31 +02:00
Michael Nebel
b53fa0f7f3 Java: Ensure that it is the callable for the model origin that carries the comment containing the model. 2024-05-06 16:41:58 +02:00
Paolo Tranquilli
d85f81d699 Merge pull request #16435 from github/redsun82/buildifier
Bazel: move buildifier out of root `BUILD`
2024-05-06 16:41:25 +02:00
Paolo Tranquilli
7c7bdb2242 Merge pull request #16434 from github/redsun82/lfs
Bazel: fix lfs lazy rule when all objects are local
2024-05-06 16:40:59 +02:00
Paolo Tranquilli
92b3eda12d Bazel: move buildifier out of root BUILD
See https://github.com/github/codeql/pull/16428 for details as to why
this is necessary.
2024-05-06 16:00:05 +02:00
Michael Nebel
a8549d2e23 Java: Convert remaining tests to inline flow tests. 2024-05-06 15:54:01 +02:00
Paolo Tranquilli
54c9aea251 Bazel: fix lfs lazy rule when all objects are local 2024-05-06 15:47:43 +02:00
Paolo Tranquilli
e71d038d7f Go: specify Go runtime version in actions 2024-05-06 14:57:24 +02:00
Paolo Tranquilli
c123513311 Go: bring back test action
This reverts commit 9055d9567a.
2024-05-06 14:56:57 +02:00
Paolo Tranquilli
bab2dd4427 Go: bring back make and CI changes
This reverts commit 12b9b805e2.
2024-05-06 14:56:21 +02:00
Paolo Tranquilli
73df4fa920 Go: fix Windows installation 2024-05-06 14:55:35 +02:00
Michael Nebel
95ddd6ec74 Java: Generalize the inline mad test to allow further re-use. 2024-05-06 13:57:18 +02:00
Michael Nebel
51e7f3be1a Java: Rename MaD to summary. 2024-05-06 13:03:38 +02:00
Paolo Tranquilli
5b184c179a Bazel/Go: add some comments 2024-05-06 12:48:01 +02:00
Paolo Tranquilli
cba4ba042c Merge branch 'main' into redsun82/go 2024-05-06 12:43:56 +02:00
Michael Nebel
a33393d452 Java: Delete old summary models expected output. 2024-05-06 11:02:04 +02:00
Michael Nebel
7cb8a6c52f Java: Inline models as data expected output as comments in the java files and add a test. 2024-05-06 11:01:23 +02:00
Michael Nebel
6815bcaa80 Java: Move param module into TestUtilities. 2024-05-06 10:19:39 +02:00
Michael Nebel
105984f7de Java: Make param module for MaD inline test. 2024-05-06 10:01:34 +02:00
Tom Hvitved
6233da3e40 Merge pull request #16399 from hvitved/csharp/unique-get-location
C#: Make `Element.getLocation` (mostly) functional
2024-05-05 20:18:19 +02:00
Chuan-kai Lin
535e6db40f Python: Use entities in reorder directives 2024-05-03 11:17:41 -07:00
Chuan-kai Lin
9b51e0e0ee JS: Use entities in reorder directives 2024-05-03 11:17:13 -07:00
Chuan-kai Lin
30b5d5092d Java: Use entities in reorder directives 2024-05-03 11:16:31 -07:00
Chuan-kai Lin
1dd3a0fd76 Go: Use entities in reorder directives 2024-05-03 11:16:08 -07:00
Chuan-kai Lin
077a2e3479 C#: Use entities in reorder directives 2024-05-03 11:15:42 -07:00
Mathias Vorreiter Pedersen
5d5e31378b Merge pull request #16415 from MathiasVP/cleanup-ir-variables 2024-05-03 18:49:11 +01:00
Jeroen Ketema
5cde3fa697 Merge pull request #16414 from jketema/range-based-for-loop-destructor-fix
C++: Correctly handle destructors at the end of range-based for-loops in the IR
2024-05-03 19:38:45 +02:00
erik-krogh
39a8b49222 add qhelp recommendation that you can use an obvious placeholder value 2024-05-03 19:37:31 +02:00
erik-krogh
b209fc67cb test the change to hardcoded-credentials 2024-05-03 19:34:18 +02:00
Paolo Tranquilli
77128de105 Bazel/Go: make installer work from internal repo and on windows
It turns out everything that is needed for the installer to work on
windows is enabling runfiles. This also requires symlinks to avoid
excessive copying of files.
2024-05-03 17:45:57 +02:00
Mathias Vorreiter Pedersen
7a1b85aa56 C++: Add FP test. 2024-05-03 16:04:21 +01:00
Geoffrey White
eb0621ab7a Merge pull request #16406 from geoffw0/test1
C++: Add test case for reassignment to UseAfterFree.ql.
2024-05-03 15:32:58 +01:00
Geoffrey White
c0cf1c7c8c Merge pull request #16402 from geoffw0/stringlifetimedoc
C++: Improve UseOfStringAfterLifetimeEnds doc.
2024-05-03 15:04:07 +01:00
Paolo Tranquilli
17990da205 Update go/extractor/BUILD.bazel
Co-authored-by: Cornelius Riemenschneider <cornelius@github.com>
2024-05-03 15:58:43 +02:00
Mathias Vorreiter Pedersen
d5475c4a89 C++: Delete predicate that I introduced by mistake. 2024-05-03 14:48:01 +01:00
Paolo Tranquilli
471303bd7c Bazel/Go: remove unneeded comment 2024-05-03 14:56:17 +02:00
Paolo Tranquilli
2132c7bf96 Bazel/Go: make @codeql//go:gen runnable from internal repo 2024-05-03 14:52:17 +02:00
Mathias Vorreiter Pedersen
7ca54a6f94 C++: Sync identical files. 2024-05-03 13:51:04 +01:00
Mathias Vorreiter Pedersen
e8cb8b4f81 C++: Convert IR variables to an abstract base class and use final alias'ing to ensure that we don't accidentially extend the abstract base class. 2024-05-03 13:50:50 +01:00
Jeroen Ketema
ba64cf3016 C++: Correctly handle destructors at the end of range-based for-loops in the IR 2024-05-03 14:38:37 +02:00
Tom Hvitved
3c91333d0b Address review comment 2024-05-03 14:09:41 +02:00
erik-krogh
d9e8e0e00a use some more standard values for credentials-kind for NodeJS client credentials 2024-05-03 13:58:37 +02:00
erik-krogh
ff85db36e2 exclude credentials as kind key from hardcoded-credentials when the key looks like a dummy password 2024-05-03 13:58:11 +02:00
Paolo Tranquilli
8f0b88497a Bazel/Go: be more specific in go/extractor/BUILD.bazel comments 2024-05-03 13:15:08 +02:00
Paolo Tranquilli
31c427e64c Bazel/Go: add more explanation in gen.py 2024-05-03 13:15:08 +02:00
Michael Nebel
e64a2d6c9c C#: Align telemetry implementation with Java. 2024-05-03 12:48:14 +02:00
Geoffrey White
807e6795a7 Apply suggestions from code review
Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com>
2024-05-03 11:40:56 +01:00
Paolo Tranquilli
880262d462 Merge pull request #16393 from github/redsun82/lfs
Bazel: improved lazy lfs files
2024-05-03 12:37:41 +02:00
Michael Nebel
95ff5bae65 Merge pull request #16297 from michaelnebel/java/improveapitelemetry
Java: Identify more APIs as supported in the telemetry queries.
2024-05-03 12:34:19 +02:00
Paolo Tranquilli
6cbe16e0c2 Bazel: add progress reporting 2024-05-03 12:00:15 +02:00
Mathias Vorreiter Pedersen
75615f2817 Merge pull request #16373 from jketema/destructors-block-fix
C++: Update test results after extractor changes
2024-05-03 10:17:40 +01:00
Michael Nebel
c07bf65eb6 Update java/ql/lib/semmle/code/java/dataflow/FlowSources.qll
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2024-05-03 11:13:05 +02:00
Michael Nebel
8def1c2c13 Java: Address review comments and some other code quality improvements. 2024-05-03 11:11:52 +02:00
Rasmus Wriedt Larsen
1b90f22e84 Merge pull request #16400 from RasmusWL/accept-ci-fixes
.expected script: Handle multiple job failure URLs
2024-05-03 09:58:47 +02:00
Paolo Tranquilli
ecdf62376d Bazel: clean up git_lfs_probe.py 2024-05-03 09:21:57 +02:00
Geoffrey White
f5431abb10 C++: Fix strncpy reference link (the old link was broken). 2024-05-02 17:37:52 +01:00
Geoffrey White
73cc211779 C++: Fix qhelp error. 2024-05-02 17:36:35 +01:00
Geoffrey White
08e08a2b3a C++: Qhelp punctuation. 2024-05-02 17:32:24 +01:00
Geoffrey White
657402b42f C++: Fix % character in qhelp. 2024-05-02 17:31:09 +01:00
Geoffrey White
ecbf7aef18 C++: Fix qhelp formatting. 2024-05-02 17:26:24 +01:00
Geoffrey White
669fc925e0 C++: Fix qhelp formatting. 2024-05-02 17:24:20 +01:00
Geoffrey White
8a04840f93 C++: Improve qhelp for IncorrectNotOperatorUsage.ql, including mention of an alternative fix. 2024-05-02 17:17:55 +01:00
Geoffrey White
f4e4e238ba C++: Add test cases for IncorrectNotOperatorUsage.ql. 2024-05-02 17:17:55 +01:00
Geoffrey White
8f682ef4e4 C++: Improve quality of some qhelp references. 2024-05-02 17:08:26 +01:00
Paolo Tranquilli
96d69ca49c Merge branch 'main' into redsun82/lfs 2024-05-02 18:05:50 +02:00
Geoffrey White
8a261b7e7a C++: Update StrncpyFlippedArgs.qhelp. 2024-05-02 17:04:49 +01:00
Paolo Tranquilli
daea674095 Bazel: cover standard https git credentials in git_lfs_probe.py 2024-05-02 18:02:22 +02:00
Geoffrey White
315f439135 C++: Add test case for reassignment to UseAfterFree.ql. 2024-05-02 16:40:28 +01:00
Geoffrey White
06d8892e03 C++: Rename an example file. 2024-05-02 16:39:59 +01:00
Geoffrey White
e22159ab5d C++: Update WrongTypeFormatArguments.qhelp. 2024-05-02 16:34:56 +01:00
Geoffrey White
355c7d9b41 C++: Rename an example file. 2024-05-02 16:34:49 +01:00
Paolo Tranquilli
00baccbc15 Go: autoformat 2024-05-02 17:08:23 +02:00
Paolo Tranquilli
81dea9f89a Merge branch 'main' into redsun82/go 2024-05-02 17:03:09 +02:00
Paolo Tranquilli
76067cb12d Go: skip X:nocoverageredesign printing by autobuilder built with bazel 2024-05-02 17:02:48 +02:00
Geoffrey White
e4cf7df38f C++: Edits to the .qhelp based on suggestions. 2024-05-02 16:00:31 +01:00
Geoffrey White
b8b3689251 C++: Autoformat. 2024-05-02 15:49:56 +01:00
Geoffrey White
0693bf9e75 C++: Improve UseOfStringAfterLifetimeEnds qhelp, references and alert message. 2024-05-02 15:40:27 +01:00
Paolo Tranquilli
1aafc377ad Revert "Go: write test go runtime version in a specific file"
This reverts commit abcd9165b4.
2024-05-02 16:22:24 +02:00
Paolo Tranquilli
abcd9165b4 Go: write test go runtime version in a specific file 2024-05-02 16:09:11 +02:00
Paolo Tranquilli
0bc6934bfc Go: rename pkg_files to something less confusing 2024-05-02 15:44:06 +02:00
Paolo Tranquilli
4ae82ac215 Go: add explanatory comment to extractor BUILD file 2024-05-02 15:40:13 +02:00
Rasmus Wriedt Larsen
ccad70897d Add --dont-wait option 2024-05-02 15:39:07 +02:00
Paolo Tranquilli
318d954536 Go: make //go:gen not clear by default, and clean on --force 2024-05-02 15:38:47 +02:00
Rasmus Wriedt Larsen
3239af9973 Handle multiple job failure URLs
CI has changed how jobs are being run 🤷
2024-05-02 15:31:56 +02:00
Mathias Vorreiter Pedersen
f7113e0105 Merge pull request #16345 from MathiasVP/cleanup-ssa-and-iterator-flow
C++: Clean up SSA and stop relying on memory edges for iterator flow
2024-05-02 14:21:25 +01:00
Paolo Tranquilli
ca2d94b297 Fix go pattern in .pre-commit-config.yaml 2024-05-02 15:15:45 +02:00
Rasmus Wriedt Larsen
2cff081f2b Minor fixes to CI script.
I had problems with proper resolution of codeql_repo_dir with old python installation, this fixes it
2024-05-02 15:13:50 +02:00
Paolo Tranquilli
9055d9567a Go: remove unused action (will be re-added later) 2024-05-02 15:08:51 +02:00
Tamás Vajk
f99cb3f649 Merge pull request #16396 from tamasvajk/buildless/opt-out-feed-check
C#: Change nuget feed responsiveness checking to be opt-out
2024-05-02 15:04:28 +02:00
Tamás Vajk
dfdd79d8cf Merge pull request #16395 from tamasvajk/buildless/logs1
C#: Add file path to log messages in assets.json parsing
2024-05-02 15:03:57 +02:00
Tom Hvitved
8ec4f0b5bd C#: Update expected test output 2024-05-02 14:53:02 +02:00
Mathias Vorreiter Pedersen
b912918d8b C++: Fix QLDoc. 2024-05-02 13:32:52 +01:00
Harry Maclean
ef88f3ed09 Merge pull request #16377 from hmac/hmac-sanitization-fp
Ruby: Fix StringSubstitutionCall charpred
2024-05-02 13:31:01 +01:00
Tom Hvitved
f5d4b2e6cd C#: Make Element.getLocation (mostly) functional 2024-05-02 14:16:34 +02:00
Felicity Chapman
54793cfa01 Update a couple of reusables 2024-05-02 12:52:43 +01:00
Tamas Vajk
d909f2bc4f Fix expected test output 2024-05-02 13:32:01 +02:00
Felicity Chapman
7f27127301 Update docs/codeql/reusables/vs-code-deprecation-note.rst 2024-05-02 12:02:09 +01:00
Paolo Tranquilli
520a2c96ff Merge branch 'main' into redsun82/go 2024-05-02 12:41:51 +02:00
Paolo Tranquilli
12b9b805e2 Go: revert changes to make and CI to postpone them in a separate PR 2024-05-02 12:37:47 +02:00
Felicity Chapman
6eb07a7a7e Apply suggestions from code review
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
2024-05-02 11:05:39 +01:00
Owen Mansel-Chan
9bfb189fa7 Merge pull request #16392 from owen-mc/external-flow/standardize-empty-model-yml
External flow: standardize `empty.model.yml`
2024-05-02 11:01:47 +01:00
Mathias Vorreiter Pedersen
322fa36359 C++: Fix QLDoc. 2024-05-02 10:37:49 +01:00
Mathias Vorreiter Pedersen
4a47e11a16 C++: Fix QLDoc. 2024-05-02 10:36:40 +01:00
Owen Mansel-Chan
83249cd9c2 Fix grammar in comment 2024-05-02 09:59:48 +01:00
Tamas Vajk
c6185b30ba C#: Change nuget feed responsiveness checking to be opt-out 2024-05-02 10:25:12 +02:00
Tamas Vajk
9ce08c586c C#: Add file path to log messages in assets.json parsing 2024-05-02 10:14:26 +02:00
Paolo Tranquilli
a8d3226e99 Merge branch 'main' into redsun82/go 2024-05-02 09:27:47 +02:00
Paolo Tranquilli
94212d103e Bazel/Go: remove apple_support
This was actually unnecessary, and requried a full Xcode installation
that we'd rather avoid.
2024-05-02 09:21:47 +02:00
Paolo Tranquilli
608791fd7f Bazel/Go: use native cross compilation for fat binaries 2024-05-02 09:21:43 +02:00
Harry Maclean
7d92ec5ddf Merge pull request #16378 from hmac/hmac-sanitization-wording
Ruby: fix wording in rb/request-without-cert-validation
2024-05-02 08:00:28 +01:00
Paolo Tranquilli
9157dee0db Bazel: integrate download_and_extract into lfs_smudge 2024-05-02 08:53:51 +02:00
Paolo Tranquilli
677520aa8e Bazel: improved lazy lfs files
This reintroduces lazy lfs file rules that were removed in
https://github.com/github/codeql/pull/16117, now improved.

The new rules will make the actual file download go through bazel's
download manager, which includes:
* caching into the repository cache
* sane limiting of concurrent downloads
* retries

The bulk of the work is done by `git_lfs_probe.py`, which will use the
LFS protocol (with authentication via SSH) to output short lived
download URLs that can be consumed by `repository_ctx.download`.
2024-05-02 06:38:26 +02:00
Owen Mansel-Chan
16dcc0969b Standardise comment explaining why extensible predicates must be defined 2024-05-01 22:00:01 +01:00
Owen Mansel-Chan
09e59ccf44 Name files with empty definitions of MaD extensible predicates to erowdmpty.model.yml 2024-05-01 21:39:38 +01:00
Mathias Vorreiter Pedersen
a8f2cbc2b1 Merge pull request #16331 from mario-campos/mario-campos/guarded-free
Cpp: new experimental query cpp/guarded-free
2024-05-01 17:32:44 +01:00
Harry Maclean
c00d0d302d Ruby: fix wording in rb/request-without-cert-validation 2024-05-01 17:25:58 +01:00
Mario Campos
5a7a1dc92e C++: forgot to import semmle.code.cpp.controlflow.Guards 2024-05-01 11:00:19 -05:00
Mario Campos
c480431ec0 C++: simplify cpp/guarded-free
This new form is more declarative by use of the `GuardCondition`. Thanks to the tireless effort of @MathiasVP!
2024-05-01 10:59:16 -05:00
Harry Maclean
f7fc2e0b00 Ruby: Fix StringSubstitutionCall charpred
Some missing parens meant this class targeted way more things than
intended.
2024-05-01 16:14:58 +01:00
Michael B. Gale
397e641f2f Merge pull request #16375 from github/mbg/go/allow-version-suffixes
Go: Allow version suffixes
2024-05-01 15:41:54 +01:00
Michael B. Gale
00cbfaf40e Go: Allow version suffixes 2024-05-01 15:00:45 +01:00
Mathias Vorreiter Pedersen
dc4604f5a5 Merge pull request #16367 from MathiasVP/better-documentation-for-iterator-to-expired-container
C++: Improve documentation for `cpp/iterator-to-expired-container`
2024-05-01 11:56:27 +01:00
Mathias Vorreiter Pedersen
40b6e1624f Update cpp/ql/src/Security/CWE/CWE-416/IteratorToExpiredContainer.qhelp
Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com>
2024-05-01 11:41:23 +01:00
Mathias Vorreiter Pedersen
22e843abc6 Update cpp/ql/src/Security/CWE/CWE-416/IteratorToExpiredContainer.qhelp
Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com>
2024-05-01 11:41:16 +01:00
Jeroen Ketema
3c70a2d7df C++: Update test results after extractor changes 2024-05-01 12:30:38 +02:00
Jeroen Ketema
541effb8cb Merge pull request #16369 from jketema/destructors-init-stmt
C++: Update IR tests after better handling of init statements in the extractor
2024-05-01 10:47:03 +02:00
Anders Schack-Mulligen
248ffa15a2 Merge pull request #16318 from aschackmull/dataflow/doublyboundedfasttc
Dataflow: Use doublyBoundedFastTC.
2024-05-01 09:48:23 +02:00
Jeroen Ketema
5843326b5c C++: Update IR tests after better handling of init statements in the extractor 2024-04-30 21:12:30 +02:00
Mathias Vorreiter Pedersen
3a2b0a2feb Merge pull request #16366 from MathiasVP/fix-ir-for-destructors-in-switch
C++: Fix IR destructor calls on `JumpStmt`s
2024-04-30 18:26:54 +01:00
Joe Farebrother
fd55713006 add changenote 2024-04-30 18:17:18 +01:00
Joe Farebrother
c6372d5822 Fix qldoc and remove PotentialViewCallable class 2024-04-30 18:13:06 +01:00
Mathias Vorreiter Pedersen
07dd6d5c8d C++: Align 'break' statements. 2024-04-30 16:40:23 +01:00
Mathias Vorreiter Pedersen
708d12624f C++: Update documentation on 'cpp/iterator-to-expired-container'. 2024-04-30 16:32:32 +01:00
Mathias Vorreiter Pedersen
3eddd3114f C++: Accept test changes. 2024-04-30 16:14:30 +01:00
Mathias Vorreiter Pedersen
61ce7252e6 C++: Update the alert message in 'cpp/iterator-to-expired-container'. 2024-04-30 16:12:54 +01:00
Mathias Vorreiter Pedersen
b86aeb68ae Merge pull request #16364 from MathiasVP/ir-guards-with-boolean
C++: Support `IRGuard`s with no implicit boolean conversion
2024-04-30 16:07:32 +01:00
Mathias Vorreiter Pedersen
cf025e1924 C++: Accept test changes. 2024-04-30 15:47:53 +01:00
Mathias Vorreiter Pedersen
a200ced2d6 C++: Fix IR generation for jump statements. 2024-04-30 15:46:46 +01:00
Mathias Vorreiter Pedersen
c04e59611b Merge pull request #16355 from MathiasVP/promote-iterator-to-expired-container-out-of-experimental
C++: Promote `cpp/iterator-to-expired-container` out of experimental
2024-04-30 15:45:56 +01:00
Mathias Vorreiter Pedersen
c5a87c95d8 C++: Add tests that incorrectly call destructors twice. 2024-04-30 15:39:00 +01:00
Joe Farebrother
4f22b91e73 Add tests for cases not yet supported 2024-04-30 15:20:09 +01:00
Henry Mercer
797f675285 Merge pull request #16365 from github/post-release-prep/codeql-cli-2.17.2
Post-release preparation for codeql-cli-2.17.2
2024-04-30 14:51:01 +01:00
Mathias Vorreiter Pedersen
c32c810ae7 C++: Add a test with a 'short' type. 2024-04-30 14:48:21 +01:00
Mathias Vorreiter Pedersen
32fe084630 Update cpp/ql/lib/semmle/code/cpp/controlflow/IRGuards.qll
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2024-04-30 14:42:30 +01:00
Joe Farebrother
ba054bd428 Manually specify subclasses for redirect models 2024-04-30 14:33:46 +01:00
Ian Lynagh
0715c4ac5a Merge pull request #16341 from igfoo/igfoo/ODASA_BUILD_ERROR_DIR
Java: Remove support for deprecated ODASA_BUILD_ERROR_DIR env var
2024-04-30 13:18:51 +01:00
github-actions[bot]
99928b82ed Post-release preparation for codeql-cli-2.17.2 2024-04-30 12:15:35 +00:00
Rasmus Wriedt Larsen
377c6b4cc8 Merge pull request #12557 from felickz/patch-1
add  security-severity score to code scanning query list
2024-04-30 13:48:22 +02:00
Mathias Vorreiter Pedersen
2939c89f7a C++: Accept test changes. 2024-04-30 12:04:42 +01:00
Mathias Vorreiter Pedersen
bb6cc92728 C++: Support guards without implicit boolean conversions. 2024-04-30 12:04:35 +01:00
Mathias Vorreiter Pedersen
d736426529 C++: Support guards without implicit boolean conversions. 2024-04-30 11:45:58 +01:00
Mathias Vorreiter Pedersen
806d42852c C++: Add test in C file with pointer type guard. 2024-04-30 11:33:22 +01:00
Henry Mercer
8e251ee54f Merge pull request #16363 from github/release-prep/2.17.2
Release preparation for version 2.17.2
2024-04-30 11:29:06 +01:00
github-actions[bot]
5228d94d42 Release preparation for version 2.17.2 2024-04-30 10:25:51 +00:00
Geoffrey White
7d9f78b2de Merge pull request #16328 from geoffw0/pathinj
C++: Reduce duplication from cpp/path-injection
2024-04-30 10:06:40 +01:00
Paolo Tranquilli
2590d8a27f Merge branch 'main' into redsun82/go 2024-04-30 11:00:27 +02:00
Joe Farebrother
7df8b1ba51 Don't rely on specific parameter names, add qldoc 2024-04-30 09:45:11 +01:00
Erik Krogh Kristensen
7e839792da Merge pull request #16330 from erik-krogh/del-deps-apr-2024
All: delete outdated deprecations
2024-04-30 10:43:39 +02:00
Paolo Tranquilli
98106f31c1 Merge pull request #16358 from github/redsun82/registry-override
Bazel: add empty registry override
2024-04-30 09:09:46 +02:00
Ian Lynagh
676bcf39a5 Java: Remove support for deprecated ODASA_BUILD_ERROR_DIR env var 2024-04-29 18:02:28 +01:00
Paolo Tranquilli
a28f87fff0 Bazel: add empty registry override
This will unblock work in parallel on two separate PRs that require
patching different modules.
2024-04-29 18:01:09 +02:00
Mathias Vorreiter Pedersen
94364f724e C++: Remove CP between all sinks and all states in 'cpp/iterator-to-expired-container'. 2024-04-29 16:46:00 +01:00
Harry Maclean
607ed2efb4 Merge pull request #16354 from hmac/hmac-incomplete-hostname-fp
Ruby: Reduce FPs for rb/incomplete-hostname-regexp
2024-04-29 14:40:44 +01:00
Michael Nebel
a304e2d8d6 Merge pull request #16248 from michaelnebel/csharp/groupsprojectbeforerestore
C#: Restore projects and collect dependencies for projects in the same folder sequentially.
2024-04-29 14:05:40 +02:00
Paolo Tranquilli
cb85a756a0 Bazel: patch apple_support to avoid registering its toolchain
This is done in order to avoid requiring a full Xcode installation, but
still being able to use other `apple_support` facilities, like
`universal_binary`.
2024-04-29 13:42:05 +02:00
Paolo Tranquilli
e7886d0e57 Bazel: add empty registry override 2024-04-29 13:39:30 +02:00
yoff
1c611fecde Merge pull request #16155 from yoff/python/MaD-method-arg-tests 2024-04-29 12:59:57 +02:00
Harry Maclean
51bc8e917e Ruby: Reduce FPs for rb/incomplete-hostname-regexp
Arguments in calls to `match[?]` should only be considered regular
expression interpretations if the `match` refers to the standard library
method, not a method in source code.
2024-04-29 11:19:34 +01:00
Mathias Vorreiter Pedersen
0fa5a1f274 C++: Add change note. 2024-04-29 11:17:53 +01:00
Paolo Tranquilli
15bb846a5f Go: add workaround for extractor pack windows installer 2024-04-29 12:17:47 +02:00
Mathias Vorreiter Pedersen
5c454bdd8c C++: Compute and add severity. 2024-04-29 11:09:42 +01:00
Mathias Vorreiter Pedersen
f194c70e8a C++: Set precision to medium. 2024-04-29 11:08:08 +01:00
Mathias Vorreiter Pedersen
179270ffc1 C++: Move 'cpp/iterator-to-expired-container' out of experimental. 2024-04-29 11:07:55 +01:00
Paolo Tranquilli
1f78882cdc Go: make windows checks happy 2024-04-29 11:27:16 +02:00
Paolo Tranquilli
f0f6c229f6 Go: fix regex in action for macOS 2024-04-29 11:16:30 +02:00
Paolo Tranquilli
2f6dd2ab81 Go: refactor workflows with shared action 2024-04-29 11:12:48 +02:00
Paolo Tranquilli
6ec223c515 Go: small cleanup in Makefile 2024-04-29 11:00:21 +02:00
Harry Maclean
8ccedd658a Merge pull request #16349 from hmac/hmac-uri-open
Ruby: Add URI.open example to rb/kernel-open qhelp
2024-04-29 09:42:39 +01:00
Mathias Vorreiter Pedersen
401717d739 C++: Add a missing taint step and accept test changes. 2024-04-29 09:38:42 +01:00
Mathias Vorreiter Pedersen
527409d05f C++: Fix iterator return types and accept test changes. 2024-04-29 09:38:42 +01:00
Mathias Vorreiter Pedersen
d3d2e2188d C++: Accept test changes. 2024-04-29 09:38:42 +01:00
Mathias Vorreiter Pedersen
141af7cc87 C++: Subclasses for both 'begin' and 'end'. 2024-04-29 09:38:42 +01:00
Mathias Vorreiter Pedersen
6e3dddede0 C++: Use iterator flow in dataflow. 2024-04-29 09:38:42 +01:00
Mathias Vorreiter Pedersen
683fe26034 C++: Add iterator flow based on dataflow SSA. 2024-04-29 09:38:41 +01:00
Mathias Vorreiter Pedersen
ea1b8a3999 C++: Implement 'getAnUltimateDefinition' on SSA definitions. 2024-04-29 09:38:41 +01:00
Mathias Vorreiter Pedersen
5f0efc19fa C++: Accept test changes. 2024-04-29 09:38:41 +01:00
Paolo Tranquilli
0dfd336729 Go: fix //go:gen on windows 2024-04-29 10:34:22 +02:00
Paolo Tranquilli
b0758fd109 Go: workaround for gazelle on macOS
See https://github.com/bazelbuild/bazel-gazelle/issues/1793 for details.
2024-04-29 10:29:53 +02:00
Michael Nebel
d62e888b86 C#: Code quality improvements. 2024-04-29 09:27:12 +02:00
Mathias Vorreiter Pedersen
50775d0c53 C++: Get rid of 'UseImpl' in TSsaDefOrUse so that it now only contains definitions. 2024-04-29 00:02:05 +01:00
Mathias Vorreiter Pedersen
9874d40d29 C++: Make 'getAddressOperand' available on 'DefImpl'. 2024-04-28 23:41:18 +01:00
Mathias Vorreiter Pedersen
044ee9b08a C++: Delete old iterator flow using memory edges. 2024-04-28 23:41:13 +01:00
Harry Maclean
8b23f6db10 Ruby: Add URI.open example to rb/kernel-open qhelp 2024-04-27 09:53:54 +01:00
Mathias Vorreiter Pedersen
3c2206728d Merge pull request #16333 from MathiasVP/fix-guards-on-pointers 2024-04-26 21:33:08 +01:00
Jeroen Ketema
8c87cb83bb Merge pull request #16342 from jketema/destructors-cleanup
C++: Don't emit destructor calls as part of 'TranslatedResultCopy' as this has already been done in some other 'TranslatedExpr'.
2024-04-26 22:05:00 +02:00
Mathias Vorreiter Pedersen
c9ce642e7a Merge pull request #16339 from MathiasVP/one-less-stage
C++: Remove a stage by properly caching `getResultIRType`
2024-04-26 16:52:16 +01:00
Mathias Vorreiter Pedersen
d18cdee0bc C++: Accept test changes. 2024-04-26 16:19:33 +01:00
Mathias Vorreiter Pedersen
b78537dd74 C++: Allow comparisons with pointer types in IRGuards. 2024-04-26 16:19:24 +01:00
Mathias Vorreiter Pedersen
e78091e9d0 C++: Sync identical files. 2024-04-26 16:19:02 +01:00
Mathias Vorreiter Pedersen
c10e00d389 C++: Add a subclass for constant instructions with pointer type. 2024-04-26 16:18:52 +01:00
Mathias Vorreiter Pedersen
bf61114284 C++: Add a test with pointer comparisons and float comparisons. 2024-04-26 16:17:45 +01:00
erik-krogh
800d7546fa change all the change-notes to breaking 2024-04-26 17:17:23 +02:00
Mathias Vorreiter Pedersen
d6c57de650 C++: Convert one of the tests to also test the 'absolute' versions of the GuardCondition predicates. 2024-04-26 16:11:19 +01:00
Paolo Tranquilli
d66494dcb0 Go: update go-tests-other-os.yml 2024-04-26 17:03:56 +02:00
Paolo Tranquilli
86d6b8ef21 Go: put back go setup 2024-04-26 16:54:14 +02:00
Mathias Vorreiter Pedersen
6147a38bea Merge pull request #16337 from MathiasVP/cache-second-level-scope
DataFlow: Cache `getSecondLevelScope`
2024-04-26 15:49:11 +01:00
Jeroen Ketema
67fb866efa C++: Update test results 2024-04-26 16:38:39 +02:00
Paolo Tranquilli
0f387eeac2 Go: add vendor update to //go:gen 2024-04-26 16:31:04 +02:00
Mathias Vorreiter Pedersen
4b0a217420 C++: Don't emit destructor calls as part of 'TranslatedResultCopy' as this has already been done in some other 'TranslatedExpr'. 2024-04-26 16:25:05 +02:00
Mario Campos
3195f0c828 Use more specific hasGlobalName() for stdlib function free(3)
Based on the CodeQL documentation's example of strncpy(3) and strlen(3): https://codeql.github.com/docs/codeql-language-guides/hash-consing-and-value-numbering/#example-query
2024-04-26 09:10:40 -05:00
Paolo Tranquilli
d98ccdfa06 Go: update workflow 2024-04-26 16:02:22 +02:00
Paolo Tranquilli
c8b02241af Merge branch 'main' into redsun82/go 2024-04-26 15:59:17 +02:00
Tamás Vajk
a707e14495 Merge pull request #16338 from tamasvajk/buildless/extractor-timing
C#: Store buildless extraction timing information and return in telem…
2024-04-26 15:59:01 +02:00
Paolo Tranquilli
146d84bbf8 Go: rework makefile 2024-04-26 15:20:33 +02:00
Tamas Vajk
1d45e3a558 C#: Store buildless extraction timing information and return in telemetry query 2024-04-26 14:59:31 +02:00
Mathias Vorreiter Pedersen
70e9c48a47 C++: Also implement the predicate in the raw stage. 2024-04-26 13:48:13 +01:00
Mathias Vorreiter Pedersen
dcc4ad2550 C++: Sync identical files. 2024-04-26 13:45:15 +01:00
Mathias Vorreiter Pedersen
54cadcfe9b C++: Forward to a cached predicate in a cached module instead of caching the predicate in 'Instruction.qll' to include it in the cached stage of the other predicates. 2024-04-26 13:44:45 +01:00
Rasmus Lerchedahl Petersen
3716b8c6a0 Python: update test to reflect correct behaviour
also add comments
2024-04-26 14:21:15 +02:00
Rasmus Lerchedahl Petersen
9f7edf378e Python: fix tests
The way to expose the `self` arguemnt
is to call an instance method on the class,
not on the instance...
2024-04-26 14:21:15 +02:00
Rasmus Lerchedahl Petersen
4f46ce1133 Python: add test for Argument[0, self, self:] for instance methods 2024-04-26 14:21:15 +02:00
Michael Nebel
f95b33049e Java: Improve the Api sources and sinks implementation. 2024-04-26 14:12:41 +02:00
Mathias Vorreiter Pedersen
2482519cd3 DataFlow: Cached second level scope. 2024-04-26 13:09:59 +01:00
Asger F
e44d4c45aa Merge pull request #16323 from asgerf/js/expose-internal-module-naming
JS: Expose InternalModuleNaming
2024-04-26 13:57:26 +02:00
Paolo Tranquilli
bfa189e2ac Go: use a dbscheme generated during the build in extractor-pack 2024-04-26 13:48:44 +02:00
Paolo Tranquilli
19b2e56d02 Go: group BUILD and dbscheme generation target 2024-04-26 13:38:10 +02:00
erik-krogh
14d88eb3ce add change-notes 2024-04-26 12:56:28 +02:00
Michael Nebel
b754706e44 Java: Update SupportedExternalApi expected test output. 2024-04-26 12:39:46 +02:00
Michael Nebel
9db32f4d26 Java: Identify more APIs as supported in the telemetry queries (as QL defined sinks). 2024-04-26 12:39:46 +02:00
Michael Nebel
acb2bbb2a3 Java: Identify more APIs as supported in the telemetry queries (as QL defined sources). 2024-04-26 12:39:46 +02:00
Michael Nebel
06f987ad58 Java: Add test example of a supported sink defined in QL. 2024-04-26 12:39:46 +02:00
Paolo Tranquilli
925a2cca7e Go: create whole extractor pack with bazel 2024-04-26 12:01:23 +02:00
Paolo Tranquilli
3ad9c026a5 Go: remove go_sdk.host
It's not required, and it can't work from the internal repository.
2024-04-26 11:20:47 +02:00
Paolo Tranquilli
7d9a68bf17 Go: wrap gazelle to regenerate from scratch and add header 2024-04-26 11:19:22 +02:00
erik-krogh
0468c5d0bf delete some tests of the old GVN library 2024-04-26 07:58:35 +02:00
erik-krogh
e55f2c5309 reinroduce GLobalValueNumbering.qll, that one was supposed to stay 2024-04-26 06:52:57 +02:00
Mario Campos
d7c784ef2f Initial commit of experimental query cpp/guarded-free. 2024-04-25 16:29:37 -05:00
erik-krogh
fb376a1cfd revert the deletion of explorationLimit. It'll be deleted along with the entire class later 2024-04-25 22:31:11 +02:00
erik-krogh
baa31e1469 delete outdated deprecations 2024-04-25 22:19:28 +02:00
Jeroen Ketema
8d962a5c28 Merge pull request #16322 from jketema/child-stmt
C++: Print destructors for children of statements that are again statements
2024-04-25 22:17:35 +02:00
Jeroen Ketema
389df35fb7 Merge branch 'main' into child-stmt 2024-04-25 21:47:06 +02:00
Geoffrey White
aa80dd41da Merge pull request #16329 from geoffw0/multibyte
C++: Fix typo.
2024-04-25 17:26:40 +01:00
Geoffrey White
553871678a C++: Change note. 2024-04-25 16:52:01 +01:00
Geoffrey White
15123a7b40 C++: Reduce duplication. 2024-04-25 16:49:22 +01:00
Geoffrey White
bbd80ec7a4 C++: Add some more test cases. 2024-04-25 16:44:52 +01:00
Florin Coada
1d421b3b28 Merge pull request #16326 from github/changedocs/2.17.1
Update codeql-changelog index.rst to include codeql-cli-2.17.1
2024-04-25 16:08:41 +01:00
Joe Farebrother
2a0459838b Add models for responses 2024-04-25 15:55:59 +01:00
Michael B. Gale
a87b991d78 Merge pull request #16325 from github/mbg/go/use-parse-instead-of-parselax 2024-04-25 15:20:36 +01:00
Geoffrey White
0fb71e24cb C++: Fix typo. 2024-04-25 14:52:56 +01:00
Florin Coada
14d04903dc Update codeql-changelog index.rst to include codeql-cli-2.17.1 2024-04-25 14:40:44 +01:00
Michael Nebel
181a063bb9 C#: Update expected test output. 2024-04-25 15:38:39 +02:00
Michael Nebel
131d0b911f C#: Inline dependency collection from asset files per group. 2024-04-25 15:35:08 +02:00
Michael Nebel
0124b0749f C#: Do not run dotnet restore in parallel for projects in the same folder. 2024-04-25 15:35:07 +02:00
Michael Nebel
6daf80cdd0 C#: Add integration test with multiple project files that have disjoint dependencies. 2024-04-25 15:35:07 +02:00
Tamás Vajk
9c139b591f Merge pull request #16321 from tamasvajk/buildless/log-messages
C#: Improve log messages
2024-04-25 15:12:37 +02:00
Michael B. Gale
b8cfff6d19 Go: Use Parse instead of ParseLax, since we need toolchain directives 2024-04-25 14:10:26 +01:00
Michael B. Gale
f33d7ee80d Go: Add unit tests for hasInvalidToolchainVersion 2024-04-25 14:09:47 +01:00
Michael B. Gale
15a6308c72 Go: Refactor condition for EmitInvalidToolchainVersion into separate function 2024-04-25 14:04:00 +01:00
Joe Farebrother
86d1e5b646 Add additional type tracking for request attributes 2024-04-25 13:58:36 +01:00
Tamas Vajk
dd9183c345 Code quality improvements 2024-04-25 14:38:26 +02:00
Asger F
d0c9e3f7ad JS: Expose InternalModuleNaming 2024-04-25 13:33:17 +02:00
Asger F
9082972842 Merge pull request #16061 from RasmusWL/js-extractor-fix
JS: More robust CommonJS/ES2015 detection logic for extractor
2024-04-25 13:26:56 +02:00
Jeroen Ketema
05819a52ef C++: Print destructors for children of statements that are again statements 2024-04-25 13:25:42 +02:00
Nick Rolfe
116873c9b0 Merge pull request #16314 from github/nickrolfe/rb-sensitive
Ruby: do fewer regexp matches in SensitiveActions
2024-04-25 11:56:41 +01:00
Rasmus Wriedt Larsen
290b0fc4ab Merge pull request #16308 from asgerf/js/model-generation-quote
JS: Fix naming issue in generated models
2024-04-25 11:36:36 +02:00
Paolo Tranquilli
332d118d93 Merge pull request #16315 from github/redsun82/buildifier
Bazel: introduce buildifier formatting
2024-04-25 10:48:18 +02:00
Owen Mansel-Chan
82bbecc9c4 Merge pull request #16307 from owen-mc/go/fix/incomplete-hostname-regex
Go: fix flow through string concatenation in `go/incomplete-hostname-regex`
2024-04-25 09:43:51 +01:00
Tamas Vajk
15c1fd9425 C#: Improve log messages 2024-04-25 10:39:53 +02:00
Ben Ahmady
be9009d653 Use clearer filename 2024-04-25 08:16:48 +00:00
Ben Ahmady
037211c4a4 Add formatting fixes 2024-04-25 08:10:27 +00:00
Rasmus Wriedt Larsen
13ff9412a4 Merge pull request #16252 from RasmusWL/move-dataflow-tests
Python: Move dataflow tests out of experimental
2024-04-25 10:05:06 +02:00
Jeroen Ketema
9d24b5afa6 Merge pull request #16319 from jketema/ir-comment-fix
C++: Fix comment in IR test
2024-04-25 09:59:58 +02:00
Ben Ahmady
8cba276b87 Deprecate the CodeQL for VS Code docs in favour of docs.github.com version 2024-04-25 07:59:33 +00:00
Paolo Tranquilli
4ca8faa9c9 Go: introduce universal binaries on macOS 2024-04-25 09:27:59 +02:00
Paolo Tranquilli
393f6b7666 Go: add gazelle-generated BUILD files 2024-04-25 08:53:26 +02:00
Jeroen Ketema
95ec4e8d26 C++: Fix comment in IR test 2024-04-24 21:47:47 +02:00
Tom Hvitved
17e0cc5648 Merge pull request #16313 from hvitved/dataflow/fix-bad-join3
Data flow: Fix bad join
2024-04-24 17:09:14 +02:00
Paolo Tranquilli
196b6d7a1d CI: simplify reporting 2024-04-24 16:43:38 +02:00
Paolo Tranquilli
9def57250d CI: make reporting better 2024-04-24 16:35:50 +02:00
Paolo Tranquilli
9af9873e04 CI: add names to steps 2024-04-24 16:20:54 +02:00
Paolo Tranquilli
9f5782b67b Bazel: introduce buildifier formatting
This introduces tooling and enforcement for formatting bazel files.

The tooling is provided as a bazel run target from
[keith/buildifier-prebuilt](https://github.com/keith/buildifier-prebuilt).

This is used in a [`pre-commit`](https://pre-commit.com/) hook for those
having that installed. In turn this is used in a CI check. Relying on a
`pre-commit` action gives us easy checking that buildifying did not
change anything in the files and printing the diff, without having to
hand-roll the check ourselves.

This enforcement will make usage of gazelle easier, as gazelle itself
might reformat files, even outside of `go`. Having them properly
formatted will allow gazelle to leave them unchanged, without needing
to configure awkward exclude directives.
2024-04-24 15:49:48 +02:00
Owen Mansel-Chan
c61177cf42 Add change note 2024-04-24 14:21:59 +01:00
Owen Mansel-Chan
4140942479 Update tests 2024-04-24 14:19:33 +01:00
Owen Mansel-Chan
fd306ed79b Exclude constant names from sources to avoid duplicate results 2024-04-24 14:19:30 +01:00
Owen Mansel-Chan
8962307291 Add second good go file to tests 2024-04-24 14:19:29 +01:00
Owen Mansel-Chan
0000c72329 Remove attempt at avoiding duplicate alerts 2024-04-24 14:19:26 +01:00
Owen Mansel-Chan
3ef7a0932a Add flow through string concatenation 2024-04-24 14:19:25 +01:00
Tamás Vajk
f29d2c21bd Merge pull request #16312 from tamasvajk/fix/buildless/file-lookup
C#: Fix `global.json` and `packages.config` lookup
2024-04-24 15:05:55 +02:00
Joe Farebrother
53f69d9966 Reduce query tests with cases covered by concept tests 2024-04-24 14:05:42 +01:00
Joe Farebrother
8fb2faa89b Add additional info to concept tests 2024-04-24 14:05:41 +01:00
Joe Farebrother
2b935e575a Add concept tests + fix typo 2024-04-24 14:05:41 +01:00
Joe Farebrother
ec4c820391 Fix deprecation 2024-04-24 14:05:41 +01:00
Joe Farebrother
1dce2eb325 Rename to response splitting 2024-04-24 14:05:40 +01:00
Joe Farebrother
49e5f8a1a5 Add tests for instances of the header write concept 2024-04-24 14:05:40 +01:00
Joe Farebrother
f3b27d611a Add test case for validated wsgiref servers + fix typo 2024-04-24 14:05:40 +01:00
Joe Farebrother
f57ba3e642 Add change note 2024-04-24 14:05:40 +01:00
Joe Farebrother
d4a072818f Add more tests 2024-04-24 14:05:40 +01:00
Joe Farebrother
eeef062f7c Implement sinks for wsgiref + allow lists in bulk header updates + local flow 2024-04-24 14:05:39 +01:00
Joe Farebrother
9d56f3eb68 Fix qldoc formatting 2024-04-24 14:05:39 +01:00
Joe Farebrother
cf8db4e425 Update instances of experimental concept to the main one, and anotate missing experimental test results. 2024-04-24 14:05:39 +01:00
Joe Farebrother
daa31b5bb7 Add documentation 2024-04-24 14:05:38 +01:00
Joe Farebrother
8636a50190 Fix qldoc + remove deprecation from experimental concepts (as they are still used in another experimental query) 2024-04-24 14:05:38 +01:00
Joe Farebrother
fa28d94363 Added a sanitizer for replacing newlines. 2024-04-24 14:05:38 +01:00
Joe Farebrother
dbbc944f32 Correct spelling 2024-04-24 14:05:38 +01:00
Joe Farebrother
a88ad62c00 Implemented sinks for bulk header updates, and added corresponding tests. 2024-04-24 14:05:38 +01:00
Joe Farebrother
3e9341ff8a Model class instantiation for werkzueg headers 2024-04-24 14:05:37 +01:00
Joe Farebrother
b9984beb16 Add test cases 2024-04-24 14:05:37 +01:00
Joe Farebrother
68d90918cf Add to header write concept a specification of whether the name or value arg allows newlines.
Ported sink defenitions from Flask and Werzeug from experimental to main.
Removed experimental sink definitions for Django, as neither name nor value are vulnerable.
2024-04-24 14:05:37 +01:00
Joe Farebrother
25ffcb2fde Split into customizations file 2024-04-24 14:05:37 +01:00
Joe Farebrother
6021d9238c Move headers injection query and concept from experimental to main 2024-04-24 14:05:37 +01:00
Tamás Vajk
3b44b131b9 Merge pull request #16311 from tamasvajk/fix/resx
C#: Do not download `Microsoft.CodeAnalysis.ResxSourceGenerator` when…
2024-04-24 13:49:55 +02:00
Tamas Vajk
4a97f95890 Improve code quality 2024-04-24 13:47:25 +02:00
Tamás Vajk
84ea3a9a2c Merge pull request #16310 from tamasvajk/buildless/nuget_versions
C#: Add integration test with multiple versions of the same nuget pac…
2024-04-24 13:33:27 +02:00
Nick Rolfe
8f2e51faa6 Ruby: do fewer regexp matches in SensitiveActions 2024-04-24 12:32:49 +01:00
Owen Mansel-Chan
f828f8ea65 Merge pull request #16250 from owen-mc/go/rename-untrusted-flow-source
Go: Rename `UntrustedFlowSource` to `RemoteFlowSource` to match other language libraries
2024-04-24 11:37:00 +01:00
Tom Hvitved
95d579d9de Data flow: Fix bad join
```
Evaluated relational algebra for predicate _DataFlowImpl::Impl<HardcodedDataInterpretedAsCodeQuery::HardcodedDataInterpretedAsCodeFlow::C>::ret__#count_range@d112335l with tuple counts:
            285176  ~2%    {3} r1 = SCAN `_DataFlowDispatch::DataFlowCall.getEnclosingCallable/0#dispred#b7b78b19_DataFlowImpl::Impl<Hardcoded__#shared` OUTPUT In.1, In.0, In.2
        3265592261  ~3%    {5}    | JOIN WITH `DataFlowImpl::Impl<HardcodedDataInterpretedAsCodeQuery::HardcodedDataInterpretedAsCodeFlow::C>::returnCallEdge1/4#d02cae42_2301#join_rhs` ON FIRST 2 OUTPUT Lhs.0, Lhs.2, Rhs.2, Lhs.1, Rhs.3
             39070  ~8%    {6}    | JOIN WITH `DataFlowImplCommon::Cached::viableImplInCallContextExt/2#58e931ad` ON FIRST 3 OUTPUT Lhs.0, Lhs.3, Lhs.1, Lhs.2, Lhs.4, _
             39070  ~0%    {6}    | REWRITE WITH Out.5 := 1
                           return r1
```
2024-04-24 12:22:28 +02:00
Tamas Vajk
f3daba510b C#: Fix global.json and packages.config lookup 2024-04-24 11:57:45 +02:00
Tamas Vajk
88e67715a1 C#: Do not download Microsoft.CodeAnalysis.ResxSourceGenerator when there are no resx files to process 2024-04-24 11:53:29 +02:00
Tamas Vajk
53eb753346 C#: Add integration test with multiple versions of the same nuget package 2024-04-24 11:50:43 +02:00
Mathias Vorreiter Pedersen
037114b336 Merge pull request #16309 from geoffw0/newtests
C++: Add test cases
2024-04-24 10:06:51 +01:00
Nick Rolfe
af72c0848e Merge pull request #16306 from github/nickrolfe/js-sensitive
JS: do fewer regexp matches in SensitiveActions
2024-04-24 09:49:44 +01:00
Tamás Vajk
de58ee5a22 Merge pull request #16225 from tamasvajk/buildless/resx
C#: Add resource generator
2024-04-24 10:10:45 +02:00
Tom Hvitved
a1a93c7331 Merge pull request #16304 from hvitved/csharp/fix-bad-join
C#: Fix a bad join
2024-04-24 08:11:25 +02:00
Asger F
db07c162e4 JS: Allow generated models to use (package) 2024-04-23 20:25:55 +02:00
Asger F
9d00f660f1 Update ModelGeneration.expected 2024-04-23 20:08:21 +02:00
Owen Mansel-Chan
0311888fd4 Update change note
Co-authored-by: Michael B. Gale <mbg@github.com>
2024-04-23 19:07:02 +01:00
Asger F
e4f23b31c6 JS: Add quotes around package name to correct parsing 2024-04-23 20:04:23 +02:00
Geoffrey White
57a53891e9 C++: Effect of recent QL changes. 2024-04-23 18:12:05 +01:00
Geoffrey White
b6703bc25c C++: Add test cases inspired by QA results differences. 2024-04-23 18:06:12 +01:00
Nick Rolfe
003d208574 JS: do fewer regexp matches in SensitiveActions 2024-04-23 15:31:38 +01:00
Tom Hvitved
d8d7688f88 C#: Fix another bad join 2024-04-23 15:39:59 +02:00
Anders Schack-Mulligen
830b83f653 Dataflow: Use doublyBoundedFastTC. 2024-04-23 13:07:20 +02:00
Mathias Vorreiter Pedersen
3592e76269 Merge pull request #16302 from MathiasVP/fieldflowbranchlimit-follow-up-1
C++: `fieldFlowBranchLimit` follow-up (1)
2024-04-23 11:35:49 +01:00
Tom Hvitved
6aa4c5c187 C#: Fix a bad join 2024-04-23 11:47:55 +02:00
Michael B. Gale
fb8ee07b43 Merge pull request #16262 from github/dependabot/go_modules/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/src/subdir1/golang.org/x/net-0.23.0 2024-04-23 10:44:54 +01:00
Michael B. Gale
4ccff1a630 Merge pull request #16263 from github/dependabot/go_modules/go/ql/integration-tests/all-platforms/go/ninja-sample/src/golang.org/x/net-0.23.0 2024-04-23 10:44:17 +01:00
Michael B. Gale
4b7160d4b2 Merge pull request #16267 from github/dependabot/go_modules/go/ql/integration-tests/all-platforms/go/go-mod-without-version/src/golang.org/x/net-0.23.0 2024-04-23 10:43:43 +01:00
Michael B. Gale
5cce5008a3 Merge pull request #16264 from github/dependabot/go_modules/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/subdir2/golang.org/x/net-0.23.0 2024-04-23 10:42:53 +01:00
Michael B. Gale
5b6ce56ca2 Merge pull request #16268 from github/dependabot/go_modules/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/src/subdir/golang.org/x/net-0.23.0 2024-04-23 10:42:24 +01:00
Michael B. Gale
2b81b6c323 Merge pull request #16265 from github/dependabot/go_modules/go/ql/integration-tests/all-platforms/go/mixed-layout/src/module/golang.org/x/net-0.23.0 2024-04-23 10:41:50 +01:00
Mathias Vorreiter Pedersen
a39d8b7c7c C++: Ensure that each node type gets mapped to an instruction by 'getAnInstruction'. 2024-04-23 09:44:30 +01:00
Mathias Vorreiter Pedersen
553c09ada3 Merge pull request #16301 from MathiasVP/proper-coroutine-cfg-support-2
C++: Implement proper coroutine support in IR
2024-04-23 09:19:15 +01:00
Anders Schack-Mulligen
b2f09949df Merge pull request #15599 from aschackmull/dataflow/fieldflowbranchlimit-v2
Dataflow: update fieldFlowBranchLimit semantics
2024-04-23 10:08:05 +02:00
Rasmus Wriedt Larsen
1bc085c8f7 Python: Fixup for callGraphConfig 2024-04-23 09:42:35 +02:00
Rasmus Wriedt Larsen
bb00d6919a Python: Move dataflow TestUtil to importable location 2024-04-23 09:40:59 +02:00
Rasmus Wriedt Larsen
e0e405bb31 Python: replace dataflow-test location in files 2024-04-23 09:40:59 +02:00
Rasmus Wriedt Larsen
ce711f7d2f Python: Move dataflow tests out of experimental 2024-04-23 09:40:44 +02:00
Rasmus Wriedt Larsen
19974f04c9 Merge pull request #16245 from github/tausbn/python-rename-StrConst-to-StringLiteral
Python: Rename `StrConst` to `StringLiteral`
2024-04-23 09:35:24 +02:00
Mathias Vorreiter Pedersen
c1755603a8 Update TranslatedExpr.qll
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2024-04-23 07:25:25 +01:00
Mathias Vorreiter Pedersen
24cf75a37c C++: Accept test changes. 2024-04-22 21:38:13 +01:00
Mathias Vorreiter Pedersen
8169e7ce68 C++: Add proper translation of 'co_await' and 'co_yield'. 2024-04-22 21:38:13 +01:00
Mathias Vorreiter Pedersen
8383bc1629 C++: Add getters for the other children of 'co_return' and 'co_yield'. 2024-04-22 21:38:13 +01:00
Jeroen Ketema
35d1a9202b Merge pull request #16298 from jketema/reuse-val
C++: Update expected test results after extractor changes
2024-04-22 21:14:42 +02:00
Joe Farebrother
f85ee38e04 Add instance taint steps for requests 2024-04-22 16:03:39 +01:00
Mathias Vorreiter Pedersen
799c380e5f Merge pull request #16255 from MathiasVP/fix-more-fps-in-iterator-to-expired-container
Fix more FPs in `cpp/iterator-to-expired-container`
2024-04-22 14:25:51 +01:00
Tamas Vajk
f20812d8ad Code quality improvement 2024-04-22 15:12:01 +02:00
Tamas Vajk
05f3c64172 Fix code review findings 2024-04-22 14:46:24 +02:00
Joe Farebrother
88e3227ed0 Add pyramid models 2024-04-22 13:27:18 +01:00
Taus
81246cd41a Python: Add missing QLDoc for isUnicode 2024-04-22 12:08:53 +00:00
Taus
bab461ffd1 Python: Add change note 2024-04-22 12:00:09 +00:00
Taus
58eaddf627 Python: Update all .expected files
I'm beginning to realise why I didn't do the `toString` overriding way
back when. Thankfully, now that all of our tests are in the same place,
this is actually not a terrible ordeal.
2024-04-22 12:00:09 +00:00
Taus
d51fcd4f2a Python: Change Str to StringLiteral
As far as I can tell, this was the only occurrence of `Str` as a type
throughout the entire library.
2024-04-22 12:00:09 +00:00
Taus
b484aee39e Python: Autoformat everything
Of course, `StringLiteral` being much longer than `StrConst` meant a
bunch of files changed formatting.
2024-04-22 12:00:09 +00:00
Taus
1c68c987b0 Python: Change all remaining occurrences of StrConst
Done using
```
git grep StrConst | xargs sed -i 's/StrConst/StringLiteral/g'
```
2024-04-22 12:00:09 +00:00
Taus
f6487d7b13 Python: Rename StrConst to StringLiteral
Does a few things:
- Renames `StrConst` to `StringLiteral`, and deprecates the former.
- Also deprecates `Str`.
- Adds an override of `StringLiteral::toString` making it output
`"StringLiteral"` rather than the inherited `"Str"`. This ensures that
the AST viewer shows these nodes as the former type, not the latter.

There are a large number of uses of `StrConst` in the codebase. These
will be fixed in a later commit.
2024-04-22 12:00:09 +00:00
Jeroen Ketema
76637b0d03 C++: Update expected test results 2024-04-22 13:01:10 +02:00
Mathias Vorreiter Pedersen
77a7e007e3 Merge branch 'main' into fix-more-fps-in-iterator-to-expired-container 2024-04-22 10:42:06 +01:00
Jeroen Ketema
bea7b94537 Merge pull request #16296 from jketema/test-fix
C++: Fix aliased IR test
2024-04-22 11:34:13 +02:00
Jeroen Ketema
19d0d7bbc0 C++: Fix aliased IR test 2024-04-22 11:08:01 +02:00
Jeroen Ketema
c5bdd5bbd7 Merge pull request #16289 from jketema/reuse-improve
C++: Improve handling of re-use expressions
2024-04-22 10:34:35 +02:00
Jeroen Ketema
bcde7151e8 C++: Address review comment 2024-04-22 10:23:03 +02:00
Jeroen Ketema
2c76b13451 C++: Improve handling of re-used qualifier in delete expressions 2024-04-21 16:16:24 +02:00
Anders Schack-Mulligen
874d9d14bc Merge pull request #16290 from aschackmull/java/oscheck-perf
Java: Fix join-order.
2024-04-19 16:55:56 +02:00
Mathias Vorreiter Pedersen
bcedf687ff Merge pull request #16246 from MathiasVP/parameter-nodes-for-functions-without-bodies
C++: Add Parameter nodes for functions without bodies
2024-04-19 15:54:38 +01:00
Tom Hvitved
57796d6d02 Merge pull request #16249 from hvitved/csharp/no-compilation-clone
C#: Do not call `CSharpCompilation.Clone`
2024-04-19 16:28:23 +02:00
Anders Schack-Mulligen
c45fd4080d Java: Fix join-order.
The TC was being fully materialised but all we need is unary
reachability.
2024-04-19 15:41:35 +02:00
Michael B. Gale
9d83c91deb Merge pull request #16261 from github/dependabot/go_modules/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/subdir1/golang.org/x/net-0.23.0
Bump golang.org/x/net from 0.0.0-20200505041828-1ed23360d12c to 0.23.0 in /go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/subdir1
2024-04-19 12:04:56 +01:00
Michael B. Gale
3c22bf4a25 Merge pull request #16260 from github/dependabot/go_modules/go/ql/integration-tests/all-platforms/go/make-sample/src/golang.org/x/net-0.23.0
Bump golang.org/x/net from 0.0.0-20200505041828-1ed23360d12c to 0.23.0 in /go/ql/integration-tests/all-platforms/go/make-sample/src
2024-04-19 12:04:31 +01:00
Michael B. Gale
3c0bb6f4e5 Merge pull request #16259 from github/dependabot/go_modules/go/ql/integration-tests/all-platforms/go/bazel-sample-2/src/golang.org/x/net-0.23.0
Bump golang.org/x/net from 0.0.0-20200505041828-1ed23360d12c to 0.23.0 in /go/ql/integration-tests/all-platforms/go/bazel-sample-2/src
2024-04-19 12:04:05 +01:00
Michael B. Gale
1648b427c2 Merge pull request #16258 from github/dependabot/go_modules/go/ql/integration-tests/all-platforms/go/bazel-sample-1/src/golang.org/x/net-0.23.0
Bump golang.org/x/net from 0.0.0-20200505041828-1ed23360d12c to 0.23.0 in /go/ql/integration-tests/all-platforms/go/bazel-sample-1/src
2024-04-19 12:03:38 +01:00
Michael B. Gale
e443c65c75 Merge pull request #16266 from github/dependabot/go_modules/go/ql/integration-tests/all-platforms/go/two-go-mods-one-failure/src/subdir1/golang.org/x/net-0.23.0
Bump golang.org/x/net from 0.0.0-20200505041828-1ed23360d12c to 0.23.0 in /go/ql/integration-tests/all-platforms/go/two-go-mods-one-failure/src/subdir1
2024-04-19 12:02:45 +01:00
Michael B. Gale
220abc4d36 Merge pull request #16270 from github/dependabot/go_modules/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/src/golang.org/x/net-0.23.0
Bump golang.org/x/net from 0.0.0-20200505041828-1ed23360d12c to 0.23.0 in /go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/src
2024-04-19 12:02:15 +01:00
Michael B. Gale
7d4ce0a79a Merge pull request #16269 from github/dependabot/go_modules/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/src/subdir0/golang.org/x/net-0.23.0
Bump golang.org/x/net from 0.0.0-20200505041828-1ed23360d12c to 0.23.0 in /go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/src/subdir0
2024-04-19 12:01:48 +01:00
Michael B. Gale
ac9b77a3ac Merge pull request #16271 from github/dependabot/go_modules/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/src/subdir/golang.org/x/net-0.23.0
Bump golang.org/x/net from 0.0.0-20200505041828-1ed23360d12c to 0.23.0 in /go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/src/subdir
2024-04-19 12:01:12 +01:00
Michael B. Gale
abfbb47390 Merge pull request #16276 from github/dependabot/go_modules/go/ql/integration-tests/all-platforms/go/mixed-layout/src/workspace/subdir/golang.org/x/net-0.23.0
Bump golang.org/x/net from 0.0.0-20200505041828-1ed23360d12c to 0.23.0 in /go/ql/integration-tests/all-platforms/go/mixed-layout/src/workspace/subdir
2024-04-19 12:00:37 +01:00
Michael B. Gale
e7e7e4197e Merge pull request #16274 from github/dependabot/go_modules/go/ql/integration-tests/all-platforms/go/go-mod-sample/src/golang.org/x/net-0.23.0
Bump golang.org/x/net from 0.0.0-20200505041828-1ed23360d12c to 0.23.0 in /go/ql/integration-tests/all-platforms/go/go-mod-sample/src
2024-04-19 12:00:10 +01:00
Michael B. Gale
e9a9f56ea5 Merge pull request #16273 from github/dependabot/go_modules/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/src/golang.org/x/net-0.23.0
Bump golang.org/x/net from 0.0.0-20200505041828-1ed23360d12c to 0.23.0 in /go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/src
2024-04-19 11:59:14 +01:00
Michael B. Gale
03d7f5ec73 Merge pull request #16275 from github/dependabot/go_modules/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/src/subdir0/subdir1/golang.org/x/net-0.23.0
Bump golang.org/x/net from 0.0.0-20200505041828-1ed23360d12c to 0.23.0 in /go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/src/subdir0/subdir1
2024-04-19 11:57:41 +01:00
Mathias Vorreiter Pedersen
ba99d49b61 Merge pull request #16187 from MathiasVP/cfg-for-coroutines
C++: Placeholder CFG for coroutines
2024-04-19 11:31:55 +01:00
Owen Mansel-Chan
ea2cf27432 Merge pull request #16234 from owen-mc/go/incorrect-integer-conversion-type-switch-fp
Go: Fix FPs in `go/incorrect-integer-conversion` query
2024-04-19 11:26:17 +01:00
dependabot[bot]
bd1731b420 Bump golang.org/x/net
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20200505041828-1ed23360d12c to 0.23.0.
- [Commits](https://github.com/golang/net/commits/v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 09:46:03 +00:00
dependabot[bot]
31bea7e0ca Bump golang.org/x/net
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20200505041828-1ed23360d12c to 0.23.0.
- [Commits](https://github.com/golang/net/commits/v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 09:46:03 +00:00
dependabot[bot]
e01e8a0842 Bump golang.org/x/net
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20200505041828-1ed23360d12c to 0.23.0.
- [Commits](https://github.com/golang/net/commits/v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 09:46:02 +00:00
dependabot[bot]
6c057ddc81 Bump golang.org/x/net
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20200505041828-1ed23360d12c to 0.23.0.
- [Commits](https://github.com/golang/net/commits/v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 09:46:02 +00:00
dependabot[bot]
3c401d3a4f Bump golang.org/x/net
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20200505041828-1ed23360d12c to 0.23.0.
- [Commits](https://github.com/golang/net/commits/v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 09:46:01 +00:00
dependabot[bot]
cf1cddc8ca Bump golang.org/x/net
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20200505041828-1ed23360d12c to 0.23.0.
- [Commits](https://github.com/golang/net/commits/v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 09:46:01 +00:00
dependabot[bot]
2e50d61446 Bump golang.org/x/net
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20200505041828-1ed23360d12c to 0.23.0.
- [Commits](https://github.com/golang/net/commits/v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 09:46:01 +00:00
dependabot[bot]
dae187eb0b Bump golang.org/x/net
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20200505041828-1ed23360d12c to 0.23.0.
- [Commits](https://github.com/golang/net/commits/v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 09:46:00 +00:00
dependabot[bot]
7f195d0257 Bump golang.org/x/net
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20200505041828-1ed23360d12c to 0.23.0.
- [Commits](https://github.com/golang/net/commits/v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 09:46:00 +00:00
dependabot[bot]
a8162baada Bump golang.org/x/net
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20200505041828-1ed23360d12c to 0.23.0.
- [Commits](https://github.com/golang/net/commits/v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 09:46:00 +00:00
dependabot[bot]
6e50357224 Bump golang.org/x/net
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20200505041828-1ed23360d12c to 0.23.0.
- [Commits](https://github.com/golang/net/commits/v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 09:46:00 +00:00
dependabot[bot]
ef53184c10 Bump golang.org/x/net
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20200505041828-1ed23360d12c to 0.23.0.
- [Commits](https://github.com/golang/net/commits/v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 09:45:59 +00:00
dependabot[bot]
9d38c255f5 Bump golang.org/x/net
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20200505041828-1ed23360d12c to 0.23.0.
- [Commits](https://github.com/golang/net/commits/v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 09:45:58 +00:00
dependabot[bot]
4de4525528 Bump golang.org/x/net
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20200505041828-1ed23360d12c to 0.23.0.
- [Commits](https://github.com/golang/net/commits/v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 09:45:57 +00:00
dependabot[bot]
b9940f260f Bump golang.org/x/net
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20200505041828-1ed23360d12c to 0.23.0.
- [Commits](https://github.com/golang/net/commits/v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 09:45:57 +00:00
dependabot[bot]
58b0bed7f3 Bump golang.org/x/net
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20200505041828-1ed23360d12c to 0.23.0.
- [Commits](https://github.com/golang/net/commits/v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 09:45:56 +00:00
dependabot[bot]
02af978e8d Bump golang.org/x/net
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20200505041828-1ed23360d12c to 0.23.0.
- [Commits](https://github.com/golang/net/commits/v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 09:45:56 +00:00
dependabot[bot]
9609dc4030 Bump golang.org/x/net
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20200505041828-1ed23360d12c to 0.23.0.
- [Commits](https://github.com/golang/net/commits/v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 09:45:55 +00:00
Mathias Vorreiter Pedersen
4aee6d506d C++: Accept test changes 2024-04-19 09:17:37 +01:00
Asger F
ac34b922ec Merge pull request #16241 from asgerf/js/re-export
JS: Improve support for `export * as ...` declarations
2024-04-19 10:03:17 +02:00
Tom Hvitved
18acad516b Merge pull request #16251 from hvitved/dataflow/fix-bad-join2
Data flow: Fix a bad join
2024-04-19 09:49:41 +02:00
Mathias Vorreiter Pedersen
cedc84df8f C++: Fix FPs by only having one dataflow config. This means we preserve the call context all the way though from the source to the sink. 2024-04-19 08:27:41 +01:00
Mathias Vorreiter Pedersen
2b9c96d7cc C++: Add testcase. 2024-04-19 08:26:50 +01:00
Anders Schack-Mulligen
595014966a Dataflow: Add change note. 2024-04-19 08:46:04 +02:00
Tom Hvitved
339c40c2b7 Data flow: Fix bad join 2024-04-18 21:30:32 +02:00
Mathias Vorreiter Pedersen
a108fcd2b4 Merge pull request #16242 from MathiasVP/fix-tostring-on-nodes
C++: Fix `toString` on non-`ExprNode`s
2024-04-18 15:47:06 +01:00
Owen Mansel-Chan
79b4890794 Also rename .expected files 2024-04-18 14:17:04 +01:00
Mathias Vorreiter Pedersen
bcda4a1377 C++: Add change note. 2024-04-18 13:02:56 +01:00
Owen Mansel-Chan
dc985c2c98 Add change note 2024-04-18 12:55:59 +01:00
Mathias Vorreiter Pedersen
45b1a5e29b Merge branch 'main' into fix-tostring-on-nodes 2024-04-18 12:48:25 +01:00
Mathias Vorreiter Pedersen
58832a546a C++: Accept test changes. 2024-04-18 12:33:27 +01:00
Mathias Vorreiter Pedersen
9f8c9615fc C++: Use the unconverted expression available for a non-'ExprNode' when one exists. 2024-04-18 12:33:20 +01:00
Owen Mansel-Chan
b6f6bdc6f4 Make RemoteFlowAsSource private
`UntrustedFlowAsSource` should have been private. Since we are deprecating them anyway
we may as well make the replacement private (and make it use `instanceof`). The deprecation
comments have been updated.
2024-04-18 12:31:38 +01:00
Mathias Vorreiter Pedersen
b43aae18e0 C++: Accept test changes. 2024-04-18 12:01:01 +01:00
Mathias Vorreiter Pedersen
06f52c2854 C++: Make the new nodes parameter nodes. 2024-04-18 12:01:00 +01:00
Mathias Vorreiter Pedersen
98a3f2da7d C++: Add new dataflow nodes for parameters without any Instructions associated with them. 2024-04-18 12:01:00 +01:00
Mathias Vorreiter Pedersen
111ad8b525 C++: Refactor parameter nodes into an abstract class that's easier to extend. 2024-04-18 12:01:00 +01:00
Owen Mansel-Chan
a49b43fdf6 Add deprecated version of renamed public classes 2024-04-18 11:49:54 +01:00
Owen Mansel-Chan
317c335269 Rename test query files 2024-04-18 11:49:42 +01:00
Owen Mansel-Chan
db06c08141 Rename UntrustedSource to RemoteSource
Including renaming some files (in the experimental folder).
2024-04-18 11:49:30 +01:00
Owen Mansel-Chan
f39301f533 Fix "an remote" and similar
Preserve case, allow for "a `Remote" etc.
2024-04-18 11:49:18 +01:00
Owen Mansel-Chan
a6646021d0 Rename Untrusted Flow to Remote Flow
Not matching case but preserving original case.
2024-04-18 11:49:05 +01:00
Owen Mansel-Chan
d967b2baa3 Rename UntrustedFlowAsSource to RemoteFlowAsSource 2024-04-18 11:48:04 +01:00
Asger F
decd576a6b Merge pull request #15386 from asgerf/js/graph-export
JS: Add library for exporting graphs as type models
2024-04-18 11:56:17 +02:00
Mathias Vorreiter Pedersen
622f69e1a1 Merge pull request #16238 from MathiasVP/fix-terator-to-expired-container-fp 2024-04-18 10:24:13 +01:00
Asger F
3c885f3969 JS: Fix bug in MkClassInstance use-nodes
This only worked when the RHS was a SourceNode, which is not generally the case
2024-04-18 10:06:11 +02:00
Tom Hvitved
3c83262d58 C#: Do no call CSharpCompilation.Clone 2024-04-18 09:45:26 +02:00
Tamás Vajk
77d0df4fb6 Merge pull request #16247 from tamasvajk/feature/adjust-known-types
C#: Adjust known type telemetry query
2024-04-18 09:26:09 +02:00
Tamas Vajk
c11adc8c28 C#: Adjust known type telemetry query 2024-04-18 08:49:48 +02:00
Mathias Vorreiter Pedersen
43df0cd5f4 C++: Add a failing test. 2024-04-17 21:47:32 +01:00
Mathias Vorreiter Pedersen
a1267d732e Merge pull request #16139 from MathiasVP/enable-sound-ir
C++: Enable sound IR
2024-04-17 21:46:51 +01:00
Owen Mansel-Chan
a4df20da85 Rename UntrustedFlowSource to RemoteFlowSource
Relaxed match case requirement. Again skipped one instance in an old
change note.
2024-04-17 21:40:46 +01:00
Owen Mansel-Chan
81eaa6e327 Rename UntrustedFlowSource to RemoteFlowSource
Relaxed whole word requirement. Again skipped one instance in an old
change note.
2024-04-17 21:35:50 +01:00
Owen Mansel-Chan
5fba9895c6 Rename UntrustedFlowSource to RemoteFlowSource
Only the whole word. Skipped one instance in an old change note.
2024-04-17 21:27:32 +01:00
Asger F
64321b314f Merge branch 'main' into js-extractor-fix 2024-04-17 20:55:54 +02:00
Asger F
da33c220a6 JS: Update test output 2024-04-17 20:11:11 +02:00
Owen Mansel-Chan
212a0f27ff Add change note 2024-04-17 16:32:53 +01:00
Owen Mansel-Chan
2f56ec7fe0 Fix QLDoc 2024-04-17 16:32:49 +01:00
Owen Mansel-Chan
80c3993ddc Remove redundant test
It was introduced in https://github.com/github/codeql-go/pull/718 in
response to https://github.com/github/codeql-go/issues/717, to check
that we don't have type assertions as sinks. We now have other tests
covering type assertions.
2024-04-17 16:32:41 +01:00
Owen Mansel-Chan
3ad2d90014 Make type switches tranform flow state 2024-04-17 16:32:36 +01:00
Owen Mansel-Chan
611f98bca4 Make type assertions transform the flow state 2024-04-17 16:32:30 +01:00
Owen Mansel-Chan
544660322f Refactor flow state transforming barriers 2024-04-17 16:32:25 +01:00
Owen Mansel-Chan
f08a598821 Add tests for FPs: type switches, type assertions 2024-04-17 16:32:13 +01:00
Michael Nebel
4d3d07a964 Merge pull request #16215 from michaelnebel/csharp/telemetryissupported
C#: Take more sources and sinks into account when reporting in the te…
2024-04-17 15:29:46 +02:00
Tamas Vajk
7b5f2c7d94 Fix expected test result on Windows 2024-04-17 15:12:51 +02:00
Tamás Vajk
dc4cc74cbb Merge pull request #16240 from tamasvajk/fix/cleanup
C#: Fix cleanup logic in dependency manager
2024-04-17 14:53:40 +02:00
Asger F
eab96988bf JS: Add test for use steps 2024-04-17 14:46:00 +02:00
Asger F
2dcb5fbd16 Ensure props are included in MkMemberLabel 2024-04-17 14:46:00 +02:00
Asger F
3eb4e39251 JS: Also do this for use-steps and exclude pseudo-properties 2024-04-17 14:45:58 +02:00
Tamas Vajk
6f782f3f62 C#: Fix cleanup logic in dependency manager 2024-04-17 14:17:47 +02:00
Asger F
55b9724f59 JS: Add store step into namespace re-export specifier 2024-04-17 14:14:12 +02:00
Asger F
0a7af90454 JS: Add test with ESModule re-exports 2024-04-17 14:14:12 +02:00
Tamas Vajk
41e666c724 Parse and use RootNamespace from project files 2024-04-17 14:01:52 +02:00
Henry Mercer
902f0f91b0 Merge pull request #16218 from github/henrymercer/remove-ml-powered-queries
JS: Remove ML-powered queries
2024-04-17 12:54:05 +01:00
Tamas Vajk
88f6e04339 Make Resx extraction opt-in 2024-04-17 13:49:05 +02:00
Tamas Vajk
b560ab1a73 Fix condition for running dotnet source generators 2024-04-17 13:44:03 +02:00
Tamas Vajk
3626c814ac Run dotnet source generators on files grouped by projects 2024-04-17 13:40:03 +02:00
Asger F
5e7026c6c6 JS: Use AccessPath as parameter type 2024-04-17 13:31:51 +02:00
Alexander Eyers-Taylor
da3fa22cbd Merge pull request #16228 from github/post-release-prep/codeql-cli-2.17.1
Post-release preparation for codeql-cli-2.17.1
2024-04-17 11:24:34 +01:00
Tamas Vajk
bef556e208 Improve log messages 2024-04-17 11:46:27 +02:00
Tamas Vajk
5a5fc79b3b Fix regex to recognize prerelease version string 2024-04-17 11:46:27 +02:00
Tamas Vajk
9926c817de Code quality improvements 2024-04-17 11:46:26 +02:00
Tamas Vajk
53902c824d Fix integration tests 2024-04-17 11:46:26 +02:00
Tamas Vajk
3c5675b3fb WIP: Hardcode namespace for Resx generation 2024-04-17 11:46:26 +02:00
Mathias Vorreiter Pedersen
592ca06159 C++: Accept test changes. 2024-04-17 10:10:54 +01:00
Mathias Vorreiter Pedersen
96ba3ec88e C++: Rename predicate. 2024-04-17 10:10:54 +01:00
Mathias Vorreiter Pedersen
eb2790ae63 C++: Fix 'case 2' in 'destroyedToBeginSink' now that we're working with the sink instead of the source. 2024-04-17 10:10:39 +01:00
Mathias Vorreiter Pedersen
d22e2bae8e C++: Select the post-update node in 'getADestroyedNode'. 2024-04-17 10:10:39 +01:00
Mathias Vorreiter Pedersen
b2974ba1c6 C++: Factor body of isSink into its own predicate. 2024-04-17 10:10:21 +01:00
Tamas Vajk
3154a11b43 List members in resx test 2024-04-17 10:47:44 +02:00
Mathias Vorreiter Pedersen
b201fd0bdd Merge pull request #16232 from MathiasVP/add-iterator-to-expired-container-fp
C++: Add `cpp/iterator-to-expired-container` FP test
2024-04-17 09:44:32 +01:00
Tamas Vajk
1ff4c0daf3 Restore and use Microsoft.CodeAnalysis.ResxSourceGenerator 2024-04-17 10:41:47 +02:00
Michael Nebel
bc0e580683 C#: Address review comments. 2024-04-17 09:34:27 +02:00
Asger F
f78ea26c3b Merge pull request #16161 from RasmusWL/js/strict-mode
JS: Parser: Never run in strict mode
2024-04-17 09:21:29 +02:00
Asger F
93a9c62e29 Merge branch 'main' into js/graph-export 2024-04-17 09:19:59 +02:00
Michael Nebel
7434a58afc Merge pull request #16236 from github/workflow/coverage/update
Update CSV framework coverage reports
2024-04-17 09:09:48 +02:00
Asger F
ed80e4e284 JS: Change note 2024-04-17 08:41:27 +02:00
Asger F
c4eeda1560 JS: Bump EXTRACTOR_VERSION 2024-04-17 08:34:26 +02:00
github-actions[bot]
7faf3a8b8e Add changed framework coverage reports 2024-04-17 00:16:33 +00:00
Taus
dd97e70ffc Merge pull request #16233 from github/tausbn/python-fix-flags-test 2024-04-17 00:35:11 +02:00
Mathias Vorreiter Pedersen
1847a6deb0 Merge pull request #16203 from MathiasVP/break-bigstep-at-store
C++: Break dataflow big-step on right-hand side of assignments
2024-04-16 23:04:17 +01:00
Mathias Vorreiter Pedersen
fdddec74d3 Merge branch 'main' into break-bigstep-at-store 2024-04-16 21:08:33 +01:00
Chad Bentz
f77f91ef49 move security-severity to end of column list in csv
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2024-04-16 16:02:15 -04:00
Taus
bf8307f78d Python: Fix flags test
In 25cb52aa52 I accidentally introduced an extra `not` where none existed before. Whoops!
2024-04-16 21:17:34 +02:00
Asger F
3335d48154 Sync files 2024-04-16 20:26:41 +02:00
Asger F
c0db40d11a Merge branch 'js/graph-export' of github.com:asgerf/codeql into js/graph-export 2024-04-16 20:25:11 +02:00
Asger F
be64daf265 Merge branch 'main' into js/graph-export 2024-04-16 20:23:33 +02:00
Asger F
ee5cb6f3d8 Update shared/mad/codeql/mad/dynamic/GraphExport.qll 2024-04-16 20:10:51 +02:00
Asger F
844b29b637 Update shared/mad/codeql/mad/dynamic/GraphExport.qll
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2024-04-16 20:09:26 +02:00
Sid Shankar
5c50ed036c Merge pull request #16231 from github/tausbn/python-temporarily-remove-crlf-test
Python: Remove test with CRLF line endings
2024-04-16 13:54:06 -04:00
Mathias Vorreiter Pedersen
62299dc95a C++: Add FP test. 2024-04-16 18:19:33 +01:00
Taus
48e367cb11 Python: Remove test with CRLF line endings
These were causing `git` to behave strangely, leaving files that were
impossible to reset. In the future we should probably generate these
problematic test files on the fly, so that they don't have to exist in
the repo, but in the short run, it's easier to just remove them so as to
not block other users of the repo.
2024-04-16 17:18:20 +00:00
Mathias Vorreiter Pedersen
8f82db07d3 Merge pull request #16230 from MathiasVP/fix-join-in-global-use-before-init
C++: Use interpolation to avoid a bad join order
2024-04-16 18:17:11 +01:00
Mathias Vorreiter Pedersen
ba9267df5b Merge branch 'main' into break-bigstep-at-store 2024-04-16 17:15:58 +01:00
Cornelius Riemenschneider
4cb0695646 Merge pull request #16229 from github/criemen/rules-pkg
Upgrade rules_pkg to 0.10.1.
2024-04-16 18:03:00 +02:00
Mathias Vorreiter Pedersen
c3cf425079 C++: Use interpolation to avoid a bad join order. 2024-04-16 16:24:08 +01:00
Mathias Vorreiter Pedersen
dd656d34be Merge branch 'main' into break-bigstep-at-store 2024-04-16 15:33:21 +01:00
Taus
c647f30576 Merge pull request #16212 from github/tausbn/python-add-copy-of-internal-tests
Python: Add copy of internal tests
2024-04-16 16:32:31 +02:00
Mathias Vorreiter Pedersen
7155af50be C++: Accept more test changes. 2024-04-16 15:32:24 +01:00
Cornelius Riemenschneider
6ba27dc863 Upgrade rules_pkg to 0.10.1. 2024-04-16 16:29:56 +02:00
github-actions[bot]
622e176a16 Post-release preparation for codeql-cli-2.17.1 2024-04-16 14:21:32 +00:00
Michael Nebel
4a4f9b3942 C#: Update expected test output. 2024-04-16 16:05:16 +02:00
Michael Nebel
e7bfd7df62 C#: Take more sources and sinks into account when reporting in the telemetry queries. 2024-04-16 16:05:16 +02:00
Michael Nebel
543032a3de C#: Add ParallelSink QL Doc. 2024-04-16 16:05:16 +02:00
Michael Nebel
f69737b407 C#: Move parallelsink to the library qlpack. 2024-04-16 16:05:16 +02:00
Michael Nebel
c720fb2c34 C#: Add HtmlString test, which is supported as it is a known sink defined in QL. 2024-04-16 16:05:16 +02:00
Michael Nebel
4886bb1116 Merge pull request #16227 from michaelnebel/csharp/fixmadid
C#: Update MaD id in expected file.
2024-04-16 16:04:47 +02:00
Mathias Vorreiter Pedersen
8888ee9fa8 Merge pull request #16149 from codeqlhelper/main
C++: Improvements to reduce false alarms
2024-04-16 15:03:31 +01:00
Chris Smowton
69d8fa6e4a Merge pull request #16188 from smowton/smowton/admin/maven-buildless-missing-host-tolerance-test
Java: add test for a Maven project with an unreachable repository
2024-04-16 14:53:22 +01:00
Michael Nebel
ae0e25e5b1 C#: Update MaD id in expected file. 2024-04-16 15:37:46 +02:00
Mathias Vorreiter Pedersen
2627a3dcb7 Merge pull request #15371 from geoffw0/mad
C++: Implement models-as-data
2024-04-16 14:33:12 +01:00
Mathias Vorreiter Pedersen
e1884c193b C++: Add tests (and fix a missing quote in the alert message). 2024-04-16 14:20:19 +01:00
Mathias Vorreiter Pedersen
6cb5db2387 C++: Improve change note comments. 2024-04-16 13:55:55 +01:00
Mathias Vorreiter Pedersen
439afd97ba C++: Small performance optimization. 2024-04-16 13:54:58 +01:00
Mathias Vorreiter Pedersen
132bb9f1d6 C++: Address (my own) review comments. 2024-04-16 13:53:27 +01:00
Michael Nebel
58635bdbd6 Merge pull request #16121 from michaelnebel/csharp/modelgenexcludeset
C#: Exclude properties with both a getter and setter as candidates for modelling.
2024-04-16 14:49:07 +02:00
Tamas Vajk
79fe5f851b C#: Add resource generator 2024-04-16 14:30:53 +02:00
Tom Hvitved
e99c78e027 Merge pull request #16226 from hvitved/csharp/exclude-delegate-dynamic-calls-extraction-info
C#: Exclude delegate and dynamic calls from extractor telemetry
2024-04-16 14:23:38 +02:00
Tom Hvitved
75b1e14098 Merge pull request #16205 from samgiz/samgiz-tiny-docs-fix
Tiny docs fix
2024-04-16 13:57:38 +02:00
Alexander Eyers-Taylor
0daa6c2c1d Merge pull request #16219 from github/release-prep/2.17.1
Release preparation for version 2.17.1
2024-04-16 12:02:14 +01:00
Tom Hvitved
6bf05eb29a C#: Exclude delegate and dynamic calls from extractor telemetry 2024-04-16 12:53:39 +02:00
Mathias Vorreiter Pedersen
fb9fc14f3d C++: Accept test changes in paths. 2024-04-16 11:09:22 +01:00
Mathias Vorreiter Pedersen
8630630c45 C++: Use 'asDefinition' instead of checking for a 'Store' instruction. 2024-04-16 11:00:57 +01:00
Mathias Vorreiter Pedersen
54957d6ea4 Merge branch 'main' into enable-sound-ir 2024-04-16 10:46:59 +01:00
Joe Farebrother
f57e0cb71e Merge pull request #16209 from joefarebrother/csharp-missing-precision
C#: Add missing query precision
2024-04-16 10:46:27 +01:00
Rasmus Wriedt Larsen
ec862ebc72 Merge pull request #16196 from michaelnebel/misc/expected-changes-usageinfo
Print usage information for accept-expected-changes script in case PR…
2024-04-16 11:38:24 +02:00
Tamás Vajk
9671e05148 Merge pull request #16213 from tamasvajk/buildless/source-generators
C#: Move source code generators to dedicated classes
2024-04-16 11:08:28 +02:00
Joe Farebrother
3567c30020 Set precision to high 2024-04-16 09:41:46 +01:00
Tamas Vajk
407837afc4 C#: Refactor dotnet source generator execution 2024-04-16 10:20:23 +02:00
Tom Hvitved
ff55ed84f4 Merge pull request #16181 from hvitved/dynamic/deprecate-csv-models
Dynamic languages: Deprecate models-as-data CSV interface
2024-04-16 10:06:30 +02:00
Tamas Vajk
13a71a4f6d C#: Move source code generators to dedicated classes 2024-04-16 09:28:50 +02:00
Michael Nebel
3105697c7f Merge pull request #16200 from michaelnebel/csharp/dependencylogging
C#: Logging
2024-04-16 08:24:36 +02:00
github-actions[bot]
9bfe4ea90a Release preparation for version 2.17.1 2024-04-15 17:34:47 +00:00
Henry Mercer
8747438613 JS: Remove ML-powered queries 2024-04-15 17:35:32 +01:00
Alexander Eyers-Taylor
feeaef14be Merge pull request #16217 from github/alexet/fix-change-note
Go: Fix broken changenote metadata
2024-04-15 17:32:20 +01:00
Michael B. Gale
d9bd547f06 Merge pull request #16216 from github/mbg/go/respect-gotoolchain
Go: Respect `GOTOOLCHAIN` in `GetEnvGoVersion` if already set
2024-04-15 17:04:27 +01:00
Alexander Eyers-Taylor
43572fe9ae Go: Fix broken changenote metadata 2024-04-15 16:55:23 +01:00
Michael B. Gale
c0d2b89de0 Go: Respect GOTOOLCHAIN in GetEnvGoVersion if already set 2024-04-15 16:28:24 +01:00
Taus
82057e2e46 Python: Autoformat tests
I guess these were never considered back when we switched to
autoformatting everything.
2024-04-15 15:27:21 +00:00
Michael B. Gale
ce73c29962 Merge pull request #16214 from github/mbg/go/use-shared-integration-test-code
Go: Use shared integration test code
2024-04-15 16:25:28 +01:00
Taus
25cb52aa52 Python: Fix inefficient string comparison 2024-04-15 15:23:07 +00:00
Michael B. Gale
7a0aad87a4 Go: Use shared library for integration tests 2024-04-15 14:46:53 +01:00
Michael B. Gale
4673fff65b Go: Add db and runFunction to go_integration_test 2024-04-15 14:46:53 +01:00
Michael B. Gale
caaccb7709 Go: Run go clean -modcache in finally for integration tests
This ensures that the temporary GOPATH is cleaned up correctly in case of an integration test failure as well
2024-04-15 14:46:53 +01:00
Anders Schack-Mulligen
3c69f8f607 Java: Count second level scopes for fieldFlowBranchLimit. 2024-04-15 15:17:43 +02:00
Anders Schack-Mulligen
2f0987e980 Dataflow: Add dummy DataFlowSecondLevelScope implementations.
These could be an empty type, but Unit was available and it probably
doesn't matter.
2024-04-15 15:16:30 +02:00
Anders Schack-Mulligen
db6d27bd2b C++: Count return dispatch based on 2nd level scopes. 2024-04-15 15:13:08 +02:00
Anders Schack-Mulligen
9e39be5aea C++: Update qltest. 2024-04-15 15:13:05 +02:00
Anders Schack-Mulligen
b87b8329a0 Dataflow: Use default fieldFlowBranchLimit in qltests. 2024-04-15 15:13:03 +02:00
Anders Schack-Mulligen
f945687a93 Dataflow: Simplify branch and join. 2024-04-15 15:13:01 +02:00
Anders Schack-Mulligen
82afbbc17b Dataflow: Adjust fieldFlowBranchLimit count (block less) and adjust return edge condition (block more) 2024-04-15 15:12:58 +02:00
Anders Schack-Mulligen
a99849d897 Merge pull request #16211 from aschackmull/dataflow/alert-provenance-update-change-note
Dataflow: Amend change note for alert provenance.
2024-04-15 15:00:49 +02:00
Anders Schack-Mulligen
1389c7220b Dataflow: Amend change note. 2024-04-15 14:35:39 +02:00
Taus
8ec414d454 Python: Add copy of internal Python 3 tests
Again, mostly extractor tests, and a single library test.
2024-04-15 12:30:01 +00:00
Taus
b22b4c5b85 Python: Add copy of internal Python 2 tests
These are mostly extractor tests, which now live in `2/extractor-tests`,
and a single library tests that was added to the existing directory.
2024-04-15 12:26:45 +00:00
Taus
e45f6e9b24 Python: Add copy of extractor tests
These get to live next to the existing library and query tests, and are
run as part of both the Python 2 and Python 3 language tests.
2024-04-15 12:22:07 +00:00
Michael Nebel
d5073df24c Merge pull request #16186 from michaelnebel/csharp/suppressnullablefix
C#: Fix issue with suppress nullable warning directly on a method call.
2024-04-15 13:11:03 +02:00
Michael Nebel
8915241166 C#: Reduce nuget and razor logging. 2024-04-15 13:01:12 +02:00
Michael Nebel
336a18a1d9 C#: Make Started log as Debug. 2024-04-15 13:01:12 +02:00
Michael Nebel
ddfed6ea65 C#: Changing logging of dotnet commands to Debug except for dotnet --info and friends. 2024-04-15 13:01:12 +02:00
Michael Nebel
72ffcf5f9c C#: Replace some LogInfo with LogDebug. 2024-04-15 13:01:12 +02:00
Michael Nebel
f7e5fe7040 C#: Inline some calls. 2024-04-15 13:01:03 +02:00
Tamás Vajk
611cf231a7 Merge pull request #16195 from tamasvajk/depManager/refactoring
C#: Split `DependencyManager` into multiple classes
2024-04-15 10:25:08 +02:00
Geoffrey White
1c66e26e92 C++: Autoformat. 2024-04-15 09:06:49 +01:00
Joe Farebrother
6e130d24cd C#: Add missing query precision 2024-04-15 08:42:26 +01:00
Tamas Vajk
69c43094ba Fix review findings 2024-04-15 09:32:18 +02:00
Zigmas Bitinas
5125468307 Tiny docs fix
Noticed the mistake when browsing the docs [here](https://codeql.github.com/codeql-standard-libraries/ruby/codeql/ruby/security/CodeInjectionCustomizations.qll/module.CodeInjectionCustomizations$CodeInjection$FlowState.html)
2024-04-13 21:18:36 +01:00
Mathias Vorreiter Pedersen
f3a5ce5efc C++: Accept more test changes. 2024-04-13 11:03:15 +01:00
Mathias Vorreiter Pedersen
6f08790065 C++: Accept test changes. 2024-04-13 01:00:48 +01:00
Mathias Vorreiter Pedersen
2cbc59b7a1 C++: Always show the right-hand side of assignment in paths. 2024-04-13 01:00:38 +01:00
Geoffrey White
9302b167d8 C++: Fix further merge conflicts. 2024-04-12 19:38:38 +01:00
Mathias Vorreiter Pedersen
0bed22178c Merge pull request #16201 from MathiasVP/add-consistency
C++: Add new AST consistency check
2024-04-12 17:46:48 +01:00
Geoffrey White
e13b3ed5e7 C++ and Swift: Fix merge conflicts. 2024-04-12 17:30:46 +01:00
Mathias Vorreiter Pedersen
aac1070aca C++: Consistent naming. 2024-04-12 17:00:46 +01:00
Mathias Vorreiter Pedersen
413d3abbd7 C++: Add new AST consistency check. 2024-04-12 16:57:19 +01:00
Mathias Vorreiter Pedersen
116664588b Merge pull request #16125 from MathiasVP/destructors-for-unconditional-unnamed
C++: Generate IR for destruction of unconditionally constructed temporaries
2024-04-12 16:26:03 +01:00
Paolo Tranquilli
3614d3d52b Merge pull request #16199 from github/redsun82/add-shared-triggers-to-swift-ci
Swift: add `shared/**` to CI triggers
2024-04-12 16:00:18 +02:00
Paolo Tranquilli
de4ffbb552 Swift: add shared/** to CI triggers
Not being triggered by changes in shared was making it possible to not
notice changes in `shared` having effect on Swift tests. For example
[this PR](https://github.com/github/codeql/pull/15501) introduced a
test change that was fixed [here](https://github.com/github/codeql/pull/16197).
2024-04-12 15:46:01 +02:00
Paolo Tranquilli
67946614e3 Merge pull request #16197 from github/redsun82/accept-swift-tests
Swift: accept new test results
2024-04-12 15:34:00 +02:00
Geoffrey White
e29ce5f5d5 Merge branch 'main' into mad 2024-04-12 14:30:44 +01:00
Geoffrey White
1df1f0dbc2 C++: Use 'concat' in the variable.ql test. 2024-04-12 14:22:21 +01:00
Geoffrey White
0235e9962e C++: Accept test changes (related to getAQlClass). 2024-04-12 14:19:37 +01:00
Chad Bentz
78ddb998a2 Merge branch 'main' into patch-1 2024-04-12 09:09:43 -04:00
Tamas Vajk
e3fe9f7ca5 Move Nuget restore logic from DependencyManager to dedicated class 2024-04-12 15:04:45 +02:00
Asger F
3949ae4123 Update shared/mad/codeql/mad/dynamic/GraphExport.qll
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2024-04-12 15:00:24 +02:00
Asger F
330229c463 Update javascript/ql/lib/semmle/javascript/frameworks/data/ModelsAsData.qll
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2024-04-12 15:00:17 +02:00
Paolo Tranquilli
70e72aadd5 Swift: accept new test results 2024-04-12 14:57:59 +02:00
Michael Nebel
52be6579b7 Print usage information for accept-expected-changes script in case PR auto detection fails. 2024-04-12 14:31:25 +02:00
Michael Nebel
1c8298ae08 C#: Update expected test output. 2024-04-12 14:24:30 +02:00
Tamas Vajk
5406fac834 C#: Move all file lookup to separate class 2024-04-12 13:58:49 +02:00
Michael Nebel
d88a813038 C#: Re-generate .NET models. 2024-04-12 13:49:26 +02:00
Michael Nebel
254c6c3344 C#: Address review comments. 2024-04-12 13:48:13 +02:00
Tom Hvitved
e7dc120456 Add deprecation comments 2024-04-12 13:40:15 +02:00
Tom Hvitved
ceb5b4c56e Python: No longer use models-as-data CSV interface 2024-04-12 13:40:15 +02:00
Tom Hvitved
9d8b93ed45 JS: No longer use models-as-data CSV interface 2024-04-12 13:40:15 +02:00
Tom Hvitved
fdb77457b3 Sync files 2024-04-12 13:40:14 +02:00
Tom Hvitved
04de315e0e Ruby: Deprecate models-as-data CSV interface 2024-04-12 13:40:14 +02:00
Michael Nebel
dc34cb0aae C#: Update all MaD ids in the tests. 2024-04-12 13:24:18 +02:00
Tamás Vajk
91f2ea572c Merge pull request #16164 from tamasvajk/buildless/nuget-feed-fallback-feed-check
C#: Check fallback nuget feeds before trying to use them in the fallb…
2024-04-12 13:17:06 +02:00
Chris Smowton
bdd6fba06a Java: add test for a Maven project with an unreachable repository 2024-04-12 12:03:38 +01:00
Asger F
15eabb42ef JS: Address review comments 2024-04-12 11:35:34 +02:00
Michael Nebel
f799962146 C#: Update expected test output. 2024-04-12 11:35:08 +02:00
Michael Nebel
cb3a59446c C#: Remove redundant neutral summaries for ProcessStartInfo. 2024-04-12 11:31:59 +02:00
Michael Nebel
e70a49a771 C#: Add some manual models for ProcessStartInfo. 2024-04-12 11:31:59 +02:00
Michael Nebel
db48461ebc C#: Add change note. 2024-04-12 11:31:59 +02:00
Michael Nebel
ac2769c142 C#: Update the Telemetry queries such that properties with both get and set are no longer interesting. 2024-04-12 11:31:59 +02:00
Michael Nebel
829557fdda C#: Update expected test output. 2024-04-12 11:31:59 +02:00
Michael Nebel
c12c2a534c C#: Update the model editor code to disregard properties in case both a getter and a setter is present. 2024-04-12 11:31:58 +02:00
Michael Nebel
5323af33d2 C#: Update flow summaries expected test output. 2024-04-12 11:31:58 +02:00
Michael Nebel
96ef6809a7 C#: Update .NET Runtime models. 2024-04-12 11:31:58 +02:00
Michael Nebel
312b96aa8b C#: Update expected test output. 2024-04-12 11:31:57 +02:00
Michael Nebel
8cc4f86e7d C#: Only attempt to generate models for properties that does not both have a get and a set accessor. 2024-04-12 11:31:57 +02:00
Michael Nebel
32595b92a2 C#: Add some property test cases. 2024-04-12 11:31:57 +02:00
Michael Nebel
cbb5d433b1 C#: Add change note. 2024-04-12 11:23:16 +02:00
Michael Nebel
a2bb3dd78b C#: Update expected test output. 2024-04-12 11:23:03 +02:00
Joe Farebrother
5cebcadc56 Merge pull request #15987 from joefarebrother/ruby-mass-reassignment
Ruby: Add query for insecure mass assignment
2024-04-12 10:18:41 +01:00
Michael Nebel
19b7574c9c C#: Fix issue with suppress nullable warning directly on a method call. 2024-04-12 11:16:37 +02:00
Michael Nebel
1e59def89d C#: Add some suppress nullable warning testcases and update expected output. 2024-04-12 11:16:37 +02:00
Anders Schack-Mulligen
854dfb35c1 Merge pull request #15501 from aschackmull/dataflow/alert-provenance
Dataflow: Support alert provenance
2024-04-12 11:14:20 +02:00
Anders Schack-Mulligen
b4e23d9487 Dataflow: Address review comments 2024-04-12 09:20:45 +02:00
Anders Schack-Mulligen
31a86574bb Dataflow: Add change note. 2024-04-12 09:20:42 +02:00
Anders Schack-Mulligen
b7ee5597a0 Swift: Update expected output (interesting). 2024-04-12 09:20:40 +02:00
Anders Schack-Mulligen
2c43d0c5a4 Ruby: Update expected output (interesting). 2024-04-12 09:20:38 +02:00
Anders Schack-Mulligen
7cc8fd00aa Ruby: Update expected output (uninteresting). 2024-04-12 09:20:35 +02:00
Anders Schack-Mulligen
cbcdf1f8b5 Python: Update expected output (interesting). 2024-04-12 09:20:33 +02:00
Anders Schack-Mulligen
bfcfedab8c Python: Update expected output (uninteresting). 2024-04-12 09:20:30 +02:00
Anders Schack-Mulligen
f85ff9defc Java: Update expected output (interesting). 2024-04-12 09:20:28 +02:00
Anders Schack-Mulligen
c2f5731e8d Java: Update expected output (uninteresting). 2024-04-12 09:20:26 +02:00
Anders Schack-Mulligen
20e91f9cac Go: Update expected output (uninteresting). 2024-04-12 09:20:23 +02:00
Anders Schack-Mulligen
c3946a92ff C#: Update expected output (interesting) 2024-04-12 09:20:21 +02:00
Anders Schack-Mulligen
647f9aba82 C#: Update some expected output (uninteresting). 2024-04-12 09:20:18 +02:00
Anders Schack-Mulligen
c355737d30 C++: Update expected output. 2024-04-12 09:20:16 +02:00
Anders Schack-Mulligen
fdfb4a1a18 JS: Adapt to shared ApiGraphModels.qll changes. 2024-04-12 09:20:13 +02:00
Anders Schack-Mulligen
44147b9520 JS: Sync. 2024-04-12 09:20:11 +02:00
Anders Schack-Mulligen
a8fc100108 Python: Add alert provenance plumbing. 2024-04-12 09:20:08 +02:00
Anders Schack-Mulligen
f202661912 C++: Add alert provenance plumbing. 2024-04-12 09:20:06 +02:00
Anders Schack-Mulligen
6991f5452f Ruby: Add alert provenance plumbing. 2024-04-12 09:20:04 +02:00
Anders Schack-Mulligen
82e6fbbd22 Swift: Add alert provenance plumbing. 2024-04-12 09:20:01 +02:00
Anders Schack-Mulligen
ba6039946b Go: Add alert provenance plumbing. 2024-04-12 09:19:59 +02:00
Anders Schack-Mulligen
004bda1ee0 C#: Add alert provenance plumbing. 2024-04-12 09:19:56 +02:00
Anders Schack-Mulligen
eafc0075fd Legacy dataflow: Sync. 2024-04-12 09:19:54 +02:00
Anders Schack-Mulligen
2925e45434 Java/Dataflow: Propagate MaD-id/model-id to PathGraph. 2024-04-12 09:19:51 +02:00
Joe Farebrother
06d7b3ce80 Use cfg nodes 2024-04-11 22:30:41 +01:00
Sid Shankar
1015ee9872 Merge pull request #16189 from github/sidshank/check-python-executable-name-option-on-win
Python: Modifies check for py launcher
2024-04-11 16:16:23 -04:00
Aditya Sharad
790ee4a906 Merge pull request #16163 from github/mbg/docs/macos14
Docs: Add macOS 14 to list of supported operating systems
2024-04-11 11:26:39 -07:00
Sid Shankar
e33c5706f8 Modifies check for py launcher
This commit modifies the check for the "py" launcher on windows. We now look for the launcher only if the python_executable_name extractor option is not specified.
2024-04-11 12:59:41 -04:00
Geoffrey White
13100b19bc C++: Fix unintentionally changing the type of AdditionalCallTarget.viableTarget. 2024-04-11 17:07:20 +01:00
Geoffrey White
66f88d9c71 C++: Restrict the AST cases in TReturnKind. 2024-04-11 16:52:15 +01:00
Mathias Vorreiter Pedersen
477322d21d C++: Accept test changes. 2024-04-11 15:44:44 +01:00
Mathias Vorreiter Pedersen
846eac8be9 C++: Add a placeholder for 'getOpcode'. 2024-04-11 15:44:33 +01:00
Mathias Vorreiter Pedersen
8842b974f0 C++: Accept test changes. 2024-04-11 15:34:34 +01:00
Mathias Vorreiter Pedersen
65b69fe353 C++: Mark 'CoYieldExpr' as a unary expression in IR construction. 2024-04-11 15:34:29 +01:00
Mathias Vorreiter Pedersen
2a914770ea C++: Accept test changes. 2024-04-11 15:27:45 +01:00
Mathias Vorreiter Pedersen
d030f0b5d2 C++: Add a placeholder for 'getOpcode'. 2024-04-11 15:27:38 +01:00
Mathias Vorreiter Pedersen
33364a8ab6 C++: Accept test changes. 2024-04-11 14:28:44 +01:00
Mathias Vorreiter Pedersen
d8bd18f369 C++: IR translation of 'co_return' statements. 2024-04-11 14:28:15 +01:00
Michael B. Gale
f7262b7e6d Merge pull request #16184 from github/mbg/go/integration-tests-lib
Go: Add integration test library
2024-04-11 14:26:03 +01:00
Ian Lynagh
3c1286385d Merge pull request #16177 from igfoo/igfoo/kt2.0.0-rc1
Kotlin: Add 2.0.0-RC1 support (and remove 2.0.0-Beta4)
2024-04-11 14:01:58 +01:00
Tamas Vajk
c004f92365 Apply code review findings 2024-04-11 14:47:20 +02:00
Tamas Vajk
da91cea153 Add unit tests for dotnet nuget list source calls 2024-04-11 14:45:43 +02:00
Tamas Vajk
743e77d0d4 Improve logging, expose inherited feeds in integration test 2024-04-11 14:45:43 +02:00
Tamas Vajk
8d0856f97e Fix failing test 2024-04-11 14:45:36 +02:00
Tamas Vajk
0f7fc90fe0 C#: Check fallback nuget feeds before trying to use them in the fallback restore process 2024-04-11 14:43:32 +02:00
Mathias Vorreiter Pedersen
3e1359b92e C++: Accept test changes. 2024-04-11 13:31:48 +01:00
Mathias Vorreiter Pedersen
4c4d2415e9 C++: Mark 'CoAwaitExpr' as a unary expression in IR construction. 2024-04-11 13:30:33 +01:00
Mathias Vorreiter Pedersen
161f586510 Merge pull request #16097 from MathiasVP/add-coroutine-tests
C++: Add coroutine tests
2024-04-11 13:11:26 +01:00
Mathias Vorreiter Pedersen
aa94ee5b96 C++: Accept test changes. 2024-04-11 12:27:33 +01:00
Michael B. Gale
9c26cdd0bb Go: Add integration test library 2024-04-11 12:27:31 +01:00
Erik Krogh Kristensen
c00e2075a4 Merge pull request #16111 from erik-krogh/rb-url
RB: Improve QHelp for `rb/url-redirect`, and fix an FP.
2024-04-11 13:03:35 +02:00
Mathias Vorreiter Pedersen
3a18da730e Merge branch 'main' into add-coroutine-tests 2024-04-11 11:59:07 +01:00
Ian Lynagh
58f825fcb8 Kotlin: Drop our 2.0.255-SNAPSHOT version
It's now older than 2.0.0-RC1
2024-04-11 11:58:59 +01:00
Ian Lynagh
9c573dbee3 Kotlin: Update expected result for kotlin-version-too-new test 2024-04-11 11:58:59 +01:00
Ian Lynagh
7ce7685b91 Kotlin: FirMetadataSource.File.files has been removed
In new versions, but not old versions, we want FirMetadataSource.File.fir
instead.
2024-04-11 11:58:59 +01:00
Ian Lynagh
1698ccff9a Kotlin: Add 2.0.0-RC1 support (and remove 2.0.0-Beta4) 2024-04-11 11:58:59 +01:00
Tom Hvitved
982765ced3 Merge pull request #16176 from hvitved/csharp/adjust-conditional-locations
C#: Adjust conditional access locations
2024-04-11 12:47:51 +02:00
Owen Mansel-Chan
d4bb4d4faa Merge pull request #16120 from owen-mc/go/fix/type-switch-control-flow
Go: Fix data flow through variable defined in type switch guard
2024-04-11 11:39:40 +01:00
Owen Mansel-Chan
1e8315d797 Merge pull request #16180 from owen-mc/go/tweak-go-tainted-path-additions
Go: Tweak go tainted path additions
2024-04-11 11:17:30 +01:00
Mathias Vorreiter Pedersen
736d59c42d Merge branch 'main' into destructors-for-unconditional-unnamed 2024-04-11 09:53:31 +01:00
Mathias Vorreiter Pedersen
34a0c02f70 Merge branch 'main' into enable-sound-ir 2024-04-11 09:48:45 +01:00
Joe Farebrother
ec973ac1f3 Use not exists 2024-04-11 09:38:41 +01:00
Tony Torralba
e6fdc75450 Merge pull request #16129 from github/workflow/coverage/update
Update CSV framework coverage reports
2024-04-11 10:21:13 +02:00
Owen Mansel-Chan
a7c5e849f4 Expand ReplaceAll in sanitizer 2024-04-11 07:35:56 +01:00
Owen Mansel-Chan
c3fefa8f69 Add extra sanitizer Part.FileName() 2024-04-11 07:35:45 +01:00
Owen Mansel-Chan
21189af294 Improve QLDoc and refactor QL 2024-04-11 07:34:58 +01:00
github-actions[bot]
c4c81b77cf Add changed framework coverage reports 2024-04-11 00:16:51 +00:00
Mathias Vorreiter Pedersen
5c4e02a1da Merge branch 'main' into enable-sound-ir 2024-04-10 23:56:16 +01:00
Mathias Vorreiter Pedersen
0e610ba535 Merge pull request #16179 from MathiasVP/delete-noisy-test 2024-04-10 23:53:50 +01:00
Joe Farebrother
0a3d73d902 Add flow steps and sanitizers for permit calls 2024-04-10 21:47:07 +01:00
Erik Krogh Kristensen
844e78dce5 remove redundant cast
Co-authored-by: Alex Ford <alexrford@users.noreply.github.com>
2024-04-10 20:02:49 +02:00
Mathias Vorreiter Pedersen
313501aa29 C++: Delete a noisy test that's not very helpful. 2024-04-10 18:54:50 +01:00
Mathias Vorreiter Pedersen
21bc8c4324 C++: Accept test changes. 2024-04-10 18:32:15 +01:00
Geoffrey White
19b14e166d C++: Reduce code duplication. 2024-04-10 17:44:55 +01:00
Mathias Vorreiter Pedersen
3d96206783 Merge branch 'main' into enable-sound-ir 2024-04-10 17:39:13 +01:00
Mathias Vorreiter Pedersen
7172e2f445 Merge branch 'main' into destructors-for-unconditional-unnamed 2024-04-10 17:34:08 +01:00
Geoffrey White
959300f963 C++: Fixes for internals that are now private. 2024-04-10 17:32:10 +01:00
Geoffrey White
41ce4ffe4b C++: Fix some QLDoc holes. 2024-04-10 17:21:48 +01:00
Geoffrey White
eca112c3bc C++: More autoformatting. 2024-04-10 17:21:05 +01:00
Geoffrey White
250cb30c05 Swift: Autoformat. 2024-04-10 17:21:02 +01:00
Geoffrey White
dd96095a30 Apply suggestions from code review
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2024-04-10 17:20:35 +01:00
Paolo Tranquilli
85968e343a Merge pull request #16178 from github/redsun82/swift-deps-extension-all
Bazel: `swift/third_party/load.bzl` cleanup and `bazel mod tidy` enablement
2024-04-10 17:59:51 +02:00
Mathias Vorreiter Pedersen
33f6b6a940 Merge pull request #16175 from MathiasVP/more-iterator-models
C++: Add alias and side-effect models for more iterator functions
2024-04-10 16:55:10 +01:00
Jeroen Ketema
b9b2aa3580 Merge pull request #16138 from jketema/coroutine3
C++: Update expected test results
2024-04-10 17:48:48 +02:00
Rasmus Wriedt Larsen
d5160927f5 Merge branch 'main' into js/strict-mode 2024-04-10 17:33:01 +02:00
Rasmus Wriedt Larsen
c4e674b8d2 Merge pull request #16173 from RasmusWL/remove-lib-stubs
Python: Remove deprecated stubs for points-to tests
2024-04-10 17:12:16 +02:00
Erik Krogh Kristensen
d33e8adae4 Merge pull request #16174 from erik-krogh/no-arr-ruby-shell
RB: don't mention arrays in the qhelp for rb/shell-command-constructed-from-input
2024-04-10 17:08:24 +02:00
Owen Mansel-Chan
1c0ef90e96 Merge pull request #15865 from owen-mc/go/extractor/no-intermediate-string-values
Go: extractor: do not store intermediate values in long string concatenations
2024-04-10 15:31:51 +01:00
Michael Nebel
b79d738f64 Merge pull request #15993 from michaelnebel/csharp/assemblycachefiltering
C#: Exclude Semmle.* dlls when using the executing runtime.
2024-04-10 16:22:22 +02:00
Tom Hvitved
1c344d6735 C#: Adjust conditional access locations 2024-04-10 16:21:58 +02:00
Geoffrey White
925ee825ff C++: Add change notes. 2024-04-10 15:18:43 +01:00
Owen Mansel-Chan
dc3ea6c418 Merge pull request #11703 from Kwstubbs/go-taintedpath-additions
Go: Add and Modify Sanitizers For TaintedPath
2024-04-10 15:13:13 +01:00
Paolo Tranquilli
05f5879a2c Bazel: swift/third_party/load.bzl cleanup and bazel mod tidy enablement 2024-04-10 16:11:20 +02:00
Mathias Vorreiter Pedersen
0ed0731024 C++: Reduce comment duplication. 2024-04-10 15:04:29 +01:00
Geoffrey White
36db493723 C++: Autoformat. 2024-04-10 15:02:19 +01:00
Geoffrey White
cbab24ba45 C++: Sort Models.qll. 2024-04-10 14:59:13 +01:00
Geoffrey White
e0f866f19d Merge branch 'main' into mad 2024-04-10 14:58:52 +01:00
Mathias Vorreiter Pedersen
9c9ed13ede C++: More comments. 2024-04-10 14:57:40 +01:00
Mathias Vorreiter Pedersen
1ae22d0781 C++: Improve comment based on PR feedback. 2024-04-10 14:55:29 +01:00
Owen Mansel-Chan
5ec3934ac8 Merge branch 'main' into go/extractor/no-intermediate-string-values 2024-04-10 14:51:22 +01:00
Tom Hvitved
7c43ca7001 C#: Add more conditional access tests 2024-04-10 15:25:00 +02:00
Mathias Vorreiter Pedersen
a7c98e3d94 C++: Accept test changes. 2024-04-10 14:19:06 +01:00
Mathias Vorreiter Pedersen
d98ed2d3cf C++: Add alias and side effect models for more iterator functions. 2024-04-10 14:19:06 +01:00
Michael Nebel
ef68e33449 C#: Address review comments. 2024-04-10 14:48:02 +02:00
erik-krogh
4ae25c2d34 don't mention arrays in the qhelp for rb/shell-command-constructed-from-input, because there are no array 2024-04-10 14:26:00 +02:00
Owen Mansel-Chan
0e67aa5baa Merge pull request #16172 from owen-mc/go/perf/synth-location
Go: Avoid magic in `TSynthLocation` definition
2024-04-10 13:02:18 +01:00
Owen Mansel-Chan
f45305ec3f Merge pull request #16170 from owen-mc/go/add-comments-in-extractor
Go: Add comments in extractor with link to online documentation
2024-04-10 12:50:18 +01:00
Michael Nebel
ff498f616a C#: Some renaming. 2024-04-10 13:20:57 +02:00
Rasmus Wriedt Larsen
9615e2ded9 Python: Remove deprecated stubs for points-to tests
I grep'ed through all our options files, and couldn't find any tests
that relies on these anymore 👍
2024-04-10 13:12:36 +02:00
Rasmus Wriedt Larsen
78ca691912 Python: remove deprecated points-to test for zope 2024-04-10 13:12:17 +02:00
Rasmus Wriedt Larsen
3db560158a Merge pull request #16169 from RasmusWL/mad-remoteflowsource
Python: Fix `RemoteFlowSourceFromCsv`
2024-04-10 13:06:42 +02:00
Mathias Vorreiter Pedersen
59936c8642 Merge pull request #16151 from MathiasVP/use-shared-typeflow-lib
C++: Use the shared typeflow library
2024-04-10 12:02:03 +01:00
Michael Nebel
3b42dc25a1 C#: Also use AssemblyLookupLocation for framework dlls. 2024-04-10 12:56:48 +02:00
Owen Mansel-Chan
a18a4fb62e Avoid magic in TSynthLocation definition
This improves performance, because in this case magic is not beneficial.
2024-04-10 11:47:13 +01:00
Michael Nebel
99f0ed26e9 C#: Make the assembly lookup case insensitive on the dll file extension and log if no dlls are found in a directory. 2024-04-10 12:45:28 +02:00
Michael Nebel
9eb13833fa C#: Code quality improvements. 2024-04-10 12:45:18 +02:00
Michael Nebel
2bea927d43 C#: Update expected test output. 2024-04-10 12:41:39 +02:00
Michael Nebel
d04bf6b6d6 C#: Don't include Semmle.* dlls, if the executing runtime is used as framework. 2024-04-10 12:41:39 +02:00
Michael Nebel
646b272b4e C#: Move the AssemblyPath class to its own file. 2024-04-10 12:41:39 +02:00
Michael Nebel
6299d9cecd C#: Introduce AssemblyPath and re-factor AssemblyCache to use this instead of strings. 2024-04-10 12:41:29 +02:00
Michael Nebel
bee54e4247 C#: Add desktop runtime dependencies integration test. 2024-04-10 12:35:52 +02:00
Owen Mansel-Chan
b4829addf7 Add comments with link to online doc 2024-04-10 10:48:23 +01:00
Rasmus Wriedt Larsen
4fed3cf12d Python: Fix RemoteFlowSourceFromCsv 2024-04-10 11:31:34 +02:00
Joe Farebrother
976ca48317 Review suggestions - rename sink class and add barrier out 2024-04-10 10:17:19 +01:00
Dave Bartolomeo
996f535f0b Merge pull request #16103 from github/dbartol/javadoc-record
Allow `@param` tags to apply to record parameters
2024-04-09 14:21:45 -04:00
Geoffrey White
138975e4a8 C++: Add ZMQ summary models. 2024-04-09 18:10:15 +01:00
Geoffrey White
783ce48538 C++: Add test cases for ZMQ summary models. 2024-04-09 18:08:56 +01:00
Mathias Vorreiter Pedersen
8a92a4250f C++: Autoformat. 2024-04-09 17:53:33 +01:00
Dave Bartolomeo
b9cfeaf614 Add test case 2024-04-09 12:41:32 -04:00
Taus
3656376cc4 Merge pull request #16064 from github/max-schaefer/fix-unexploitable-types
Automodel: Filter unexploitable types in application mode.
2024-04-09 17:14:53 +02:00
Mathias Vorreiter Pedersen
a53ef495ee C++: Simplify 'hasExactBufferType' and add comments. 2024-04-09 16:04:20 +01:00
Felicity Chapman
5253c96aa2 Merge pull request #16162 from github/felicitymay/threat-models-csharp
Make duplicated content clear
2024-04-09 15:47:44 +01:00
Mathias Vorreiter Pedersen
291cc0a671 C++: Anonymous namespaces provide internal linkage. 2024-04-09 15:25:13 +01:00
Owen Mansel-Chan
5e4a5c1571 Merge pull request #16160 from owen-mc/java/delete-jdk-internal-models
Java: Delete models for JDK internal packages
2024-04-09 15:01:16 +01:00
Mathias Vorreiter Pedersen
2a7420ce11 Update cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/TypeFlow.qll
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2024-04-09 15:00:23 +01:00
Geoffrey White
1264e6e292 C++: Fit the function pointer tests better with what is and isn't working. 2024-04-09 14:57:15 +01:00
Max Schaefer
deb78b248b Apply suggestions from code review
Co-authored-by: Taus <tausbn@github.com>
2024-04-09 14:38:17 +01:00
Tom Hvitved
6c9a0e4a9a Merge pull request #16154 from hvitved/ruby/redundant-implicit-read
Ruby: Remove two redundant `allowImplicitRead` predicates
2024-04-09 15:38:05 +02:00
Jeroen Ketema
46c44b4dc0 C++: Update QLDoc of IRDeclarationEntry to reflect current reality 2024-04-09 15:15:41 +02:00
Jeroen Ketema
e821a62b44 C++: Update expected test results 2024-04-09 15:15:41 +02:00
Rasmus Wriedt Larsen
6f1a9d4574 Merge pull request #16159 from RasmusWL/fix-integration-tests
Python: Fixup integration tests after no dep inst
2024-04-09 15:08:20 +02:00
Michael B. Gale
0c3c20ece1 Docs: Add macOS 14 to list of supported operating systems 2024-04-09 14:06:24 +01:00
Felicity Chapman
e6d63b980d Make duplicated content clear 2024-04-09 14:05:42 +01:00
Mathias Vorreiter Pedersen
e9cd2dc9e1 C++: Implement 'lambdaCreation' and 'lambdaCall' for models-as-data. 2024-04-09 14:05:32 +01:00
Rasmus Wriedt Larsen
16e2ac898f JS: Parser: Remove direct this.strict assignment 2024-04-09 14:58:14 +02:00
Geoffrey White
4d5f158652 C++: Pivot ReturnKind solution to derive types from SSA + AST, rather than SSA + MAD. 2024-04-09 13:49:21 +01:00
Rasmus Wriedt Larsen
6ce38be3cc Merge pull request #16112 from github/tausbn/python-various-extractor-fixups
Python: Various extractor fixups
2024-04-09 14:46:23 +02:00
Asger F
f5355cfa98 Dynamic: Sync ApiGraphModels.qll 2024-04-09 14:37:20 +02:00
Rasmus Wriedt Larsen
1985dd629d JS: Parser: Never run in strict mode
This initial change is a bit of a hacky way to achieve our goals (since
it doesn't rewrite all the uses of this.strict), but it is easy to
understand is correct. Let's accept test changes NOW, and ensure that
later changes don't change things further.
2024-04-09 14:37:07 +02:00
Asger F
82101434fd Dynamic: Add hasPrettyName() 2024-04-09 14:32:59 +02:00
Asger F
8cb80d6014 JS: Switch from hasLocationInfo to Location 2024-04-09 14:32:59 +02:00
Asger F
81b96a8041 JS: Ensure MkClassInstance exists for base classes 2024-04-09 14:32:58 +02:00
Asger F
29a61458e0 JS: Add test case showing problem with chains going through internal classes 2024-04-09 14:32:58 +02:00
Asger F
56ebe6c727 JS: More re-export logic to handle subclass export 2024-04-09 14:32:58 +02:00
Asger F
f2ea88aa4c JS: Add test showing missing re-export of base class relationship 2024-04-09 14:32:58 +02:00
Asger F
9313564e64 JS: Add subclassing test and fix lack of subclassing handling 2024-04-09 14:32:58 +02:00
Asger F
ef7767b6cd JS: Add partial test for subclassing 2024-04-09 14:32:58 +02:00
Asger F
3022c59654 JS: Add access path alias test 2024-04-09 14:32:58 +02:00
Asger F
ab3c03d2d6 JS: Add test where root export object is a function 2024-04-09 14:32:58 +02:00
Asger F
f4e05cc621 JS: Add tests with semi-internal class problem 2024-04-09 14:32:58 +02:00
Asger F
946f0b4dc4 JS: Add test for class with aliases 2024-04-09 14:32:58 +02:00
Asger F
348c95ebe1 JS: Add a test case with fluent flow 2024-04-09 14:32:58 +02:00
Asger F
c55e03c588 Dynamic/JS: Add support for re-exporting type models 2024-04-09 14:32:58 +02:00
Asger F
acef9b7111 Dynamic/JS: Add library for exporting models 2024-04-09 14:32:58 +02:00
Michael Nebel
bd1de179b3 Merge pull request #15887 from michaelnebel/csharp/qualifiedname
C#: Fully qualified name.
2024-04-09 14:26:36 +02:00
Owen Mansel-Chan
ae8240a695 Delete models for JDK internal packages 2024-04-09 13:23:03 +01:00
Rasmus Wriedt Larsen
e9e7ccddce Python: delete force-enable-library-extraction integration test 2024-04-09 14:02:34 +02:00
Rasmus Wriedt Larsen
a0d6324f68 Python: Fix ignore-venv integration test
Now that we no longer support the fallback option
(https://github.com/github/codeql/pull/16127)
2024-04-09 14:01:10 +02:00
Rasmus Wriedt Larsen
bb4952f557 Revert "Python: Disable failing integration tests"
This reverts commit 8c2455fc11.
2024-04-09 14:00:25 +02:00
Owen Mansel-Chan
322d9fe105 Update change note wording
Co-authored-by: Chris Smowton <smowton@github.com>
2024-04-09 12:46:26 +01:00
Paolo Tranquilli
7b2dc325ec Merge pull request #16153 from github/redsun82/setup-swift-fix
CI: apply `setup-swift` workaround
2024-04-09 13:15:39 +02:00
Taus
29b843f772 Merge pull request #16158 from github/tausbn/python-disable-failing-integration-tests
Python: Disable failing integration tests
2024-04-09 13:12:48 +02:00
Geoffrey White
13734d4e62 C++: Improve indirectionForModelledFunction. 2024-04-09 12:06:03 +01:00
Geoffrey White
70bb29581d C++: Test failures. 2024-04-09 11:53:33 +01:00
Taus
8c2455fc11 Python: Disable failing integration tests
These failures were likely caused by
https://github.com/github/codeql/pull/16127

My guess is that they can probably be deleted altogether, but as the
failures are blocking other development, I have opted to simply disable
them for the time being.
2024-04-09 10:49:30 +00:00
Tamás Vajk
239776ba21 Merge pull request #16124 from tamasvajk/buildless/nuget-feed-precheck
C#: Validate all nuget feeds to respond in reasonable time
2024-04-09 12:12:06 +02:00
Owen Mansel-Chan
a65b02eb28 Update test expectations 2024-04-09 10:59:06 +01:00
Owen Mansel-Chan
f89fb8eb57 Add change note 2024-04-09 10:59:00 +01:00
Owen Mansel-Chan
6ae07a2c43 Add location for implicitly declared variables 2024-04-09 10:58:55 +01:00
Owen Mansel-Chan
ffdb610d93 Add new IR::Instruction MkTypeSwitchImplicitVariable
It represents the implicit declaration of a variable at the beginning of a case clause
2024-04-09 10:58:49 +01:00
Owen Mansel-Chan
4ffc4f5c62 Add test for dataflow through switches 2024-04-09 10:58:42 +01:00
Owen Mansel-Chan
0ed330056d Add extra CFG test for type switch 2024-04-09 10:55:52 +01:00
Owen Mansel-Chan
8df23522f0 Delete redundant test 2024-04-09 10:55:40 +01:00
Mathias Vorreiter Pedersen
448a9015c0 C++: Compute the number of indirections from MaD using a new predicate. 2024-04-09 10:33:06 +01:00
Mathias Vorreiter Pedersen
21592563cb C++: Define 'ReturnKind's in terms of SSA instead of 'Function'. 2024-04-09 10:32:31 +01:00
Tom Hvitved
5f8eb7b138 Merge pull request #16110 from hvitved/dataflow/param-flow-no-expects-content
Data flow: Block flow at `expectsContents` nodes in `parameterValueFlow`
2024-04-09 11:26:24 +02:00
yoff
1048cf7c5e Merge pull request #15711 from RasmusWL/tt-content
Python: Add type tracking for content
2024-04-09 10:37:43 +02:00
Mathias Vorreiter Pedersen
c325a79206 C++: Ensure 'isConditionalTemporaryDestructorCall' only holds when the reused expression is a temporary. 2024-04-09 09:32:54 +01:00
Michael Nebel
10d96ee02f C#: Address review comments. 2024-04-09 10:31:48 +02:00
Mathias Vorreiter Pedersen
17c8fa3e84 Update cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2024-04-09 09:27:44 +01:00
Tom Hvitved
e6984aa865 Ruby: Remove two redundant allowImplicitRead predicates 2024-04-09 10:10:25 +02:00
Tamas Vajk
80995ec1d7 Improve comments on environment variable names 2024-04-09 09:51:45 +02:00
codeqlhelper
ac7a25734b Merge branch 'main' into main 2024-04-09 15:42:58 +08:00
Paolo Tranquilli
e3d676f91b CI: apply tentative setup-swift fix 2024-04-09 09:37:21 +02:00
Erik Krogh Kristensen
44fba68015 Merge pull request #16128 from erik-krogh/java-info
Java: add link to the source variable in the alert-message for `java/implicit-cast-in-compound-assignment`
2024-04-09 08:55:09 +02:00
Mathias Vorreiter Pedersen
386580fc94 C++: Accept test changes. 2024-04-08 21:26:12 +01:00
Mathias Vorreiter Pedersen
b2002a981a C++: Use the shared typeflow library to determine whether a pointer points to a buffer or an object. 2024-04-08 21:25:05 +01:00
Mathias Vorreiter Pedersen
c389611e5c C++: Add spurious dataflow test. 2024-04-08 21:24:59 +01:00
erik-krogh
8cb6598f50 fixing that I put a type on the wrong thing in the alert-message 2024-04-08 20:51:19 +02:00
codeqlhelper@gmail.com
334c0d0449 ... 2024-04-09 02:06:06 +08:00
codeqlhelper
fc26e148fd Create 2024-04-09-reduce-FP.md 2024-04-09 02:00:52 +08:00
Geoffrey White
e3ce7c608b C++: Fix indirection ambiguity in the test. 2024-04-08 18:27:51 +01:00
Geoffrey White
087d689997 C++: Additional test cases. 2024-04-08 18:18:30 +01:00
codeqlhelper
af2a7eadc3 Reduce false alarms of InconsistentNullnessTesting.ql
We should ignore `checked` in a macro to avoid too many false alarms,
2024-04-09 00:07:40 +08:00
codeqlhelper
fb15a4ea11 Reduce the false alarms of GlobalUseBeforeInit.ql 2024-04-09 00:03:05 +08:00
Geoffrey White
c0c1ab7006 C++: Fix code scanning warnings. 2024-04-08 16:05:55 +01:00
Geoffrey White
31a246b554 Swift: Remove similar non-functional case from Swift as well. 2024-04-08 16:05:50 +01:00
Geoffrey White
06d369ba11 C++: Remove untested PostUpdateNode code for now, and field cases that don't work anyway. 2024-04-08 16:05:18 +01:00
Geoffrey White
b2b2c2016c C++: Update more QLDoc. 2024-04-08 16:04:23 +01:00
Mathias Vorreiter Pedersen
4fa53b63ae Merge branch 'main' into destructors-for-unconditional-unnamed 2024-04-08 15:42:35 +01:00
Mathias Vorreiter Pedersen
9c25ce4079 C++: Add testcase with two destructor calls without a temporary object expression at the top-level. 2024-04-08 15:35:33 +01:00
Mathias Vorreiter Pedersen
e08790d21e Merge pull request #16146 from MathiasVP/missing-destructor-for-parameter
C++: Add example with missing destructor call on parameter
2024-04-08 15:33:00 +01:00
Mathias Vorreiter Pedersen
b581a9ba04 C++: Add example with missing destructor calls on parameters passed by value. 2024-04-08 13:49:05 +01:00
Asger F
f08e8b1d5e Merge pull request #16136 from asgerf/js/instance-to-subclasses
JS: Make getInstance() propagate to subclasses
2024-04-08 14:37:42 +02:00
Jeroen Ketema
ad1139d3af Merge pull request #16116 from jketema/cpp-version-in-doc
C++: Update supported compiler versions based on frontend documentation
2024-04-08 14:09:40 +02:00
Mathias Vorreiter Pedersen
febd06063a C++: Add testcase where two destructor calls are remapped to a temporary object expression. 2024-04-08 13:03:51 +01:00
Michael Nebel
fc689efd1b C#: Add debug version of the getFullyQualifiedName predicate. 2024-04-08 13:47:59 +02:00
Michael Nebel
8fbfafc1d7 C#: Dont cache the deprecated getFullyQualifiedName predicate. 2024-04-08 13:46:45 +02:00
Michael Nebel
b677e89f35 C#: Deprecate getFullyQualifiedNameWithTypes. 2024-04-08 13:46:45 +02:00
Michael Nebel
8fa9191434 C#: Deprecate the getFullyQualifiedName predicate. 2024-04-08 13:46:44 +02:00
Michael Nebel
2fb9c2db6f C#: Remove deprecated qualifiedName predicates. 2024-04-08 13:46:44 +02:00
Tamas Vajk
d7f8b96158 Improve logging 2024-04-08 13:15:33 +02:00
Tamas Vajk
95896bc95f Make sure diagnostic directory exists 2024-04-08 13:15:32 +02:00
Tamas Vajk
6a5520c85d Add integration test for unreachable nuget feeds 2024-04-08 13:15:32 +02:00
Tamas Vajk
7051db5e1c Fix code review findings 2024-04-08 13:15:32 +02:00
Tamas Vajk
9aa85f2d13 C#: Validate all nuget feeds to respond in reasonable time 2024-04-08 13:15:20 +02:00
Geoffrey White
ec515f967d C++: Update QLDoc. 2024-04-08 11:57:35 +01:00
erik-krogh
642a134035 add tests for the fixes in the qhelp, and fix an FP that appeared 2024-04-08 12:00:27 +02:00
erik-krogh
59c72b683c update the url-redirect QHelp 2024-04-08 12:00:27 +02:00
Tom Hvitved
aa24c29395 Merge pull request #16122 from hvitved/ruby/cfg-may-raise-issue
Ruby: Fix CFG for nodes that may raise
2024-04-08 11:20:49 +02:00
Mathias Vorreiter Pedersen
9917c3c5ba C++: Add change note. 2024-04-08 10:10:31 +01:00
Mathias Vorreiter Pedersen
fae002fbb7 C++: Accept test changes. 2024-04-08 10:10:31 +01:00
Mathias Vorreiter Pedersen
4831ee65b6 C++: Enable sound IR. 2024-04-08 10:10:31 +01:00
Mathias Vorreiter Pedersen
b8e6632bf1 Merge pull request #16140 from MathiasVP/alias-model-for-fopen
C++: Add alias models for `fopen` and friends
2024-04-08 10:09:54 +01:00
Rasmus Wriedt Larsen
dfe2f1a52b Merge pull request #16127 from RasmusWL/remove-dep-inst-fallback
Python: Extractor: Remove dependency installation fallback
2024-04-08 10:43:50 +02:00
Asger F
ad9838d0fe JS: Add change note 2024-04-08 10:02:28 +02:00
Asger F
6e931000c2 JS: Rewrite docs for API::Node#getInstance() 2024-04-08 10:02:22 +02:00
Asger F
d829dd435f JS: Update docs 2024-04-08 10:00:06 +02:00
erik-krogh
018b066b95 autoformat 2024-04-08 07:15:33 +02:00
erik-krogh
ca4f667053 add fallback if I can't easily determine the variable 2024-04-08 07:14:48 +02:00
erik-krogh
8b220cc1b3 also get the variable for array accesses 2024-04-08 07:14:48 +02:00
erik-krogh
795b767b6e add link to the source variable in the alert-message for java/implicit-cast-in-compound-assignment 2024-04-08 07:14:48 +02:00
Mathias Vorreiter Pedersen
d40fa4cfba C++: Accept test changes. 2024-04-07 15:50:16 +01:00
Mathias Vorreiter Pedersen
8a6a60e59b C++: Also handle destructor calls on converted expressions in PrintAST. 2024-04-07 15:49:50 +01:00
Mathias Vorreiter Pedersen
fcd0e9999c C++: Accept test changes. 2024-04-07 15:49:27 +01:00
Mathias Vorreiter Pedersen
89eaadd76f C++: Move destructor calls from expressions with a temporary object conversion to the temporary object conversion. 2024-04-07 15:48:38 +01:00
Mathias Vorreiter Pedersen
a0de95dc44 C++: Add testcases that produces an 'missingOperandType' and 'missingPhiOperand' consistency errors. 2024-04-07 14:26:30 +01:00
Mathias Vorreiter Pedersen
557555eb71 C++: Make Code Scanning happy. 2024-04-05 19:03:03 +01:00
Mathias Vorreiter Pedersen
777755a241 C++: Add alias models for 'fopen'. 2024-04-05 19:02:23 +01:00
Mathias Vorreiter Pedersen
45e71543b4 C++: Accept test changes. 2024-04-05 18:08:25 +01:00
Mathias Vorreiter Pedersen
54e4103e71 C++: Fix another multiple parents problem. 2024-04-05 18:07:53 +01:00
Mathias Vorreiter Pedersen
955f9c735c C++: Add a failing testcase. 2024-04-05 18:05:30 +01:00
Mathias Vorreiter Pedersen
2256c4c008 Merge pull request #15728 from MathiasVP/shared-typeflow-library
Java/Shared: Refactor `TypeFlow.qll` into a shared library
2024-04-05 16:24:17 +01:00
Mathias Vorreiter Pedersen
c85db2a026 Merge pull request #16137 from MathiasVP/swift-5.10-support-fix
Docs: Remove Swift version in footnote
2024-04-05 14:59:39 +01:00
Mathias Vorreiter Pedersen
d114d09d73 Docs: Remove Swift version in footnote. 2024-04-05 14:52:19 +01:00
Mathias Vorreiter Pedersen
4c01c06f0c C++: Accept test changes. 2024-04-05 14:49:22 +01:00
Mathias Vorreiter Pedersen
f1d2dac648 C++: Fix a bug where the destructor attached to a 'new' expression would
have multiple parents (the 'new' expression, the call to 'operator new',
and the size expression). This happens because the latter two are
'TranslatedExpr's that return the 'new' expression as their expression
even though they don't technically represent the translation of this
expression.
To prevent this bug we tell the IR construction that the latter two
handle their destructors explicitly which means that IR construction
doesn't try to synthesize them.
2024-04-05 14:46:27 +01:00
Mathias Vorreiter Pedersen
b042366c8e C++: Add a failing testcase. 2024-04-05 14:41:11 +01:00
Asger F
cd84fa4bee JS: Make getInstance() propagate to subclasses 2024-04-05 15:12:02 +02:00
Mathias Vorreiter Pedersen
27688bf154 Shared: Rename 'joinStep' to 'joinStepNotNull' to prevent name clashes. Rename 'sccJoinStep' to 'sccJoinStepNotNull' to match the new name. 2024-04-05 13:25:29 +01:00
Mathias Vorreiter Pedersen
bae633ad24 Shared: Make 'erasedHaveIntersection' more identical to the Java version. 2024-04-05 13:19:21 +01:00
Mathias Vorreiter Pedersen
9deeb67af4 Update shared/typeflow/codeql/typeflow/internal/TypeFlowImpl.qll
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2024-04-05 13:10:08 +01:00
Mathias Vorreiter Pedersen
ba347bdcf2 Merge pull request #16133 from MathiasVP/swift-5.10-support-docs
Docs: Mark Swift version 5.10 as supported
2024-04-05 13:07:09 +01:00
Mathias Vorreiter Pedersen
bffa262a2c Shared: Make 'getAStrictAncestor' private. 2024-04-05 13:04:26 +01:00
Mathias Vorreiter Pedersen
96e205a4a6 Docs: Mark Swift 5.10 as supported. 2024-04-05 12:59:07 +01:00
Mathias Vorreiter Pedersen
a2c29fe094 Shared: nomagicify 'getASourceSupertype'. 2024-04-05 12:57:11 +01:00
Mathias Vorreiter Pedersen
3f6967829e Update shared/typeflow/codeql/typeflow/internal/TypeFlowImpl.qll
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2024-04-05 12:53:23 +01:00
Mathias Vorreiter Pedersen
1775bdee5f Java: Remove redundant qualifiers. 2024-04-05 12:52:04 +01:00
Mathias Vorreiter Pedersen
26cf8df8d6 Update java/ql/lib/semmle/code/java/dataflow/TypeFlow.qll
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2024-04-05 12:50:26 +01:00
Mathias Vorreiter Pedersen
3f63d3a865 Update java/ql/lib/semmle/code/java/dataflow/TypeFlow.qll
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2024-04-05 12:49:40 +01:00
Mathias Vorreiter Pedersen
1acbb84444 Shared/Java: Make the 'isNull' interface slightly prettier. 2024-04-05 11:58:43 +01:00
Pierre
e5b7957e4a Merge pull request #16130 from github/sitedocs/2.17.0
Add changelog for 2.17.0
2024-04-05 12:46:45 +02:00
Taus
ef9f99b3be Python: Remove unparse.py 2024-04-05 12:30:40 +02:00
Taus
599f573a4a Python: Preserve comments and docstrings in extractor 2024-04-05 12:30:40 +02:00
Taus
752d28c1b9 Python: Update repinning instructions
This aligns us better with the corresponding instructions for
the Ruby extractor.
2024-04-05 12:30:40 +02:00
Taus
7bec41096c Python: Rename tsg-build target to tsp-build
The latter makes more sense, as it's actually building
`tree-sitter-python`.
2024-04-05 12:30:40 +02:00
Mathias Vorreiter Pedersen
bb2c690bdd C++: Accept test changes. 2024-04-05 09:49:38 +01:00
Mathias Vorreiter Pedersen
d279e3f17a C++: Suppress destructor calls for the right-hand side of logical operations since these are also conditional. 2024-04-05 09:47:11 +01:00
Mathias Vorreiter Pedersen
e63a607eb3 C++: Add another test with conditional construction. 2024-04-05 09:41:50 +01:00
Pierre
268141822d Merge branch 'main' into sitedocs/2.17.0 2024-04-05 09:39:18 +02:00
erik-krogh
6d3244d01c update expected outputs with an FP 2024-04-05 09:36:44 +02:00
erik-krogh
3ab73c8552 C++: Improve the cpp/path-injection qhelp 2024-04-05 09:36:39 +02:00
Pierre
9e49c5f185 Add changelogs for 2.16.6 (to this branch) and 2.17.0 (new) 2024-04-05 09:34:27 +02:00
Pierre
0604b4cc14 Changelog mergeback for versions prior to 2.17.0 2024-04-05 09:33:51 +02:00
Owen Mansel-Chan
e10333bf2b Merge pull request #14919 from github/java/jdk-model-autogeneration
Java: add dataflow-generated models for JDK17
2024-04-04 21:12:55 +01:00
Owen Mansel-Chan
32ea94e625 Merge pull request #16123 from owen-mc/go/misc-trivial-fixes
Go: miscellaneous trivial fixes
2024-04-04 21:09:15 +01:00
Mathias Vorreiter Pedersen
b6ddb97e40 C++: Accept test changes. 2024-04-04 20:02:02 +01:00
Mathias Vorreiter Pedersen
f098b8eb82 C++: Make sure the edge kind out of a throw is an 'ExceptionEdge' even if destructors are called. 2024-04-04 20:01:52 +01:00
Geoffrey White
bdc3d10cdb C++: QLDoc SummaryCall, SourceCallable and SummarizedCallable. 2024-04-04 17:13:59 +01:00
Geoffrey White
49ef677b1d C++: Additional test case for function pointers. 2024-04-04 16:53:29 +01:00
Geoffrey White
144c19db74 C++: Add a test of SummaryCalls, SummarizedCallables and sourceCallables. 2024-04-04 16:50:50 +01:00
Mathias Vorreiter Pedersen
587ae07579 C++: Accept query test changes. 2024-04-04 16:23:41 +01:00
Mathias Vorreiter Pedersen
8f11cb64ec C++: Accept test changes. 2024-04-04 16:03:06 +01:00
Mathias Vorreiter Pedersen
180888616b C++: Properly handle the case where a TranslatedElement has no children. 2024-04-04 16:02:01 +01:00
Mathias Vorreiter Pedersen
805b4d6465 C++: Add a failing testcase. 2024-04-04 16:01:25 +01:00
Rasmus Wriedt Larsen
4faff83aa0 Python: Extractor: Remove dependency installation fallback 2024-04-04 16:49:55 +02:00
Dave Bartolomeo
2336e14627 Remove expectation of spurious diagnostic 2024-04-04 10:31:05 -04:00
Mathias Vorreiter Pedersen
774efb5f3f Merge branch 'main' into destructors-for-unconditional-unnamed 2024-04-04 15:04:34 +01:00
Asger F
b8b8e2b991 Merge pull request #16054 from asgerf/js/call-graph-improvement2
JS: more implied receiver steps
2024-04-04 15:54:06 +02:00
Mathias Vorreiter Pedersen
0b7070feec C++: Accept test changes. 2024-04-04 14:51:16 +01:00
Mathias Vorreiter Pedersen
73602dca92 C++: Also suppress destructor calls on throwing ternary expressions. 2024-04-04 14:51:11 +01:00
Mathias Vorreiter Pedersen
a6a0e20176 C++: Accept test changes. 2024-04-04 14:45:20 +01:00
Mathias Vorreiter Pedersen
796fcfec6c C++: Handle conversions in 'isInConditionalEvaluation'. 2024-04-04 14:44:16 +01:00
Erik Krogh Kristensen
0cfac605bd Merge pull request #16100 from erik-krogh/fix-js-rb-typo
RB: fix language specifier typo in qhelp for rb/multi-char-san
2024-04-04 15:42:45 +02:00
Mathias Vorreiter Pedersen
56a132fa8e C++: Accept test changes. 2024-04-04 14:41:24 +01:00
Mathias Vorreiter Pedersen
a756f14e77 C++: Only report implicit destructors if we need to translate them. 2024-04-04 14:41:23 +01:00
Tamas Vajk
e42639852c C#: Move nuget related DependencyManager methods to separate file 2024-04-04 14:25:09 +02:00
Tom Hvitved
ce3b359813 Ruby: Fix CFG for nodes that may raise 2024-04-04 13:27:29 +02:00
Tom Hvitved
6d2d9654b5 Ruby: Add CFG test 2024-04-04 13:27:29 +02:00
Mathias Vorreiter Pedersen
d4e2d37311 C++: Add a simple test that fails. 2024-04-04 11:29:25 +01:00
Mathias Vorreiter Pedersen
cf996f8600 C++: Accept test changes. 2024-04-04 11:28:33 +01:00
Robert Marsh
17e8c95e7f C++: suppress destructors on conditional temporaries 2024-04-04 11:28:10 +01:00
Mathias Vorreiter Pedersen
894d934de8 C++: Accept test changes. 2024-04-04 11:28:01 +01:00
Owen Mansel-Chan
7fc5265168 Misc small tidy-ups mostly suggested by linter 2024-04-04 10:51:22 +01:00
Owen Mansel-Chan
68321dd9ec Use nil for optional argument to packages.Visit 2024-04-04 10:51:13 +01:00
Owen Mansel-Chan
d9fe39d5ae Extractor: add comment about tw.Package.TypesInfo.Defs 2024-04-04 10:37:31 +01:00
Owen Mansel-Chan
720961787b Improve QLDoc for CaseClause 2024-04-04 10:37:25 +01:00
Jeroen Ketema
a8f27af6d8 Merge pull request #16119 from jketema/coroutine2
C++: Add more missing variable declaration tests
2024-04-04 11:35:52 +02:00
Robert Marsh
75c453fd30 C++: Unsuppress temporary destructors in IR 2024-04-04 10:29:59 +01:00
Jeroen Ketema
70491c4a8d C++: Add more missing variable declaration tests 2024-04-04 10:54:09 +02:00
Tom Hvitved
c03b74545d Merge pull request #16115 from hvitved/dataflow/fix-bad-join
Data flow: Fix bad join
2024-04-04 10:51:22 +02:00
Jeroen Ketema
55d1f43239 C++: Update supported compiler versions based on frontend documentation 2024-04-04 10:18:56 +02:00
Tom Hvitved
79440f6734 Data flow: Fix bad join
```
Evaluated relational algebra for predicate DataFlowImpl::Impl<PolynomialReDoSQuery::PolynomialReDoSFlow::C>::storeEx/5#34133ef9@0425e0m7 with tuple counts:
           2209132     ~1%    {6} r1 = SCAN `DataFlowImpl::Impl<PolynomialReDoSQuery::PolynomialReDoSFlow::C>::storeExUnrestricted/5#3a86a98e` OUTPUT In.1, In.0, In.1, In.2, In.3, In.4
        4338565685     ~1%    {6}    | JOIN WITH `DataFlowPublic::ContentSet.getAReadContent/0#dispred#e4acf74e_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Lhs.5
          34811200  ~1428%    {5}    | JOIN WITH `project#DataFlowImpl::Impl<PolynomialReDoSQuery::PolynomialReDoSFlow::C>::readSetEx/3#35ac556a` ON FIRST 1 OUTPUT Lhs.1, Lhs.2, Lhs.3, Lhs.4, Lhs.5
                              return r1
```
2024-04-04 10:02:02 +02:00
Tom Hvitved
c2f91a5ccf Merge pull request #16104 from hvitved/csharp/more-compiler-generated
C#: Mark more expressions as compiler generated
2024-04-04 09:09:16 +02:00
Tom Hvitved
fc02938687 Merge pull request #16088 from hvitved/csharp/library-property-store
C#: Include all non-source-code properties in data flow
2024-04-04 09:04:00 +02:00
Tamás Vajk
7beb73729d Merge pull request #16036 from tamasvajk/autobuilder/disposable
C#: Properly dispose diagnostic writer objects
2024-04-04 08:21:11 +02:00
Tom Hvitved
813f5b99e7 C#: Update PrintAST query 2024-04-03 20:03:02 +02:00
Tom Hvitved
d93d6585d9 C#: Mark more expressions as compiler generated 2024-04-03 20:03:02 +02:00
Tom Hvitved
c2d771b334 Ruby: Reduce alerts produced by MassAssignment.ql 2024-04-03 19:58:51 +02:00
Tom Hvitved
3c96bf6b22 Fix bad join 2024-04-03 19:41:37 +02:00
Erik Krogh Kristensen
35f61d9de4 Merge pull request #16107 from erik-krogh/fix-log-injection-typo
RB: Tiny fixes to log-injection QHelp
2024-04-03 18:29:37 +02:00
Tom Hvitved
2d4cf55c87 Merge pull request #15985 from hvitved/ruby/phi-barrier-guards
Ruby: Extend barrier guards to handle phi inputs
2024-04-03 15:22:39 +02:00
Tom Hvitved
7871fb8ce6 Data flow: Block flow at expectsContents nodes in parameterValueFlow 2024-04-03 15:19:34 +02:00
Tom Hvitved
137594cf36 Ruby: Add regression test 2024-04-03 15:19:34 +02:00
Geoffrey White
a8742ea111 C++: PascalCase and US spelling fixes. 2024-04-03 14:17:55 +01:00
Owen Mansel-Chan
fe24710c96 Improve QLDoc of Entity.getDeclaration 2024-04-03 14:09:37 +01:00
Owen Mansel-Chan
c7f2e991ed Improve QLDoc for TypeAssertExpr
Include information about the type assert `x.(type)` used in type switches.
2024-04-03 13:59:04 +01:00
Owen Mansel-Chan
698debfa20 Extractor: explicitly deal with extracting x.(type) in type switches 2024-04-03 13:58:58 +01:00
Tamás Vajk
9be2b9cbdb Merge pull request #16108 from tamasvajk/cleanup/utils
C#: Remove unused classes from `Util` project
2024-04-03 14:24:58 +02:00
Tamás Vajk
362a109e04 Remove redundant implemented interface
Co-authored-by: Michael Nebel <michaelnebel@github.com>
2024-04-03 14:23:36 +02:00
Tom Hvitved
8b78463f25 Merge pull request #16087 from hvitved/dataflow/store-step-exploration
Data flow: Do not require stores to have matching reads in flow exploration
2024-04-03 14:10:28 +02:00
Tom Hvitved
550e251d68 Data flow: Do not require stores to have matching reads in flow exploration 2024-04-03 13:28:24 +02:00
Tamas Vajk
75894d581c C#: Remove unused classes from Util project 2024-04-03 12:15:37 +02:00
Tom Hvitved
1dc13cc169 Merge pull request #15923 from hvitved/shared-xml-impl
Properly shared `XML.qll` implementation
2024-04-03 11:39:50 +02:00
Tom Hvitved
64e82bb00e C#: Include all non-source-code properties in data flow 2024-04-03 10:22:36 +02:00
Tom Hvitved
cccb11f697 Merge pull request #16091 from hvitved/csharp/system-diagnostics-modules
C#: Neutralize some `System.Diagnostics` generated models
2024-04-03 10:21:56 +02:00
Tamas Vajk
fbec197d4a Move TSP diagnostics related classes to separate files 2024-04-03 10:13:44 +02:00
Tamas Vajk
305fa84186 Change IDiagnosticsWriter to implement IDisposable 2024-04-03 10:08:46 +02:00
Tamas Vajk
0f980e2b97 C#: Properly dispose diagnostic writer objects 2024-04-03 09:47:24 +02:00
erik-krogh
ec32bdce63 fix unsanitized -> sanitized typo, and don't add a new variable just to remove newlines 2024-04-03 09:19:18 +02:00
Tamás Vajk
d7e514913f Merge pull request #16039 from tamasvajk/fix/buildless-references
C#: Reword public mentions of C# buildless
2024-04-03 09:19:13 +02:00
Dave Bartolomeo
ce98353d22 Allow @param tags to apply to record parameters 2024-04-02 15:15:11 -04:00
Chuan-kai Lin
1f27eb3658 Merge pull request #16102 from github/post-release-prep/codeql-cli-2.17.0
Post-release preparation for codeql-cli-2.17.0
2024-04-02 11:47:23 -07:00
github-actions[bot]
19797fdd27 Post-release preparation for codeql-cli-2.17.0 2024-04-02 18:20:44 +00:00
Chuan-kai Lin
839ca60f90 Merge pull request #16099 from github/release-prep/2.17.0
Release preparation for version 2.17.0
2024-04-02 11:07:43 -07:00
erik-krogh
572d3ba542 fix language specifier typo in qhelp for rb/multi-char-san 2024-04-02 19:40:46 +02:00
github-actions[bot]
c511de2eae Release preparation for version 2.17.0 2024-04-02 17:15:41 +00:00
Chuan-kai Lin
b87cf3c41a Merge pull request #16098 from github/revert-16085-release-prep/2.17.0
Revert "Release preparation for version 2.17.0"
2024-04-02 10:11:15 -07:00
Chuan-kai Lin
6c649c898e Revert "Release preparation for version 2.17.0" 2024-04-02 10:06:20 -07:00
Mathias Vorreiter Pedersen
4baa9ad8c8 C++: Accept test changes. 2024-04-02 18:02:43 +01:00
Mathias Vorreiter Pedersen
baa508d336 C++: Add some simple coroutine tests. 2024-04-02 18:02:43 +01:00
Geoffrey White
db60360293 C++: Add a test case where a function has a MAD model *and* an implementation. 2024-04-02 17:50:00 +01:00
Geoffrey White
9c4567bd6d Swift: Additional models-as-data doc change I missed out in the other PR - neither CPP nor Swift support 'Parameter' with no argument in an access path. 2024-04-02 16:18:25 +01:00
Geoffrey White
f2ef4ad6ac C++: Update for the provenance changes. 2024-04-02 16:15:08 +01:00
Geoffrey White
57beb73bf7 C++: Update for the dataflow hasLocationInfo -> getLocation change made on main. 2024-04-02 16:15:06 +01:00
Geoffrey White
f1ead2554f C++: Trivial merge fixes. 2024-04-02 16:15:05 +01:00
Geoffrey White
33164c8a43 Merge branch 'main' into mad 2024-04-02 16:14:53 +01:00
Michael B. Gale
48f93438d8 Merge pull request #16096 from github/mbg/go/revert-auto-version-fixing
Go: Revert `go version` call in `LoadGoModules`
2024-04-02 16:01:45 +01:00
Geoffrey White
11acb499bb Merge pull request #16042 from geoffw0/maddoc
Remove [potentially] untrue claims about models-as-data
2024-04-02 16:01:31 +01:00
Rasmus Wriedt Larsen
a22b9947c0 Python: Revert IterableSequenceNode as LocalSourceNode
When looking things over a bit more, we could actually exclude the steps
that would never be used instead. A much more involved solution, but
more performance oriented and clear in terms of what is supported (at
least until we start supporting type-tracking with more than depth 1
access-path, if that ever happens)
2024-04-02 16:51:00 +02:00
Michael B. Gale
55fa245194 Go: Revert go version call in LoadGoModules 2024-04-02 15:20:56 +01:00
Mathias Vorreiter Pedersen
0bf742b82d Merge pull request #16089 from MathiasVP/fix-double-free-join
C++: Fix join order in 'cpp/double-free'.
2024-04-02 14:15:51 +01:00
Asger F
2feb00bb2e Merge pull request #13303 from asgerf/js/use-server-and-client
JS: Move Directive subclasses into module and support "use client/server"
2024-04-02 15:13:45 +02:00
Michael Nebel
c378d6a661 Merge pull request #16027 from github/workflow/coverage/update
Update CSV framework coverage reports
2024-04-02 14:08:09 +02:00
Tom Hvitved
368a500d93 C#: Neutralize some System.Diagnostics generated models 2024-04-02 13:58:55 +02:00
Felicity Chapman
75eee04f3e Merge pull request #15890 from intrigus-lgtm/patch-9
[cpp-docs] Fix 404 link in guards library doc.
2024-04-02 12:49:03 +01:00
Rasmus Wriedt Larsen
8707a63edb Python: Add comments around storeStepCommon 2024-04-02 13:26:26 +02:00
Rasmus Wriedt Larsen
20202aba90 Python: Deprecate AttributeName 2024-04-02 13:21:46 +02:00
Ian Lynagh
e610573411 Merge pull request #16078 from igfoo/igfoo/exprs_changes
Kotlin 2: Accept more changes
2024-04-02 12:19:17 +01:00
Ian Lynagh
e5999f76b0 Merge pull request #16079 from igfoo/igfoo/del
Kotlin 2: Accept some more location changes
2024-04-02 12:18:58 +01:00
Harry Maclean
409f46ef7b Merge pull request #14308 from hmac/hmac-rb-csrf-not-enabled
Ruby: Add a query for CSRF protection not enabled
2024-04-02 11:30:36 +01:00
Jeroen Ketema
3c8c45872e Merge pull request #16060 from jketema/qual-fix
C++: Output destructor calls for delete expressions
2024-04-02 11:49:51 +02:00
Henry Mercer
9409d7fdca Merge pull request #16066 from github/henrymercer/ql-run-diagnostics
QL: Run diagnostics and summary metrics in code scanning
2024-04-02 10:45:50 +01:00
Mathias Vorreiter Pedersen
352e7de07d C++: Accept test changes. 2024-04-02 10:43:10 +01:00
Jeroen Ketema
01183800a6 C++: Fix formatting 2024-04-02 11:38:19 +02:00
Jeroen Ketema
9190bf25ce C++: Add example to QLDoc 2024-04-02 11:35:43 +02:00
Rasmus Wriedt Larsen
f33222c83b JS: Add change-note 2024-04-02 11:10:53 +02:00
Mathias Vorreiter Pedersen
bd0ddec630 C++: Fix join order in 'cpp/double-free'. 2024-04-02 09:59:53 +01:00
Jeroen Ketema
a5d4fad806 C++: Output destructor calls for delete expressions 2024-04-02 10:32:03 +02:00
Tom Hvitved
a8dac17aec Merge pull request #16016 from hvitved/csharp/remove-lgtm-autobuilder-options
C#: Remove support for legacy LGTM options in autobuilder
2024-04-02 10:03:10 +02:00
Erik Krogh Kristensen
332c1e3b8a Merge pull request #16026 from erik-krogh/htmlSafeSan
RB: Add barrier guard for `.html_safe?` to the XSS queries
2024-04-02 07:54:19 +02:00
Erik Krogh Kristensen
0fd89549da Merge pull request #16033 from github/dependabot/cargo/ql/regex-1.10.4
Bump regex from 1.10.3 to 1.10.4 in /ql
2024-04-02 07:52:17 +02:00
Erik Krogh Kristensen
58bf0b709f Merge pull request #16077 from github/dependabot/cargo/ql/chrono-0.4.37
Bump chrono from 0.4.35 to 0.4.37 in /ql
2024-04-02 07:51:49 +02:00
github-actions[bot]
55987d9c1f Add changed framework coverage reports 2024-04-02 00:16:19 +00:00
Chuan-kai Lin
0bc9318400 Merge pull request #16086 from github/post-release-prep/codeql-cli-2.17.0
Post-release preparation for codeql-cli-2.17.0
2024-04-01 08:41:39 -07:00
github-actions[bot]
8e61c6625b Post-release preparation for codeql-cli-2.17.0 2024-04-01 15:27:42 +00:00
Chuan-kai Lin
6475034b09 Merge pull request #16085 from github/release-prep/2.17.0
Release preparation for version 2.17.0
2024-04-01 06:53:52 -07:00
github-actions[bot]
ec97d9a304 Release preparation for version 2.17.0 2024-04-01 13:46:57 +00:00
Owen Mansel-Chan
fdafaa2ff4 Change note: update numbers of models added 2024-04-01 14:04:01 +01:00
Owen Mansel-Chan
e3fb40a842 Adjust change note 2024-04-01 14:03:53 +01:00
Owen Mansel-Chan
a5979e209a Add change note 2024-04-01 14:03:47 +01:00
Owen Mansel-Chan
fa614df3f4 Tests fixed by model for CharBuffer.wrap(char[]) 2024-04-01 14:03:42 +01:00
Owen Mansel-Chan
2d24fe011b Accept that lots of sinks are now summaries as well 2024-04-01 14:03:36 +01:00
Owen Mansel-Chan
9067a337b0 Test fixed by model for BasicAttributes(String, Object) 2024-04-01 14:03:30 +01:00
Owen Mansel-Chan
776c9d9eb2 Accept changes to top jdk apis test 2024-04-01 14:03:23 +01:00
Owen Mansel-Chan
52e6ea30e7 Accept more capture summary models
This line is added because `FileOutputStream`'s constructor is now modeled as propagating taint, not just as a sink.
| p;PrivateFlowViaPublicInterface$SPI;true;openStream;();;Argument[this];ReturnValue;taint;df-generated |
2024-04-01 14:03:00 +01:00
Owen Mansel-Chan
919436efbb Remove df-gen models we have deliberately modeled
Manual models always take precedence over generated models, so there is
no point in keeping the generated models.

These manual models were deliberately written to take precedence over
the corresponding df-gen models.
2024-04-01 13:59:36 +01:00
Jami
d889e3cf98 Merge pull request #14854 from jcogs33/jcogs33/unsafe-url-forward-promotion
Java: Promote Unsafe URL Forward query from experimental
2024-03-29 16:34:06 -04:00
Geoffrey White
fa26b55452 C++: Add models-as-data models for ZMQ networking library + wiring. 2024-03-28 21:50:07 +00:00
Geoffrey White
16f9ad06ef C++: Add a test for ZMQ network library sources as well. 2024-03-28 21:50:07 +00:00
Geoffrey White
891f05c5ae C++: Add a test for simple sinks involving ZMQ networking library. 2024-03-28 21:50:07 +00:00
Geoffrey White
5618001c3f C++: More QLDoc refinement. 2024-03-28 21:50:07 +00:00
Jami
2f8c4df309 docs wording updates
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
2024-03-28 16:15:05 -04:00
James Fletcher
5b1cae5fc2 Merge pull request #16076 from github/jf205-patch-1
Make customizing-library-models-for-javascript.rst visible to search and the docs TOC
2024-03-28 17:05:32 +00:00
Calum Grant
ef2e2e4067 Merge pull request #16071 from github/calumgrant/cpp-analysis
Add C++ analysis in separate workflow
2024-03-28 17:53:53 +01:00
Ian Lynagh
3acdc73f22 Kotlin 2: Accept some more location changes 2024-03-28 16:15:37 +00:00
Ian Lynagh
568fba6940 Kotlin 2: Accept some more test changes 2024-03-28 15:28:36 +00:00
Ian Lynagh
0fdc71bf57 Kotlin 2: Accept a test change
For

    if(r != null) {
        val r2: Rectangle = r

in Kotlin 2 mode, there is no IMPLICIT_NOTNULL check in Kotlin 2 mode:

    then: BLOCK type=kotlin.Unit origin=null
      VAR name:r2 type:java.awt.Rectangle [val]
-       TYPE_OP type=java.awt.Rectangle origin=IMPLICIT_NOTNULL typeOperand=java.awt.Rectangle
-         GET_VAR 'val r: @[FlexibleNullability] java.awt.Rectangle? [val] declared in <root>.foo' type=@[FlexibleNullability] java.awt.Rectangle? origin=null
+       GET_VAR 'val r: @[FlexibleNullability] java.awt.Rectangle? [val] declared in <root>.foo' type=@[FlexibleNullability] java.awt.Rectangle? origin=null
      VAR name:height type:kotlin.Int [val]
        GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:height type:kotlin.Int visibility:public' type=kotlin.Int origin=null
          receiver: GET_VAR 'val r2: java.awt.Rectangle [val] declared in <root>.foo' type=java.awt.Rectangle origin=null
2024-03-28 15:23:27 +00:00
Ian Lynagh
96723b1a8f Kotlin 2: Accept some loc changes 2024-03-28 15:11:19 +00:00
Ian Lynagh
24c4c3e068 Kotlin 2: Accept a test change
With:

    open class Root {}
    class Subclass1: Root() {}

    fun typeTests(x: Root, y: Subclass1) {
        val y1: Subclass1 = if (x is Subclass1) { x } else { y }
    }

we now get a slightly different AST, which means we no longer need to
insert a StmtExpr:

     BRANCH
       if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=<root>.Subclass1
         GET_VAR 'x: <root>.Root declared in <root>.typeTests' type=<root>.Root origin=null
-      then: TYPE_OP type=<root>.Subclass1 origin=IMPLICIT_CAST typeOperand=<root>.Subclass1
-        BLOCK type=<root>.Root origin=null
+      then: BLOCK type=<root>.Subclass1 origin=null
+        TYPE_OP type=<root>.Subclass1 origin=IMPLICIT_CAST typeOperand=<root>.Subclass1
           GET_VAR 'x: <root>.Root declared in <root>.typeTests' type=<root>.Root origin=null
2024-03-28 15:07:30 +00:00
Michael B. Gale
73f71d8ace Merge pull request #15979 from github/mbg/go/deal-with-incorrect-versions 2024-03-28 14:16:14 +00:00
Michael B. Gale
f6c22d466f Update toolchain_test.go
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2024-03-28 13:32:02 +00:00
Sid Shankar
aeacfb82c1 Merge pull request #16073 from hmac/ruby-re-add-mad-docs
Ruby: Re-add MaD docs
2024-03-28 09:18:04 -04:00
Paolo Tranquilli
2fa2a5a53c Merge pull request #15984 from github/alexdenisov/swift-5.10
Swift: upgrade to 5.10
2024-03-28 13:58:39 +01:00
Geoffrey White
03d0d984e3 C++: Remove duplicate TDataFlowCallable's and fix three places where we assumed a source callable (two of them would have caused lost results). 2024-03-28 11:39:43 +00:00
Michael B. Gale
977ac71b26 Update toolchain_test.go
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2024-03-28 11:15:30 +00:00
Ian Lynagh
5dcd635403 Merge pull request #15961 from igfoo/igfoo/MissingEnumInSwitch
Java: Limit the amount of results that MissingEnumInSwitch produces per switch
2024-03-28 11:13:45 +00:00
Paolo Tranquilli
a34bb2608d Swift: fix ql format 2024-03-28 11:57:33 +01:00
Paolo Tranquilli
ece0d1f477 Swift: add upgrade/downgrade scripts 2024-03-28 11:54:18 +01:00
Paolo Tranquilli
bfce01cef6 Swift: add change note for Swift 5.10 upgrade 2024-03-28 11:38:39 +01:00
James Fletcher
d57e8efaf2 Update codeql-for-javascript.rst 2024-03-28 10:28:37 +00:00
Geoffrey White
a55f07ac68 C++: QLDoc FlowSummaryNode. 2024-03-28 10:17:39 +00:00
Jeroen Ketema
3d8ac1441a Merge pull request #16074 from jketema/reuse-val-cat
C++: Add value category column to the expr_reuse relation
2024-03-28 10:14:32 +01:00
dependabot[bot]
07f9614dc2 Bump chrono from 0.4.35 to 0.4.37 in /ql
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.35 to 0.4.37.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.35...v0.4.37)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-28 03:07:21 +00:00
Jeroen Ketema
9eb51a9b9e C++: Add value category column to the expr_reuse relation 2024-03-27 22:49:40 +01:00
Jeroen Ketema
9e47909208 Merge pull request #16065 from geoffw0/codeowners
C++: Divide CODEOWNERS responsibilities.
2024-03-27 22:22:15 +01:00
Harry Maclean
3690f294da Ruby: add MaD doc to TOC tree 2024-03-27 21:02:25 +00:00
Ian Lynagh
b6a1266ade Java: Accept test changes for MissingEnumInSwitch Oxford commas 2024-03-27 18:48:22 +00:00
Harry Maclean
ce0edcc265 Ruby: Make MaD doc visible to search
Co-authored-by: James Fletcher <42464962+jf205@users.noreply.github.com>
2024-03-27 17:29:18 +00:00
James Fletcher
04edd6ec69 Update docs/codeql/codeql-language-guides/codeql-for-javascript.rst 2024-03-27 17:08:47 +00:00
James Fletcher
121fed63a0 Update codeql-for-javascript.rst 2024-03-27 17:06:31 +00:00
James Fletcher
fbc0f57280 Update customizing-library-models-for-javascript.rst 2024-03-27 16:58:11 +00:00
Paolo Tranquilli
e9957aa4a6 Swift: make result a child in ThenStmt 2024-03-27 17:53:36 +01:00
Geoffrey White
103932fec8 C++: Resolve discussed TODO comment. 2024-03-27 16:44:50 +00:00
Geoffrey White
507ada1951 C++: Sort out the localFlow / simpleLocalFlow confusion (and the same for taint). 2024-03-27 16:05:35 +00:00
Harry Maclean
f6e2e1319b Ruby: Link to MaD docs from Ruby doc page
Also remove an internal link from the docs.
2024-03-27 15:30:05 +00:00
Harry Maclean
e6ba0a34f4 Revert "Ruby: remove customizing-library-models-for-ruby.rst"
This reverts commit 5b46256fdb.
2024-03-27 15:24:30 +00:00
Michael B. Gale
45b41bb506 Go: Mirror stdout/stderr output in InstallVersion 2024-03-27 15:18:24 +00:00
Michael B. Gale
6b1d1d427c Go: Add integration test for incorrect version format logic 2024-03-27 15:16:32 +00:00
Michael B. Gale
6ea99825be Go: Add unit test to sanity check HasGoVersion 2024-03-27 15:15:40 +00:00
Michael B. Gale
ab255d70b5 Go: Fix semver-related logic bugs 2024-03-27 15:15:20 +00:00
Ian Lynagh
fda3c92612 Java: Add a changenote for the MissingEnumInSwitch change 2024-03-27 15:12:55 +00:00
Ian Lynagh
59ae6dd5f5 Java: Add a couple of Oxford commas 2024-03-27 15:07:58 +00:00
Michael B. Gale
86bf4fbbc0 Go: Make diagnostic names static 2024-03-27 14:22:58 +00:00
Jami Cogswell
40c932a5f9 Java: move UrlForward.qll code to UrlForwardQuery.qll 2024-03-27 10:12:28 -04:00
Max Schaefer
5b07e14fb3 Merge pull request #16055 from github/max-schaefer/go-open-redirect-qhelp
Go: Improve QHelp for `go/unvalidated-url-redirection`.
2024-03-27 13:56:48 +00:00
Paolo Tranquilli
0243d9f2b9 Swift: accept explicit any in existential type name 2024-03-27 13:49:15 +01:00
Jami Cogswell
2391fe7d89 Java: use InlineFlowTest instead of InlineExpectationsTest 2024-03-27 08:44:17 -04:00
Paolo Tranquilli
d9c40488bb Swift: add ThenStmt to control flow 2024-03-27 13:37:24 +01:00
Paolo Tranquilli
b8e38288e3 Swift: add extraction of ThenStmt
These are currently added implicitly by the compiler in the context of
`if`/`switch` expressions. In the future, there might be explicit
`then <expr>` statement useful for cases where one would like to add
more than one statement in the branch, to mark what value to actually
use.

See https://forums.swift.org/t/pitch-multi-statement-if-switch-do-expressions/68443
2024-03-27 13:26:04 +01:00
Max Schaefer
32ebd4eebb Automodel: Filter unexploitable types in application mode.
We already did this in framework mode.
2024-03-27 12:22:24 +00:00
Arthur Baars
ba89f1b6b1 Merge pull request #15896 from github/aibaars/java-update-output
Java: update expected output
2024-03-27 13:19:52 +01:00
Jami Cogswell
121b24ea7c Java: remove parentheses 2024-03-27 08:16:06 -04:00
Owen Mansel-Chan
311512c768 Remove df-gen models for incidentally modelled APIs
Manual models always take precedence over generated models, so there is
no point in keeping the generated models.

These APIs happened to have been modelled between model generation and
merging this PR.
2024-03-27 12:15:08 +00:00
Owen Mansel-Chan
f03a56f7e0 Run generation script
The command line was:
python3 /Users/owen-mc/workspace/codeql-home/codeql/java/ql/src/utils/modelgenerator/GenerateFlowModel.py /Users/owen-mc/db/java/openjdk17 --with-summaries --with-neutrals
2024-03-27 12:15:00 +00:00
Jami Cogswell
35fbc95cc7 Java: remove redundant line 2024-03-27 08:09:40 -04:00
Mathias Vorreiter Pedersen
7bb2b57394 Merge pull request #15964 from rdmarsh2/rdmarsh2/cpp/temp-destructors-extended
C++: IR translation for destruction of temporaries with extended lifetimes
2024-03-27 11:58:48 +00:00
Calum Grant
03bf804a68 Add C++ analysis in separate workflow 2024-03-27 11:44:58 +00:00
Mathias Vorreiter Pedersen
8711232a38 Merge pull request #16069 from jketema/var-templ
C++: Add `VariableTemplateInstantiation` class
2024-03-27 11:31:35 +00:00
Paolo Tranquilli
2382f76317 Swift: ignore experimental ThenStmt 2024-03-27 12:23:37 +01:00
Paolo Tranquilli
f9d10cec08 Swift: fix DeclTranslator.cpp compile errors 2024-03-27 12:21:28 +01:00
Ian Lynagh
6cd94cf253 Merge pull request #16059 from igfoo/igfoo/exprs
Kotlin 2: Accept more location changes
2024-03-27 11:17:07 +00:00
Jeroen Ketema
050682c477 C++: Update expected test results 2024-03-27 12:03:37 +01:00
Paolo Tranquilli
8e9b4336da Merge branch 'main' into alexdenisov/swift-5.10 2024-03-27 11:35:14 +01:00
Jeroen Ketema
27c6e2421c C++: Add VariableTemplateInstantiation class
This adds some uniformity, as we already had `FunctionTemplateInstantiation` and
`ClassTemplateInstantiation` classes.
2024-03-27 11:35:13 +01:00
Tony Torralba
b617667b0e Merge pull request #16062 from atorralba/atorralba/java/more-neutrals
Java: Add more neutrals and improve `java.net.URL` models
2024-03-27 10:41:38 +01:00
Geoffrey White
30c9ec1926 C++: Adjust following discussion. 2024-03-27 09:23:48 +00:00
Tony Torralba
7a0446740b Update java/ql/lib/ext/java.net.model.yml
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2024-03-27 09:09:48 +01:00
Henry Mercer
568442d5f8 QL: Run diagnostics and summary metrics in code scanning
Add diagnostics and summary metric queries to the code scanning suite.
2024-03-26 18:11:50 +00:00
Arthur Baars
497325455a Java: update expected output 2024-03-26 18:40:22 +01:00
Geoffrey White
b4a6f75ad7 C++: Divide CODEOWNERS responsibilities. 2024-03-26 17:35:07 +00:00
Mathias Vorreiter Pedersen
3e9602854a Merge pull request #16063 from MathiasVP/taint-inheriting-content-for-cpp
C++: Add `TaintInheritingContent`
2024-03-26 17:28:52 +00:00
Mathias Vorreiter Pedersen
3bfaab9182 C++: Remove debugging conjunct. 2024-03-26 17:01:06 +00:00
Mathias Vorreiter Pedersen
6a8c592900 Update cpp/ql/lib/semmle/code/cpp/ir/dataflow/FlowSteps.qll
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2024-03-26 16:59:18 +00:00
Mathias Vorreiter Pedersen
d610d721a4 C++: Add file QLDoc. 2024-03-26 16:47:39 +00:00
Mathias Vorreiter Pedersen
e3744c435a C++: Add change note. 2024-03-26 16:44:16 +00:00
Mathias Vorreiter Pedersen
ec3d041c8d C++: Accept test changes. 2024-03-26 16:40:18 +00:00
Mathias Vorreiter Pedersen
bd2ecd3346 C++: Add test. 2024-03-26 16:38:28 +00:00
Mathias Vorreiter Pedersen
2075716df7 C++: Add 'TaintInheritingContent'. 2024-03-26 16:37:22 +00:00
Tony Torralba
d786ea90a4 Java: Add more neutrals
Adds more neutral models to help the model generator ignore certain callables.

Also improves the precision of certain URL models by using synthetic fields so that the parts of a URL are tainted separately.
2024-03-26 17:31:11 +01:00
Rasmus Wriedt Larsen
df463e51c1 JS: Extractor: Fix experimental flag value for NodeJSDetectorTests 2024-03-26 17:02:47 +01:00
Rasmus Wriedt Larsen
60944a9bcb JS: Accept new trap files
As I see it, these all seem to have invalid code initially anyway, but
this is definitely something a JS expert should review :)
2024-03-26 17:01:57 +01:00
Rasmus Wriedt Larsen
1d51d182ec JS: Extractor: Explain how to make replaceExpectedOutput work now with bazel 2024-03-26 17:01:57 +01:00
Rasmus Wriedt Larsen
04a0740ccb JS: Extractor: More robust ES2015 checking
Created shared AbstractDetector to not duplicate all the tedious logic
;)

I took inspiration from the tests in  `javascript/extractor/tests/esnext/input/dynamic-import.js`
2024-03-26 17:01:57 +01:00
Rasmus Wriedt Larsen
cd84500c56 JS: Extractor: Separate base detector logic into own file
Should hopefully make it easier to review these changes to have it split into its' own commit :)
2024-03-26 17:01:57 +01:00
Henry Mercer
2de62dfcdd Merge pull request #16058 from github/henrymercer/merge-back-rc-3.13
Merge `rc/3.13` back to `main`
2024-03-26 14:57:31 +00:00
Ian Lynagh
c5604c97bd Kotlin 2: Accept more location changes 2024-03-26 14:10:28 +00:00
Henry Mercer
0646744928 Merge branch 'main' into henrymercer/merge-back-rc-3.13 2024-03-26 12:59:12 +00:00
Michael B. Gale
cf9e2dcea1 Merge pull request #16056 from github/mbg/go/changenote-for-dependency-improvement
Go: Add changenote for `CODEQL_EXTRACTOR_GO_FAST_PACKAGE_INFO` change
2024-03-26 12:50:19 +00:00
Henry Mercer
f89109df7c Merge pull request #16048 from github/post-release-prep/codeql-cli-2.16.6
Post-release preparation for codeql-cli-2.16.6
2024-03-26 12:23:11 +00:00
Geoffrey White
8fbbc2b6d8 C++: Improve QLDoc. 2024-03-26 11:21:25 +00:00
Max Schaefer
d7258f76d3 Go: Improve QHelp for go/unvalidated-url-redirection.
The example showed a different (and better) fix from what the help claimed, but the suggestion also had a subtle bug that I fixed at the same time.
2024-03-26 10:57:36 +00:00
Michael B. Gale
f84609dbc4 Go: Add changenote for CODEQL_EXTRACTOR_GO_FAST_PACKAGE_INFO change 2024-03-26 10:51:57 +00:00
Tamás Vajk
0c5ea975a4 Merge pull request #16021 from tamasvajk/feature/add-buildless-telemetry
C#: Add high level diagnostic messages for buildless extraction (star…
2024-03-26 11:03:20 +01:00
Asger F
22b56a4a40 JS: More implied receiver steps 2024-03-26 10:23:08 +01:00
Asger F
f2939bd05b JS: Add test case 2024-03-26 10:23:08 +01:00
Asger F
f8641dd82d JS: Fix use of deprecated alias 2024-03-26 09:39:39 +01:00
Asger F
a0b49b23f5 JS: Add UseServer and UseClient directives 2024-03-26 09:39:39 +01:00
Asger F
1d22e65851 JS: Move Directive subclasses into Directive module 2024-03-26 09:39:37 +01:00
Dave Bartolomeo
a950de36a0 Merge pull request #16050 from github/dbartol/more-test-fixes
Remove unused data extension in test
2024-03-25 20:50:09 -04:00
Dave Bartolomeo
c11b8f9d51 Remove unused data extension in test 2024-03-25 19:14:54 -04:00
Max Schaefer
ff23f572d0 Merge pull request #16038 from github/max-schaefer/string-break-qhelp
Go: Improve QHelp for `go/unsafe-quoting`.
2024-03-25 20:10:02 +00:00
Max Schaefer
5bc710b406 Apply suggestions from code review
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2024-03-25 19:48:56 +00:00
Dave Bartolomeo
98bf5269a0 Merge pull request #16040 from github/dbartol/qltest-model
Use correct model pack name in qltest data extension
2024-03-25 15:29:16 -04:00
Chris Smowton
f5ebd3d501 Merge pull request #16047 from github/smowton/admin/update-java-supported-version
Update Java version supported to 22
2024-03-25 18:42:35 +00:00
Geoffrey White
ce52cbb428 C++: Disambiguate *n1..n2 doc. 2024-03-25 18:22:28 +00:00
github-actions[bot]
f67b5f9158 Post-release preparation for codeql-cli-2.16.6 2024-03-25 18:17:15 +00:00
Geoffrey White
76780d74d9 C++: Unify four implementations of repeatStars. Note that the recursive approach is faster for very large strings (well over 100 stars), while the concat approach appears to be faster for short strings and does not require an upper bound. 2024-03-25 18:10:21 +00:00
Geoffrey White
95db7aa776 C++: Clean up argument / parameter position logic. 2024-03-25 18:10:21 +00:00
Chris Smowton
757b9bb5fa Update Java version supported to 22 2024-03-25 18:01:30 +00:00
Chris Smowton
6fc99e3ad6 Merge pull request #16023 from smowton/smowton/feature/jdk22-support
Java: support Java 22 language features
2024-03-25 17:58:50 +00:00
Geoffrey White
58737b1d7e C++: We *could* support .Argument with no index, but I'm not convinced we can do so efficiently, so lets not. 2024-03-25 17:08:15 +00:00
Geoffrey White
0a33a6e79b C++: Another test case - Arguments with no specified index. 2024-03-25 17:00:46 +00:00
Henry Mercer
3d82318839 Merge pull request #16045 from github/release-prep/2.16.6
Release preparation for version 2.16.6
2024-03-25 16:59:13 +00:00
github-actions[bot]
71ab804274 Release preparation for version 2.16.6 2024-03-25 16:58:08 +00:00
Geoffrey White
cf35fd4dee C++: Improve ExternalFlow.qll doc. 2024-03-25 16:52:09 +00:00
Geoffrey White
cdafb26423 C++: Fix test failures. 2024-03-25 16:51:36 +00:00
Chris Smowton
dcebcc35b6 Rename getPatternAtIndex 2024-03-25 16:36:38 +00:00
Chris Smowton
568bddc4a9 Add test cases for cases falling directly out of switch blocks 2024-03-25 16:31:40 +00:00
Chris Smowton
17193ac11b Distinguish record patterns that do or don't declare identifiers 2024-03-25 16:31:40 +00:00
Chris Smowton
a4401963f5 Use getAPattern 2024-03-25 16:31:39 +00:00
Chris Smowton
f347784ec2 autoformat 2024-03-25 16:31:39 +00:00
Chris Smowton
3d9bc6fc89 Note pattern-cases may be missing some type-accesses 2024-03-25 16:31:39 +00:00
Chris Smowton
5e0961b348 Account for new possible child index gap 2024-03-25 16:31:39 +00:00
Chris Smowton
9fa2f19990 Add test for guards in the presence of fall-through between pattern and constant cases 2024-03-25 16:31:39 +00:00
Chris Smowton
c48e64e536 Add tests for the combination of anonymous labels and a guard 2024-03-25 16:31:39 +00:00
Chris Smowton
1e0766dffa Add tests for case statement type test dominance against anonymous labels and fall-through 2024-03-25 16:31:39 +00:00
Chris Smowton
f2ff6c476a Add printast tests for anonymous variables 2024-03-25 16:31:38 +00:00
Chris Smowton
5cb5ee026c Fix pretty-printing of anonymous vars and multiple patterns; add test 2024-03-25 16:31:38 +00:00
Chris Smowton
f317f782ae Add test for control-flow with mixed patterns, constants and fall-through 2024-03-25 16:31:38 +00:00
Chris Smowton
6cf956d07a Add CFG test for anonymous variables and fall-throughs with pattern cases 2024-03-25 16:31:38 +00:00
Chris Smowton
cc8dcf63b0 Convert test to use an anonymous local 2024-03-25 16:31:38 +00:00
Chris Smowton
ee36e3b72b autoformat 2024-03-25 16:31:38 +00:00
Chris Smowton
403e86878c Don't mistake a rule case for a fall-through edge 2024-03-25 16:31:37 +00:00
Chris Smowton
5243a62a41 Accept test changes 2024-03-25 16:31:37 +00:00
Chris Smowton
c0874ab04b Fix pattern-case variable pretty-printer 2024-03-25 16:31:37 +00:00
Chris Smowton
f66811048d Fix next-normal-statement predicate 2024-03-25 16:31:37 +00:00
Chris Smowton
bc0724e2b3 Add change note 2024-03-25 16:31:37 +00:00
Chris Smowton
d5443b3f10 Remove dead code 2024-03-25 16:31:37 +00:00
Chris Smowton
29e93edf90 Dataflow: restrict pattern-case flow to unique patterns. 2024-03-25 16:31:37 +00:00
Chris Smowton
00c7dd5f92 Fix a stray use of getPattern 2024-03-25 16:31:36 +00:00
Chris Smowton
e59487a324 Don't regard cases with multiple patterns as conducting a type test 2024-03-25 16:31:36 +00:00
Chris Smowton
c7cb885e71 Add missing javadoc and getUniquePattern predicate 2024-03-25 16:31:36 +00:00
Chris Smowton
f44becea7f Implement multiple pattern case and fall-through pattern case support 2024-03-25 16:31:36 +00:00
Chris Smowton
c283894b4b Fix typo 2024-03-25 16:31:36 +00:00
Chris Smowton
33b807f3bb Parameters and local variables: add isAnonymous predicate 2024-03-25 16:31:36 +00:00
Joe Farebrother
fb19288981 Address review comments - Fix docs typo and add a reference 2024-03-25 15:46:45 +00:00
Geoffrey White
b2a301c206 Swift: Remove claims about 'Annotated'. 2024-03-25 15:45:37 +00:00
Geoffrey White
4a4c77e81d Remove claims about models-as-data that require you to select a parameter from non-Java languages. We believe this is only possible in Java. 2024-03-25 15:41:00 +00:00
Edward Minnix III
7377cbb46e Merge pull request #15930 from egregius313/egregius313/csharp/mad/database/dapper-sources
C#: Sources for the `Dapper` database library
2024-03-25 11:21:51 -04:00
Rasmus Wriedt Larsen
d516db6abc Merge pull request #15903 from yoff/python/test-MaD-keyword-argument
Python: test MaD syntax for keyword argument
2024-03-25 15:51:49 +01:00
Dave Bartolomeo
d805bbcd27 Use correct model pack name in qltest data extension 2024-03-25 10:31:11 -04:00
Tamas Vajk
78912d5eea C#: Reword public mentions of C# buildless 2024-03-25 14:33:51 +01:00
Max Schaefer
120fb93c23 Go: Improve QHelp for go/unsafe-quoting. 2024-03-25 13:32:51 +00:00
Paolo Tranquilli
dea922958b Merge pull request #16034 from github/redsun82/swift-move-integration-tests-to-internal
Swift: prepare integration tests for internal running
2024-03-25 14:08:47 +01:00
Paolo Tranquilli
9c9f4b956e Swift: fix db in diagnostics_test_utils.py 2024-03-25 13:53:27 +01:00
Tamas Vajk
2f0b54c801 Refactor buildless telemetry logging 2024-03-25 12:48:27 +01:00
Geoffrey White
88ea9197d9 C++: Add more tests for uncommon cases. 2024-03-25 11:40:15 +00:00
Ian Lynagh
55226c48a6 Merge pull request #16022 from igfoo/igfoo/k2_exprs
Kotlin 2: Accept more location changes
2024-03-25 11:38:15 +00:00
Tamas Vajk
b94d33d78d Add buildless failed diagnostic 2024-03-25 12:27:36 +01:00
Paolo Tranquilli
7f53509022 Merge branch 'main' into redsun82/swift-move-integration-tests-to-internal 2024-03-25 12:22:00 +01:00
Geoffrey White
46b8e3be66 C++: Fix another mistake in the test. 2024-03-25 11:20:55 +00:00
Geoffrey White
dec5fc0f48 C++: Switch MAD syntax from *Argument[0] style to Argument[*0] style. 2024-03-25 11:20:55 +00:00
Geoffrey White
40270e1f70 C++: Fix mistake in test model. 2024-03-25 11:20:55 +00:00
Geoffrey White
b598b4ac45 C++: Fix for field content indirection (1-based). 2024-03-25 11:20:55 +00:00
Geoffrey White
73e95d67b9 C++: Implement Field indirection. 2024-03-25 11:20:55 +00:00
Geoffrey White
393bd7277c C++: Add some negative test cases for indirection. 2024-03-25 11:20:55 +00:00
Geoffrey White
af4320df50 C++: Modify a summary test case to only test the summary model, not a source model as well. 2024-03-25 11:20:55 +00:00
Geoffrey White
14deb06e80 C++: Implement Argument + Parameter indirection. 2024-03-25 11:20:55 +00:00
Paolo Tranquilli
6707fc3a7c Swift: remove wrong flag in runner.py 2024-03-25 12:20:13 +01:00
Geoffrey White
638bfff09d C++: Implement ReturnValue indirection (this version only worked with a small change to the shared library parsing to permit '*' in the token name; we no longer need this, so I rebased it out). 2024-03-25 11:20:09 +00:00
Paolo Tranquilli
148033e020 Swift: fix assertion diagnostics test 2024-03-25 12:05:22 +01:00
Tamas Vajk
5ab5244171 Change public messages to not include 'buildless' 2024-03-25 11:59:29 +01:00
Chris Smowton
10afb1cd93 Merge pull request #16030 from smowton/smowton/admin/buildless-wording-update
Java: Update buildless test expectations
2024-03-25 10:57:56 +00:00
Paolo Tranquilli
ca5d85c57e Merge branch 'main' into redsun82/swift-move-integration-tests-to-internal 2024-03-25 11:56:48 +01:00
Paolo Tranquilli
0fa40af131 Swift: fix last references to old integration test location 2024-03-25 11:49:19 +01:00
Rasmus Wriedt Larsen
0515b12305 JS: Add example of bad NodeJS detection
Notice the TRAP lines

```
is_module(#20001)
is_es2015_module(#20001)
```
2024-03-25 11:36:21 +01:00
Max Schaefer
ffbe3e6ed4 Merge pull request #16020 from github/max-schaefer/go-path-injection-qhelp
Go: Update query help for `go/path-injection` to include example fixes.
2024-03-25 10:25:36 +00:00
Owen Mansel-Chan
f2db9ce312 Merge pull request #16028 from owen-mc/java/sensitive-log-whitelist-tokenimage
Java: whitelist variable name `tokenImage` for `java/sensitive-log` as it's used in code generated by JavaCC
2024-03-25 10:02:19 +00:00
Paolo Tranquilli
5a771ad2cf Swift: bump python version 2024-03-25 10:42:16 +01:00
Tamás Vajk
d6374f65e4 Merge pull request #15957 from tamasvajk/feature/limit-message-extraction
C#: Limit extracted compilation and extraction messages
2024-03-25 10:30:10 +01:00
Paolo Tranquilli
762b4ce42e Swift: prepare integration tests for internal running
This harmonizes Swift integration tests with the rest of the repository,
to prepare for the internal integration test runner to run them. The
stripped down runner is kept compatible, so that current CI can still
use it now. Maybe it will be kept for developer use.

This PR includes:
* moving the integration tests inside `ql`
* editing `qlpack.yml` so that the internal runner can use it
* change database directory to be `test-db` rather than `db`
2024-03-25 10:17:55 +01:00
dependabot[bot]
0c73340e47 Bump regex from 1.10.3 to 1.10.4 in /ql
Bumps [regex](https://github.com/rust-lang/regex) from 1.10.3 to 1.10.4.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.10.3...1.10.4)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-25 03:31:03 +00:00
Owen Mansel-Chan
ac6c4add14 Apply suggestions from code review
Co-authored-by: Chris Smowton <smowton@github.com>
2024-03-24 20:20:37 +00:00
Chris Smowton
d8686e02a8 Update test expectations 2024-03-24 17:57:27 +00:00
Owen Mansel-Chan
821f399193 Add change note 2024-03-23 23:51:52 +00:00
Owen Mansel-Chan
f4b3bae88b Add test for ParseException use of tokenImage 2024-03-23 23:48:16 +00:00
Owen Mansel-Chan
4832dc51ed Whitelist variable name tokenImage 2024-03-23 21:33:02 +00:00
Owen Mansel-Chan
63a04c056a Add test with tokenImage as used in JavaCC 2024-03-23 21:30:33 +00:00
erik-krogh
051120e958 add qldoc for ReflectedXssSanitizers 2024-03-22 17:58:25 +01:00
erik-krogh
c60cec36d4 add calls to .html_safe? as a shared XSS sanitizer 2024-03-22 17:46:39 +01:00
Aditya Sharad
1a8932bc28 Merge pull request #16024 from github/changedocs/2.16.5
Update CodeQL CLI to version 2.16.5
2024-03-22 09:32:52 -07:00
Erik Krogh Kristensen
45ce988943 Merge pull request #16002 from erik-krogh/tarBlank
JS: change the precision of the `js/unsafe-external-link` query to `low`
2024-03-22 17:12:58 +01:00
Florin Coada
c653f1ce8c Add CodeQL 2.16.5 changelog 2024-03-22 15:28:54 +00:00
Joe Farebrother
592acb94d2 Add missing .s to qldoc 2024-03-22 15:28:34 +00:00
Max Schaefer
034ed17227 Apply suggestions from code review
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
2024-03-22 15:24:29 +00:00
Jeroen Ketema
d9b0a5918c Merge pull request #16018 from jketema/tls-precision
C++: Add precision to `cpp/boost/tls-settings-misconfiguration` and `cpp/boost/use-of-deprecated-hardcoded-security-protocol`
2024-03-22 16:17:34 +01:00
Jeroen Ketema
453cdfa513 C++: Add change note 2024-03-22 15:52:52 +01:00
Joe Farebrother
a6ee19ca2d Fix query id 2024-03-22 14:36:47 +00:00
Ian Lynagh
63e34c4dec Kotlin 2: Accept more location changes 2024-03-22 14:09:20 +00:00
Joe Farebrother
01f712476b Add change note and update severity 2024-03-22 14:07:11 +00:00
Joe Farebrother
b74145349b Add test cases 2024-03-22 14:07:11 +00:00
Joe Farebrother
507a6102a2 Reorganise into Custimizations file + add some more sinks on ActiveRecord methods 2024-03-22 14:07:04 +00:00
Joe Farebrother
a8aac318d0 Add qhelp 2024-03-22 14:04:52 +00:00
Joe Farebrother
89838981b7 Add test cases 2024-03-22 14:04:52 +00:00
Joe Farebrother
0f45a53adc Add mass assignment query 2024-03-22 14:04:52 +00:00
Edward Minnix III
1785086ccb Merge pull request #15784 from egregius313/egregius313/csharp/dataflow/sources/file
C#: Add source models for `file` threat model/source kind for .NET standard library
2024-03-22 09:50:30 -04:00
Michael Nebel
a07ee8e961 C#: Update the AsList model to a value flow model. 2024-03-22 14:40:25 +01:00
Tamas Vajk
178a45af25 C#: Add high level diagnostic messages for buildless extraction (start, success) 2024-03-22 14:27:36 +01:00
Max Schaefer
bc9396e0e6 Address suggestions from review. 2024-03-22 13:19:36 +00:00
Michael B. Gale
f48e295f4a Merge pull request #16019 from p-/p--weak-enc-ecb-qhelp
C#: add hint regarding ECB to weak encryption QHelp
2024-03-22 13:09:08 +00:00
Michael Nebel
ca72b0583d C#: Update source and sink expected test output. 2024-03-22 13:59:47 +01:00
Erik Krogh Kristensen
7d968184fd improve the change-note
Co-authored-by: Asger F <asgerf@github.com>
2024-03-22 13:58:34 +01:00
Ed Minnix
4b13ad1310 Fix flow summary tests 2024-03-22 13:46:20 +01:00
Ed Minnix
9ed8ca27a1 Fix test and model 2024-03-22 13:46:19 +01:00
Ed Minnix
1f04229def Fix typo 2024-03-22 13:46:19 +01:00
Ed Minnix
73b4e8fe6a Add WithElement identifier to AsList method 2024-03-22 13:46:19 +01:00
Ed Minnix
9b23bfa038 Execute methods which return objects
The `Execute` method returns `int` for "number of rows affected". But
some of the other `Execute*` methods return objects.
2024-03-22 13:46:19 +01:00
Ed Minnix
5885938eaf Use wildcard signatures for Query methods 2024-03-22 13:46:19 +01:00
Ed Minnix
8223781978 Fix FlowSummaries tests 2024-03-22 13:46:19 +01:00
Ed Minnix
5ca6b40c34 Change note 2024-03-22 13:46:18 +01:00
Ed Minnix
23aeb1d878 Add tests 2024-03-22 13:46:18 +01:00
Ed Minnix
98285b5171 Add AsList summary 2024-03-22 13:46:18 +01:00
Ed Minnix
87ad170067 Dapper source models 2024-03-22 13:46:18 +01:00
Ian Lynagh
01475fd8ba Merge pull request #16011 from igfoo/igfoo/legacy_vars
Java/Kotlin: Remove references to legacy ODASA_SNAPSHOT env var
2024-03-22 12:38:37 +00:00
Max Schaefer
4e4cd52f63 Go: Update query help for go/path-injection to include example fixes. 2024-03-22 11:45:59 +00:00
Peter Stöckli
d62d68a40b C#: add hint regarding ECB to weak encryption QHelp 2024-03-22 12:08:30 +01:00
Rasmus Wriedt Larsen
69f6e1e263 Merge pull request #16010 from RasmusWL/perf
Python: Two small join-order fixes
2024-03-22 11:36:17 +01:00
Jeroen Ketema
adfb3c3d50 C++: Simplify cpp/boost/tls-settings-misconfiguration 2024-03-22 11:22:11 +01:00
yoff
c520cb6d58 Merge branch 'main' into python/test-MaD-keyword-argument 2024-03-22 10:56:08 +01:00
Rasmus Lerchedahl Petersen
eef60c9ad2 python: add test for "ReturnValue.TupleElement[0,1]"
also synchronise files
2024-03-22 10:54:12 +01:00
Jeroen Ketema
fb4ed39d89 Merge pull request #16017 from jketema/destructors21
C++: Add destructor test cases for AV Rule 114
2024-03-22 10:50:27 +01:00
Jeroen Ketema
a770bddff0 C++: Add precision to cpp/boost/tls-settings-misconfiguration and cpp/boost/use-of-deprecated-hardcoded-security-protocol
Also clean up the names of the queries while here.
2024-03-22 10:48:18 +01:00
Jeroen Ketema
3f0ce98ccb C++: Add destructor test cases for AV Rule 114 2024-03-22 10:25:47 +01:00
Tom Hvitved
9d124197e8 C#: Remove support for legacy LGTM options in autobuilder 2024-03-22 10:09:24 +01:00
Tamas Vajk
205d6a3bc5 Extract total number of diagnostic per ID and compilation 2024-03-22 08:55:41 +01:00
Tamas Vajk
fa7f437e71 Code quality improvement 2024-03-22 08:16:11 +01:00
Jeroen Ketema
eca6c00003 Merge pull request #16014 from jketema/destructors20
C++: Handle destructors of range-based for-loop, if, and switch initializer statements
2024-03-21 21:04:23 +01:00
Ed Minnix
c7a746e3dc Flow summary tests 2024-03-21 13:15:45 -04:00
Ed Minnix
3e3eceea5f Typo 2024-03-21 13:06:34 -04:00
Ed Minnix
e2c2d574f8 Add FileInfo::OpenText 2024-03-21 13:06:33 -04:00
Ed Minnix
46a9bb9804 Change note 2024-03-21 13:06:31 -04:00
Ed Minnix
08611f0c9c Fix flow summary tests 2024-03-21 13:06:30 -04:00
Ed Minnix
e14e47cd73 Fix Stream::Read(Span<byte>) model 2024-03-21 13:06:28 -04:00
Ed Minnix
d6f085373e System.IO.Stream::ReadExactly models 2024-03-21 13:06:27 -04:00
Ed Minnix
2a73677fd2 Missing Stream::ReadAsync overload 2024-03-21 13:06:26 -04:00
Ed Minnix
a698684fec System.IO.Stream::ReadAtLeast 2024-03-21 13:06:24 -04:00
Ed Minnix
3e29a8d2a1 System.IO files test 2024-03-21 13:06:23 -04:00
Ed Minnix
d387e6d068 Fix flow-summary tests 2024-03-21 13:06:21 -04:00
Ed Minnix
9232fafde1 Add System.IO.Stream::Read(Span<Byte>) model 2024-03-21 13:06:20 -04:00
Ed Minnix
a8c5e4e0f2 FileInfo source models 2024-03-21 13:06:18 -04:00
Ed Minnix
bb9b0eabf2 Add BufferedStream summary models 2024-03-21 13:06:17 -04:00
Ed Minnix
a5b801b31f Add File reading methods 2024-03-21 13:06:15 -04:00
Arthur Baars
c219b1a3c7 Merge pull request #16013 from github/rc/3.13
Merge rc/3.13 into main
2024-03-21 16:04:58 +01:00
Rasmus Wriedt Larsen
93f940aa9c Python: Join-order improvement for DataFlowDispatch::TrackAttrReadInput
I was surprised to see that this predicate actually gets evaluated 3 times

- Pipeline standard for DataFlowDispatch::TrackAttrReadInput::start/2#67f26627@c15596yu was evaluated in 74 iterations totaling 165ms (delta sizes total: 113119).
- Pipeline standard for DataFlowDispatch::TrackAttrReadInput::start/2#67f26627@3459ejws was evaluated in 30 iterations totaling 76ms (delta sizes total: 32555).
- Pipeline standard for DataFlowDispatch::TrackAttrReadInput::start/2#67f26627@5ac22jwq was evaluated in 30 iterations totaling 108ms (delta sizes total: 32555).

It does however fit with it being used in exactly 3 places: https://github.com/search?q=repo%3Agithub%2Fcodeql+%2FattrReadTracker%5C%28%2F&type=code -- so I assume it's because each use forces a new evaluation. Although that's something we could look into solving, for now I'm just trying to fix the join-order.

Initial

```
Pipeline standard for DataFlowDispatch::TrackAttrReadInput::start/2#67f26627@3459ejws was evaluated in 30 iterations totaling 76ms (delta sizes total: 32555).
        7068090   ~0%    {2} r1 = SCAN Attributes::AttrRead#class#f6c3f431 OUTPUT In.0, In.0
                         {2}    | AND NOT `DataFlowDispatch::TrackAttrReadInput::start/2#67f26627#prev`(FIRST 2)
        3901178   ~5%    {2}    | SCAN OUTPUT In.1, In.1
        3901178   ~0%    {3}    | JOIN WITH `Attributes::AttrRef.getObject/0#dispred#d7cd0a97` ON FIRST 1 OUTPUT Rhs.1, Lhs.0, Lhs.1

          13615   ~1%    {2} r2 = JOIN r1 WITH `DataFlowDispatch::classTracker/1#d11f2237#reorder_1_0#prev_delta` ON FIRST 1 OUTPUT Lhs.1, Lhs.2

             94   ~2%    {2} r3 = JOIN r1 WITH `DataFlowDispatch::superCallTwoArgumentTracker/2#d18be99f#reorder_2_0_1#prev_delta` ON FIRST 1 OUTPUT Lhs.1, Lhs.2

          18846   ~1%    {2} r4 = JOIN r1 WITH `DataFlowDispatch::classInstanceTracker/1#d73ecef4#prev_delta_1#join_rhs` ON FIRST 1 OUTPUT Lhs.1, Lhs.2

          32555   ~1%    {2} r5 = r2 UNION r3 UNION r4
                         return r5
```

==>

```
Pipeline standard for DataFlowDispatch::TrackAttrReadInput::start/2#67f26627@f2517jwq was evaluated in 30 iterations totaling 12ms (delta sizes total: 32704).
        186719  ~121%    {1} r1 = SCAN `DataFlowDispatch::classInstanceTracker/1#d73ecef4#prev_delta` OUTPUT In.1

        164342  ~158%    {1} r2 = SCAN `DataFlowDispatch::classTracker/1#d11f2237#reorder_1_0#prev_delta` OUTPUT In.0

            96    ~0%    {1} r3 = SCAN `DataFlowDispatch::superCallTwoArgumentTracker/2#d18be99f#reorder_2_0_1#prev_delta` OUTPUT In.0

        351157   ~80%    {1} r4 = r1 UNION r2 UNION r3
         88074   ~14%    {1}    | JOIN WITH `Attributes::AttrRef.getObject/0#dispred#d7cd0a97_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1
         41789   ~18%    {2}    | JOIN WITH Attributes::AttrRead#class#f6c3f431 ON FIRST 1 OUTPUT Lhs.0, Lhs.0
                         {2}    | AND NOT `DataFlowDispatch::TrackAttrReadInput::start/2#67f26627#prev`(FIRST 2)
         32883    ~2%    {2}    | SCAN OUTPUT In.1, In.1
                         return r4
```

AND

initial

```
Pipeline standard for DataFlowDispatch::TrackAttrReadInput::start/2#67f26627@c15596yu was evaluated in 74 iterations totaling 165ms (delta sizes total: 113119).
        17434622   ~0%    {2} r1 = SCAN Attributes::AttrRead#class#f6c3f431 OUTPUT In.0, In.0
                          {2}    | AND NOT `DataFlowDispatch::TrackAttrReadInput::start/2#67f26627#prev`(FIRST 2)
         9483976   ~4%    {2}    | SCAN OUTPUT In.1, In.1
         9483976   ~0%    {3}    | JOIN WITH `Attributes::AttrRef.getObject/0#dispred#d7cd0a97` ON FIRST 1 OUTPUT Rhs.1, Lhs.0, Lhs.1

           19258   ~1%    {2} r2 = JOIN r1 WITH `DataFlowDispatch::classInstanceTracker/1#d73ecef4#reorder_1_0#prev_delta` ON FIRST 1 OUTPUT Lhs.1, Lhs.2

            1654   ~1%    {2} r3 = JOIN r1 WITH `DataFlowDispatch::superCallNoArgumentTracker/1#0a2e8a06#reorder_1_0#prev_delta` ON FIRST 1 OUTPUT Lhs.1, Lhs.2

            1314   ~4%    {2} r4 = JOIN r1 WITH `DataFlowDispatch::clsArgumentTracker/1#47339327#reorder_1_0#prev_delta` ON FIRST 1 OUTPUT Lhs.1, Lhs.2

              94   ~2%    {2} r5 = JOIN r1 WITH `DataFlowDispatch::superCallTwoArgumentTracker/2#d18be99f#reorder_2_0_1#prev_delta` ON FIRST 1 OUTPUT Lhs.1, Lhs.2

           77217   ~0%    {2} r6 = JOIN r1 WITH `DataFlowDispatch::selfTracker/1#f157aa27#reorder_1_0#prev_delta` ON FIRST 1 OUTPUT Lhs.1, Lhs.2

           13632   ~1%    {2} r7 = JOIN r1 WITH `DataFlowDispatch::classTracker/1#d11f2237#reorder_1_0#prev_delta` ON FIRST 1 OUTPUT Lhs.1, Lhs.2

          113169   ~0%    {2} r8 = r2 UNION r3 UNION r4 UNION r5 UNION r6 UNION r7
                          return r8
```
==>

```
Pipeline standard for DataFlowDispatch::TrackAttrReadInput::start/2#67f26627@d732e6yt was evaluated in 74 iterations totaling 31ms (delta sizes total: 113129).
        186719  ~150%    {1} r1 = SCAN `DataFlowDispatch::classInstanceTracker/1#d73ecef4#reorder_1_0#prev_delta` OUTPUT In.0

          1669    ~0%    {1} r2 = SCAN `DataFlowDispatch::superCallNoArgumentTracker/1#0a2e8a06#reorder_1_0#prev_delta` OUTPUT In.0

          3425   ~15%    {1} r3 = SCAN `DataFlowDispatch::clsArgumentTracker/1#47339327#prev_delta` OUTPUT In.1

            96    ~0%    {1} r4 = SCAN `DataFlowDispatch::superCallTwoArgumentTracker/2#d18be99f#reorder_2_0_1#prev_delta` OUTPUT In.0

        123310    ~0%    {1} r5 = SCAN `DataFlowDispatch::selfTracker/1#f157aa27#reorder_1_0#prev_delta` OUTPUT In.0

        164342  ~581%    {1} r6 = SCAN `DataFlowDispatch::classTracker/1#d11f2237#reorder_1_0#prev_delta` OUTPUT In.0

        479561   ~94%    {1} r7 = r1 UNION r2 UNION r3 UNION r4 UNION r5 UNION r6
        169424    ~2%    {1}    | JOIN WITH `Attributes::AttrRef.getObject/0#dispred#d7cd0a97_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1
        116290    ~0%    {2}    | JOIN WITH Attributes::AttrRead#class#f6c3f431 ON FIRST 1 OUTPUT Lhs.0, Lhs.0
                         {2}    | AND NOT `DataFlowDispatch::TrackAttrReadInput::start/2#67f26627#prev`(FIRST 2)
        113160    ~0%    {2}    | SCAN OUTPUT In.1, In.1
                         return r7
```
2024-03-21 15:55:58 +01:00
Jeroen Ketema
98de4e209b C++: Handle destructors of if and switch initializer statements 2024-03-21 15:47:11 +01:00
Jeroen Ketema
9cc287dff1 C++: Handle destructors of range-based for-loop initializer statements 2024-03-21 15:47:11 +01:00
Cornelius Riemenschneider
be245dd4b2 Merge pull request #16012 from github/criemen/swift-linux-sandbox
Swift genrule: Replace local with no-sandbox.
2024-03-21 15:06:47 +01:00
Rasmus Wriedt Larsen
bfa8515b28 Python: Apply suggestions from code review
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2024-03-21 14:51:45 +01:00
Cornelius Riemenschneider
79094e4b89 Swift genrule: Replace local with no-sandbox.
This allows the bazel cache to cache this genrule invocation.
It shouldn't depend on system-specific binaries, so
I believe this is correct.
This is the only part of our build where we otherwise
need to recompute parts after pulling in a full cache.
2024-03-21 13:51:22 +00:00
Ian Lynagh
1b3605754f Java: Add a changenote for dropping ODASA_SNAPSHOT support 2024-03-21 13:38:54 +00:00
Tamás Vajk
0aa7de295b Merge pull request #16004 from tamasvajk/feature/adjust-incorrect-compare-to
C#: Simplify the output of `cs/wrong-compareto-signature` to remove e…
2024-03-21 14:38:54 +01:00
Ian Lynagh
33fe5abf94 Kotlin: Remove references to legacy ODASA_SNAPSHOT env var 2024-03-21 13:29:40 +00:00
Henry Mercer
4e3a6e2140 Merge pull request #15874 from github/henrymercer/mark-loc-as-telemetry
Show lines of code data in debug mode only
2024-03-21 12:20:09 +00:00
Rasmus Wriedt Larsen
cff63ad5d5 Python: Fix small join-order problem for call-graph
problem is:
```
           14294  ~33%    {1} r23 = r21 UNION r22
           13626   ~0%    {2}    | JOIN WITH `DataFlowPublic::Node.getEnclosingCallable/0#dispred#be95825a` ON FIRST 1 OUTPUT Rhs.1, Lhs.0
        11871493   ~2%    {2}    | JOIN WITH `DataFlowPublic::Node.getEnclosingCallable/0#dispred#be95825a_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1
         6810938   ~3%    {2}    | JOIN WITH num#DataFlowPublic::TCfgNode#2cd2fb22_10#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.1
               0   ~0%    {4}    | JOIN WITH `DataFlowDispatch::resolveMethodCall/4#3067f1f1#reorder_0_3_1_2#prev` ON FIRST 2 OUTPUT Rhs.3, Lhs.1, Lhs.0, Rhs.2
               0   ~0%    {4}    | JOIN WITH num#DataFlowDispatch::CallTypeClassMethod#3508c3e5 ON FIRST 1 OUTPUT Lhs.3, Lhs.2, Lhs.0, Lhs.1
               0   ~0%    {4}    | JOIN WITH `DataFlowDispatch::resolveCall/3#454c02d8#reorder_1_0_2#prev` ON FIRST 3 OUTPUT Lhs.3, Lhs.1, Lhs.0, Lhs.2
               0   ~0%    {5}    | JOIN WITH num#DataFlowDispatch::TSelfArgumentPosition#de6d64b8 CARTESIAN PRODUCT OUTPUT Lhs.1, Lhs.2, Lhs.3, Lhs.0, Rhs.0
```
that is, it does cartesian product of DataFlowPublic::Node.getEnclosingCallable

After fix

```
        14294  ~33%    {1} r23 = r21 UNION r22
            0   ~0%    {4}    | JOIN WITH `DataFlowDispatch::resolveMethodCall/4#3067f1f1#reorder_3_0_1_2#prev` ON FIRST 1 OUTPUT Rhs.3, Lhs.0, Rhs.1, Rhs.2
            0   ~0%    {4}    | JOIN WITH num#DataFlowDispatch::CallTypeClassMethod#3508c3e5 ON FIRST 1 OUTPUT Lhs.3, Lhs.2, Lhs.0, Lhs.1
            0   ~0%    {4}    | JOIN WITH `DataFlowDispatch::resolveCall/3#454c02d8#reorder_1_0_2#prev` ON FIRST 3 OUTPUT Lhs.1, Lhs.3, Lhs.0, Lhs.2
            0   ~0%    {5}    | JOIN WITH num#DataFlowPublic::TCfgNode#2cd2fb22 ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.0, Lhs.2, Lhs.3
            0   ~0%    {5}    | JOIN WITH `DataFlowPublic::Node.getEnclosingCallable/0#dispred#be95825a` ON FIRST 1 OUTPUT Lhs.1, Rhs.1, Lhs.2, Lhs.3, Lhs.4
            0   ~0%    {4}    | JOIN WITH `DataFlowPublic::Node.getEnclosingCallable/0#dispred#be95825a` ON FIRST 2 OUTPUT Lhs.0, Lhs.2, Lhs.3, Lhs.4
            0   ~0%    {5}    | JOIN WITH num#DataFlowDispatch::TSelfArgumentPosition#de6d64b8 CARTESIAN PRODUCT OUTPUT Lhs.1, Lhs.2, Lhs.3, Lhs.0, Rhs.0
```

Overall stats

(old)
Pipeline standard for DataFlowDispatch::getCallArg/5#21589076@b30c7vxg was evaluated in 51 iterations totaling 54ms (delta sizes total: 38247).

==>

(new)
Pipeline standard for DataFlowDispatch::getCallArg/5#21589076@c1559vxu was evaluated in 51 iterations totaling 28ms (delta sizes total: 38247).
2024-03-21 12:31:58 +01:00
Jeroen Ketema
ccc5a80d93 Merge pull request #16008 from jketema/destructors19
C++: Handle `getInitializingExpr` in PrintAST
2024-03-21 12:22:48 +01:00
Rasmus Wriedt Larsen
2aa5ae41fb Python: Fix join-order problem in SqlAlchemy
No major performance impact, more of a learning example for myself (had +3000 join order badness).

Initial tuple counts

```
Evaluated recursive predicate SqlAlchemy::SqlAlchemy::Connection::ConnectionConstruction#45e716e0@594cfx2g in 1ms on iteration 1 (delta size: 4).
Evaluated relational algebra for predicate SqlAlchemy::SqlAlchemy::Connection::ConnectionConstruction#45e716e0@594cfx2g on iteration 1 running pipeline base with tuple counts:
        37793   ~0%    {3} r1 = JOIN `ApiGraphs::API::Node.getACall/0#dispred#312deb92_10#join_rhs` WITH DataFlowPublic::CallCfgNode#b8ddbf81 ON FIRST 1 OUTPUT Lhs.1, Lhs.0, Rhs.1
            0   ~0%    {2}    | JOIN WITH `SqlAlchemy::SqlAlchemy::Connection::classRef/0#565fc3ad` ON FIRST 1 OUTPUT Lhs.1, Lhs.2

           30   ~0%    {5} r2 = JOIN DataFlowPublic::CallCfgNode#b8ddbf81 WITH `DataFlowPublic::MethodCallNode.calls/2#dispred#1dd1e0f4#ffb` ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Rhs.1, Rhs.2, _
                       {4}    | REWRITE WITH NOT [NOT [Tmp.4 := "begin", TEST InOut.3 = Tmp.4], NOT [Tmp.4 := "connect", TEST InOut.3 = Tmp.4]] KEEPING 4
           21   ~0%    {3}    | SCAN OUTPUT In.2, In.0, In.1
            4   ~0%    {2}    | JOIN WITH `SqlAlchemy::SqlAlchemy::Engine::instance/0#1828baef` ON FIRST 1 OUTPUT Lhs.1, Lhs.2

            4   ~0%    {2} r3 = r1 UNION r2
                       return r3
```

which is fixed by the only_bind_out

```
Evaluated recursive predicate SqlAlchemy::SqlAlchemy::Connection::ConnectionConstruction#45e716e0@49effxtg in 0ms on iteration 1 (delta size: 0).
Evaluated relational algebra for predicate SqlAlchemy::SqlAlchemy::Connection::ConnectionConstruction#45e716e0@49effxtg on iteration 1 running pipeline base with tuple counts:
        0  ~0%    {1} r1 = JOIN `SqlAlchemy::SqlAlchemy::Connection::classRef/0#565fc3ad` WITH `ApiGraphs::API::Node.getACall/0#dispred#312deb92` ON FIRST 1 OUTPUT Rhs.1
        0  ~0%    {2}    | JOIN WITH DataFlowPublic::CallCfgNode#b8ddbf81 ON FIRST 1 OUTPUT Lhs.0, Rhs.1
                  return r1
```

We also had this initial problem

```
Evaluated recursive predicate SqlAlchemy::SqlAlchemy::Connection::ConnectionConstruction#45e716e0@594cfx2g in 1ms on iteration 4 (delta size: 0).
Evaluated relational algebra for predicate SqlAlchemy::SqlAlchemy::Connection::ConnectionConstruction#45e716e0@594cfx2g on iteration 4 running pipeline standard with tuple counts:
        48722   ~6%    {2} r1 = DataFlowPublic::CallCfgNode#b8ddbf81 AND NOT SqlAlchemy::SqlAlchemy::Connection::ConnectionConstruction#45e716e0#prev(FIRST 2)

        48722   ~3%    {3} r2 = SCAN r1 OUTPUT In.0, _, In.1
        48722   ~1%    {3}    | REWRITE WITH Out.1 := "connect"
           16   ~0%    {3}    | JOIN WITH `DataFlowPublic::MethodCallNode.calls/2#dispred#1dd1e0f4#ffb_021#join_rhs` ON FIRST 2 OUTPUT Rhs.2, Lhs.0, Lhs.2
            0   ~0%    {2}    | JOIN WITH `SqlAlchemy::SqlAlchemy::Connection::instance/0#5ed87c17#prev_delta` ON FIRST 1 OUTPUT Lhs.1, Lhs.2

        48722   ~3%    {3} r3 = SCAN r1 OUTPUT In.0, _, In.1
        48722   ~2%    {3}    | REWRITE WITH Out.1 := "execution_options"
            9   ~0%    {3}    | JOIN WITH `DataFlowPublic::MethodCallNode.calls/2#dispred#1dd1e0f4#ffb_021#join_rhs` ON FIRST 2 OUTPUT Rhs.2, Lhs.0, Lhs.2
            0   ~0%    {2}    | JOIN WITH `SqlAlchemy::SqlAlchemy::Connection::instance/0#5ed87c17#prev_delta` ON FIRST 1 OUTPUT Lhs.1, Lhs.2

            0   ~0%    {2} r4 = r2 UNION r3
                       return r4
```

which is fixed by `connectionConstruction_helper`

```
Evaluated recursive predicate SqlAlchemy::SqlAlchemy::Connection::helper/0#62cfc178#b@4f295yef in 1ms on iteration 4 (delta size: 0).
Evaluated relational algebra for predicate SqlAlchemy::SqlAlchemy::Connection::helper/0#62cfc178#b@4f295yef on iteration 4 running pipeline standard with tuple counts:
         4  ~0%    {1} r1 = JOIN `SqlAlchemy::SqlAlchemy::Connection::instance/1#029b4c87#prev_delta` WITH `TypeTrackingImpl::TypeTracker::end/0#2ac2cfd4` ON FIRST 1 OUTPUT Lhs.1
        16  ~0%    {1}    | JOIN WITH `LocalSources::Cached::hasLocalSource/2#8b3ee0ec_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1
         0  ~0%    {3}    | JOIN WITH `DataFlowPublic::MethodCallNode.calls/2#dispred#1dd1e0f4#ffb_102#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Rhs.2, _
         0  ~0%    {2}    | REWRITE WITH NOT [NOT [Tmp.2 := "connect", TEST InOut.1 = Tmp.2], NOT [Tmp.2 := "execution_options", TEST InOut.1 = Tmp.2]] KEEPING 2
         0  ~0%    {1}    | JOIN WITH DataFlowPublic::CallCfgNode#b8ddbf81 ON FIRST 1 OUTPUT Lhs.0
         0  ~0%    {1}    | AND NOT `SqlAlchemy::SqlAlchemy::Connection::helper/0#62cfc178#b#prev`(FIRST 1)
                   return r1
```
2024-03-21 11:55:49 +01:00
Jeroen Ketema
4c4ebd907e C++: Update more expected test results 2024-03-21 11:54:29 +01:00
Jeroen Ketema
a3ae304dfe C++: Handle getInitializingExpr in PrintAST 2024-03-21 11:32:23 +01:00
Jeroen Ketema
33c524d9fd Merge pull request #16003 from jketema/destructors18
C++: Add tests showing missing destructors for initialization statements
2024-03-21 11:28:54 +01:00
Tamas Vajk
9d655520cc Code quality improvement 2024-03-21 11:26:45 +01:00
Mathias Vorreiter Pedersen
dc5ee7c8b4 Merge pull request #16007 from MathiasVP/fix-tls-settings-misconfiguration
C++: Fix `cpp/boost/tls-settings-misconfiguration` FPs
2024-03-21 10:16:37 +00:00
Mathias Vorreiter Pedersen
7fb64268bd Merge pull request #15997 from MathiasVP/simplify-guard-in-missing-check-scanf
C++: Simplify use of guard conditions in `cpp/missing-check-scanf`
2024-03-21 10:16:12 +00:00
Tamas Vajk
d0c09f43a9 Add change note 2024-03-21 11:13:42 +01:00
Paolo Tranquilli
eb7f07dc3f Merge pull request #15967 from github/redsun82/test
Swift: add `-headerpad_max_install_names` to link options
2024-03-21 11:11:53 +01:00
Tom Hvitved
c0f80ecd2f Merge pull request #15994 from hvitved/csharp/no-trap-stack-in-buildless
C#: Avoid using TRAP stack in buildless mode
2024-03-21 10:46:08 +01:00
erik-krogh
54a1c25276 change the precision of the js/unsafe-external-link query to low 2024-03-21 10:32:15 +01:00
Tamas Vajk
9da8cb1165 C#: Simplify the output of cs/wrong-compareto-signature to remove entity locations 2024-03-21 10:27:55 +01:00
Jeroen Ketema
06313b9bb6 Merge pull request #15998 from MathiasVP/simplify-guard-in-incorrectly-check-scanf
C++: Simplify use of guard conditions in `cpp/incorrectly-checked-scanf`
2024-03-21 10:10:03 +01:00
Jeroen Ketema
84646cd795 C++: Add tests showing missing destructors for initialization statements
Incidentially this also shows that for contructs like `if (char x = ...)`, so
there is an initialization but not initializer statement, the initialization
is not displayed in the AST, although the IR does contain the initialization.
2024-03-21 09:40:00 +01:00
Michael Nebel
6619be3137 Merge pull request #15940 from michaelnebel/csharp/sourcesinktests
C#: Source- and sink tests.
2024-03-21 08:12:16 +01:00
Jeroen Ketema
ec071cde51 Merge pull request #15991 from jketema/destructors17
C++: Handle destruction of temporaries in expressions with a `thow` at the root
2024-03-21 07:47:09 +01:00
Jeroen Ketema
9300b04def C++: Update test results 2024-03-21 00:05:30 +01:00
Henry Mercer
a76832f4e0 Mark LOC queries as debug instead 2024-03-20 21:18:55 +00:00
Tom Hvitved
8f56edea80 Merge pull request #15966 from hvitved/treesitter-split-up-node-info-table
Tree-sitter: Split up `ast_node_info` table into two tables
2024-03-20 20:38:18 +01:00
Mathias Vorreiter Pedersen
0ef8c7d87f C++: Accept test changes. 2024-03-20 18:05:14 +00:00
Mathias Vorreiter Pedersen
1330c885c8 C++: Use 'asIndirectExpr' in the sink of 'ExistsAnyFlowConfig. 2024-03-20 18:04:59 +00:00
Mathias Vorreiter Pedersen
f31bb1391d C++: Simplify 'checkedForEof'. 2024-03-20 16:59:39 +00:00
Mathias Vorreiter Pedersen
5476f42d2c C++: Simplify use of 'GuardCondition's in 'cpp/missing-check-scanf'. 2024-03-20 16:44:43 +00:00
Mathias Vorreiter Pedersen
e3be2057d3 Merge pull request #15996 from MathiasVP/missing-check-scanf-path-problem
Make `cpp/missing-check-scanf` a `path-problem` query
2024-03-20 16:42:47 +00:00
Mathias Vorreiter Pedersen
96cd259eda C++: Add change note. 2024-03-20 14:56:39 +00:00
Mathias Vorreiter Pedersen
14aff5c94c C++: Convert 'cpp/missing-check-scanf' to a path-problem query. 2024-03-20 14:54:53 +00:00
Mathias Vorreiter Pedersen
0fe3072a65 Merge pull request #15988 from MathiasVP/clean-up-missing-check-scanf
C++: Rewrite 'cpp/missing-check-scanf' to use standard dataflow configs
2024-03-20 14:50:08 +00:00
Mathias Vorreiter Pedersen
ebac171b2b Java/Shared: Rename 'joinStep0' to 'joinStep'. 2024-03-20 14:40:16 +00:00
Mathias Vorreiter Pedersen
6a65c46b2e Java/Shared: Share more 'isNull' computations. 2024-03-20 14:36:12 +00:00
Mathias Vorreiter Pedersen
90fbacc7bf Java/Shared: Use getLocation instead of hasLocationInfo. 2024-03-20 14:29:48 +00:00
Michael Nebel
969676975d C#: Address review comments. 2024-03-20 15:28:56 +01:00
Michael B. Gale
616015fddf Merge pull request #15935 from github/mbg/go/speed-up-dependencies 2024-03-20 14:26:46 +00:00
Tom Hvitved
79dc7fcc04 C#: Avoid using TRAP stack in buildless mode 2024-03-20 15:21:36 +01:00
Taus
1d38ca371b Merge pull request #15845 from github/tausbn/python-extractor-fix-build
Python: Build external extractor
2024-03-20 15:18:59 +01:00
Michael B. Gale
648543f2fb Merge pull request #15989 from github/mbg/docs/go-1.22
Docs: Add Go 1.22 to supported versions range
2024-03-20 14:04:26 +00:00
Michael B. Gale
c74d6348f9 Go: Run go with a valid toolchain version if we have found an invalid one 2024-03-20 13:55:37 +00:00
Michael B. Gale
0d527b2f75 Go: Keep track of all installed toolchains that we know of 2024-03-20 13:52:06 +00:00
Jeroen Ketema
1fd11928eb Merge pull request #15978 from jketema/destructors16
C++: Handle destructors at temporary object lifetime expressions
2024-03-20 14:24:10 +01:00
Ian Lynagh
9086ec8b13 Merge pull request #15973 from igfoo/igfoo/exprs
Kotlin 2: Accept more test changes
2024-03-20 13:13:56 +00:00
Michael B. Gale
96a6dd72cd Go: Move go version command construction into its own function 2024-03-20 13:08:59 +00:00
Michael B. Gale
c71ba0361e Docs: Add Go 1.22 to supported versions range 2024-03-20 12:12:20 +00:00
Mathias Vorreiter Pedersen
c9dbb7c5a9 C++: Rewrite 'cpp/missing-check-scanf' to use standard dataflow configurations. 2024-03-20 12:01:57 +00:00
Michael B. Gale
06134467e9 Go: Make CODEQL_EXTRACTOR_GO_FAST_PACKAGE_INFO true by default 2024-03-20 12:01:49 +00:00
Ian Lynagh
3fa7532b43 Kotlin 2: Accept more test changes 2024-03-20 11:46:58 +00:00
Cornelius Riemenschneider
8fbd743e9e Merge pull request #15971 from github/criemen/bazel-7-1
Upgrade to bazel 7.1
2024-03-20 12:27:03 +01:00
Mathias Vorreiter Pedersen
7ff2998c88 Merge pull request #15980 from MathiasVP/guards-lt
C++: Support `<` reasoning for `switch` statements in Guards library
2024-03-20 10:40:39 +00:00
Mathias Vorreiter Pedersen
3a7b80da47 C++: Respond to review comments. 2024-03-20 10:12:29 +00:00
Mathias Vorreiter Pedersen
9179f0bda6 Merge pull request #15969 from MathiasVP/disable-some-constant-folding
C++: Disable _some_ constant folding in IR
2024-03-20 09:25:06 +00:00
Arthur Baars
1d956e1039 Merge pull request #15974 from github/dbartol/rc3.13-mergeback
Mergeback from `rc/3.13`
2024-03-20 10:13:32 +01:00
erik-krogh
db3bf0e482 use the sanitizers from ReflectedXSS in unsafe-html-construction 2024-03-20 10:11:07 +01:00
Jeroen Ketema
3ee965f2b9 C++: Update test results 2024-03-20 10:05:35 +01:00
Tom Hvitved
90779f4413 Ruby: Extend barrier guards to handle phi inputs 2024-03-20 10:02:20 +01:00
Tom Hvitved
0f0acc0428 Ruby: Add barrier guard flow tests 2024-03-20 09:25:20 +01:00
Alex Denisov
1cfde49297 Swift: remove unused patches 2024-03-20 09:24:25 +01:00
Alex Denisov
589a5039c8 Swift: update Swift 5.10 dependencies 2024-03-20 09:23:12 +01:00
Tony Torralba
0bb86fc087 Merge pull request #15983 from github/workflow/coverage/update
Update CSV framework coverage reports
2024-03-20 09:00:34 +01:00
Paolo Tranquilli
10efcc2bb4 Swift: add -headerpad_max_install_names to link options 2024-03-20 08:35:33 +01:00
github-actions[bot]
f6f7073520 Add changed framework coverage reports 2024-03-20 00:15:31 +00:00
Mathias Vorreiter Pedersen
97aa301ac9 C++: Accept more test changes. 2024-03-19 17:33:23 +00:00
Mathias Vorreiter Pedersen
88bfb81b1f C++: Add change note. 2024-03-19 17:14:07 +00:00
Taus
d12ac1e7ce Python: Use tsp instead of tree-sitter-python 2024-03-19 17:11:40 +00:00
Taus
38169a981d Python: Shorten tree-sitter-python directory name
The current name results in a path that is more than 260 characters long,
and this causes issues for the build on Windows.
2024-03-19 17:11:40 +00:00
Taus
6f388acdd8 Python: Rename tsg_python_crate_index to py_deps
This aligns us a bit more with Ruby.
2024-03-19 17:11:40 +00:00
Taus
04c9ed37a7 Python: Fix reference in unit test
The referenced file lives in the internal repo, so this is perhaps a bit
of a hack, but I think it should be fine in the short run.
2024-03-19 17:11:40 +00:00
Taus
cac5a8236e Python: Fix CLI integration tests
Two issues:

- Tests relying on existing query machinery (i.e. `import python`) were not resolving
  correctly due to a bad `qlpack.yml` file.
- The diagnostics output tests needed an updated import to account for their new location.
2024-03-19 17:11:40 +00:00
Taus
0550c46766 Python: Fix Bazel build 2024-03-19 17:11:40 +00:00
Taus
5fed8bc57b Python: Add codeql-extractor.yml 2024-03-19 17:11:40 +00:00
Taus
016aedab0a Python: Move Python language pack tooling to external repo
This is essentially the contents of `language-packs/python/tools` with some minor
modifications to account for the changed location.

Of note: we explicitly exclude the `recorded-call-graph-metrics` director that
was already present in `python/tools`. When we revisit this directory for some
cleanup (e.g. to get rid of the `lgtm` references), we'll probably want to switch
to an explicit list of sources to include.
2024-03-19 17:11:40 +00:00
Taus
cdc879ee89 Python: Fix up some bazel references 2024-03-19 17:11:40 +00:00
Mathias Vorreiter Pedersen
1411ee5b26 C++: Extend tests to also test the new predicates and accept test changes. 2024-03-19 17:09:22 +00:00
Mathias Vorreiter Pedersen
a78080cc0e C++: Implement less-than logic for guard conditions when comparing to constants. 2024-03-19 17:06:26 +00:00
Mathias Vorreiter Pedersen
8b85735cdc C++: Generalize predicates from booleans to abstract values. 2024-03-19 17:03:59 +00:00
Dave Bartolomeo
bf46fa27d6 Merge remote-tracking branch 'origin/main' into dbartol/rc3.13-mergeback 2024-03-19 13:02:15 -04:00
Mathias Vorreiter Pedersen
aeb667c6ca Merge pull request #15976 from MathiasVP/guards-eq-follow-up
C++: Fix interface for `GuardCondition.comparesEq` and `GuardCondition.ensuresEq`
2024-03-19 16:45:38 +00:00
Mathias Vorreiter Pedersen
6bf1611f10 C++: Fix comments. 2024-03-19 16:26:37 +00:00
Michael B. Gale
be027e217e Go: Emit diagnostic for invalid toolchain versions 2024-03-19 16:26:06 +00:00
Mathias Vorreiter Pedersen
357a2ba733 C++: Sync identical files. 2024-03-19 16:24:11 +00:00
Mathias Vorreiter Pedersen
458ee13345 C++: Add constant analysis for bitwise operations now that these are no longer constant folded by IR construction. 2024-03-19 16:23:57 +00:00
yoff
ee411cc53a Merge pull request #15936 from yoff/python/test-conflicting-summaries
Python: No `fieldFlowBranchLimit` for `SummarizedCallable`s
2024-03-19 16:56:56 +01:00
Robert Marsh
467f4e11a1 C++: Change note for IR translation of destruction of temporaries with extended lifetimes 2024-03-19 15:55:36 +00:00
Robert Marsh
5a30ad162a C++: Add a comment for ReusedExpr IR translation 2024-03-19 15:54:52 +00:00
Robert Marsh
3d4f7d880d C++: unsuppress destructoion of temporaries with extended lifetimes 2024-03-19 15:54:42 +00:00
Robert Marsh
ba10ea8121 C++: ReuseExpr IR translation 2024-03-19 15:50:28 +00:00
Michael Nebel
d3aa2eed64 C#: Fix test. 2024-03-19 16:30:24 +01:00
Jeroen Ketema
f5fed84bb2 Merge pull request #15968 from jketema/destructors15
C++: Fabricate destructors for temporaries that occur in dynamic initializations
2024-03-19 16:16:43 +01:00
Owen Mansel-Chan
b8608a1b1c Merge pull request #15946 from owen-mc/java/more-manual-models
Java: more manual models
2024-03-19 15:00:27 +00:00
Mathias Vorreiter Pedersen
c640bd67e9 C++: Fix tests for guards. 2024-03-19 14:43:16 +00:00
Mathias Vorreiter Pedersen
6ce3f35ef5 C++: Fix API for guards. 2024-03-19 14:43:10 +00:00
Dave Bartolomeo
311ba8ea1b Merge from main to resolve conflicts 2024-03-19 10:41:31 -04:00
Harry Maclean
219cd4e415 Merge pull request #14426 from hmac/hmac-ar-scopes
Ruby: Track flow into ActiveRecord scopes
2024-03-19 14:19:14 +00:00
Chris Smowton
f8124222cc Merge pull request #15959 from smowton/smowton/admin/jdk22-test-changes
JDK22 upgrade test changes
2024-03-19 14:02:46 +00:00
Harry Maclean
7e479e3c8e Ruby: Fix Hash#keys flow summary 2024-03-19 13:47:45 +00:00
Tom Hvitved
ee3e38f0eb Simplify test interface in FlowSummaryImpl.qll 2024-03-19 14:35:00 +01:00
Owen Mansel-Chan
7371f5e508 Provenance should be "df-manual" 2024-03-19 13:33:49 +00:00
Mathias Vorreiter Pedersen
597f0082e7 Merge pull request #15958 from MathiasVP/ir-guards-from-switch-statements-2
C++: Implement guards logic for switch statements
2024-03-19 13:21:45 +00:00
Michael Nebel
70c6744944 Java/Go/Swift: Sync changes. 2024-03-19 14:20:43 +01:00
Michael Nebel
d24f032d97 C#: Update other tests. 2024-03-19 14:20:43 +01:00
Michael Nebel
b39842501a C#: Update sink test expected output. 2024-03-19 14:20:42 +01:00
Michael Nebel
e32902ad47 C#: Update source expected test output. 2024-03-19 14:20:42 +01:00
Michael Nebel
5b37ee4ec7 Re-factor TestOutput into a param module. 2024-03-19 14:20:42 +01:00
Mathias Vorreiter Pedersen
54262a53c3 Revert "C++: Accept test changes."
This reverts commit f36b48346e.
2024-03-19 13:18:01 +00:00
Mathias Vorreiter Pedersen
a88d8b260d C++: Only ignore constant folding for certain binary operations. 2024-03-19 13:17:49 +00:00
Mathias Vorreiter Pedersen
a97891cbc1 C++: Add QLDoc to 'getNumberOfBinaryOperands' (and rename it to 'getNumberOfNestedBinaryOperands'). 2024-03-19 12:56:15 +00:00
Mathias Vorreiter Pedersen
f36b48346e C++: Accept test changes. 2024-03-19 12:50:43 +00:00
Harry Maclean
df1845379a Merge pull request #15965 from hmac/hmac-symbol-constant
Ruby: remove isString from TSymbol
2024-03-19 12:50:27 +00:00
Michael Nebel
90db9b330f C#: Add MaD source and sink test query to shared library. 2024-03-19 13:45:38 +01:00
Cornelius Riemenschneider
42c5066cae Upgrade to bazel 7.1 2024-03-19 13:40:45 +01:00
Harry Maclean
22ddf2129b Ruby: remove isString from TSymbol 2024-03-19 12:27:34 +00:00
Tom Hvitved
2e370e2ded Python: Switch to shared XML.qll implementation 2024-03-19 13:17:53 +01:00
Tom Hvitved
61ef9e2e5c JS: Switch to shared XML.qll implementation 2024-03-19 13:17:50 +01:00
Tom Hvitved
a6c147134a Java: Switch to shared XML.qll implementation 2024-03-19 13:15:45 +01:00
Tom Hvitved
754b491d09 C++: Switch to shared XML.qll implementation 2024-03-19 13:14:42 +01:00
Tom Hvitved
529e901fb1 C#: Switch to shared XML.qll implementation 2024-03-19 13:14:42 +01:00
Tom Hvitved
7055cd8239 Make XML.qll a parameterized module 2024-03-19 13:14:42 +01:00
Tom Hvitved
ccfbd2956c Copy existing XML.qll into new a new codeql/xml pack 2024-03-19 13:14:42 +01:00
Tom Hvitved
31e04631d1 QL4QL: Regenerate DB scheme and stats 2024-03-19 13:04:12 +01:00
Tom Hvitved
865026f22b Ruby: Add up/downgrade scripts (sigh) 2024-03-19 13:04:12 +01:00
Tom Hvitved
72ff494739 Ruby: Regenerate dbscheme and stats 2024-03-19 13:04:07 +01:00
Mathias Vorreiter Pedersen
1af1ba48a9 C++: Accept test changes. 2024-03-19 11:46:51 +00:00
Mathias Vorreiter Pedersen
4d3076ae7e C++: Don't constant fold small binary operations. 2024-03-19 11:46:51 +00:00
Mathias Vorreiter Pedersen
e16e1c7e83 C++: Add tests. 2024-03-19 11:26:32 +00:00
Jeroen Ketema
06dbb4e9ef Merge pull request #15937 from jketema/destructors14
C++: Handle destructors of temporaries with extended lifetimes
2024-03-19 12:07:05 +01:00
Mathias Vorreiter Pedersen
d7afd7b2e1 C++: Accept test changes. 2024-03-19 10:54:35 +00:00
Mathias Vorreiter Pedersen
350b239ed6 C++: Fix cartesian product in 'simple_comparison_eq'. 2024-03-19 10:29:43 +00:00
Jeroen Ketema
d47e2690b8 C++: Update test results after extractor changes 2024-03-19 11:18:36 +01:00
Jeroen Ketema
fd49871b9a C++: Handle destructors of temporaries with extended lifetimes 2024-03-19 10:56:44 +01:00
Tom Hvitved
cee6f003fd Tree-sitter: Split up ast_node_info table into two tables 2024-03-19 10:52:37 +01:00
Mathias Vorreiter Pedersen
0c3d9f75f4 C++: Add change note. 2024-03-19 09:41:58 +00:00
yoff
f025430431 Merge pull request #15319 from Sim4n6/main
[Python] Add Unicode DoS (qhelp, tests and the query)
2024-03-19 10:00:30 +01:00
Rasmus Wriedt Larsen
d78efdb67b Merge pull request #15883 from RasmusWL/js-cg-tests
JS: show test changes after #15823
2024-03-19 09:58:20 +01:00
Harry Maclean
dde148ee7e Ruby: add changenote 2024-03-19 08:40:30 +00:00
Harry Maclean
32b80f8cb1 Ruby: Add tests for hash flow 2024-03-19 08:38:14 +00:00
Tom Hvitved
5ab1047b14 Merge pull request #15882 from hvitved/js/dataflow-node-get-location
JS: Add `DataFlow::Node.getLocation`
2024-03-19 09:21:00 +01:00
Chris Smowton
9a8ec36a4f Accept test changes 2024-03-19 07:55:08 +00:00
Mathias Vorreiter Pedersen
aa1d5c5e41 Merge pull request #15960 from MathiasVP/unitialized-local-as-path
C++: Convert `cpp/uninitialized-local` to a `path-problem` query
2024-03-18 21:18:17 +00:00
Erik Krogh Kristensen
a3da6c886b Merge pull request #15895 from erik-krogh/url-java-qhelp
Java: update the url-redirection in the same style as the C# qhelp
2024-03-18 21:10:07 +01:00
yoff
44ab36f238 Merge pull request #15729 from yoff/python/hardcoded-credentials-without-pointsto
python: Rewrite `HardcodedCredentials` away from `PointsTo`
2024-03-18 20:48:30 +01:00
Tom Hvitved
fc55567d90 Merge pull request #15853 from hvitved/dataflow/get-location
Data flow: Replace `hasLocationInfo` with `getLocation`
2024-03-18 20:21:46 +01:00
Tom Hvitved
8899d66132 Merge pull request #15734 from hvitved/dataflow/hidden-subpath
Data flow: Account for hidden `subpath` wrappers
2024-03-18 20:17:16 +01:00
Michael B. Gale
3649af3f05 Go: Add test for go/autobuilder/invalid-go-toolchain-version diagnostic 2024-03-18 17:56:59 +00:00
Harry Maclean
187a68bf76 Ruby: Add flow summary for Hash#keys 2024-03-18 17:56:10 +00:00
Harry Maclean
e895f96a3a Ruby: Taint flow to second block param in map
When `map` is called on a hash, the values in the hash are passed to the
second parameter of the block.
2024-03-18 17:55:02 +00:00
Mathias Vorreiter Pedersen
b66b8785c4 Merge branch 'main' into unitialized-local-as-path 2024-03-18 17:42:53 +00:00
Chris Smowton
35a309fd40 Merge pull request #15897 from smowton/smowton/admin/test-for-gradle-wrapper-without-gradle
Java: add test for partial gradle wrapper without gradle on the path
2024-03-18 17:07:20 +00:00
Owen Mansel-Chan
764e99bda7 Fix model for java.util.Scanner#findall(String)
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2024-03-18 16:56:20 +00:00
Owen Mansel-Chan
e10ce8875f Merge pull request #15947 from owen-mc/java/fix-model-provenance-to-df-manual
Fix model provenance to df-manual
2024-03-18 16:54:39 +00:00
Mathias Vorreiter Pedersen
9c2b2160ce Merge pull request #15939 from MathiasVP/experimental-surprising-lifetimes-for-range-based-for-loop
C++: Add an experimental query for surprising lifetimes from range-based for loops
2024-03-18 16:43:11 +00:00
Mathias Vorreiter Pedersen
40dbc6fdd9 C++: Accept test changes. 2024-03-18 16:27:18 +00:00
Mathias Vorreiter Pedersen
032678a367 C++: Extend tests to also test the new predicates. 2024-03-18 16:27:10 +00:00
Mathias Vorreiter Pedersen
dbd47b387a C++: Add AST wrappers for the new predicates. 2024-03-18 16:26:36 +00:00
Mathias Vorreiter Pedersen
decede51dc C++: Use the new predicate in 'ScanfChecks.qll'. 2024-03-18 16:07:57 +00:00
Mathias Vorreiter Pedersen
44045d3eed C++: Add guards logic for constant comparisons. 2024-03-18 16:07:57 +00:00
Mathias Vorreiter Pedersen
a21eea4ee0 C++: Generalize more predicates from booleans to abstract values. 2024-03-18 16:07:57 +00:00
Arthur Baars
e812682991 Merge pull request #15955 from github/post-release-prep/codeql-cli-2.16.5
Post-release preparation for codeql-cli-2.16.5
2024-03-18 16:58:01 +01:00
Mathias Vorreiter Pedersen
b944f3b411 C++: Fix FP. 2024-03-18 15:57:20 +00:00
Mathias Vorreiter Pedersen
e373341f62 C++: Add more tests. 2024-03-18 15:57:17 +00:00
Ian Lynagh
60b5e49905 Java: Limit the amount of results that MissingEnumInSwitch produces per switch
The tool status page warns:
    An analysis file contained multiple alerts that included more related
    locations than our allowed limit of 100.
    These alerts correspond to the rule java/missing-case-in-switch.
    Only 100 locations were stored for these alerts.
2024-03-18 15:56:21 +00:00
Ian Lynagh
916b1e959e Java: Add a test for MissingEnumInSwitch 2024-03-18 15:56:10 +00:00
Chris Smowton
af7b1bc425 Java: add test for partial gradle wrapper without gradle on the path
Note I had to mimic the actual absence of Gradle by testing the case where it fails, but have manually verified a missing binary works too.
2024-03-18 15:37:39 +00:00
Mathias Vorreiter Pedersen
668239f355 C++: Convert tabs to spaces. 2024-03-18 15:16:10 +00:00
Mathias Vorreiter Pedersen
bd0969b87b C++: Add change note. 2024-03-18 15:04:19 +00:00
Mathias Vorreiter Pedersen
4a55b6fbdf C++: Make 'cpp/uninitialized-local' a path-problem query. 2024-03-18 15:02:33 +00:00
Harry Maclean
80ae017aa1 Ruby: Track flow into ActiveRecord scopes 2024-03-18 15:01:37 +00:00
Tom Hvitved
0cecbf5239 Update 2024-02-28-hidden-subpaths.md
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2024-03-18 15:36:01 +01:00
Joe Farebrother
4177c38ed4 Merge pull request #15907 from joefarebrother/ruby-uploaded-file
Ruby: Model ActiveDispatch::Http::UploadedFile
2024-03-18 14:02:33 +00:00
Tamas Vajk
322fb6c507 Change integration test to return stable results 2024-03-18 14:53:49 +01:00
Tom Hvitved
7a3b8ebb3a Address review comments 2024-03-18 14:49:35 +01:00
Tom Hvitved
40089e8088 Add change note 2024-03-18 14:49:35 +01:00
Tom Hvitved
e53357d376 Update expected test output 2024-03-18 14:49:32 +01:00
Tom Hvitved
d7c9bfa08b Data flow: Account for hidden subpath wrappers 2024-03-18 14:47:11 +01:00
Sim4n6
1af8167354 updated the .expected file 2024-03-18 13:26:20 +00:00
Tamas Vajk
d749335f54 C#: Limit extracted compilation and extraction messages 2024-03-18 14:24:34 +01:00
Tom Hvitved
d83500de5d Address review comments 2024-03-18 14:24:07 +01:00
Tamas Vajk
e8e1dc0390 C#: Add integration test with extraction and compilation messages 2024-03-18 14:23:40 +01:00
github-actions[bot]
aebe9f6992 Post-release preparation for codeql-cli-2.16.5 2024-03-18 12:16:26 +00:00
Rasmus Wriedt Larsen
c82f5dad56 JS: show test changes after #15823 2024-03-18 13:09:37 +01:00
Rasmus Wriedt Larsen
28c3d35e9b Merge commit '7c35309732dd2aa4dc0b4e2949922272ad448854' into js-cg-tests 2024-03-18 13:08:46 +01:00
Rasmus Wriedt Larsen
f9309cec0b JS: Add tests before #15823 changes 2024-03-18 13:08:39 +01:00
Mathias Vorreiter Pedersen
7b6accd33a Update cpp/ql/src/experimental/Security/CWE/CWE-416/IteratorToExpiredContainer.ql
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2024-03-18 12:01:51 +00:00
Mathias Vorreiter Pedersen
457d71d7bc Update cpp/ql/src/experimental/Security/CWE/CWE-416/IteratorToExpiredContainer.ql
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2024-03-18 12:01:44 +00:00
Arthur Baars
dbf16827bf Merge pull request #15951 from github/aibaars/changenotes-fixes
Fix minor formatting issues in changenotes
2024-03-18 12:56:50 +01:00
Tamás Vajk
7429fa7b96 Merge pull request #15952 from tamasvajk/buildless/impr1
C#: Add logging for source file parsing
2024-03-18 12:27:27 +01:00
Tamás Vajk
f63c9fa07f Merge pull request #15953 from tamasvajk/buildless/impr2
C#: Iterate text files only once
2024-03-18 12:26:38 +01:00
Ian Lynagh
d2bb951ecd Merge pull request #15943 from igfoo/igfoo/k2locs
Kotlin 2: Accept more location changes
2024-03-18 11:26:08 +00:00
Owen Mansel-Chan
7fb05f4a76 Fix duplicate "df-" in "df-df-manual" 2024-03-18 11:17:55 +00:00
Mathias Vorreiter Pedersen
575af1a5f9 Merge branch 'main' into experimental-surprising-lifetimes-for-range-based-for-loop 2024-03-18 11:11:32 +00:00
Mathias Vorreiter Pedersen
1d12e0c9d9 Merge pull request #15941 from MathiasVP/ir-guards-from-switch-statements
C++: Handle `switch` statements in the guards library
2024-03-18 11:07:10 +00:00
Mathias Vorreiter Pedersen
e0476b555d Merge pull request #15934 from MathiasVP/ir-models-for-iterators
C++: Add alias and side-effect models to `begin` and `end` functions
2024-03-18 11:06:59 +00:00
Arthur Baars
769e3469a4 Merge pull request #15954 from github/release-prep/2.16.5
Release preparation for version 2.16.5
2024-03-18 11:56:14 +01:00
Mathias Vorreiter Pedersen
0be329dbdc C++: Delete duplicated code. 2024-03-18 10:33:40 +00:00
github-actions[bot]
0a6243d07b Release preparation for version 2.16.5 2024-03-18 10:14:07 +00:00
Mathias Vorreiter Pedersen
51db2b0bc4 C++: Convert tabs to spaces in ir.cpp. 2024-03-18 10:11:37 +00:00
Tamas Vajk
881c426631 C#: Iterate text files only once 2024-03-18 11:06:44 +01:00
Tamas Vajk
3a8d468983 C#: Add logging for source file parsing 2024-03-18 11:02:29 +01:00
Arthur Baars
a810165e35 Fix minor formatting issues in changenotes 2024-03-18 10:57:05 +01:00
Tom Hvitved
a13391bda1 Merge pull request #15802 from hvitved/dataflow/variable-capture-overlapping-paths
Variable capture: Avoid overlapping and false-positive data flow paths
2024-03-18 10:45:55 +01:00
Rasmus Lerchedahl Petersen
2a0c451d2d python: No fieldFlowBranchLimit for SummarizedCallables
Like https://github.com/github/codeql/pull/15689 for Ruby.
2024-03-18 10:29:36 +01:00
Rasmus Lerchedahl Petersen
45c65b48aa python: make it a real package
so python2 also respects it
2024-03-18 08:49:31 +01:00
Jami Cogswell
a8eb1d10f6 Java: remove experimental tests 2024-03-17 22:35:27 -04:00
Jami Cogswell
658fffeac1 Java: remove experimental files 2024-03-17 22:03:59 -04:00
Owen Mansel-Chan
754d4cd959 Fix model provenance to df-manual 2024-03-17 14:36:47 +00:00
Owen Mansel-Chan
23a58a0835 Add df-manual models related to existing df-manual models 2024-03-17 14:21:05 +00:00
Owen Mansel-Chan
fc367042ef Fix df-manual model with wrong parameter type 2024-03-17 14:21:01 +00:00
Ian Lynagh
a53d5d832d Kotlin 2: Accept more loc changes 2024-03-15 18:08:53 +00:00
Ian Lynagh
c4c843968e Kotlin 2: Accept more loc changes 2024-03-15 18:07:39 +00:00
Ian Lynagh
57d17d85f2 Kotlin 2: Accept more loc changes 2024-03-15 18:07:12 +00:00
Ian Lynagh
6c0885c24d Kotlin 2: Accept more loc changes 2024-03-15 18:06:45 +00:00
Jami Cogswell
55f7369df0 Java: performance fix 2024-03-15 14:06:36 -04:00
Ian Lynagh
5580daf60e Kotlin 2: Accept more loc changes 2024-03-15 18:06:13 +00:00
Ian Lynagh
1d2b31f0be Kotlin 2: Accept more loc changes 2024-03-15 18:05:46 +00:00
Ian Lynagh
5552fe3c34 Kotlin 2: Accept more loc changes 2024-03-15 18:05:09 +00:00
Ian Lynagh
28f98d0344 Kotlin 2: Accept more location changes 2024-03-15 18:04:28 +00:00
Ian Lynagh
354cdf44aa Kotlin 2: Accept more location changes 2024-03-15 18:03:55 +00:00
Ian Lynagh
f4542f6160 Kotlin2 : Accept some more location changes 2024-03-15 18:02:54 +00:00
Mathias Vorreiter Pedersen
e23e3d7fb4 C++: Run tests without the extractor and analysis changes. 2024-03-15 17:35:47 +00:00
Mathias Vorreiter Pedersen
a8718f99a1 C++: Add qhelp for 'cpp/iterator-to-expired-container'. 2024-03-15 17:35:47 +00:00
Mathias Vorreiter Pedersen
3a8db49573 C++: Add tests for 'cpp/iterator-to-expired-container'.
NOTE: This is with the yet-to-be-merged changes to the extractor and IR generation.
2024-03-15 17:35:17 +00:00
Mathias Vorreiter Pedersen
f4f417c3f9 C++: Fix QLoc. 2024-03-15 17:19:36 +00:00
Mathias Vorreiter Pedersen
b5e59492bf C++: Add change note. 2024-03-15 17:17:05 +00:00
Mathias Vorreiter Pedersen
fb218150e1 C++: Change the testcase so that it outputs the controlling values for switch statements as well. 2024-03-15 17:05:42 +00:00
Mathias Vorreiter Pedersen
07ebbb0591 C++: Accept test changes. 2024-03-15 17:04:27 +00:00
Mathias Vorreiter Pedersen
34decd3cf1 C++: Add more general public predicates to work with abstract values. 2024-03-15 17:03:45 +00:00
Mathias Vorreiter Pedersen
f4eb5f5a2d C++: Convert 'getBranchSuccessor' to use abstract values. 2024-03-15 17:03:45 +00:00
Mathias Vorreiter Pedersen
b7292fbc67 C++: Introduce 'AbstractValue' similar to what C# has. 2024-03-15 17:03:45 +00:00
Mathias Vorreiter Pedersen
2af68d37d0 C++: Include 'SwitchInstruction's as 'IRGuardCondition's. 2024-03-15 17:03:45 +00:00
Mathias Vorreiter Pedersen
704f1fad46 C++: Add switches as testcases for guard conditions. 2024-03-15 17:02:32 +00:00
Max Schaefer
daee22d38c Merge pull request #15933 from github/max-schaefer/go-incomplete-hostname-regex
Go: Mention raw string iterals in QHelp for `go/incomplete-hostname-regexp`.
2024-03-15 15:07:10 +00:00
Edward Minnix III
8ae64e992c Merge pull request #15929 from egregius313/egregius313/csharp/mad/source-node-clases-for-models
C#: Add classes extending `SourceNode` for local and stored source models
2024-03-15 11:06:14 -04:00
Joe Farebrother
8c5fff2d11 Update names and qldoc for params taint predicates 2024-03-15 14:43:29 +00:00
Mathias Vorreiter Pedersen
23cf99734a C++: Add a new experimental query ' cpp/iterator-to-expired-container'. 2024-03-15 14:29:29 +00:00
Mathias Vorreiter Pedersen
f7c29e6bfb C++: Expose some previously private classes from our models so they can be used in queries. 2024-03-15 14:21:39 +00:00
Rasmus Lerchedahl Petersen
cfbc3f73ec Pyhton: add test for conflicting summaries
We noticed that when
- a function has more than one summary (with different charpred)
- one summary is subsumed by a subpath (or something happens around the function being extracted)
- the function is called multiple times(we needed at least three)
one of the summaries would no longer lead to flow.
2024-03-15 15:13:39 +01:00
Sim4n6
3acdd3382c Update the expected file 2024-03-15 14:17:23 +01:00
Sim4n6
26a16b7857 use of a single var "op" of type Cmpop 2024-03-15 14:17:23 +01:00
Sim4n6
a717bf1b9d Fix p tag in UnicodeDoS.qhelp 2024-03-15 14:17:23 +01:00
Sim4n6
af19a0342e Fix UnicodeDoS vulnerability in CWE-770 code 2024-03-15 14:17:23 +01:00
Sim4n6
085d803b14 Fix UnicodeDoS vulnerability in CWE-770 2024-03-15 14:17:23 +01:00
Sim4n6
31dc542111 Update request parameter name in good_1() function 2024-03-15 14:17:23 +01:00
Sim4n6
70ebc58b4c Refactor Unicode normalization code 2024-03-15 14:17:23 +01:00
Sim4n6
3d8868a6c3 Add routes for bad_5 and bad_6, and fix routes for good_3 and good_4 2024-03-15 14:17:23 +01:00
Sim4n6${{7*'7'}}
658b88e62f Update python/ql/src/experimental/Security/CWE-770/UnicodeDoS.ql
update the Config API

Co-authored-by: yoff <lerchedahl@gmail.com>
2024-03-15 14:17:23 +01:00
Sim4n6
1f767b887e Add some comments and docs 2024-03-15 14:17:23 +01:00
Sim4n6
5cc9170249 Add UnicodeDoS sink for werkzeug secure_filename 2024-03-15 14:17:23 +01:00
Sim4n6
342465057c Add Unicode DoS (CWE-770) 2024-03-15 14:17:23 +01:00
Mathias Vorreiter Pedersen
19c9ea7e20 C++: Implement alias and side effect models for iterators. 2024-03-15 12:13:43 +00:00
Mathias Vorreiter Pedersen
a51fe4a00e C++: Make the vector and iterator classes in 'ir.cpp' more realistic. This matches the one we use for dataflow tests. 2024-03-15 12:10:48 +00:00
Max Schaefer
d3e0a90ae5 Go: Mention raw string iterals in QHelp for go/incomplete-hostname-regexp. 2024-03-15 11:22:40 +00:00
Tom Hvitved
693c28a821 Merge pull request #15931 from hvitved/ql/remove-missing-override-query
QL4QL: Remove `MissingOverride` query
2024-03-15 11:28:41 +01:00
Owen Mansel-Chan
8e52483beb Add df-manual models in manually modeled classes 2024-03-15 10:10:23 +00:00
Tom Hvitved
80649786c3 QL4QL: Remove MissingOverride query 2024-03-15 11:06:15 +01:00
Tom Hvitved
e7b00a7b42 Ruby: Add post-update argument nodes for string constants 2024-03-15 10:47:39 +01:00
Rasmus Wriedt Larsen
7eb4419342 Python: Restrict type-tracking content to only be precise
At least for now :)
2024-03-15 10:24:57 +01:00
Rasmus Wriedt Larsen
6babb2ff90 Python: Accept .expected for typetracking-summaries 2024-03-15 10:24:33 +01:00
Rasmus Wriedt Larsen
00f2a6a65e Python: Update ssa-compute test expectations 2024-03-15 10:14:45 +01:00
Tony Torralba
171ff4d161 Merge pull request #15928 from github/workflow/coverage/update
Update CSV framework coverage reports
2024-03-15 09:24:57 +01:00
Ed Minnix
71cf948650 Classes extending SourceNode for local and stored source models
Queries such as `cs/sql-injection` cast their source to a `SourceNode`
in order to describe them. For example:

```ql
import semmle.code.csharp.security.dataflow.flowsources.FlowSources

string getSourceType(DataFlow::Node source) {
   result = source.(SourceNode).getSourceType()
}
```

Models as data source models are not included in `SourceNode` by
default, they must be wrapped with a class extending `SourceNode`.

This adds such classes, which wrap the
`sourceNode(DataFlow::Node,string)` predicate and assigns a
`getSourceType`.
2024-03-14 22:23:54 -04:00
github-actions[bot]
7f05743212 Add changed framework coverage reports 2024-03-15 00:16:16 +00:00
Joe Farebrother
f464f1b94e Accept test output + fix qldoc typo 2024-03-14 22:25:37 +00:00
Joe Farebrother
b4ed77343b Add change note + fix qldoc 2024-03-14 22:25:36 +00:00
Joe Farebrother
3e61be1b6a Add test cases 2024-03-14 22:25:36 +00:00
Joe Farebrother
5333c75919 Model additional string attributes 2024-03-14 22:25:36 +00:00
Joe Farebrother
8c31b612ca Model UploadedFile original_filename and read 2024-03-14 22:25:35 +00:00
Mathias Vorreiter Pedersen
6dddae0154 Merge pull request #15925 from MathiasVP/rename-dataflowutil-class
C++: Follow-up to #15918
2024-03-14 18:15:14 +00:00
Tony Torralba
ee3efbadae Merge pull request #15924 from atorralba/atorralba/go/hardcoded-credentials-fix
Go: Consider more strings as hardcoded credentials
2024-03-14 16:52:34 +01:00
Tamás Vajk
945121de1b Merge pull request #15922 from tamasvajk/buildless/namespace-extraction
C#: Handle namespace resolution error more gracefully
2024-03-14 16:19:48 +01:00
Michael Nebel
2280469564 Merge pull request #15902 from michaelnebel/csharp/uncontrolledformatstring
C#: Remove hard-coded local sources from the uncontrolled-format-string query.
2024-03-14 15:21:31 +01:00
Mathias Vorreiter Pedersen
7fdea27d33 C++: Rename 'IndirectTemporaryExpr' to 'IndirectOperandExprNode'. 2024-03-14 11:46:15 +00:00
Owen Mansel-Chan
2bd08838d4 Add manual neutral models for java.lang.ClassLoader 2024-03-14 11:40:06 +00:00
Owen Mansel-Chan
5b734c76b6 Add manual neutral models for java.util.Locale and its subclasses 2024-03-14 11:39:59 +00:00
Tony Torralba
20691e409c Add change note 2024-03-14 11:56:43 +01:00
Mathias Vorreiter Pedersen
9aefdca7a7 Merge pull request #15875 from MathiasVP/bring-back-type-barriers-in-non-constant-format
C++: Clean up `cpp/non-constant-format`
2024-03-14 10:51:23 +00:00
Tony Torralba
30d906d42a Merge pull request #15906 from atorralba/atorralba/java/jdk-neutrals
Java: Add more neutral JDK models
2024-03-14 11:07:06 +01:00
Geoffrey White
19cc620f18 C++: Effect of 'Fix dataflow node <> expression problem on prvalues' from main. 2024-03-14 09:47:38 +00:00
Rasmus Wriedt Larsen
7a3ee0f5f8 Python: Make IterableSequenceNode LocalSourceNode
We do this to remove the inconsistencies, and to be ready for a future
where type-tracking support content tracker of depth > 1.

It works because targets of loadSteps needs to be LocalSourceNodes

predicate loadStep(Node nodeFrom, LocalSourceNode nodeTo, Content content) {
2024-03-14 10:46:29 +01:00
Geoffrey White
f208594067 Merge branch 'main' into mad 2024-03-14 09:44:45 +00:00
Rasmus Wriedt Larsen
6ffaad1bc8 Python: Expand type-tracking tests with nested tuples
I was initially surprised to see that this didn't work, until I
remembered that type-tracking only works with content of depth 1.
2024-03-14 10:44:25 +01:00
Rasmus Wriedt Larsen
af8cef5b53 Python: Fixup deprecated type-tracker API 2024-03-14 10:43:28 +01:00
Rasmus Wriedt Larsen
2b09b084e0 Python: Add change-note 2024-03-14 10:43:28 +01:00
Rasmus Wriedt Larsen
7de304bf16 Python: Add proper type-tracking tests for content
Instead of just relying on the call-graph tests
2024-03-14 10:43:28 +01:00
Rasmus Wriedt Larsen
fa0c4e18fc Python: Expand dict-content tt test even more
While it might be useful to track content to any lookup, it's not
something we do right now.
2024-03-14 10:43:28 +01:00
Rasmus Wriedt Larsen
4d78762ba8 Python: Ignore consistency failure 2024-03-14 10:43:28 +01:00
Rasmus Wriedt Larsen
8a7ffac19c Python: Accept consistency failure 2024-03-14 10:43:28 +01:00
Rasmus Wriedt Larsen
92729dbbd6 Python: Support iterable unpacking in type-tracking 2024-03-14 10:42:38 +01:00
Rasmus Wriedt Larsen
0cf3fe4a4c Python: Expand dict update tests 2024-03-14 10:42:38 +01:00
Rasmus Wriedt Larsen
dac2b57bb0 Python: type-track through dict-updates 2024-03-14 10:42:38 +01:00
Rasmus Wriedt Larsen
73fe596753 Python: type-tracking through dictionary construction 2024-03-14 10:42:38 +01:00
Rasmus Wriedt Larsen
ece8245a4b Python: type-track through tuple content 2024-03-14 10:42:38 +01:00
Rasmus Wriedt Larsen
a95bb7c86b Python: Expand function reference in content test 2024-03-14 10:42:38 +01:00
Rasmus Wriedt Larsen
7721fb3331 Python: Setup shared read/store steps 2024-03-14 10:42:37 +01:00
Rasmus Wriedt Larsen
636cf611ae Python: Allow general content in type-tracker
This should not result in many changes, since store/load steps are still
only implemented for attributes.
2024-03-14 10:42:37 +01:00
Rasmus Wriedt Larsen
fc8caa66c8 Python: Prepare for general content in type-tracker
Due to the char-pred of Content, this change should keep exactly the
same behavior as before.
2024-03-14 10:42:37 +01:00
Mathias Vorreiter Pedersen
dacf7d73d9 Merge pull request #15918 from MathiasVP/fix-as-expr-for-temps
C++: Fix dataflow node <> expression problem on prvalues
2024-03-14 09:38:46 +00:00
Tony Torralba
87b2dcc892 Adjust test expectations 2024-03-14 10:25:04 +01:00
Mathias Vorreiter Pedersen
a24432bacc Update cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll 2024-03-14 09:23:33 +00:00
Mathias Vorreiter Pedersen
c375497fa5 Update cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll 2024-03-14 09:16:04 +00:00
Tony Torralba
d8c0ab8e1f Go: Consider more strings as hardcoded credentials 2024-03-14 10:11:39 +01:00
Tony Torralba
9d44045e6f Adjust test expectations 2024-03-14 09:41:34 +01:00
Tony Torralba
eecab9122a Recognize the model generator involvement in the models' provenances 2024-03-14 08:56:23 +01:00
Tony Torralba
5b88b8a3ed A few more neutrals 2024-03-14 08:53:58 +01:00
Tony Torralba
36f6a6fb10 Model more EnumSet methods as neutrals 2024-03-14 08:46:43 +01:00
Tamas Vajk
b5f349bd2c C#: Handle namespace resolution error more gracefully 2024-03-14 08:37:22 +01:00
Jeroen Ketema
b2e0485c94 Merge pull request #15908 from jketema/destructors12
C++: suppress destructors with reuse expressions until proper support is added
2024-03-14 07:41:59 +01:00
Mathias Vorreiter Pedersen
a839c92979 C++: Fix mapping issue between dataflow nodes and expressions when the expression is a prvalue. 2024-03-13 22:59:09 +00:00
Mathias Vorreiter Pedersen
2fc0922b29 Merge branch 'main' into bring-back-type-barriers-in-non-constant-format 2024-03-13 22:46:35 +00:00
Mathias Vorreiter Pedersen
d1c253b519 C++: Accept test changes. 2024-03-13 22:41:32 +00:00
Mathias Vorreiter Pedersen
61597f5ac7 C++: This commit does two things:
1. It fixes a logic error in the cannotContainString predicate.
2. It reverts the changes to the `isSource` predicate that required the external
function to be within the source root.

The change to `isSource` was meant to fix the a performance problem that occurred
because of the logic error in the cannotContainString predicate. However, now that
the logic error is fixed this is no longer necessary 🎉
2024-03-13 22:40:06 +00:00
erik-krogh
ef8368cfc4 fix typo 2024-03-13 22:37:13 +01:00
Jami Cogswell
1b01f26d09 Java: adjust BarrierPrefix to handle prepended chars 2024-03-13 16:28:45 -04:00
Jami Cogswell
5ac453eb38 Java: add spurious test case for StringBuilder.append 2024-03-13 16:28:45 -04:00
Jami Cogswell
04d27f2d65 Java: adjust prefix barriers 2024-03-13 16:28:44 -04:00
Jami Cogswell
e99cea340b Java: update UrlPathBarrier to include FollowsBarrierPrefix 2024-03-13 16:28:44 -04:00
Jami Cogswell
c5a59d6c51 Java: add QLDoc 2024-03-13 16:28:44 -04:00
Jami Cogswell
7310c155e2 Java: rename SpringUrlForwardSink 2024-03-13 16:28:44 -04:00
Jami Cogswell
a002674587 Java: clean up comments on test cases 2024-03-13 16:28:44 -04:00
Jami Cogswell
a8075969d8 Java: add QLDocs to UrlPathBarrier code 2024-03-13 16:28:44 -04:00
Jami Cogswell
042dcf9cd9 Java: some updates to UrlPathBarrier code 2024-03-13 16:28:44 -04:00
Jami Cogswell
052452b186 Java: create UrlDecodeMethod 2024-03-13 16:28:44 -04:00
Jami Cogswell
d220b3a298 Java: some updates to test cases 2024-03-13 16:28:43 -04:00
Jami Cogswell
d9772c1880 Java: update change note 2024-03-13 16:28:43 -04:00
Jami Cogswell
43b49628fc Java: use new 'SimpleTypeSanitizer', and update some non-extending subtype relationships 2024-03-13 16:28:43 -04:00
Jami Cogswell
2708e53c7f Java: remove redundant imports 2024-03-13 16:28:43 -04:00
Jami Cogswell
f573032b2e Java: remove todo comments from ext files 2024-03-13 16:28:43 -04:00
Jami Cogswell
911a61df22 Java: initial update of barrier and test cases to remove FN 2024-03-13 16:28:42 -04:00
Jami Cogswell
c8ec301793 Java: add change note 2024-03-13 16:28:42 -04:00
Jami Cogswell
e75c96c0f9 Java: combine test cases; add test for StaplerResponse.forward 2024-03-13 16:28:41 -04:00
Jami Cogswell
5fa63ab5c2 Java: update/add some TODO comments 2024-03-13 16:28:41 -04:00
Jami Cogswell
c331393cfd Java: update qhelp 2024-03-13 16:28:41 -04:00
Jami Cogswell
09bc21dbd3 Java: rename 'UnsafeUrlForward' to 'UrlForward' 2024-03-13 16:28:41 -04:00
Jami Cogswell
6e7c05467b Java: update query metadata and alert message 2024-03-13 16:28:41 -04:00
Jami Cogswell
5a9d7552b3 Java: add some comments and minor code reorg 2024-03-13 16:28:41 -04:00
Jami Cogswell
1da1e896cb Java: convert SpringModelAndViewSink to MaD 2024-03-13 16:28:41 -04:00
Jami Cogswell
8d66097483 Java: switch StaplerResponse.forward from request-forgery sink to url-forward sink 2024-03-13 16:28:41 -04:00
Jami Cogswell
42e3825ea3 Java: convert RequestDispatcherSink to MaD 2024-03-13 16:28:40 -04:00
Jami Cogswell
4ff884e26c Java: remove more path-injection related classes (will maybe add some of these back in a separate PR) 2024-03-13 16:28:40 -04:00
Jami Cogswell
2a682995ae Java: move MaD models to correct files, delete ones that already exist 2024-03-13 16:28:40 -04:00
Jami Cogswell
915e106ab3 Java: remove path-injection related models and tests for now 2024-03-13 16:28:40 -04:00
Jami Cogswell
35a083ae9e Java: update test cases to use inline expectations 2024-03-13 16:28:40 -04:00
Jami Cogswell
2793f28428 Java: move config to Query.qll file 2024-03-13 16:28:40 -04:00
Jami Cogswell
0d38a9625e Java: copy files from experimental 2024-03-13 16:28:39 -04:00
Jeroen Ketema
866a3934d4 C++: suppress destructors with reuse expressions until proper support is added 2024-03-13 20:17:00 +01:00
Tom Hvitved
54fa8181da Address review comment 2024-03-13 20:03:01 +01:00
Jeroen Ketema
67b3670d06 Merge pull request #15901 from jketema/destructors11
C++: Introduce re-use expressions in the database scheme
2024-03-13 18:27:28 +01:00
Geoffrey White
8d3fc735ea C++: Fix compilation issue in UseAfterFree.qll. 2024-03-13 17:03:00 +00:00
Geoffrey White
f52b6e0449 C++: Add more test cases for taint through qualifier fields. 2024-03-13 16:20:12 +00:00
Geoffrey White
6019a38266 C++: Add more test cases for indirection (4). 2024-03-13 16:20:08 +00:00
Geoffrey White
23da0c16c7 C++: Add more test cases for indirection (3). 2024-03-13 16:20:04 +00:00
Geoffrey White
7c4927c2e3 C++: Add more test cases for indirection (2). 2024-03-13 16:19:58 +00:00
Tony Torralba
039bea1625 Java: Add more neutral JDK models
This is similar to https://github.com/github/codeql/pull/15766, in the sense that it adds neutral models to prevent the model generator from generating summaries for them. These models were spotted while evaluating https://github.com/github/codeql/pull/14919.
2024-03-13 16:59:38 +01:00
Geoffrey White
fcda0c9819 C++: Add more test cases for indirection (1). 2024-03-13 15:35:28 +00:00
Geoffrey White
c17a36ec07 C++: Add more test cases for taint through qualifiers. 2024-03-13 15:30:13 +00:00
Mathias Vorreiter Pedersen
b638d4d0ba Merge pull request #15900 from MathiasVP/glib-alloc-and-dealloc
C++: Add models for `GLib` allocation and deallocation
2024-03-13 15:29:46 +00:00
Geoffrey White
92d57ab504 C++: Correct some existing cases that are in fact indirect. 2024-03-13 15:26:21 +00:00
Erik Krogh Kristensen
bd121b98ae Merge pull request #15893 from erik-krogh/more-filter-taint
JS: allow more flow through .filter()
2024-03-13 16:19:28 +01:00
Rasmus Lerchedahl Petersen
533b63743b Python: test MaD syntax for keyword argument
use the combined positional/keyword syntax as
that is what we will probably mostly use.
2024-03-13 15:28:34 +01:00
Tom Hvitved
6c0ed28e6b Python: Implement new data flow interface 2024-03-13 14:41:57 +01:00
Tom Hvitved
02ae2d1520 Java: Implement new data flow interface 2024-03-13 14:41:57 +01:00
Tom Hvitved
e4a4c18166 Go: Implement new data flow interface 2024-03-13 14:41:57 +01:00
Michael Nebel
560b355e0c C#: Remove hard-coded local sources from the uncontrolled-format-string query. 2024-03-13 14:26:30 +01:00
Erik Krogh Kristensen
53502a8662 Merge pull request #15510 from yoff/ts-54
JS: Add support for TS 5.4
2024-03-13 14:22:24 +01:00
Jeroen Ketema
8d5eab401d C++: Introduce re-use expressions in the database scheme 2024-03-13 13:28:27 +01:00
Tom Hvitved
16cef92106 JS: Add DataFlow::Node.getLocation 2024-03-13 13:06:16 +01:00
Mathias Vorreiter Pedersen
8d504d8b32 Merge pull request #15899 from jketema/destructors10
C++: Add IR tests for the destruction of temporaries
2024-03-13 11:56:04 +00:00
Mathias Vorreiter Pedersen
465c3c18e3 C++: Add change note. 2024-03-13 11:49:26 +00:00
Asger F
c5a02dae2b Merge pull request #15768 from asgerf/js/amd-pseudo-deps
JS: Do not treat AMD pseudo-dependencies as imports
2024-03-13 12:49:17 +01:00
Mathias Vorreiter Pedersen
3ea39a2553 C++: Add some query tests. 2024-03-13 11:39:34 +00:00
Mathias Vorreiter Pedersen
bcd36b1994 C++: Recognize glib allocations and deallocations. 2024-03-13 11:39:15 +00:00
Geoffrey White
9aad43f649 C++: Add indirect test models. 2024-03-13 11:34:36 +00:00
Ian Lynagh
adefdfd59f Merge pull request #15889 from igfoo/igfoo/k2exprs
Kotlin 2: Accept more changes in the exprs test
2024-03-13 11:34:10 +00:00
erik-krogh
129286aa1c allow more flow through .filter() 2024-03-13 12:03:00 +01:00
Jeroen Ketema
3ef1ab49ea C++: Add IR tests for the destruction of temporaries 2024-03-13 12:00:02 +01:00
erik-krogh
013ed7adb3 Java: update the url-redirection in the same style as the C# qhelp 2024-03-13 11:58:16 +01:00
yoff
b5c0fbb827 Merge pull request #15776 from RasmusWL/tt-consistency
Python: Add type-tracking consistency query
2024-03-13 11:11:07 +01:00
Tom Hvitved
4085c8ec8f Merge pull request #15866 from hvitved/ruby/orm-tracking-ap-limit
Ruby: Lower access path limit to 1 for `OrmTracking`
2024-03-13 10:57:09 +01:00
Harry Maclean
806f42ef72 Ruby: Update change note 2024-03-13 09:54:17 +00:00
Harry Maclean
dd5eb982ec Merge pull request #15524 from hmac/hmac-process-spawn
Ruby: Add some more command injection sinks
2024-03-13 09:53:10 +00:00
Tony Torralba
2fd2b4c874 Merge pull request #15891 from github/workflow/coverage/update
Update CSV framework coverage reports
2024-03-13 09:51:22 +01:00
github-actions[bot]
cff2cdb9e4 Add changed framework coverage reports 2024-03-13 00:15:53 +00:00
Edward Minnix III
c190dd21db Merge pull request #15877 from egregius313/egregius313/csharp/mad/sources/windows-registry
C#: Add source models for values from the Windows registry
2024-03-12 16:41:42 -04:00
Edward Minnix III
d54489931c Merge pull request #15869 from egregius313/egregius313/java/fix/parcelfiledescriptor-open-sink
Java: Add path-injection sink for `ParcelFileDescriptor::open`
2024-03-12 16:39:20 -04:00
intrigus-lgtm
f70a39e72f [cpp-docs] Fix 404 link in guards library doc. 2024-03-12 19:59:26 +01:00
Erik Krogh Kristensen
863e3f79e5 Merge pull request #15731 from erik-krogh/java-url
Java: More sanitizers for request-forgery
2024-03-12 19:31:52 +01:00
Geoffrey White
cbacd51337 C++: Make Argument[-1] refer to *this rather than this. 2024-03-12 17:51:43 +00:00
Geoffrey White
22d5e9bbfb C++: Add test cases involving pointer qualifiers. 2024-03-12 17:47:11 +00:00
Ian Lynagh
0e94aa0eb5 Kotlin 2: Accept more changes in the exprs test 2024-03-12 16:42:37 +00:00
Ian Lynagh
8d1ee10981 Merge pull request #15876 from igfoo/igfoo/buildless-java-complete
Java: Accept test changes
2024-03-12 16:12:58 +00:00
Tamás Vajk
be2ce17376 Merge pull request #15881 from tamasvajk/buildless/fix-fallback
C#: Deduplicate not yet restored package names
2024-03-12 16:08:16 +01:00
Mathias Vorreiter Pedersen
ab6e2f9364 C++: Accept test regression. 2024-03-12 15:04:49 +00:00
erik-krogh
f613823047 add explicit QLDoc that any method named "contains" is matched 2024-03-12 15:25:27 +01:00
Geoffrey White
900c8b71d8 C++: Complete the SummaryCall class. 2024-03-12 14:23:00 +00:00
erik-krogh
35aae0a981 move changenote to src/ 2024-03-12 15:22:57 +01:00
Erik Krogh Kristensen
b53ae77c56 expand change-note
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2024-03-12 15:22:17 +01:00
Mathias Vorreiter Pedersen
51f5740707 C++: Exclude functions that aren't declared inside the source root. This fixes performance on ImageMagick. 2024-03-12 14:20:16 +00:00
Mathias Vorreiter Pedersen
6a563c161e C++: Simplify the definition of 'isNonConst'. On ImageMagick I get the same exact sources before and after. 2024-03-12 14:20:09 +00:00
Mathias Vorreiter Pedersen
179a7d500e C++: Handle 'wchar_t' types that may be defined as unsigned short in C. This brings back SAMATE results. 2024-03-12 14:19:48 +00:00
Geoffrey White
a27949cffa C++: Set certain = true in storeStepImpl. 2024-03-12 14:08:20 +00:00
Tamas Vajk
b07b0762f2 Adjust based on code review feedback 2024-03-12 15:07:58 +01:00
erik-krogh
74876ff49b add change-note 2024-03-12 15:07:36 +01:00
erik-krogh
52f71e4553 small fixes based on review 2024-03-12 15:07:29 +01:00
Ian Lynagh
c2aa334465 Java: Accept test changes 2024-03-12 14:03:02 +00:00
Tom Hvitved
695e728ed5 Ruby: Lower access path limit to 1 for OrmTracking 2024-03-12 14:58:29 +01:00
Tom Hvitved
dddba3228b Merge pull request #15867 from hvitved/dataflow/ap-limit
Data flow: Add `ConfigSig::accessPathLimit`
2024-03-12 14:57:51 +01:00
erik-krogh
6be0ed1dc3 narrow the version specifier used for TypeScript 2024-03-12 13:42:58 +01:00
Tom Hvitved
d7790faece Address review comments 2024-03-12 13:34:55 +01:00
erik-krogh
95a5ec7f27 add test that the new Object.groupBy method has a type 2024-03-12 13:22:11 +01:00
Owen Mansel-Chan
33c17313b4 Add test for not extracting values for intermediate string concatenations 2024-03-12 11:59:10 +00:00
Michael Nebel
50851210ea Merge pull request #15794 from michaelnebel/csharp/removecil
C#: Delete the CIL extractor.
2024-03-12 12:48:41 +01:00
Mathias Vorreiter Pedersen
1a42e55095 Merge pull request #15820 from MathiasVP/add-type-confusion-query
C++: Add a new query for detecting type confusion vulnerabilities
2024-03-12 10:29:22 +00:00
Tom Hvitved
0e0b73a5e6 Address review comment 2024-03-12 11:22:04 +01:00
Michael Nebel
eb62c033aa C#: Remove the cil extractor option. 2024-03-12 11:12:56 +01:00
Michael Nebel
f59aaf1d75 C#: Add change note. 2024-03-12 11:12:55 +01:00
Michael Nebel
2e5155d1f8 C#: Remove all CIL related tests. 2024-03-12 11:12:55 +01:00
Michael Nebel
af06202241 C#: Cleanup implementation. 2024-03-12 11:12:55 +01:00
Michael Nebel
bf27f203d5 C#: Remove CIL extractor projects. 2024-03-12 11:12:55 +01:00
Tamas Vajk
1633673cc2 C#: Deduplicate not yet restored package names 2024-03-12 09:22:38 +01:00
Kevin Stubbings
5acc15bfff fix grammar 2024-03-11 20:13:08 -07:00
Kevin Stubbings
30fe4168e3 Removed filepath.base sanitizer 2024-03-11 15:08:10 -07:00
Angela P Wen
ca12348ecb Merge pull request #15880 from github/sitedocs/2.16.4-2
Add changelog for 2.16.4
2024-03-11 14:59:53 -07:00
Kevin Stubbings
c4c0b22bc7 Formattinga and change notes 2024-03-11 14:54:30 -07:00
Kevin Stubbings
c9b49d3760 resolve feedback 2024-03-11 14:54:28 -07:00
Kevin Stubbings
530c76ca8b Add New Sanitizers and Modify Old Ones 2024-03-11 14:53:29 -07:00
Pierre
d1f8336be6 Add changelog for 2.16.4 2024-03-11 22:21:25 +01:00
Ed Minnix
7745c2c2b7 Change note 2024-03-11 17:00:12 -04:00
Tom Hvitved
8d767862dc Swift: Implement new data flow interface 2024-03-11 20:56:38 +01:00
Tom Hvitved
1c57e99686 C++: Implement new data flow interface 2024-03-11 20:56:38 +01:00
Tom Hvitved
257686eb9a C#: Implement new data flow interface 2024-03-11 20:56:38 +01:00
Tom Hvitved
4291290277 Ruby: Implement new data flow interface 2024-03-11 20:56:38 +01:00
Tom Hvitved
e82e3180f0 Data flow: Replace hasLocationInfo with getLocation 2024-03-11 20:56:38 +01:00
Mathias Vorreiter Pedersen
9854ed4b89 C++: Delete comment. 2024-03-11 18:54:53 +00:00
Mathias Vorreiter Pedersen
2345907a52 C++: Reintroduce the 'cannotContainString' optimization that was removed in #15516. 2024-03-11 18:49:03 +00:00
Mathias Vorreiter Pedersen
f97b6e2848 C++: Stop conflating pointers and indirections in the query. 2024-03-11 18:48:19 +00:00
Mathias Vorreiter Pedersen
32e532ff3c C++: Some cleanup to avoid conflating the case of a function returning something as a return value, and a function updating one of its arguments. 2024-03-11 18:42:42 +00:00
Ed Minnix
bc745dfd5e Windows registry sources 2024-03-11 13:55:34 -04:00
erik-krogh
9f410eb2d6 Merge branch 'main' into ts-54 2024-03-11 18:07:52 +01:00
Joe Farebrother
9c51514bd9 Merge pull request #15857 from joefarebrother/ruby-activerecord-from
Ruby: Model second argument of `ActiveRecord` `from`
2024-03-11 16:49:52 +00:00
Henry Mercer
c325ff8a23 Mark lines of code queries as telemetry queries
The new file coverage metrics are available in all supported GHES
versions. This PR tags lines of code queries as telemetry queries. Lines
of code information will still be available in the SARIF file, but it
will no longer be displayed in the logging output of the CLI.

The one exception is the metric queries for Java/Kotlin that provides
separate lines of code information for Java and Kotlin. I've kept these
since separate file coverage information for languages like Java and
Kotlin is only available for GHES 3.12 and later.
2024-03-11 16:40:31 +00:00
Rasmus Lerchedahl Petersen
d73f43477f update ts to released version 54 2024-03-11 16:32:19 +01:00
Tony Torralba
04436208ab Merge pull request #15843 from atorralba/atorralba/go/uncontrolled-allocation-size
Go: Promote `go/uncontrolled-allocation-size` from experimental
2024-03-11 16:12:27 +01:00
Michael Nebel
5749fdbc46 Merge pull request #15868 from michaelnebel/csharp/csharp12releasenote
C#: Overall change note for C# 12 / .NET 8 support.
2024-03-11 16:08:24 +01:00
Tony Torralba
ff2d78d2c8 Update go/ql/src/Security/CWE-770/UncontrolledAllocationSize.ql 2024-03-11 15:53:40 +01:00
Ed Minnix
76aeee2820 Change note 2024-03-11 10:34:15 -04:00
Ed Minnix
61dbe26858 Add sinks for android.os.ParcelFileDescriptor 2024-03-11 10:31:51 -04:00
Mathias Vorreiter Pedersen
7b0df57d7a C++: Remove the two configurations that depend on flow state to speed up performance on ChakraCore. 2024-03-11 13:56:22 +00:00
Michael Nebel
f571ebdaf4 C#: Overall change note for C# 12 / .NET 8 support. 2024-03-11 14:43:14 +01:00
Rasmus Wriedt Larsen
800351c7b7 Merge branch 'main' into tt-consistency 2024-03-11 14:12:09 +01:00
yoff
e6e6a4e9c8 Merge pull request #15841 from RasmusWL/missing-use-use2
Python: Add example of missing use-use flow
2024-03-11 13:59:57 +01:00
yoff
adbcbefaa9 Merge pull request #15551 from yoff/python/avoid-duplicate-model-inclusions
python: Remove `TaintStepFromSummary`
2024-03-11 13:52:20 +01:00
Geoffrey White
026a13b4db C++: Change Node/Node0.getEnclosingCallable back to returning Declaration. 2024-03-11 12:22:55 +00:00
Tom Hvitved
da66281fef Sync files 2024-03-11 13:02:04 +01:00
Tom Hvitved
7a39f077d9 Data flow: Add ConfigSig::accessPathLimit 2024-03-11 13:01:58 +01:00
Rasmus Wriedt Larsen
4ac8dd72a7 Merge pull request #15855 from yoff/python/add-MaD-test-tuple-output
Python: Add test for `ReturnValue.TupleElement[n]`
2024-03-11 12:05:31 +01:00
Owen Mansel-Chan
da8cc13506 go extractor: avoid long string concatenations
When we see "a" + "b" + "c" + "d", do not add a
row to the constvalues table for the intermiediate
strings "ab" and "abc". We still have entries for
the string literals ("a", "b", "c", and "d") and
the whole string concatenation ("abcd").
2024-03-11 10:53:26 +00:00
Mathias Vorreiter Pedersen
73c4fe08fa Merge pull request #15835 from MathiasVP/initial-def-of-addresses
C++: Provide an initial SSA definition of the address of a variable
2024-03-11 10:42:01 +00:00
Geoffrey White
4bc272da73 C++: Doc correction and TODOs for interpretOutput, interpretInput. 2024-03-11 10:16:46 +00:00
Erik Krogh Kristensen
00c228540e Merge pull request #15836 from github/dependabot/cargo/ql/chrono-0.4.35
Bump chrono from 0.4.34 to 0.4.35 in /ql
2024-03-11 11:13:15 +01:00
Tamás Vajk
35a8e7cbf0 Merge pull request #15854 from tamasvajk/buildless/change-assembly-id
C#: Change ID of buildless output assembly
2024-03-11 10:03:40 +01:00
Rasmus Wriedt Larsen
42acd9c22c Merge pull request #15695 from github/tausbn/python-add-copy-method-as-copy-step
Python: Add `.copy()` method call as copy step
2024-03-11 09:43:34 +01:00
Michael Nebel
6485dcc0fc Merge pull request #15859 from github/workflow/coverage/update
Update CSV framework coverage reports
2024-03-11 09:10:52 +01:00
Tony Torralba
a09eb9f4c5 Update go/ql/src/Security/CWE-770/UncontrolledAllocationSize.ql
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
2024-03-11 08:58:59 +01:00
Edward Minnix III
7fe378e831 Merge pull request #15756 from egregius313/egregius313/csharp/dataflow/threat-model/remove-addlocalsource
C#: Remove `AddLocalSource` classes from queries
2024-03-10 22:56:28 -04:00
Ed Minnix
3fdc7e95df Add local models to CodeInjection tests 2024-03-10 22:20:54 -04:00
Ed Minnix
8187b00562 Change note 2024-03-10 22:20:52 -04:00
Ed Minnix
d300736c7e Remove AddLocalSource classes 2024-03-10 22:20:51 -04:00
Edward Minnix III
58f2777532 Merge pull request #15629 from egregius313/egregius313/csharp/dataflow/threat-modeling/remove-stored-query-variants
C#: Remove `Stored` variants of queries
2024-03-10 22:17:03 -04:00
github-actions[bot]
589a34241c Add changed framework coverage reports 2024-03-11 00:16:32 +00:00
Owen Mansel-Chan
820c14577a Merge pull request #13553 from am0o0/amammad-go-bombs
Go: Decompression Bombs
2024-03-10 13:48:04 +00:00
Edward Minnix III
e7852f520f Merge pull request #15605 from egregius313/egregius313/csharp/dataflow/sources/commandargs-and-environment
C#: Add more `environment` and `commandargs` sources for the C# Standard Library
2024-03-08 14:10:09 -05:00
Geoffrey White
e8d0f1fa3e C++: Comments. 2024-03-08 18:25:01 +00:00
Edward Minnix III
5440dbf70d Merge pull request #15758 from egregius313/egregius313/csharp/docs/threat-modeling-in-mad-docs
C#: Add references to threat modeling to C# Models-as-Data documentation
2024-03-08 11:50:51 -05:00
am0o0
43df6a2c07 add comments for already implemented io.Read and io.WriteTo Sinks.
remove some sinks about `"decompressor"` which was added wrongly.
change `GeneralReadIoSink` type from module to class.
separate `KlauspostGzipAndPgzip` `KlauspostPgzip` and `KlauspostGzip`.
2024-03-08 20:05:46 +04:00
am0o0
66130d208e convert abstract predicate isAdditionalFlowStep to non-abstract 2024-03-08 19:30:41 +04:00
Joe Farebrother
dbd33d1cf0 Model Argument[1] of ActiveRecord from 2024-03-08 14:04:01 +00:00
Tamas Vajk
9b5cfc9026 Change assembly population in buildless 2024-03-08 15:02:30 +01:00
Rasmus Lerchedahl Petersen
3601773856 python: support encoding lower bound 2024-03-08 14:59:28 +01:00
Rasmus Wriedt Larsen
adf5a4b1e4 Python: Fix internal consistency failures 2024-03-08 14:13:47 +01:00
Tom Hvitved
9ee2314ef6 Merge pull request #15847 from hvitved/ruby/orm-field-as-source-no-args
Ruby: Exclude calls with arguments from `OrmFieldAsSource`
2024-03-08 13:52:34 +01:00
Asger F
7c35309732 Merge pull request #15823 from asgerf/js/lift-cg-restriction
JS: Call graph improvements
2024-03-08 13:40:38 +01:00
Rasmus Wriedt Larsen
87b6592dbc Python: Accept inconsistency for missing use-use flow
At least until we have a proper fix
2024-03-08 13:34:26 +01:00
Rasmus Wriedt Larsen
8fe483d9d8 Python: Add example of missing use-use flow
(see PR for more detailed description)
2024-03-08 13:26:01 +01:00
Asger F
245cd5c0b5 Merge pull request #15760 from asgerf/js/summarised-tt-store-steps
JS: Summarise store steps for type tracking
2024-03-08 13:16:25 +01:00
Asger F
ac4601cb8f Update javascript/ql/lib/semmle/javascript/dataflow/internal/CallGraphs.qll
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2024-03-08 13:01:38 +01:00
Ian Lynagh
a9bab18804 Merge pull request #15848 from igfoo/igfoo/deleg2
Kotlin 2: Accept some more loc changes in exprs test
2024-03-08 11:49:11 +00:00
Michael Nebel
36a775502f Merge pull request #15851 from microsoft/54-csharp-add-missing-mad-for-httprequestmessage-upstream
csharp update MaD for HttpRequestMessage
2024-03-08 12:39:08 +01:00
Michael Nebel
7c46e9fcf4 Merge pull request #15838 from michaelnebel/csharp/deleteirqueries
C#: Remove IR queries.
2024-03-08 11:29:23 +01:00
Tamas Vajk
33eb69164c C#: Change ID of buildless output assembly 2024-03-08 11:20:04 +01:00
Rasmus Lerchedahl Petersen
6d8d106d91 Python: add test for ReturnValue.TupleElement[n] 2024-03-08 11:18:51 +01:00
Asger F
546b0a9a89 Merge pull request #15763 from asgerf/js/escaping-instance-detection
JS: Improve detection of classes with escaping instances
2024-03-08 11:13:50 +01:00
Asger F
fc5b9e2796 JS: Expand test case 2024-03-08 10:34:39 +01:00
Tom Hvitved
24e35f6f3d Update expected test output 2024-03-08 10:00:43 +01:00
Tom Hvitved
63bb772ef9 Variable capture: Avoid overlapping and false-positive data flow paths 2024-03-08 10:00:42 +01:00
Tom Hvitved
e793a1e9fe Ruby: Add variable capture spurious flow test 2024-03-08 10:00:42 +01:00
Tom Hvitved
2896bfbd9f Merge pull request #15821 from hvitved/dataflow/clears-content-store
Data flow: Allow for direct stores into nodes with `clearsContent`
2024-03-08 09:59:29 +01:00
Ed Minnix
7f950d8e0d Fix ExpandEnvironmentVariables test case 2024-03-07 21:48:05 -05:00
Lindsay Simpkins
7dd175d938 change note 2024-03-07 17:16:17 -08:00
Mathias Vorreiter Pedersen
761f6d3a7e C++: Disable field flow from the 'cpp/type-confusion' query to fix performance on ChakraCore. 2024-03-07 15:24:04 -08:00
Lindsay Simpkins
feb1ca29cc csharp update MaD for HttpRequestMessage 2024-03-07 15:00:05 -08:00
Chris Smowton
e4f680d476 Merge pull request #15778 from smowton/smowton/admin/test-multi-release-jars
Java: Add tests for multi-release jars under Java 11 and 17
2024-03-07 22:59:35 +00:00
Mathias Vorreiter Pedersen
a548316747 C++: Accept test changes. 2024-03-07 13:55:31 -08:00
Mathias Vorreiter Pedersen
4f9bdca4f0 C++: Optimize. 2024-03-07 13:08:26 -08:00
Chris Smowton
2321eecb9e Add tests for multi-release jars under Java 11 and 17 2024-03-07 21:07:49 +00:00
Mathias Vorreiter Pedersen
cedbfbe7ea C++: Use a more generous definition of compatible types. 2024-03-07 10:50:20 -08:00
Ian Lynagh
e74606eba3 Kotlin 2: Accept some more loc changes 2024-03-07 18:40:59 +00:00
Ian Lynagh
79c5ad93b0 Kotlin 2: Accept a loc change
This is a bit of an odd location for the IrVariableImpl as it includes a
comment, but the comment is already included in the corrresponding
IrLocalDelegatedPropertyImpl so it's not clearly wrong:

 Element: 16 59 (2:4 - 2:47) class org.jetbrains.kotlin.ir.declarations.impl.IrLocalDelegatedPropertyImpl
-Element: 29 42 (2:17 - 2:30) class org.jetbrains.kotlin.ir.declarations.impl.IrVariableImpl
+Element: 16 59 (2:4 - 2:47) class org.jetbrains.kotlin.ir.declarations.impl.IrVariableImpl

So just accept the change.
2024-03-07 18:37:00 +00:00
Michael Nebel
f2e467d8ea C#: Cleanup identical-files. 2024-03-07 19:22:47 +01:00
Michael Nebel
5b48bc4a3e C#: Delete the experimental IR queries. 2024-03-07 19:22:47 +01:00
Michael Nebel
48fcec82d6 Merge pull request #15736 from michaelnebel/csharp/disconnectfromdotnet
C#: Deprecate dotnet and CIL in QL.
2024-03-07 19:17:05 +01:00
Ed Minnix
608a3f907c Add type signature for methods with no overloads 2024-03-07 12:32:06 -05:00
Ed Minnix
1f64f5f8c9 Change note 2024-03-07 12:32:05 -05:00
Ed Minnix
f8c805de6b Microsoft.Extensions.Configuration models 2024-03-07 12:32:04 -05:00
Ed Minnix
ec6e17360d Replace Main-method parameters with ThreatModelFlowSource 2024-03-07 12:30:08 -05:00
Ed Minnix
a3f6bfe1df commandargs sources 2024-03-07 12:30:06 -05:00
Ed Minnix
51afe12ae1 Environment variable sources 2024-03-07 12:20:48 -05:00
Ed Minnix
b0eb0e1f1e Move common source kinds to "shared" 2024-03-07 12:20:45 -05:00
Tom Hvitved
85782ff1d4 Ruby: Exclude calls with arguments from OrmFieldAsSource 2024-03-07 17:34:01 +01:00
Mathias Vorreiter Pedersen
9e77b89885 Update TypeConfusion.qhelp
Co-authored-by: hubwriter <hubwriter@github.com>
2024-03-07 08:33:49 -08:00
Tamás Vajk
1fa151db7c Merge pull request #15844 from tamasvajk/buildless/sdk-version-parsing
C#: Improve `global.json` file parsing
2024-03-07 17:03:12 +01:00
Tom Hvitved
76564edc93 Address review comment 2024-03-07 16:50:28 +01:00
Edward Minnix III
92b086d36f Merge pull request #15798 from egregius313/egregius313/csharp/mad/fix-textreader-models
C#: Change `System.IO.TextReader` models to transfer taint to out parameter
2024-03-07 10:40:28 -05:00
Chris Smowton
c9474050c8 Merge pull request #15839 from smowton/smowton/admin/jdk22-extractor-upgrade-test-changes
Java: Explicitly import Lock class
2024-03-07 15:05:50 +00:00
Tamas Vajk
ea38bf5ebc C#: Improve global.json file parsing 2024-03-07 15:35:10 +01:00
Tony Torralba
138ce42cf6 Fix qhelp 2024-03-07 15:22:46 +01:00
Tony Torralba
7d74125508 Go: Promote go/uncontrolled-allocation-size 2024-03-07 15:17:49 +01:00
Taus
5202792163 Merge pull request #15754 from github/tausbn/python-copy-extractor-to-external-repo
Python: Copy Python extractor to `codeql` repo
2024-03-07 15:15:28 +01:00
Geoffrey White
b71b43a2fb Merge pull request #15705 from geoffw0/qldoc3
Shared: Fill some QLDoc holes
2024-03-07 14:12:51 +00:00
Taus
4b0689b6ba Python: Add warnOnImplicitThis: true to qlpack.yml 2024-03-07 13:59:16 +00:00
Taus
6dec323cfc Python: Copy Python extractor to codeql repo 2024-03-07 13:59:16 +00:00
Rasmus Wriedt Larsen
4dd8f6e618 Python: Add example of missing use-use flow
(see PR for more detailed description)
2024-03-07 14:25:55 +01:00
Asger F
81b04863b2 JS: Change note 2024-03-07 13:35:50 +01:00
Tom Hvitved
22b168beee Data flow: Allow for direct stores into nodes with clearsContent 2024-03-07 12:47:12 +01:00
Ian Lynagh
67612e60b5 Merge pull request #15829 from igfoo/igfoo/expr-del-2
Kotlin 2: Accept more loc changes in exprs test
2024-03-07 11:18:03 +00:00
Ian Lynagh
7bbc18f114 Merge pull request #15799 from igfoo/igfoo/kotlin-upper-bound
Kotlin: Docs: Give upper bound as 1.9.2x rather than 1.9.20
2024-03-07 11:17:51 +00:00
Asger F
c7295a09cd JS: Benign test output update 2024-03-07 11:55:56 +01:00
Anders Schack-Mulligen
f3a381f10d Merge pull request #15822 from aschackmull/dataflow/perf-fixes
Dataflow: Misc performance fixes
2024-03-07 11:47:36 +01:00
Chris Smowton
dae20ca50c Explicitly import Lock 2024-03-07 09:54:17 +00:00
Tamás Vajk
6d5fd3c9de Merge pull request #15827 from tamasvajk/buildless/impr-progress-reporting
C#: Improve buildless progress reporting
2024-03-07 10:00:06 +01:00
Michael Nebel
73040bd30f C#: Use fully qualified name with types instead of label in IR queries. 2024-03-07 09:40:34 +01:00
Michael Nebel
990dec67d0 C#: Address more review comments. 2024-03-07 09:40:34 +01:00
Michael Nebel
43ee62ad64 C#: Update the NoDisposeCallOnLocalIDisposable and expected output. 2024-03-07 09:40:34 +01:00
Michael Nebel
eda345a5b8 C#: Address review comments. 2024-03-07 09:40:34 +01:00
Michael Nebel
e3380aa545 C#: Add change note. 2024-03-07 09:40:34 +01:00
Michael Nebel
7f6c84dda8 C#: Fix bad join order. 2024-03-07 09:40:34 +01:00
Michael Nebel
35b93063f9 C#: Deprecate dotnet and cil. 2024-03-07 09:40:34 +01:00
Michael Nebel
16375b0fe7 C#: Remove CIL dataflow tests. 2024-03-07 09:40:34 +01:00
Michael Nebel
37677142b9 C#: Update QL tests. 2024-03-07 09:40:33 +01:00
Michael Nebel
58a1353ddc C#: Clean up implementation and remove CIL dataflow implementation. 2024-03-07 09:40:33 +01:00
Michael Nebel
1638183d18 C#: Copy dotnet.Variable implementation. 2024-03-07 09:40:33 +01:00
Michael Nebel
6178acc070 C#: Copy dotnet.Type implementation. 2024-03-07 09:40:33 +01:00
Michael Nebel
81ce8dc02d C#: Copy dotnet.Parameterizable implementation. 2024-03-07 09:40:33 +01:00
Michael Nebel
92447dc743 C#: Copy dotnet.Namespace implementation. 2024-03-07 09:40:33 +01:00
Michael Nebel
7ba25b23a5 C#: Copy dotnet.Generics implementation. 2024-03-07 09:40:33 +01:00
Michael Nebel
eb5cb2a7bf C#: Copy dotnet.Expr implementation. 2024-03-07 09:40:33 +01:00
Michael Nebel
215808d7e9 C#: Copy dotnet.Declaration implementation. 2024-03-07 09:40:33 +01:00
Michael Nebel
cdf3d47031 C#: Copy dotnet.Element implementation. 2024-03-07 09:40:32 +01:00
Michael Nebel
c606ab09a5 C#: Copy dotnet.Callable implementation. 2024-03-07 09:40:32 +01:00
Michael Nebel
d7dc73e18b C#: Remove the CIL related parts of the Disposal tests. 2024-03-07 09:40:32 +01:00
Mathias Vorreiter Pedersen
b876117ecc C++: Add more QLDoc. 2024-03-06 22:25:04 -08:00
Mathias Vorreiter Pedersen
01fc7432cb C++: Add more tests. 2024-03-06 22:17:33 -08:00
Mathias Vorreiter Pedersen
bf84f3a936 C++: Add FN. 2024-03-06 21:19:17 -08:00
Mathias Vorreiter Pedersen
3295d5cb9f C++: Add more QLDoc. 2024-03-06 21:17:57 -08:00
Mathias Vorreiter Pedersen
fc9919a5b6 C++: Add a test that exercise the 'last field' check. 2024-03-06 21:17:55 -08:00
Mathias Vorreiter Pedersen
c2db5f490e C++: Add more FNs and FPs to show examples of where the 'successor typing' strategy fails. 2024-03-06 21:16:51 -08:00
Mathias Vorreiter Pedersen
cd57cd0d8a C++: Add qhelp reference. 2024-03-06 21:15:27 -08:00
Mathias Vorreiter Pedersen
cf4c8eb517 C++: Add more tests. 2024-03-06 21:15:25 -08:00
Mathias Vorreiter Pedersen
6dc0fa515d C++: Add change note. 2024-03-06 21:11:36 -08:00
Mathias Vorreiter Pedersen
8ae6fa5366 C++: Add a new query 'cpp/type-confusion' for detecting type confusion vulnerabilities. 2024-03-06 21:11:32 -08:00
dependabot[bot]
f0a5183a3f Bump chrono from 0.4.34 to 0.4.35 in /ql
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.34 to 0.4.35.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.34...v0.4.35)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-07 03:59:07 +00:00
Angela P Wen
31f1f50a64 Merge pull request #15834 from github/post-release-prep/codeql-cli-2.16.4
Post-release preparation for codeql-cli-2.16.4
2024-03-06 18:40:08 -08:00
Mathias Vorreiter Pedersen
4c9876b008 C++: Accept test changes. 2024-03-06 18:18:36 -08:00
Mathias Vorreiter Pedersen
cf162aa412 C++: Add an explicit definition of the address of an IRVariable. 2024-03-06 18:18:33 -08:00
Mathias Vorreiter Pedersen
84797b9091 C++: Refactor the address out of 'DefImpl' and into a new abstract class 'OperandBasedDef'. 2024-03-06 18:15:52 -08:00
Mathias Vorreiter Pedersen
cc754858c6 C++: Add a testcase with missing flow out of the address of 'a' and to the argument of 'sink'. 2024-03-06 18:15:49 -08:00
Mathias Vorreiter Pedersen
a60afef923 C++: Add a local flow test file for IR dataflow. 2024-03-06 18:10:08 -08:00
github-actions[bot]
dc9092c9ec Post-release preparation for codeql-cli-2.16.4 2024-03-06 22:19:33 +00:00
Angela P Wen
2daf50500c Merge pull request #15833 from github/release-prep/2.16.4
Release preparation for version 2.16.4
2024-03-06 13:00:06 -08:00
github-actions[bot]
2f058ffb4d Release preparation for version 2.16.4 2024-03-06 20:56:51 +00:00
Angela P Wen
711c474049 Merge pull request #15832 from github/revert-15814-release-prep/2.16.4
Revert "Release preparation for version 2.16.4"
2024-03-06 12:53:52 -08:00
Angela P Wen
ce31f8641a Revert "Release preparation for version 2.16.4" 2024-03-06 12:07:33 -08:00
Ian Lynagh
e58b6e86b2 Kotlin 2: Accept more loc changes in exprs test 2024-03-06 17:57:44 +00:00
Geoffrey White
23fd3f62ac C++: Add models-as-data case to allowParameterReturnInSelf. 2024-03-06 16:12:46 +00:00
Geoffrey White
26ef1bc249 Swift: comment models-as-data implementation. 2024-03-06 16:12:46 +00:00
Geoffrey White
18d9573b6a C++: Add summaryLocalStep as well. 2024-03-06 16:12:46 +00:00
Geoffrey White
0edfafeb06 Shared: Correct and clarify doc for SemBound.getExpr. 2024-03-06 16:00:36 +00:00
Ed Minnix
a87df5459f Fix flow summary tests 2024-03-06 10:39:32 -05:00
Ed Minnix
527041348e Add comment about Memory<T> 2024-03-06 10:39:31 -05:00
Ed Minnix
e065390185 Add .Element modifier to Memory<T> arguments in MaD models 2024-03-06 10:39:30 -05:00
Ed Minnix
27ba51cf9d Change note 2024-03-06 10:39:28 -05:00
Ed Minnix
94a941115f Fix FlowSummaries test results 2024-03-06 10:39:27 -05:00
Ed Minnix
ca55b92281 Change System.IO.TextReader models to transfer taint to out parameter instead of return value
Some of the `System.IO.TextReader` models transfered taint to
`ReturnValue`, when there is a more relevant out-parameter/array.
2024-03-06 10:39:25 -05:00
Owen Mansel-Chan
0ebe045cd8 Merge pull request #15819 from github/workflow/coverage/update
Update CSV framework coverage reports
2024-03-06 15:35:14 +00:00
Tamas Vajk
c4f2bbda2a Simplify task counter incrementing 2024-03-06 16:12:14 +01:00
Tamas Vajk
34308eee8d C#: Improve buildless progress reporting 2024-03-06 16:11:19 +01:00
Geoffrey White
8c0f02ac4b C++: Add summary jumpStep, readStep, storeStep. 2024-03-06 14:51:48 +00:00
Owen Mansel-Chan
4e5a6d770a Merge branch 'main' into workflow/coverage/update 2024-03-06 13:43:05 +00:00
Owen Mansel-Chan
f1115af146 Merge pull request #15130 from Malayke/main
Go: new query for detect DOS vulnerability
2024-03-06 11:32:57 +00:00
Tony Torralba
f4c2e65614 Merge pull request #15812 from atorralba/atorralba/go/squirrel-sinks
Go: Add SQLi sinks for Squirrel
2024-03-06 12:09:19 +01:00
Asger F
a54a73c9a2 JS: Detect more FunctionStyleClasses 2024-03-06 11:37:20 +01:00
Anders Schack-Mulligen
caa45058ae Dataflow: Improve join-order.
Join with the functional getApprox before filtering with revFlow as this
is always better.
2024-03-06 11:29:08 +01:00
Anders Schack-Mulligen
55e6255e05 Dataflow: Extend the first join to also include argApa.
Improves from
2024-03-04 13:29:20] Evaluated non-recursive predicate DataFlowImpl::Impl<TaintedPath::TaintedPath::C>::Stage5::flowThroughIntoCall/6#b44155c7@6dd478n9 in 126ms (size: 398332).
Evaluated relational algebra for predicate DataFlowImpl::Impl<TaintedPath::TaintedPath::C>::Stage5::flowThroughIntoCall/6#b44155c7@6dd478n9 with tuple counts:
              1  ~0%    {2} r1 = SCAN `DataFlowImpl::Impl<TaintedPath::TaintedPath::C>::TAccessPathApproxNone#dom#04382804` OUTPUT _, _
              1  ~0%    {0}    | REWRITE WITH Tmp.0 := true, Tmp.1 := false, TEST Tmp.0 != Tmp.1 KEEPING 0
          83798  ~0%    {4}    | JOIN WITH `project#DataFlowImpl::Impl<TaintedPath::TaintedPath::C>::Stage5::returnFlowsThrough/8#ffafcf14` CARTESIAN PRODUCT OUTPUT Rhs.0, Rhs.3, Rhs.1, Rhs.2
        4044102  ~3%    {7}    | JOIN WITH `project#DataFlowImpl::Impl<TaintedPath::TaintedPath::C>::Stage5::flowIntoCallApaTaken/6#d989a8d1#cpe#12346_2013#join_rhs` ON FIRST 1 OUTPUT Rhs.2, Lhs.2, Lhs.3, Rhs.3, Lhs.1, Lhs.0, Rhs.1
         398332  ~3%    {6}    | JOIN WITH `project#DataFlowImpl::Impl<TaintedPath::TaintedPath::C>::Stage5::fwdFlow/9#00ae2fc8#2` ON FIRST 4 OUTPUT Lhs.6, Lhs.0, Lhs.5, _, Lhs.2, Lhs.4
         398332  ~1%    {6}    | REWRITE WITH Out.3 := true
                        return r1
to
[2024-03-04 15:20:26] Evaluated non-recursive predicate DataFlowImpl::Impl<TaintedPath::TaintedPath::C>::Stage5::flowThroughIntoCall/6#b44155c7@97bd358u in 35ms (size: 398332).
Evaluated relational algebra for predicate DataFlowImpl::Impl<TaintedPath::TaintedPath::C>::Stage5::flowThroughIntoCall/6#b44155c7@97bd358u with tuple counts:
         83798   ~0%    {7} r1 = SCAN `project#DataFlowImpl::Impl<TaintedPath::TaintedPath::C>::Stage5::returnFlowsThrough/9#53894c55` OUTPUT In.0, In.1, In.2, In.3, In.4, _, _
                        {5}    | REWRITE WITH Tmp.5 := true, Tmp.6 := false, TEST Tmp.5 != Tmp.6 KEEPING 5
         83798   ~3%    {5}    | SCAN OUTPUT In.0, In.3, In.4, In.1, In.2
        416847   ~2%    {7}    | JOIN WITH `project#DataFlowImpl::Impl<TaintedPath::TaintedPath::C>::Stage5::flowIntoCallApaTaken/6#d989a8d1#cpe#12346_2301#join_rhs` ON FIRST 2 OUTPUT Rhs.3, Lhs.3, Lhs.4, Lhs.1, Lhs.2, Lhs.0, Rhs.2
        398332   ~3%    {6}    | JOIN WITH `project#DataFlowImpl::Impl<TaintedPath::TaintedPath::C>::Stage5::fwdFlow/9#00ae2fc8#2` ON FIRST 4 OUTPUT Lhs.6, Lhs.0, Lhs.5, _, Lhs.2, Lhs.4
        398332   ~1%    {6}    | REWRITE WITH Out.3 := true
                        return r1
2024-03-06 11:29:08 +01:00
Owen Mansel-Chan
316273c7f3 Merge branch 'main' into workflow/coverage/update 2024-03-06 10:14:46 +00:00
Jeroen Ketema
66d2a8499d Merge pull request #15816 from MathiasVP/remove-ssa-pruning-stage
C++: Remove the pruning stage from dataflow SSA
2024-03-06 11:04:05 +01:00
Malayke
02bab4c15a Update go/ql/src/experimental/CWE-770/DenialOfService.ql
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2024-03-06 17:57:20 +08:00
Anders Schack-Mulligen
0dbe8c3d8a Merge pull request #15140 from hvitved/dataflow/pruned-ctx-sensitivity
Data flow: prune context-sensitivity relations
2024-03-06 10:04:48 +01:00
Jeroen Ketema
d13ea0b6c9 Merge pull request #15817 from github/rdmarsh2/suppress-expr-destructors
C++: Suppress implicit destructors on expr in preparation for destructors on temporaries
2024-03-06 09:54:50 +01:00
Jeroen Ketema
6972f9b31d C++: Update syntax-zoo expected test results 2024-03-06 09:34:47 +01:00
Harry Maclean
350dab4621 Merge pull request #15722 from hmac/mad-sinks 2024-03-06 08:18:19 +00:00
Edward Minnix III
6ba6b12b9f Docs review suggestion
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
2024-03-05 22:31:25 -05:00
github-actions[bot]
b71074f9c4 Add changed framework coverage reports 2024-03-06 00:16:26 +00:00
Robert Marsh
fbbd57b34f C++: Suppress epxr destructors in preparation for temporaries 2024-03-05 21:12:12 +00:00
Mathias Vorreiter Pedersen
f400228037 C++: Remove the pruning stage from SSA. 2024-03-05 12:55:55 -08:00
Angela P Wen
727a38a409 Merge pull request #15814 from github/release-prep/2.16.4
Release preparation for version 2.16.4
2024-03-05 10:16:21 -08:00
github-actions[bot]
661e68dab5 Release preparation for version 2.16.4 2024-03-05 18:13:58 +00:00
Geoffrey White
3657269d3e C++: Autoformat. 2024-03-05 17:35:05 +00:00
Geoffrey White
d1fc700735 C++: Fill out some QLDoc. 2024-03-05 17:34:48 +00:00
Geoffrey White
7675f153ce C++: Add SummaryOutNode class. 2024-03-05 17:32:54 +00:00
Angela P Wen
7e2a775a2a Merge pull request #15813 from github/revert-15801-release-prep/2.16.4
Revert "Release preparation for version 2.16.4"
2024-03-05 09:20:42 -08:00
Joe Farebrother
dcc6f83d3b Merge pull request #15782 from joefarebrother/ruby-typhoeus
Ruby: Model `Typhoeus::Request.new`
2024-03-05 16:55:38 +00:00
Angela P Wen
967963a653 Revert "Release preparation for version 2.16.4" 2024-03-05 08:53:33 -08:00
Joe Farebrother
7027b7fe82 Apply review suggestions: Use getInstance and clarify predicate name/qldoc. Also fix changenote formatting. 2024-03-05 16:34:48 +00:00
Tamás Vajk
b4fdd4e222 Merge pull request #15808 from tamasvajk/buildless/package-source-telemetry
C#: Add package source error count to DB
2024-03-05 17:20:38 +01:00
Michael B. Gale
eaef544a26 Merge pull request #15810 from github/mbg/go/fix-initialised-module-names 2024-03-05 15:34:07 +00:00
Tony Torralba
e78e71c875 List Squirrel builders explicitly 2024-03-05 16:05:22 +01:00
Michael B. Gale
40ff75db07 Go: Update list of expected files for single-go-mod-and-go-files-not-under-it test 2024-03-05 14:56:51 +00:00
Ian Lynagh
edd383afc1 Merge pull request #15803 from igfoo/igfoo/del1
Kotlin 2: Accept more location changes
2024-03-05 14:41:05 +00:00
Tony Torralba
a264ea23c6 Go: Add SQLi sinks for Squirrel 2024-03-05 15:35:34 +01:00
Tamas Vajk
2b99b83857 C#: Add package source error count to DB 2024-03-05 15:32:08 +01:00
Michael B. Gale
a8d240dd72 Go: Add integration test for mixed layout project 2024-03-05 14:08:16 +00:00
Michael B. Gale
ac394dc80c Go: Better check for path prefixes 2024-03-05 13:46:33 +00:00
Owen Mansel-Chan
8e43c5c683 Merge pull request #15811 from owen-mc/go/limit-password-heuristics
Go: Only check strings of length <= 100 for dummy password with <= 2 unique characters
2024-03-05 13:42:26 +00:00
Michael B. Gale
b1e0bc03ab Go: Fix check for whether it is safe to initialise a go.mod file in a given directory 2024-03-05 12:48:21 +00:00
Michael B. Gale
367ecf75d5 Go: Use import path for auto-generated Go module names 2024-03-05 12:48:21 +00:00
Michael B. Gale
2aa093c95c Go: Move getImportPath to shared util package 2024-03-05 12:48:19 +00:00
Owen Mansel-Chan
4dde1fb117 Only check strings of length <= 100 for dummy password with <= 2 unique characters 2024-03-05 11:45:17 +00:00
Harry Maclean
148241183a Ruby: update changenote 2024-03-05 10:20:25 +00:00
Harry Maclean
91cb2a37fd Ruby: Model Process.exec 2024-03-05 10:19:22 +00:00
Tom Hvitved
bd7b2c4cc6 Update expected output 2024-03-05 10:44:13 +01:00
Tom Hvitved
d5c34264ad Data flow: Prune call-context sensitivity relations 2024-03-05 10:44:12 +01:00
Harry Maclean
179aaa1342 Ruby: model Open4.popen4ext 2024-03-05 09:35:18 +00:00
Tom Hvitved
5be75e91fc Merge pull request #15796 from hvitved/csharp/variable-capture-follow-up
C#: Variable capture follow-up
2024-03-05 09:58:23 +01:00
Harry Maclean
87f3b43576 Ruby: remove deprecated private class 2024-03-05 08:28:16 +00:00
Tony Torralba
a78e04eb34 Merge pull request #15795 from atorralba/atorralba/go/macaron-sources
Go: Add Macaron sources
2024-03-05 09:08:58 +01:00
Tony Torralba
05aaf2bb67 Merge pull request #15805 from github/workflow/coverage/update
Update CSV framework coverage reports
2024-03-05 08:53:41 +01:00
github-actions[bot]
84f3771cdd Add changed framework coverage reports 2024-03-05 00:15:54 +00:00
Robert Marsh
28e1e3a13a C++: remove skeleton for IR destructors on expressions 2024-03-04 21:54:18 +00:00
Ian Lynagh
6e09dcc16a Kotlin 2: Accept more loc changes in exprs 2024-03-04 19:06:32 +00:00
Ian Lynagh
22e6c676c3 Kotlin 2: Accept loc change for a string literal in expr test 2024-03-04 19:02:40 +00:00
Ian Lynagh
b7d2e54bbd Kotlin 2: exprs test: Accept loc change for ClassWithDelegate 2024-03-04 19:00:40 +00:00
Ian Lynagh
00ab1a3129 Kotlin 2: exprs test: Accept loc change for MyClass 2024-03-04 19:00:38 +00:00
Angela P Wen
92e91f596f Merge pull request #15801 from github/release-prep/2.16.4
Release preparation for version 2.16.4
2024-03-04 10:57:55 -08:00
Tom Hvitved
a92e394a7c C#: Variable capture follow-up 2024-03-04 19:36:30 +01:00
github-actions[bot]
a67218a027 Release preparation for version 2.16.4 2024-03-04 17:42:08 +00:00
Angela P Wen
19539ab6d8 Merge pull request #15800 from github/angelapwen/fix-ruby-changenotes
Fix Markdown formatting on Ruby changenotes
2024-03-04 08:52:13 -08:00
Angela P Wen
2b2ea597ce Fix formatting on changenotes 2024-03-04 16:42:38 +00:00
Tony Torralba
7286f56718 Change tests to inline expectations 2024-03-04 17:29:12 +01:00
Owen Mansel-Chan
331f308997 Merge pull request #13692 from Marcono1234/patch-1
Mention needed imports at top of "Analyzing data flow in Java"
2024-03-04 15:32:18 +00:00
Ian Lynagh
97275157e6 Kotlin: Docs: Give upper bound as 1.9.2x rather than 1.9.20
I think that this will be clearer.
2024-03-04 15:21:05 +00:00
Owen Mansel-Chan
e124b07611 Merge branch 'main' into patch-1 2024-03-04 14:44:23 +00:00
Owen Mansel-Chan
dcc2b2c50d Merge pull request #15057 from aydinnyunus/main
Web Cache Deception Vulnerability on Go Frameworks
2024-03-04 14:36:39 +00:00
Owen Mansel-Chan
c0974934bc Fix test expectations again 2024-03-04 14:05:04 +00:00
Owen Mansel-Chan
39a802fb98 Add new columns to test expectations 2024-03-04 13:45:54 +00:00
yoff
00e77a3ddb Merge pull request #15720 from RasmusWL/nosql-precision
Python: Add precision to NoSQL query
2024-03-04 14:44:46 +01:00
yoff
569bb991d4 Merge pull request #15775 from RasmusWL/scope-consistency
Python: Add consistency check for `PhaseDependentFlow`
2024-03-04 14:43:13 +01:00
Owen Mansel-Chan
6a1bb9bfb0 Merge branch 'main' into main 2024-03-04 13:42:53 +00:00
Tom Hvitved
357638baa8 C#: Update variable capture test 2024-03-04 14:39:48 +01:00
Owen Mansel-Chan
0bf0c069c6 Fix formatting 2024-03-04 13:39:44 +00:00
yoff
a9ce2e10ad Merge pull request #15781 from RasmusWL/dict-update
Python: Fix missing DictionaryElementContents
2024-03-04 14:37:34 +01:00
Tony Torralba
fc12537699 Go: Add Macaron sources 2024-03-04 14:29:56 +01:00
Ian Lynagh
ab288d0d4c Merge pull request #15712 from igfoo/igfoo/k2ref
Kotlin 2: Accept changes in library-tests/reflection
2024-03-04 13:19:56 +00:00
Michael B. Gale
e5de4f2d67 Merge pull request #15789 from github/mbg/go/autobuilder-review-comments 2024-03-04 13:19:29 +00:00
Ian Lynagh
73fe20f33b Merge pull request #15713 from igfoo/igfoo/past
Kotlin 2: Accept some PrintAst changes in library-tests/exprs
2024-03-04 13:12:49 +00:00
Max Schaefer
1f3a3492ae Merge pull request #15792 from github/max-schaefer-patch-1
Java: Fix sink type in hudson.model.yml
2024-03-04 13:08:47 +00:00
Owen Mansel-Chan
910725939f Update QLDoc 2024-03-04 13:06:23 +00:00
Ian Lynagh
9bad1e60db Merge pull request #15765 from igfoo/igfoo/deleg
Kotlin 2: Accept loc changes in library-tests/exprs/delegatedProperties
2024-03-04 13:02:34 +00:00
Michael B. Gale
9b5bf519a1 Update go/extractor/project/project.go
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2024-03-04 12:25:40 +00:00
Owen Mansel-Chan
279605b486 Merge pull request #15786 from owen-mc/java/sensitive-logging-query-exclude-null-in-variable-name
Java: sensitive logging query exclude null in variable name
2024-03-04 12:14:42 +00:00
Michael B. Gale
acf2f761a6 Go: Improve log message for InitGoModForLegacyProject 2024-03-04 12:14:24 +00:00
Michael B. Gale
1a13a0e4c9 Go: Log discovered Go modules in case workspace files can't be read/parsed 2024-03-04 12:14:24 +00:00
Michael B. Gale
52b273ae23 Go: Include workspace count in success message 2024-03-04 12:14:24 +00:00
Michael B. Gale
8055c5d9e3 Go: Avoid extra loop to track unsuccessfulProjects 2024-03-04 12:14:23 +00:00
Michael B. Gale
020eb4aed7 Go: Use slices.Concat for bazelPaths 2024-03-04 12:14:23 +00:00
Michael B. Gale
040a288bb3 Go: Update comment to replace Go.mod with go.mod 2024-03-04 12:14:23 +00:00
Michael B. Gale
37212737fb Go: Delete unused AnyGoFilesOutsideDirs 2024-03-04 12:14:22 +00:00
Michael B. Gale
ac484e5a04 Merge pull request #15793 from github/mbg/go/autobuilder-refactor-changelog
Go: Add changenote for autobuilder refactor
2024-03-04 12:10:24 +00:00
Michael B. Gale
a8ae2e2525 Go: Add changenote for autobuilder refactor 2024-03-04 12:02:51 +00:00
Geoffrey White
50ad45944c Update shared/dataflow/codeql/dataflow/DataFlow.qll
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2024-03-04 12:02:01 +00:00
Geoffrey White
5def2887e7 Shared: Add an example for SemBound.getExpr. 2024-03-04 11:59:52 +00:00
Max Schaefer
52a36ce41c Java: Fix sink type in hudson.model.yml 2024-03-04 11:53:37 +00:00
Michael B. Gale
4dd23d4767 Merge pull request #15791 from github/mbg/go/use-1.22-for-extractor
Go: Use Go 1.22 for the extractor
2024-03-04 11:53:37 +00:00
Michael B. Gale
726e0928ed Merge pull request #15790 from github/mbg/go/allow-1.22
Go: Allow 1.22 as a supported version
2024-03-04 11:49:33 +00:00
Chris Smowton
83cef78200 Merge pull request #15783 from github/smowton/fix/extractor-information-fractional-percentage
Java: extractor information: tolerate fractional percentages
2024-03-04 11:09:42 +00:00
Michael B. Gale
0e9a7c84d1 Go: Update go.work.sum 2024-03-04 10:59:23 +00:00
Michael B. Gale
ff82eb95f5 Go: Use 1.22 in go.mod 2024-03-04 10:58:51 +00:00
Michael B. Gale
6563414370 Go: Allow 1.22 as a supported version 2024-03-04 10:56:03 +00:00
Rasmus Wriedt Larsen
fbf6727809 Python: Add change-note 2024-03-04 11:46:38 +01:00
Rasmus Wriedt Larsen
16cb6c2044 Python: Fix validTest expectations
Co-authored-by: yoff <lerchedahl@gmail.com>
2024-03-04 11:41:47 +01:00
Rasmus Wriedt Larsen
85a45b0155 Python: Fix comment
Co-authored-by: yoff <lerchedahl@gmail.com>
2024-03-04 11:40:17 +01:00
Michael B. Gale
0c93641b54 Merge pull request #15361 from github/mbg/go/legacy-gopath-mode-deprecated
Go: Update autobuilder to deal with the upcoming deprecation of the legacy GOPATH mode
2024-03-04 10:23:37 +00:00
Harry Maclean
ce1d0d2375 Merge pull request #15780 from p-/p--method-injection
Ruby: sinks for code injection via calls to `method`
2024-03-04 10:02:40 +00:00
Joe Farebrother
31687afd5d Fix performance 2024-03-04 09:47:12 +00:00
Asger F
4ab7acedb6 JS: Do not track instance methods 2024-03-04 10:36:13 +01:00
Owen Mansel-Chan
038afc4008 Merge pull request #15772 from owen-mc/java/model-generator-exclude-tostring
Java: do not generate models for `toString` and lambda flow methods
2024-03-04 07:57:48 +00:00
Owen Mansel-Chan
037c76d840 Update change note
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2024-03-04 07:49:18 +00:00
Michael Nebel
11142df4d0 Merge pull request #15764 from michaelnebel/csharp/csharptracerrunapp
C#: Don't inject compiler flags when dotnet is used to execute an application.
2024-03-04 08:13:11 +01:00
Owen Mansel-Chan
7a96b11a0a Add change note 2024-03-03 21:41:05 +00:00
Owen Mansel-Chan
19ac9e089a Add test 2024-03-03 21:03:41 +00:00
Owen Mansel-Chan
c7efde3b7a Remove variables with "null" in their name as sources 2024-03-03 20:55:04 +00:00
Merdan Aziz
72e6853792 address the review comments 2024-03-03 20:36:43 +08:00
Michael B. Gale
9c2322dd82 Merge pull request #15362 from github/mbg/go/add-go-work 2024-03-03 11:59:18 +00:00
Malayke
7072ab9364 Update go/ql/src/experimental/CWE-770/DenialOfServiceGood.go
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2024-03-03 18:09:33 +08:00
Owen Mansel-Chan
114c17ad57 Add more methods of java.util.Comparator 2024-03-02 20:55:30 +00:00
Chris Smowton
040395485e Update ExtractorInformation.expected 2024-03-02 10:20:45 +00:00
Owen Mansel-Chan
bf22c6dae0 Merge pull request #15766 from owen-mc/java/add-neutral-models
Java: add neutral models
2024-03-02 06:00:33 +00:00
Asger F
f5d014baa5 JS: Remove allocation site restriction in CG 2024-03-01 23:20:35 +01:00
Ed Minnix
59b14f6a69 Fix test expectations (merge conflict) 2024-03-01 12:52:03 -05:00
Ed Minnix
45e1be875c Fix test expectations 2024-03-01 12:52:00 -05:00
Ed Minnix
4dc605354c Second-order SQL injection 2024-03-01 12:51:59 -05:00
Ed Minnix
1ba3efb111 Change note updates 2024-03-01 12:51:58 -05:00
Ed Minnix
e84a509976 Modify test cases 2024-03-01 12:51:56 -05:00
Ed Minnix
c3671c7625 Fix change note 2024-03-01 12:51:55 -05:00
Ed Minnix
be3c1ed0be Change note 2024-03-01 12:51:53 -05:00
Ed Minnix
c95abd47ce Remove stored variants of queries 2024-03-01 12:51:51 -05:00
Geoffrey White
cb1c68260e Shared: QLDoc for ContentApprox and getContentApprox. 2024-03-01 17:36:53 +00:00
Geoffrey White
c663809cc7 Update shared/rangeanalysis/codeql/rangeanalysis/RangeAnalysis.qll
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2024-03-01 17:06:48 +00:00
Geoffrey White
0e24ed14da Apply suggestions from code review
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2024-03-01 17:04:34 +00:00
Chris Smowton
0bb6a64e81 Java: extractor information: tolerate fractional percentages 2024-03-01 16:49:29 +00:00
Owen Mansel-Chan
0a8dfbafe4 Accept suggestion to put models under the right heading
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2024-03-01 16:05:28 +00:00
Geoffrey White
d1a2048134 C++: Add SummaryPostUpdateNode class. 2024-03-01 16:03:37 +00:00
Geoffrey White
340a17dd74 C++: Attempt to QLDoc OutNode better. 2024-03-01 16:03:37 +00:00
Geoffrey White
dbf0b98791 C++: Add some test cases involving function pointers. 2024-03-01 15:56:44 +00:00
Geoffrey White
f649939d78 C++: Allow flow through (previously missing) summary taint steps. 2024-03-01 15:56:44 +00:00
Ian Lynagh
fd82a06b93 Merge pull request #15777 from igfoo/igfoo/label-kot
CI: Kotlin: Label Kotlin test changes as "Kotlin"
2024-03-01 15:38:01 +00:00
Joe Farebrother
5a1c0f60e6 Fix qldoc typo 2024-03-01 15:12:16 +00:00
Peter Stöckli
4adc373dfe Ruby: more test cases for code injection via method 2024-03-01 16:01:07 +01:00
Joe Farebrother
4b1626c83a Add change note 2024-03-01 14:59:24 +00:00
Peter Stöckli
3418ec8a81 Ruby: Update method code injection sinks change note
Co-authored-by: Harry Maclean <hmac@github.com>
2024-03-01 15:54:58 +01:00
Michael B. Gale
bda8a804ec Go: Add go.work file 2024-03-01 14:50:00 +00:00
Joe Farebrother
65b30c1dff Add tests and qldoc 2024-03-01 14:46:55 +00:00
Rasmus Wriedt Larsen
d99a763ef7 Python: add change-note 2024-03-01 15:24:33 +01:00
Joe Farebrother
a08b292099 Add models for Typhoeus::Request 2024-03-01 14:23:24 +00:00
Owen Mansel-Chan
5399d88d15 Accept test change: slight change in gen vs man modelgen stats 2024-03-01 14:22:00 +00:00
Rasmus Wriedt Larsen
eeda4355f1 Python: Fix missing DictionaryElementContent 2024-03-01 15:21:13 +01:00
Peter Stöckli
e43c368222 Ruby: change note for methode code injection sinks 2024-03-01 15:20:32 +01:00
Rasmus Wriedt Larsen
30b7fadbb8 Python: Add test 2024-03-01 15:19:56 +01:00
Owen Mansel-Chan
6e63df9e32 Accept test change: toString method no longer generated 2024-03-01 14:16:14 +00:00
Owen Mansel-Chan
0e1c45e84b Accept test change: some more APIs have manual models now 2024-03-01 14:08:42 +00:00
Owen Mansel-Chan
df64e0bc5f Add neutral summary models for java.security.MessageDigest#digest 2024-03-01 14:08:31 +00:00
Owen Mansel-Chan
f89fedcbaf Add some neutral models for java.util 2024-03-01 14:07:45 +00:00
Peter Stöckli
a693c6d9b4 Ruby: sinks for code injection via calls to method 2024-03-01 14:42:22 +01:00
Michael Nebel
a97510a2fc Merge pull request #15419 from github/egregius313/csharp/dataflow/threat-modeling/refactor-to-threatmodelflowsource
C#: Refactor C# queries to use `ThreatModelFlowSource` instead of `RemoteFlowSource`
2024-03-01 14:40:40 +01:00
Tom Hvitved
15d1105d8d Merge pull request #15779 from hvitved/csharp/build-mode-none
C#: Add `build_modes: none` to `codeql-extractor.yml`
2024-03-01 14:34:08 +01:00
Rasmus Wriedt Larsen
7c60562132 Python: Ignore IterableSequenceNode inconsistencies 2024-03-01 14:22:18 +01:00
Rasmus Wriedt Larsen
7e3e5db3db Python: Add example of consistency failure 2024-03-01 14:21:16 +01:00
Rasmus Wriedt Larsen
bcd5c08ebd Python: Ignore match-related inconsistencies 2024-03-01 14:15:32 +01:00
Rasmus Wriedt Larsen
5d212514c6 Python: Add example of consistency failure 2024-03-01 14:07:08 +01:00
Mathias Vorreiter Pedersen
9133a13fc7 Merge pull request #15628 from microsoft/cpp-non-constant-format-as-path-query
Cpp non constant format as path query
2024-03-01 13:05:44 +00:00
Rasmus Wriedt Larsen
1658a1cb80 Python: Ignore SynthDictSplatArgumentNode failures 2024-03-01 14:00:06 +01:00
Rasmus Wriedt Larsen
bff95c4c1b Python: Add example of consistency failure 2024-03-01 13:58:33 +01:00
Tom Hvitved
6d9f3d4a3e C#: Add build_modes: none to codeql-extractor.yml 2024-03-01 13:54:57 +01:00
Owen Mansel-Chan
10f6329b3e Add manual neutral models for java.util.stream
See comment in java/ql/src/Metrics/Summaries/TopJdkApis.qll

   * Note: the following top JDK APIs are not modeled with MaD:
   * `java.util.stream.Collectors#joining(CharSequence)`: cannot be modeled completely without a model for `java.util.stream.Stream#collect(Collector)` as well
   * `java.util.stream.Collectors#toMap(Function,Function)`: specialized collectors flow
   * `java.util.stream.Stream#collect(Collector)`: handled separately on a case-by-case basis as it is too complex for MaD
2024-03-01 12:32:04 +00:00
Owen Mansel-Chan
f907fd21ad Add manual neutral models for java.text.Format and java.text.MessageFormat
See comment in java/ql/src/Metrics/Summaries/TopJdkApis.qll

   * Note: the following top JDK APIs are not modeled with MaD:
   * `java.text.Format#format(Object)`: similar issue as `Object.toString`; depends on the object being passed as the argument
   * `java.text.MessageFormat#format(String,Object[])`: similar issue as `Object.toString`; depends on the object being passed as the argument
2024-03-01 12:31:59 +00:00
Owen Mansel-Chan
0e95f41900 Add manual neutral models for java.lang
See comment in java/ql/src/Metrics/Summaries/TopJdkApis.qll

   * Note: the following top JDK APIs are not modeled with MaD:
   * `java.lang.System#getProperty(String)`: needs to be modeled by regular CodeQL matching the get and set keys to reduce FPs
   * `java.lang.System#setProperty(String,String)`: needs to be modeled by regular CodeQL matching the get and set keys to reduce FPs
2024-03-01 12:31:49 +00:00
Michael Nebel
ac4ad0cbc0 C#: Add test where build should not be interpreted as a SDK sub command. 2024-03-01 13:24:04 +01:00
Michael Nebel
24572848f3 C#: Move helper function to other repo to allow sharing. 2024-03-01 13:24:04 +01:00
Michael Nebel
07fc84de8c C#: Don't inject compiler flags when dotnet is used to execute an application. 2024-03-01 13:24:04 +01:00
Tom Hvitved
cb128da5aa Merge pull request #15762 from hvitved/csharp/fetch-dotnet-dependency-fetching
C#: Fetch .NET in dependency manager instead of autobuilder
2024-03-01 13:19:20 +01:00
Owen Mansel-Chan
bb97df1d71 do not generate models for lambda flow methods 2024-03-01 12:11:40 +00:00
Tom Hvitved
20ff7def73 Address review comment 2024-03-01 12:54:47 +01:00
Ian Lynagh
86b4f27d12 CI: Kotlin: Label Kotlin test changes as "Kotlin" 2024-03-01 11:26:56 +00:00
Geoffrey White
1fece75f15 Apply suggestions from code review
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2024-03-01 11:10:26 +00:00
Mathias Vorreiter Pedersen
a7547d516a Merge branch 'main' into cpp-non-constant-format-as-path-query 2024-03-01 11:08:58 +00:00
Florin Coada
1719fd8acb Merge pull request #15769 from github/coadaflorin/changelog-2.16.3-updates
Match changelog updates with public unified changelog
2024-03-01 10:57:02 +00:00
Joe Farebrother
0f1106b2f6 Merge pull request #15753 from joefarebrother/ruby-i18n-translation
Ruby: Model Rails translation methods
2024-03-01 10:35:12 +00:00
Geoffrey White
2e5f7dc8fc C++: QLDoc (mostly placeholder). 2024-03-01 09:59:31 +00:00
Geoffrey White
8faad92cfd C++: Define DataFlowCallable.getUnderlyingCallable and use it to fix some issues. 2024-03-01 09:59:31 +00:00
Owen Mansel-Chan
bbf3fa7506 do not generate models for toString 2024-03-01 09:59:27 +00:00
Joe Farebrother
abdae2c437 Apply reveiw suggestion - update change note
Co-authored-by: Harry Maclean <hmac@github.com>
2024-03-01 09:57:28 +00:00
Joe Farebrother
bf2174ffce Add change note 2024-03-01 09:57:28 +00:00
Joe Farebrother
0b7b7ea1b8 Add test cases and improve controller model 2024-03-01 09:57:24 +00:00
Joe Farebrother
ef0a1d2873 Implement models for translation methods 2024-03-01 09:52:53 +00:00
Rasmus Wriedt Larsen
ff5f794750 Python: Exclude synth preupdate nodes from tt-consistency
... and that should be it 👍 (so that's why I'm allowing the tests to
run on all data-flow nodes again)
2024-03-01 10:27:29 +01:00
Tony Torralba
e0515269c5 Merge pull request #15774 from atorralba/atorralba/java/mapentry-copyof-provenance
Java: Fix provenance of Map.Entry.copyOf models
2024-03-01 10:26:22 +01:00
Mathias Vorreiter Pedersen
4e913592fa Merge branch 'main' into cpp-non-constant-format-as-path-query 2024-03-01 09:26:00 +00:00
Mathias Vorreiter Pedersen
2eb8d13439 C++: Accept test changes. 2024-03-01 09:25:25 +00:00
Rasmus Wriedt Larsen
bbe8c6dcaa Python: Remove synth postupdate nodes from tt-consistency 2024-03-01 10:23:50 +01:00
Rasmus Wriedt Larsen
9f01ea68f7 Python: Add type-tracking consistency query
For now I'm only ignoring stdlib nodes, so it's easy for reviewer to see
why we need to have more excludes :)
2024-03-01 10:19:49 +01:00
Florin Coada
a8816a6d1c Update java/ql/src/change-notes/released/0.8.9.md
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2024-03-01 09:18:22 +00:00
Florin Coada
d54e3d73ab Update java/ql/src/CHANGELOG.md
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2024-03-01 09:18:14 +00:00
Rasmus Wriedt Larsen
d182eae868 Python: Add consistency check for PhaseDependentFlow
This would have found the problem in
https://github.com/github/codeql/pull/15755.

As highlighted in the comment in the code, it's not a perfect solution
since we don't have an automatic way to ensure we don't introduce a new
PhaseDependentFlow use with a new step relation and forget to add it to
this consistency check... but I think this consistency check still adds
value!
2024-03-01 10:01:08 +01:00
Tony Torralba
664dac6b28 Merge pull request #15773 from github/workflow/coverage/update
Update CSV framework coverage reports
2024-03-01 09:22:47 +01:00
Tony Torralba
dd1dbdf4ec Java: Fix provenance of Map.Entry.copyOf models 2024-03-01 09:00:13 +01:00
github-actions[bot]
148bc26b09 Add changed framework coverage reports 2024-03-01 00:17:57 +00:00
Owen Mansel-Chan
54031a8187 Merge pull request #15767 from owen-mc/java/add-summary-models
Java: add a few summary models
2024-02-29 21:21:23 +00:00
Tom Hvitved
a8468a6178 C#: Better handle multiple global.json files 2024-02-29 20:27:52 +01:00
Mathias Vorreiter Pedersen
1466f11a92 C++: Add change note. 2024-02-29 18:39:59 +00:00
Geoffrey White
a499919239 Shared: More helpful QLDoc for simpleLocalFlowStep. 2024-02-29 17:13:40 +00:00
Paolo Tranquilli
6d90877c52 Merge pull request #15536 from github/redsun82/bazel-cmake
Bazel/CMake: auto detect all `cc_binary`/`cc_test` targets
2024-02-29 18:13:40 +01:00
Geoffrey White
f834768720 Shared: Improve QLDoc for forceHighPrecision. 2024-02-29 17:09:31 +00:00
Geoffrey White
9d2dc7a3cc Shared: Format. 2024-02-29 17:09:16 +00:00
Ed Minnix
f488f23a48 Add LocalFlowSource back to UncontrolledFormatString 2024-02-29 12:06:59 -05:00
Geoffrey White
88e3bc6865 Update shared/dataflow/codeql/dataflow/DataFlow.qll
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2024-02-29 17:03:30 +00:00
Edward Minnix III
89bdb7f437 Remove discussion of local flow in change note
Co-authored-by: Michael Nebel <michaelnebel@github.com>
2024-02-29 12:03:19 -05:00
Ed Minnix
86ceeebd89 Change handling of LocalSource in queries
1. Change `LocalSource` to extend `DataFlow::Node`, thus removed from
   the definiton of `Source`
2. Add a private class `AddLocalSource` which extends `Source`. This
   allows us to currently preserve the inclusion of local sources, while
   making it easier to remove it in the future.
2024-02-29 12:03:17 -05:00
Ed Minnix
3563c7ef03 Modify deprecated RemoteSource classes to extend DataFlow::Node directly.
Since `ThreatModelFlowSource` contains `RemoteFlowSource` by default, we
can safely remove the `RemoteSource` from the default of the queries.
2024-02-29 12:03:16 -05:00
Ed Minnix
e64826db1b Add threat-model configuration for UncontrolledFormatString test 2024-02-29 12:03:14 -05:00
Ed Minnix
af749e221b Remove commented out code 2024-02-29 12:03:13 -05:00
Ed Minnix
f237d2aeda Refactor to use ThreatModelFlowSource 2024-02-29 12:03:12 -05:00
Ed Minnix
5198f52351 Add references to changed queries in change note 2024-02-29 12:03:11 -05:00
Ed Minnix
22e8da2928 Update change note date 2024-02-29 12:03:09 -05:00
Ed Minnix
eb81946adc Change note changes to mention local sources as well 2024-02-29 12:03:08 -05:00
Ed Minnix
b4dabee770 Remove unnecessary flowsources.Remote imports
Since `FlowSources` now re-exports `Remote`, these can be safely removed.
2024-02-29 12:03:07 -05:00
Ed Minnix
434fa20646 Refactor to using ThreatModelFlowSource 2024-02-29 12:03:05 -05:00
Ed Minnix
1086abca63 Refactor to using ThreatModelFlowSource 2024-02-29 12:03:04 -05:00
Ed Minnix
b76795fd28 Refactor to using ThreatModelFlowSource 2024-02-29 12:03:03 -05:00
Ed Minnix
fd3738b10e Refactor to using SourceNode::getSourceType 2024-02-29 12:03:01 -05:00
Ed Minnix
31d4d0ca57 Move getSourceType to SourceNode 2024-02-29 12:03:00 -05:00
Ed Minnix
75772664f2 Change note 2024-02-29 12:02:58 -05:00
Ed Minnix
f388a0f10c Deprecate direct uses of RemoteFlowSource and replace with ThreatModelFlowSource 2024-02-29 12:02:57 -05:00
Ed Minnix
bd0137a721 Deprecated direct use of RemoteFlowSource and use ThreatModelFlowSource instead 2024-02-29 12:02:55 -05:00
Chris Smowton
051d63a5a9 Merge pull request #15740 from smowton/smowton/feature/call-and-type-telemetry
Java: add extraction quality telemetry; improve stringification of some erroneous expressions
2024-02-29 16:51:51 +00:00
Tony Torralba
47bf556223 Merge pull request #15709 from atorralba/atorralba/java/enable-widget-taint-steps
Java: Re-enable Widget.qll flow steps
2024-02-29 17:33:05 +01:00
Owen Mansel-Chan
7b5f51b1e2 Change summary models to neutral models for javax.crypto.Cipher 2024-02-29 16:22:27 +00:00
Geoffrey White
445b82b4e1 Shared: Explain 'guard'. 2024-02-29 16:07:20 +00:00
Geoffrey White
70465b22c7 Shared: Remove @ annotations. 2024-02-29 16:00:43 +00:00
Geoffrey White
98289b52d6 Shared: Explain SsaPhiNode a bit more. 2024-02-29 15:45:43 +00:00
Geoffrey White
8151f3024d Shared: Pinch better doc for isEquality from a related Guards class in csharp. 2024-02-29 15:41:51 +00:00
Chris Smowton
ef9544cbef Adjust test expectations now signature type-accesses are named 2024-02-29 15:33:29 +00:00
Chris Smowton
903e4f59f0 Exclude error types from contradictory-type-check query 2024-02-29 14:59:46 +00:00
Chris Smowton
140c3189e3 Adjust test expectations 2024-02-29 14:59:46 +00:00
Chris Smowton
3bd0c3b2c2 Switch test to using a qlref to the real telemetry query 2024-02-29 14:59:46 +00:00
Chris Smowton
ef82ea7541 Add change note 2024-02-29 14:59:46 +00:00
Chris Smowton
551006c15e Make predicate private 2024-02-29 14:59:46 +00:00
Chris Smowton
ffa998eb4a Autoformat 2024-02-29 14:59:45 +00:00
Chris Smowton
b6507e795a Add test for a buildless project that doesn't compile cleanly 2024-02-29 14:59:45 +00:00
Chris Smowton
5d55265910 Add telemetry for untyped expressions and missing call targets 2024-02-29 14:59:45 +00:00
Chris Smowton
1fd459e8fc Improve stringification of some erroneous expressions 2024-02-29 14:59:45 +00:00
Alexander Eyers-Taylor
6c8105fd1c Merge pull request #15568 from github/alexet/kotlin-jdk-change
Kotlin: Compile tests using the same jdk as the java tests.
2024-02-29 14:48:03 +00:00
Paolo Tranquilli
0a137c7b02 Bazel/Cmake: share build options 2024-02-29 15:35:21 +01:00
Florin Coada
8d1965db59 match changelog to unified changelog 2024-02-29 14:33:14 +00:00
Florin Coada
cfdf163b40 Update changelog to match unified changelog 2024-02-29 14:32:57 +00:00
Paolo Tranquilli
81facd2fd6 Merge branch 'main' into redsun82/bazel-cmake 2024-02-29 14:28:00 +01:00
Mathias Vorreiter Pedersen
e620bfa9c6 Merge pull request #15761 from MathiasVP/fewer-variablenodes
C++: Restrict `VariableNode`s to only be global-like variables
2024-02-29 13:12:20 +00:00
Asger F
13e3a5158e JS: Fix qldoc 2024-02-29 13:59:25 +01:00
Alex Eyers-Taylor
d892a04506 Kotlin: Compile tests using the same jdk as the java tests. 2024-02-29 12:23:56 +00:00
Owen Mansel-Chan
939d6f973f Add summary models for javax.crypto.Cipher 2024-02-29 12:20:47 +00:00
Owen Mansel-Chan
65bc62c10a Add summary model for Map$Entry#copyOf 2024-02-29 12:20:43 +00:00
Ian Lynagh
b0a13fb661 Kotlin 2: Accept loc changes in library-tests/exprs/delegatedProperties 2024-02-29 12:11:07 +00:00
Mathias Vorreiter Pedersen
4474b54662 C++: Add more QLDoc. 2024-02-29 12:09:50 +00:00
Mathias Vorreiter Pedersen
46b47db78e C++: Rename IPA branch. 2024-02-29 12:02:13 +00:00
yoff
7beafc933d Merge pull request #15755 from RasmusWL/it-fix
Python: Fix module level flow for iterable unpacking
2024-02-29 12:52:44 +01:00
Tom Hvitved
0e93f5ac1a Merge pull request #15733 from hvitved/ruby/desugar-hidden
Ruby: Rework hidden synthetic data-flow nodes
2024-02-29 11:24:01 +01:00
Tom Hvitved
62382fc5a2 C#: Fetch .NET in dependency manager instead of autobuilder 2024-02-29 11:23:36 +01:00
Asger F
6a0adff1dc JS: More precise detection of classes with escaping instances 2024-02-29 11:15:37 +01:00
Asger F
eeaa2bcc55 JS: Add test for class instance escaping into dependency 2024-02-29 11:14:23 +01:00
Florin Coada
840ca9118e Merge pull request #15750 from github/changedocs/2.16.3
Codeql 2.16.3 changelogs
2024-02-29 09:46:31 +00:00
Michael Nebel
a3b39c8210 Merge pull request #15752 from michaelnebel/csharp/updatesupportedlanguages
C#: Claim suppport for C# 12 / .NET 8.
2024-02-29 10:41:42 +01:00
Asger F
853397361f JS: Do not treat AMD pseudo-dependencies as file paths 2024-02-29 10:23:28 +01:00
Asger F
052a8e7f81 JS: Avoid spurious recursion in AMD 2024-02-29 10:23:28 +01:00
Asger F
f384afbaf6 JS: Also summarize loadStore steps 2024-02-29 10:11:16 +01:00
Asger F
3ad83cc098 JS: Summarise store steps for type tracking 2024-02-29 10:10:39 +01:00
Asger F
7cd84c8f0a JS: Add type-tracking test 2024-02-29 10:10:07 +01:00
Michael Nebel
14d046ef18 Merge pull request #15710 from michaelnebel/csharp/refreadonlyparameters
C# 12: Ref readonly parameters.
2024-02-29 09:59:12 +01:00
Tom Hvitved
c6426d8858 C#: Move BuildScript.cs and friends to Semmle.Util 2024-02-29 08:49:20 +01:00
Ed Minnix
6b310bb825 Fix reference 2024-02-28 21:39:16 -05:00
Florin Coada
0d017a9343 Update docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.16.3.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2024-02-28 22:07:04 +00:00
Florin Coada
62f4d8e53e Update docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.16.3.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2024-02-28 22:06:46 +00:00
Florin Coada
b1deeaff05 Update docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.16.3.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2024-02-28 22:06:29 +00:00
Ed Minnix
2a70437a12 Add references to threat modeling 2024-02-28 14:34:01 -05:00
Mathias Vorreiter Pedersen
a7f0966fcb C++: Restrict 'VariableNode's to only be global-like variables (which is the only place where use them for). 2024-02-28 19:12:38 +00:00
Ed Minnix
4b9340816c Add threat-modeling section to C# MaD docs 2024-02-28 13:27:19 -05:00
Ed Minnix
9ab3837cdc Make threat model beta notice more general 2024-02-28 13:26:01 -05:00
Mathias Vorreiter Pedersen
2fd57f6ee7 Shared: Remove cached annotation. 2024-02-28 16:24:21 +00:00
Felicity Chapman
ca1a27dc75 Merge pull request #15748 from github/13332-codeql-model-editor-csharp
Minor updates to CodeQL for VS Code docs for expansion of support for model editing
2024-02-28 15:56:32 +00:00
Rasmus Wriedt Larsen
8079788a5f Python: Add change-note 2024-02-28 16:44:25 +01:00
Rasmus Wriedt Larsen
cdf4dd16f0 Python: Fix module level flow for iterable unpacking
(and for * patterns in match)

Since `PhaseDependentFlow` uses the following predicate, that relies on
.getScope() to be present for there to be any importTimeFlow (flow at
toplevel scope), it's important that data-flow nodes implement `.getScope`.

```
private predicate isTopLevel(Node node) { node.getScope() instanceof Module }
```

By implementing getScope, we can now rely on default implementation of
`getEnclosingCallable` in DataFlow::Node:

```
  /** Gets the enclosing callable of this node. */
  DataFlowCallable getEnclosingCallable() { result = getCallableScope(this.getScope()) }
```
2024-02-28 16:39:08 +01:00
Felicity Chapman
377ef59c3a Merge branch 'main' into 13332-codeql-model-editor-csharp 2024-02-28 15:33:27 +00:00
Felicity Chapman
efff0149d0 Update formatting of 'tip' 2024-02-28 15:33:07 +00:00
Koen Vlaswinkel
ab11068d6d Merge pull request #15749 from github/koesie10/update-testing-vscode-docs
Update documentation for testing CodeQL queries in VS Code
2024-02-28 16:29:54 +01:00
Rasmus Wriedt Larsen
e4699e092d Python: Add test for iterable unpacking on module level
Currently doesn't work :O
2024-02-28 16:10:29 +01:00
Koen Vlaswinkel
6aeef17f99 Rename Test Explorer to Testing view 2024-02-28 16:00:15 +01:00
Tom Hvitved
297a17975d Merge pull request #15665 from hvitved/csharp/variable-capture
C#: Adopt shared variable capture library
2024-02-28 15:13:03 +01:00
Michael Nebel
9563705eb3 C#: Add change note. 2024-02-28 14:53:15 +01:00
Michael Nebel
bb282b94dd C#: Claim suppport for C# 12 / .NET 8. 2024-02-28 14:41:38 +01:00
Michael Nebel
f6b1d1f235 C#: Add upgrade and downgrade scripts. 2024-02-28 14:09:59 +01:00
Florin Coada
b76449714a codeql 2.16.3 changelogs 2024-02-28 13:07:48 +00:00
Koen Vlaswinkel
5226c77abf Update documentation for testing CodeQL queries in VS Code 2024-02-28 13:47:11 +01:00
Michael Nebel
00d311205b C#: Update expected test output. 2024-02-28 13:44:28 +01:00
Michael Nebel
794bc44a41 C#: Add test query predicate for ref readonly parameters. 2024-02-28 13:44:28 +01:00
Michael Nebel
692d7036a0 C#: Add extractor and QL library support for ref readonly parameters. 2024-02-28 13:44:28 +01:00
Michael Nebel
a86de9de2f C#: Update comment in DB Scheme. 2024-02-28 13:44:28 +01:00
Michael Nebel
18c7e73805 C#: Add test for parameter modifiers. 2024-02-28 13:44:28 +01:00
Michael Nebel
d8bff14365 C#: Adjust locations for the parameter default value tests. 2024-02-28 13:44:28 +01:00
Michael Nebel
4bbaf687ad Merge pull request #15723 from michaelnebel/csharp/experimentalattribute
C# 12: Experimental attribute.
2024-02-28 13:06:09 +01:00
Jeroen Ketema
ae97a23c27 Merge pull request #15213 from jketema/frontend-update
C++: Accept test changes after frontend upgrade
2024-02-28 13:00:02 +01:00
Felicity Chapman
c247dee11a Delete docs/codeql/reusables/beta-note-model-packs-java.rst
This was accidentally reintroduced during merge conflict resolution.
2024-02-28 11:49:50 +00:00
Felicity Chapman
053e172d94 Merge branch 'main' into 13332-codeql-model-editor-csharp 2024-02-28 11:43:02 +00:00
Felicity Chapman
897786dc99 Minor updates to model editor article 2024-02-28 11:28:59 +00:00
Michael Nebel
65ec80967e Merge pull request #15696 from michaelnebel/csharp/compilergeneratedstmt
C#: Compiler generated statements.
2024-02-28 12:06:39 +01:00
Jeroen Ketema
00ad7854dc C++: Accept test changes after frontend upgrade
* The `specifiers2` tests have a different result now due to the implementation
  of CWG 2387.
* The `special_members/generated_copy` has improved results as the frontend has
  improved support for deleted copy constructors.
2024-02-28 11:29:57 +01:00
Michael Nebel
3c15b21385 C#: Add change note. 2024-02-28 11:25:23 +01:00
Michael Nebel
7535a15fda C#: Add tests and update expected test output. 2024-02-28 11:22:12 +01:00
Michael Nebel
95dc2f71d3 C#: Add ExperimentalAttribute class. 2024-02-28 11:20:43 +01:00
Mathias Vorreiter Pedersen
7be76405f5 Merge pull request #15741 from MathiasVP/fix-ir-inconsistencies-from-returning-routine-types
C++: Fix IR inconsistencies from routine types
2024-02-28 09:13:53 +00:00
Erik Krogh Kristensen
0358e81117 Merge pull request #15746 from github/dependabot/cargo/ql/rayon-1.9.0
Bump rayon from 1.8.1 to 1.9.0 in /ql
2024-02-28 10:11:50 +01:00
dependabot[bot]
cc178ab58f Bump rayon from 1.8.1 to 1.9.0 in /ql
Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.8.1 to 1.9.0.
- [Changelog](https://github.com/rayon-rs/rayon/blob/main/RELEASES.md)
- [Commits](https://github.com/rayon-rs/rayon/compare/rayon-core-v1.8.1...rayon-core-v1.9.0)

---
updated-dependencies:
- dependency-name: rayon
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-28 03:24:58 +00:00
Edward Minnix III
a743683d4f Merge pull request #15563 from egregius313/egregius313/csharp/docs/mad-docs
C#: Models as Data Documentation
2024-02-27 13:45:09 -05:00
Mathias Vorreiter Pedersen
b8c141f292 C++: Accept test changes. 2024-02-27 17:58:52 +00:00
Mathias Vorreiter Pedersen
ddd5113c02 C++: Ensure that we can construct an 'IRType' from a 'RoutineType'. 2024-02-27 17:58:52 +00:00
Mathias Vorreiter Pedersen
892f97cd7a C++: Add testcase with invalid IR from constructing a 'RoutineType'. 2024-02-27 17:58:52 +00:00
Mathias Vorreiter Pedersen
0335a4f4ce Merge pull request #15735 from MathiasVP/ir-for-vacuous-destructor-calls
C++: IR construction for `VacuousDestructorCall`s
2024-02-27 17:58:30 +00:00
Geoffrey White
0df10bda0c C++: Post-merge fixup. 2024-02-27 17:32:59 +00:00
Geoffrey White
1da611cc02 Merge branch 'main' into mad 2024-02-27 17:29:45 +00:00
Geoffrey White
bc42e2bc35 C++: Workaround to get the tests passing again. 2024-02-27 17:28:38 +00:00
Felicity Chapman
f9c2b4d23c MVP changes for C# library expansion support 2024-02-27 16:47:13 +00:00
Chris Smowton
7c7c10ea11 Merge pull request #15739 from github/smowton-patch-1
Add change note for https://github.com/github/codeql/pull/15646
2024-02-27 16:07:29 +00:00
Max Schaefer
f2935caa5c Merge pull request #15732 from github/max-schaefer/more-sink-types
Automodel: Add four more sink types.
2024-02-27 15:52:45 +00:00
Mathias Vorreiter Pedersen
bba152da13 Merge branch 'main' into ir-for-vacuous-destructor-calls 2024-02-27 15:42:46 +00:00
Chris Smowton
9f84653283 Merge pull request #15613 from smowton/smowton/fix/golang-map-range-read-dataflow
Golang: fix flow from a map value via a range statement
2024-02-27 15:42:43 +00:00
Chris Smowton
aedd3badf7 Add change note for https://github.com/github/codeql/pull/15646 2024-02-27 15:41:43 +00:00
Chris Smowton
5ea30e95a5 Merge pull request #15646 from smowton/smowton/fix/notice-self-sufficient-mvnw
Java: Add tests for Maven wrapper
2024-02-27 15:29:50 +00:00
Mathias Vorreiter Pedersen
f7b2de800b Merge pull request #15506 from rdmarsh2/rdmarsh2/cpp/ir-synthetic-destructors
C++: Add implicit destructors for named variables to the IR
2024-02-27 15:12:46 +00:00
Tom Hvitved
914a605a87 Ruby: Rework hidden synthetic data-flow nodes 2024-02-27 15:33:58 +01:00
Tom Hvitved
994d990f37 Ruby: Add another data flow test 2024-02-27 15:33:58 +01:00
Mathias Vorreiter Pedersen
dc3b78dd7c C++: Accept more test changes. 2024-02-27 14:30:19 +00:00
Chris Smowton
a6480a4ca1 Autoformat again / tabify 2024-02-27 13:55:26 +00:00
Mathias Vorreiter Pedersen
4a501e5b3c C++: Accept test changes. 2024-02-27 13:53:43 +00:00
Mathias Vorreiter Pedersen
9eaa4e19ad C++: Add IR construction for vacuous destructor calls. 2024-02-27 13:53:42 +00:00
Chris Smowton
74448c092a Autoformat / uglify 2024-02-27 13:49:12 +00:00
Chris Smowton
e62a0805db Add test for map literal 2024-02-27 13:44:52 +00:00
Mathias Vorreiter Pedersen
fbb0ffcadd C++: Add testcase with invalid IR from vacuous destructor call. 2024-02-27 12:53:46 +00:00
Joe Farebrother
3ab6f222d0 Merge pull request #15718 from joefarebrother/ruby-arel-sqlliteral
Ruby: Model Arel::Nodes::SqlLiteral.new
2024-02-27 12:43:47 +00:00
Anders Schack-Mulligen
df5e753ee0 Merge pull request #15570 from aschackmull/java/cache-interpretelement
Java: Cache interpretElement.
2024-02-27 13:39:56 +01:00
Geoffrey White
540c20e143 Merge pull request #15700 from geoffw0/extensions
Swift: Workaround for TypeDecl.getFullName issue.
2024-02-27 11:14:33 +00:00
Harry Maclean
d0e7fbc871 Ruby: Add changenote 2024-02-27 09:47:51 +00:00
Anders Schack-Mulligen
699dddcfbe Merge pull request #15725 from aschackmull/dataflow/summary-join-fix
Dataflow: Prevent bad join in FlowSummaryImpl::Private::Steps::summaryLocalStep.
2024-02-27 10:32:38 +01:00
erik-krogh
b4b5ae2a2c add some request-forgery sanitizers, inspired from C# 2024-02-27 10:05:26 +01:00
Tom Hvitved
bbeee8f38d Merge pull request #15717 from hvitved/csharp/view-cfg
Shared `View CFG` implementation
2024-02-27 09:13:18 +01:00
Chris Smowton
f7cdcd4981 Force Maven wrapper tests to run sequentially 2024-02-26 22:28:55 +00:00
Chris Smowton
03f01a0121 Add tests for Maven wrapper 2024-02-26 22:28:55 +00:00
Robert Marsh
a513598a4d C++: Change note for IR named destructors. 2024-02-26 19:41:56 +00:00
Geoffrey White
408a550467 Merge pull request #15727 from geoffw0/qldoc4
C++: Mark internal files in the old dataflow library as deprecated
2024-02-26 17:45:05 +00:00
Mathias Vorreiter Pedersen
690fdc076d Shared: Add change note. 2024-02-26 17:13:32 +00:00
Mathias Vorreiter Pedersen
1d4c889ab8 Java: Use the shared type-flow library. 2024-02-26 17:13:32 +00:00
Mathias Vorreiter Pedersen
9ec17e6338 Shared: Pull out the shared parts of Java's type flow library into a shared module. 2024-02-26 17:13:27 +00:00
Geoffrey White
2e66392353 C++: Update deprecated note to respect identical files. 2024-02-26 16:38:27 +00:00
Rasmus Lerchedahl Petersen
3eb9491cb4 python: rewrite HardcodedCredentials away from PointsTo
- `ModuleValue.attr` and `ClassValue.lookup` are approximated by `Function.getName`
- `ClassValue.getName` is apprximated by `Class.getName`
- `Module::named` is approximated by `Module.getName`
- `Value::named` is approximated by `Builtins::likelyBuiltin`
- `FunctionValue.getNamedArgumentForCall` is approximated by `ArgumentNode.argumentOf`
2024-02-26 17:18:40 +01:00
Joe Farebrother
cb733dcf85 Simplify model defenition 2024-02-26 14:59:03 +00:00
Cornelius Riemenschneider
4bb725cbf5 Merge pull request #15656 from github/criemen/ruby-bazel
Ruby: Start building the language pack using bazel.
2024-02-26 15:52:28 +01:00
Cornelius Riemenschneider
234623ec0d Merge pull request #15726 from github/criemen/js
JS: Remove empty build target.
2024-02-26 15:50:31 +01:00
Geoffrey White
5c4543f167 C++: Mark internal files in the old dataflow library as deprecated (the public imports already are). 2024-02-26 14:49:10 +00:00
Cornelius Riemenschneider
e9b5394cd5 JS: Remove empty build target.
The `resources` folder never existed, this was probably introduced
as a copy-paste mistake. Remove the rule.
2024-02-26 15:26:44 +01:00
Harry Maclean
6ff0054e52 Merge pull request #13431 from am0o0/amammad-ruby-YAMLunsafeLoad
Ruby: add seperate additional steps between `YAML.parse*` methods and `to_ruby`
2024-02-26 13:40:48 +00:00
Tom Hvitved
f92c106972 Merge pull request #15724 from hvitved/csharp-change-note
C#: Add change note
2024-02-26 14:35:38 +01:00
Harry Maclean
8212f5de1b Ruby: Update test 2024-02-26 13:10:27 +00:00
Harry Maclean
b86643fab2 Ruby: doc fixes 2024-02-26 12:57:21 +00:00
Michael Nebel
cba247788a C#: Add change note. 2024-02-26 13:51:07 +01:00
Michael Nebel
f9934ed5e7 C#: Add downgrade script. 2024-02-26 13:51:07 +01:00
Michael Nebel
4dd368f7a6 C#: Add upgrade script. 2024-02-26 13:51:07 +01:00
Michael Nebel
80513d846d C#: Update PrintAst test expected outputs. 2024-02-26 13:51:07 +01:00
Michael Nebel
ff32cf90fd C#: Add a test for compiler generated statements. 2024-02-26 13:51:06 +01:00
Michael Nebel
e6f4263eff C#: Do not print compiler generated statements. 2024-02-26 13:51:06 +01:00
Michael Nebel
bf4e3a7d1c C#: Merge expr_compiler_generated and compiler_generated and add compiler generated statements. 2024-02-26 13:51:06 +01:00
Tom Hvitved
dd0c721e8c C#: Add change note 2024-02-26 13:48:19 +01:00
Anders Schack-Mulligen
20bb631456 Dataflow: Prevent bad join. 2024-02-26 13:45:19 +01:00
Tom Hvitved
606a8fed0c Merge pull request #15406 from hvitved/csharp/no-stats-experiment
C#: Remove all DB stats
2024-02-26 13:40:37 +01:00
Harry Maclean
8a670fe9a2 Ruby: formatting 2024-02-26 12:26:04 +00:00
Michael Nebel
e5e0b4c537 C#: Add some examples of uses of the Experimental attribute and update the expected test output. 2024-02-26 13:15:55 +01:00
Michael Nebel
bc98712da5 C#: Add one more using statement to the attributes test file. 2024-02-26 13:14:03 +01:00
amammad
32f5667bb6 revert YAML.qll and yaml sinks to previous PR, make a separate experimental query only for yaml 2024-02-26 12:12:03 +00:00
amammad
c582ea626d update expected test file 2024-02-26 12:10:04 +00:00
amammad
1c1a6f13df fix QLDoc style 2024-02-26 12:05:35 +00:00
amammad
9c5c8c8362 fix test file 2024-02-26 12:05:35 +00:00
amammad
464e2e4291 fix qldoc and test files 2024-02-26 12:04:52 +00:00
amammad
18fa91bde4 add transform method that is an alias for to_ruby 2024-02-26 11:59:41 +00:00
amammad
a75a004942 add more additional steps, change parse* sinks to reciever of them 2024-02-26 11:59:41 +00:00
amammad
474a4f8abd thanks @asgerf for informing me that Successor wants to be deprecated and thank him that providing the solution 2024-02-26 11:59:41 +00:00
amammad
1410574f76 make seperate steps for YAML.parse* and use getAsuccessor*() to reach final to_ruby method call, All parts have Rewritten with API graphs exclusively 2024-02-26 11:59:35 +00:00
Harry Maclean
f7b8e8af41 Ruby: Include request forgery sinks from MaD 2024-02-26 11:34:11 +00:00
Harry Maclean
8bed3fbed4 Ruby: Add basic model for Terrapin library 2024-02-26 11:32:41 +00:00
Harry Maclean
9d13a1ff51 Ruby: Add model for Process.spawn 2024-02-26 11:26:38 +00:00
Harry Maclean
d1847566b6 Ruby: Ql4QL fix 2024-02-26 11:26:38 +00:00
Harry Maclean
beef9965cc Ruby: Model Open4 library
Also remove duplicate modeling of Process.spawn.
2024-02-26 11:26:38 +00:00
Harry Maclean
a03c06802e Ruby: Add some more command injection sinks 2024-02-26 11:26:38 +00:00
Cornelius Riemenschneider
1657b314c1 Re-pin ruby extractor deps. 2024-02-26 11:21:23 +00:00
Cornelius Riemenschneider
688b9955a0 Address review, start accomodating bzlmod. 2024-02-26 11:21:23 +00:00
Cornelius Riemenschneider
b82ffd40e7 Fix windows CI build.
As we're now checking out the `codeql` repo in a sub-path,
we need to enable long paths on Windows.
2024-02-26 11:21:23 +00:00
Cornelius Riemenschneider
fd85c44129 Ruby: Start building the language pack using bazel.
This PR introduces a bazel and `rules_rust`-based build system
for the ruby extractor and language pack.
This replacese the existing, `cargo` and `cross`-based build system.

For local development, nothing changes, and the existing `cargo`-based
build still keeps working as-is.

We no longer need to use `cross` to compile our Linux binaries,
as we now can link against our hermetic C++ toolchain, which ships
with an old enough glibc, so that we don't run into symbol version issues
when deploying the binaries to older systems.
Besides the one change in dependency (explained in detail in `Cargo.toml`
and in https://github.com/github/codeql/pull/15595), nothing ought to
change in how we build the extractor.
2024-02-26 11:21:22 +00:00
Joe Farebrother
386defc3c7 Update test output 2024-02-26 11:21:03 +00:00
Anders Schack-Mulligen
c22cbf5b01 Merge pull request #15721 from aschackmull/workflows/format-check-shared
Workflows: Run format check on shared.
2024-02-26 12:12:29 +01:00
Joe Farebrother
fb06e9f6b2 Merge pull request #15719 from joefarebrother/ruby-changenote-formatting
Ruby: Fix change note formatting
2024-02-26 11:12:01 +00:00
Harry Maclean
dd092fd18f Ruby: Fix CSRF test 2024-02-26 11:02:54 +00:00
Jeroen Ketema
acf3a99dff Merge pull request #15716 from jketema/command-line-options
C++: Update test after extractor changes
2024-02-26 12:01:03 +01:00
Rasmus Wriedt Larsen
4ede553b21 Merge pull request #15365 from RasmusWL/lgtm_index_filter_handling
Tree sitter extractor: Proper handling of `LGTM_INDEX_FILTERS`
2024-02-26 11:59:45 +01:00
Tom Hvitved
5f5bcf686d Update csharp/ql/lib/semmle/code/csharp/AnnotatedType.qll
Co-authored-by: Michael Nebel <michaelnebel@github.com>
2024-02-26 11:35:28 +01:00
Anders Schack-Mulligen
dab8e237e6 Workflows: Run format check on shared. 2024-02-26 11:33:00 +01:00
Tom Hvitved
5b1fb8789a C#: Implement View CFG query 2024-02-26 11:23:49 +01:00
Tom Hvitved
5b6e76c030 Move View CFG implementation from Ruby/Swift into shared library 2024-02-26 11:23:49 +01:00
Rasmus Wriedt Larsen
1cfac50749 Python: Add precision to NoSQL query
Due to this, it was not part of any query suite :O
2024-02-26 11:23:43 +01:00
Joe Farebrother
403a1ac483 Fix change note formatting 2024-02-26 10:21:26 +00:00
Joe Farebrother
2257df5c6f Model Arel::Nodes::SqlLiteral.new 2024-02-26 10:09:33 +00:00
Tom Hvitved
8fbe62ccae Swift: Implement getExtension and getStem 2024-02-26 10:33:57 +01:00
Jeroen Ketema
788100d475 C++: Update test after extractor changes 2024-02-26 10:04:42 +01:00
Tom Hvitved
03a125de38 Merge pull request #15562 from Marcono1234/patch-2
Ruby: Fix formatting in changelog
2024-02-26 10:03:29 +01:00
Tom Hvitved
4bd79c0eb3 Add change note 2024-02-26 09:58:23 +01:00
Rasmus Wriedt Larsen
07223031e8 Merge branch 'main' into lgtm_index_filter_handling 2024-02-26 09:56:02 +01:00
Tom Hvitved
acd52192d1 C#: Adopt shared variable capture library 2024-02-26 09:53:30 +01:00
Tom Hvitved
7197c64e2d C#: Add more variable capture tests 2024-02-26 09:53:29 +01:00
erik-krogh
0056067a17 Merge branch 'main' into ts-54 2024-02-25 21:20:43 +01:00
erik-krogh
083f56921c update to 5.4.1-rc 2024-02-25 21:20:41 +01:00
Tom Hvitved
2683e40038 Merge pull request #15708 from hvitved/share-ide-contextual
Share `getFileBySourceArchiveName` implementation
2024-02-23 19:56:33 +01:00
Chris Smowton
12213a0a08 Add test 2024-02-23 18:39:16 +00:00
Ian Lynagh
bfea40fca0 Kotlin 2: Accept some PrintAst changes in library-tests/exprs 2024-02-23 18:39:06 +00:00
Chris Smowton
d57160db5c Direct map stores via a post-update node 2024-02-23 16:37:26 +00:00
Robert Marsh
da5e3d64ac C++: autoformat 2024-02-23 16:20:42 +00:00
Robert Marsh
dd97584eff C++: fix for duplicated parent of ReturnVoid statements 2024-02-23 16:19:34 +00:00
Ian Lynagh
1abd81ec34 Kotlin 2: Accept loc changes in library-tests/reflection 2024-02-23 13:52:05 +00:00
Ian Lynagh
f43e929d1a Kotlin: More generated elements in Kotlin 2 in library-tests/reflection 2024-02-23 13:45:58 +00:00
Paolo Tranquilli
6b63492d6b Merge pull request #15699 from github/criemen/bazel7-2
Upgrade to bazel 7.0.2.
2024-02-23 14:15:00 +01:00
Tamás Vajk
72f73553ca Merge pull request #15692 from tamasvajk/buildless/no-dotnet-sdk
C#: Download latest dotnet SDK when missing
2024-02-23 13:24:46 +01:00
Tony Torralba
759b74791c Java: Re-enable Widget.qll flow steps
The library Widget.qll was accidentally removed from the global context when its sources were migrated to models-as-data in #13136. This re-adds it so that its flow steps are enabled again.
2024-02-23 13:07:35 +01:00
Harry Maclean
f5be407989 Ruby: deprecate old ProtectFromForgeryCall class 2024-02-23 12:02:26 +00:00
Ian Lynagh
047a8b400e Merge pull request #15703 from igfoo/igfoo/k2mf
Kotlin: Accept changes in library-tests/multiple_files
2024-02-23 11:49:05 +00:00
Ian Lynagh
ee967e62e1 Merge pull request #15704 from igfoo/igfoo/k2ministdlib
Kotlin: Remove the Kotlin 2 ministdlib test
2024-02-23 11:48:55 +00:00
Owen Mansel-Chan
3dc6918356 Merge pull request #15648 from github/workflow/coverage/update
Update CSV framework coverage reports
2024-02-23 11:48:17 +00:00
Harry Maclean
7b3f1a0982 Ruby: fix comment 2024-02-23 11:14:52 +00:00
Harry Maclean
081c1201ed Ruby: Make csrf query more specific
CSRF protection only needs to be explicitly enabled on Rails
applications < 5.2 _or_ those that don't include a `load_defaults` call
with a version >= 5.2.
2024-02-23 11:13:17 +00:00
Harry Maclean
3ee425cc47 Ruby: Identify ActionController::API
`ActionController::API < ActionController::Base` is a base controller
class, so we should recognise it as such.
2024-02-23 11:13:17 +00:00
Harry Maclean
32b775fdc3 Ruby: reduce duplicate alerts for csrf query
Only generate an alert on the top-most vulnerable Rails controller in
the controller tree.
2024-02-23 11:13:17 +00:00
Harry Maclean
1fbf177b54 Ruby: QLDoc fix 2024-02-23 11:13:16 +00:00
Harry Maclean
3499d169f9 Ruby: Add missing QLDoc 2024-02-23 11:13:16 +00:00
Harry Maclean
0597b2ed1b Ruby: recognise csrf_meta_tag
csrf_meta_tag is an alias for csrf_meta_tags, retained for backwards
compatibility.
2024-02-23 11:13:16 +00:00
Harry Maclean
f19a5a9837 Ruby: Add tests for Gemfile modeling 2024-02-23 11:13:16 +00:00
Harry Maclean
3c69ab10f2 Ruby: Restrict rb/csrf-protection-not-enabled
This query only applies to codebases using Ruby on Rails < 5.2, or where
there is no call to `csrf_meta_tags` in the base ERb template.
2024-02-23 11:13:15 +00:00
Harry Maclean
581072721c Ruby: Add change note 2024-02-23 11:13:15 +00:00
Harry Maclean
6d6f8ba512 Ruby: Make CSRF query more sensitive
Generate an alert for every controller class that doesn't have or
inherity a `protect_from_forgery` setting.
2024-02-23 11:13:15 +00:00
Harry Maclean
49d826f667 Ruby: Add a query for CSRF protection not enabled
Specifically in Rails apps, we look for root ActionController classes
without a call to `protect_from_forgery`.
2024-02-23 11:13:14 +00:00
Erik Krogh Kristensen
a0f91fbc15 Merge pull request #15706 from erik-krogh/pol-reg
ReDoS: Restrict some edges related to upper/lower-case when constructing possible attack strings for polynomial-redos.
2024-02-23 12:06:17 +01:00
Tom Hvitved
62b16c0fa3 Share getFileBySourceArchiveName implementation 2024-02-23 11:25:49 +01:00
Tamas Vajk
20f795c03a Code quality improvements 2024-02-23 11:20:15 +01:00
Michael Nebel
1a155b3a30 Merge pull request #15667 from michaelnebel/csharp/syntheticconstructorbody
C#: Add synthetic bodies and inititializers for default constuctors.
2024-02-23 11:14:00 +01:00
Tom Hvitved
94113521d1 Merge pull request #15689 from hvitved/ruby/no-field-branch-limit-summarized-callable
Ruby: No `fieldFlowBranchLimit` for `SummarizedCallable`s
2024-02-23 10:47:22 +01:00
Tom Hvitved
d8645cc960 Merge pull request #15694 from hvitved/csharp/assignable-definition-node
C#: Use separate `newtype` branch for `AssignableDefinitionNode`
2024-02-23 10:45:04 +01:00
github-actions[bot]
b2b5aa18b2 Add changed framework coverage reports 2024-02-23 00:16:49 +00:00
Tom Hvitved
303a2bb63a C#: Update expected test output 2024-02-22 21:04:55 +01:00
Tom Hvitved
ea7d9c97fd C#: Use separate newtype branch for AssignableDefinitionNode 2024-02-22 21:04:55 +01:00
Ian Lynagh
8d358a9f64 Kotlin: Remove the Kotlin 2 ministdlib test
Upstream doesn't plan to fix it before the K2 release:
    https://youtrack.jetbrains.com/issue/KT-62183/K2-no-stdlib-doesnt-behave-as-expected

I've made a ticket to remind us to return to this later.
2024-02-22 19:01:22 +00:00
Geoffrey White
573763a4b3 Shared: More revisions, manual and aided by further discussion with Copilot. 2024-02-22 18:59:35 +00:00
Ian Lynagh
cf441d1a30 Kotlin: Accept changes in library-tests/multiple_files
I think that this is a regression, but one that we're not likely to fix
soon, so let's just accept the output for now. I've opened a ticket to
remind us to return to this.
2024-02-22 18:57:12 +00:00
Robert Marsh
6f7f68fee8 Merge branch 'main' into rdmarsh2/cpp/ir-synthetic-destructors 2024-02-22 18:10:13 +00:00
Geoffrey White
797fee9c9e Swift: Change note. 2024-02-22 17:54:53 +00:00
Mathias Vorreiter Pedersen
63a5b49846 Merge pull request #15633 from MathiasVP/model-experiments
C++: Assume modelled functions always override buffers by default
2024-02-22 18:48:24 +01:00
Geoffrey White
47a9a8b82a Swift: MAke TypeDecl.getFullName robust to when there's an ExtensionDecl extending more than one thing. 2024-02-22 17:39:57 +00:00
Geoffrey White
515e93522f Swift: Make ExtensionDecl.toString robust to when there's more than one extended thing. 2024-02-22 17:39:57 +00:00
Cornelius Riemenschneider
d2e6746e7f Upgrade to bazel 7.0.2. 2024-02-22 17:51:17 +01:00
Robert Marsh
942a4ed925 C++: move handlesDestructorsExplicitly up to TranslatedReturnStmt 2024-02-22 16:46:19 +00:00
Robert Marsh
ebe6ee5257 C++: accept test changes from extractor fixes 2024-02-22 16:44:19 +00:00
Mathias Vorreiter Pedersen
c7ee5b2912 Merge branch 'main' into model-experiments 2024-02-22 16:40:17 +00:00
Harry Maclean
fbc689227d Merge pull request #15604 from p-/p--rails-more-request-sources
Ruby: add additional sources on the request object of Rails
2024-02-22 16:35:59 +00:00
Tamas Vajk
50f9354ca8 Remove redundant using 2024-02-22 17:14:02 +01:00
Tamas Vajk
e176b32a83 Remove environment dictionary passing 2024-02-22 17:12:38 +01:00
Paolo Tranquilli
6c5e5966c3 Merge pull request #15583 from github/redsun82/bzlmod
Bazel: use bzlmod
2024-02-22 17:06:59 +01:00
Tamas Vajk
648c06ce27 Simplify dotnet SDK check in autobuilder 2024-02-22 16:44:46 +01:00
Mathias Vorreiter Pedersen
0bf29f0a62 Merge branch 'main' into model-experiments 2024-02-22 15:05:53 +00:00
Paolo Tranquilli
b7df26e6c9 Bazel: make codeql compatible with workspace setup 2024-02-22 15:50:02 +01:00
Paolo Tranquilli
b1e0287a7c Merge branch 'main' into redsun82/bzlmod 2024-02-22 15:35:41 +01:00
Ben Rodes
47f94e2ebe Merge branch 'main' into cpp-non-constant-format-as-path-query 2024-02-22 06:24:18 -08:00
Ian Lynagh
2b4b512611 Merge pull request #15693 from igfoo/igfoo/kot2b4
Kotlin: Update to 2.0.0-Beta4
2024-02-22 14:06:32 +00:00
Joe Farebrother
2ebb80b632 Merge pull request #15548 from joefarebrother/android-local-auth-keys
Java: Add query for insecurely generated keys for local authentication.
2024-02-22 14:04:17 +00:00
Joe Farebrother
67e8f17c4c Merge pull request #15619 from joefarebrother/ruby-activerecord-connection
Ruby: Add additional sql sinks for ActiveRecord connection methods
2024-02-22 14:02:31 +00:00
Joe Farebrother
1f409b0456 Merge pull request #15671 from joefarebrother/ruby-activerecord-extra-args
Ruby: Consider additional arguments to certain `ActiveRecord` methods as sql injection sinks.
2024-02-22 14:01:56 +00:00
Tamas Vajk
c0d82cb73e Minor improvement to not start dotnet process when it is known to fail 2024-02-22 14:58:00 +01:00
Tom Hvitved
c55354b544 Merge pull request #15688 from hvitved/ruby/multi-variable-capture
Ruby: Fix bug in `allowParameterReturnInSelf`
2024-02-22 14:51:09 +01:00
Mathias Vorreiter Pedersen
350d5bf0ce C++: Update QLDoc on 'modeledFlowBarrier'. 2024-02-22 13:30:39 +00:00
Tamas Vajk
8e64880e86 Fix and add unit tests 2024-02-22 14:27:28 +01:00
Mathias Vorreiter Pedersen
671904d58c C++: Fix QLoc on 'PartialFlowFunction'. 2024-02-22 13:27:10 +00:00
Mathias Vorreiter Pedersen
aca3970c33 C++: Fix QLoc on 'isPartialWrite'. 2024-02-22 13:25:13 +00:00
Taus
f1392712ee Python: Add .copy() as a copy step 2024-02-22 13:09:27 +00:00
Taus
5125973f9b Python: Add test case for .copy() as a copy step 2024-02-22 13:01:03 +00:00
Paolo Tranquilli
fe6b27bcf8 Merge branch 'main' into redsun82/bzlmod 2024-02-22 13:45:09 +01:00
Michael Nebel
a24a57c586 C#: Update most other test cases to reflect the synthesized constructor calls and bodies. 2024-02-22 13:33:30 +01:00
Michael Nebel
a4ab163532 C#: Update test output for cfg tests. 2024-02-22 13:33:29 +01:00
Michael Nebel
d19c83228e C#: Do not bind comments to compiler generated statements. 2024-02-22 13:33:29 +01:00
Michael Nebel
cf9c3d5dd1 C#: Remove un-needed code as we extract synthetic default constructors. 2024-02-22 13:33:29 +01:00
Michael Nebel
14de39a854 C#: Also add synthetic bodies and inititializers for default constructors. 2024-02-22 13:33:29 +01:00
Ian Lynagh
245ce2208e Kotlin: Update to 2.0.0-Beta4 2024-02-22 12:33:00 +00:00
erik-krogh
bf22f4a870 update expected output 2024-02-22 13:21:11 +01:00
Michael Nebel
7ce7b58ce0 Merge pull request #15657 from michaelnebel/csharp/recordflow
C#: Use primary constructors for record types for dataflow.
2024-02-22 13:18:29 +01:00
erik-krogh
e74e5b3613 try to restrict the edges we follow (related to upper/lower-case) when contructing possible attack-strings for polynomial-redos 2024-02-22 13:15:17 +01:00
Felicity Chapman
95ce0cd640 Merge pull request #15691 from github/felicitymay-patch-1
Remove period from 'name' for Java query
2024-02-22 11:50:21 +00:00
Tamas Vajk
976c627d52 C#: Download latest dotnet SDK when missing 2024-02-22 12:07:15 +01:00
Paolo Tranquilli
3bea642d5c Bazel: fix typo 2024-02-22 11:58:02 +01:00
Paolo Tranquilli
fd485d06aa Merge branch 'main' into redsun82/bzlmod 2024-02-22 11:54:14 +01:00
Paolo Tranquilli
0471287cdd Bazel: remove unstable lock file 2024-02-22 11:53:47 +01:00
Felicity Chapman
4810657515 Remove period from 'name'
This is an error for the Docs content linter and does not match the style guide for query help.
2024-02-22 10:50:45 +00:00
Mathias Vorreiter Pedersen
d953a9a523 Merge pull request #15662 from jketema/destructors6
C++: Support destructors for range-based for-loops
2024-02-22 11:41:39 +01:00
Paolo Tranquilli
f1bdd6bdda Bazel: switch to erroring out by default on outdated lock file 2024-02-22 11:26:39 +01:00
Michael Nebel
f2c849c737 C#: Simplify. 2024-02-22 11:19:34 +01:00
Michael Nebel
2afcc611ce C#: Fix formatting. 2024-02-22 11:18:00 +01:00
Paolo Tranquilli
b66153be97 Merge branch 'main' into redsun82/bzlmod 2024-02-22 11:15:07 +01:00
Paolo Tranquilli
a14c2ae8ab Bazel: bump rules_python to 0.31.0 2024-02-22 11:14:53 +01:00
Joe Farebrother
ef124695a5 Apply suggestions from documentation review
Co-authored-by: Sam Browning <106113886+sabrowning1@users.noreply.github.com>
2024-02-22 10:11:49 +00:00
Paolo Tranquilli
67222f8f7e Bazel: add module lock file 2024-02-22 11:09:15 +01:00
Paolo Tranquilli
cda4ca68f8 Bazel: tweak .bazelrc 2024-02-22 11:08:50 +01:00
Paolo Tranquilli
7410522660 Bazel: bump version to 6.5.0 2024-02-22 11:08:33 +01:00
Ian Lynagh
b405c5fc02 Merge pull request #15683 from igfoo/igfoo/expr
Kotlin: Accept some Kotlin 2 location changes
2024-02-22 10:00:01 +00:00
Joe Farebrother
92bdd637a3 Address reveiw comment - add create nd remove select_insert 2024-02-22 09:55:46 +00:00
Michael Nebel
21aa025db2 Update csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll
Co-authored-by: Tom Hvitved <hvitved@github.com>
2024-02-22 10:40:54 +01:00
Tom Hvitved
ebee35b385 Ruby: No fieldFlowBranchLimit for SummarizedCallables 2024-02-22 10:27:25 +01:00
Tom Hvitved
23869fc8e6 Ruby: Fix bug in allowParameterReturnInSelf 2024-02-22 09:43:52 +01:00
Tom Hvitved
007d08ea63 Ruby: Add another variable capture test 2024-02-22 09:39:01 +01:00
Tamás Vajk
9ecac04709 Merge pull request #15680 from tamasvajk/buildless/no-mono-fallback-impr
C#: Improve fallback nuget package restore in buildless
2024-02-22 08:40:16 +01:00
Paolo Tranquilli
c15d3ab08a Merge branch 'main' into redsun82/bzlmod 2024-02-22 06:05:37 +01:00
Robert Marsh
875ab74c28 Merge branch 'main' into rdmarsh2/cpp/ir-synthetic-destructors
Fixes conflicts in C++ IR tests and Stmt.qll
2024-02-21 21:34:49 +00:00
Robert Marsh
66743fb0db C++: refactor TranslatedReturnStmt 2024-02-21 20:50:30 +00:00
Robert Marsh
e0c7849f52 C++: fix incorrect use of getChildInternal 2024-02-21 20:35:58 +00:00
Ian Lynagh
218a3877d2 Merge pull request #15682 from igfoo/igfoo/propStackOverflow
Java: Properties: Add a test that used to give a stack overflow
2024-02-21 19:35:32 +00:00
Asger F
db10c229de Merge pull request #15663 from asgerf/js/endpoint-naming2
JS: Improvements to endpoint naming
2024-02-21 19:36:57 +01:00
amammad
1927530517 update tests after branch update 2024-02-21 22:15:23 +04:00
Am
376c6ea09a Merge branch 'main' into amammad-go-bombs 2024-02-21 21:42:25 +03:30
Geoffrey White
7b85bb4c95 Shared: Autoformat. 2024-02-21 17:54:00 +00:00
Geoffrey White
4367b7813c Shared: Use more standard QLDoc phrasing. 2024-02-21 17:54:00 +00:00
Geoffrey White
d1c0294551 Shared: Delete hallucinated return values. 2024-02-21 17:54:00 +00:00
Geoffrey White
5e401abccb Shared: Undo changes to existing QLDoc. 2024-02-21 17:53:59 +00:00
Geoffrey White
2f1d4b923e Shared: Generate some QLDoc using the "GitHub Copilot: Generate Docs" command. 2024-02-21 17:53:59 +00:00
Benjamin Rodes
8d35db0fe6 Making argv filter positional. 2024-02-21 12:25:35 -05:00
Ian Lynagh
e6f70385f4 Kotlin: Accept more loc changes in library-tests/exprs 2024-02-21 17:23:03 +00:00
Ian Lynagh
006b682333 Kotlin: Accept more loc changes in library-tests/exprs 2024-02-21 17:18:06 +00:00
Ian Lynagh
36b304d9a1 Kotlin: Accept some locations in library-tests/exprs 2024-02-21 17:13:50 +00:00
Ian Lynagh
212d5def16 Kotlin: Accept more loc changes in library-tests/exprs
These are more instances of the same changes as the previous 2 commits
2024-02-21 17:04:49 +00:00
Ian Lynagh
1b98dc16ba Kotlin: Accept some more loc changes in library-tests/exprs 2024-02-21 17:02:59 +00:00
Ian Lynagh
5ecdc29808 Kotlin: Accept some loc changes in library-tests/exprs
These aren't ideal, but I think they will be improve once we handle
pre/post inc/decrement properly.
2024-02-21 17:00:23 +00:00
Jeroen Ketema
f9d391d087 C++: Support destructors for range-based for-loops 2024-02-21 17:26:32 +01:00
Paolo Tranquilli
3ca9d70100 Bazel: drop experimental from bzlmod flag 2024-02-21 16:53:08 +01:00
Paolo Tranquilli
61bfe7e520 Bazel: rename internal module to semmle_code 2024-02-21 16:51:39 +01:00
Paolo Tranquilli
cb5e3c336d Merge branch 'main' into redsun82/bzlmod 2024-02-21 16:47:36 +01:00
Robert Marsh
339c89019a Merge pull request #15681 from jketema/destructors6b
C++: Add IR test where the for loop should call destructors at the end of its body
2024-02-21 10:20:46 -05:00
Tamás Vajk
e13d6cdd57 Merge pull request #15678 from tamasvajk/fix/integration-test-paths
C#: Modify reported assembly paths in integration tests
2024-02-21 15:26:36 +01:00
Paolo Tranquilli
3df3fbc65b Merge branch 'main' into redsun82/bzlmod 2024-02-21 15:01:19 +01:00
Ian Lynagh
9948052fb6 Java: Properties: Add a test that used to give a stack overflow 2024-02-21 13:51:53 +00:00
Jeroen Ketema
11dc467add C++: Add test where the for loop should call destructors at the end of its body 2024-02-21 14:42:23 +01:00
Jeroen Ketema
8bbfb82f8e Merge pull request #15670 from jketema/destructors7
C++: Add IR tests for destruction of static locals
2024-02-21 12:54:38 +01:00
Ian Lynagh
204be4a809 Merge pull request #15669 from igfoo/igfoo/operator-overloads
Kotlin 2: Accept changes in library-tests/operator-overloads
2024-02-21 11:36:16 +00:00
Ian Lynagh
3c35683e25 Merge pull request #15668 from igfoo/igfoo/interface-delegate
Kotlin 2: Accept location changes in library-tests/interface-delegate
2024-02-21 11:35:59 +00:00
Tamas Vajk
0c46b493c3 C#: Improve fallback nuget package restore in buildless
Fallback cases coming from `<PackageReference />` and `packages.config` are now differentiated. In the latter case we're restoring the package through projects that target `net481`.
2024-02-21 11:58:02 +01:00
Paolo Tranquilli
31959eaf1f Merge branch 'main' into redsun82/bzlmod 2024-02-21 11:20:55 +01:00
Michael Nebel
a0b44c0fc1 C#: Update other tests expected output. 2024-02-21 10:57:22 +01:00
Michael Nebel
0d32192f62 C#: Update expected test output. 2024-02-21 10:57:22 +01:00
Michael Nebel
b76a27bba2 C#: Make a store step from explicit parameter nodes on primary constructors to the property of the same name for record types. 2024-02-21 10:57:22 +01:00
Anders Schack-Mulligen
71f8ccf45f Merge pull request #15654 from aschackmull/java/static-init-vec-query-perf
Java: Switch helper flow from Global to SimpleGlobal in StaticInitializationVectorQuery.
2024-02-21 10:51:16 +01:00
Michael Nebel
132b8baa57 C#: Delete summarized callable implementation for record flow and update expected output. 2024-02-21 10:33:19 +01:00
Michael Nebel
009ea1bcfd C#: Add test examples for record flow and update expected test output. 2024-02-21 10:31:07 +01:00
Jeroen Ketema
57cb7f8218 C++: Update tests after extractor changes related to static variables 2024-02-21 10:22:59 +01:00
Jeroen Ketema
c1f18edfed C++: Add IR tests for destruction of static locals 2024-02-21 10:22:59 +01:00
Michael Nebel
f072e41d50 Merge pull request #15652 from michaelnebel/csharp/constructorflow
C#: Read-only property flow.
2024-02-21 10:12:46 +01:00
Tamas Vajk
e1e29f277c C#: Modify reported assembly paths in integration tests 2024-02-21 09:39:19 +01:00
Michael Nebel
060133d3e9 C#: Add change note. 2024-02-21 09:34:21 +01:00
Tamás Vajk
70a2d16b1a Merge pull request #15600 from tamasvajk/buildless/no-mono-dlls
C# Change desktop dotnet assembly lookup to fall back to nuget reference assemblies
2024-02-21 08:36:41 +01:00
Paolo Tranquilli
c5ed96b4f8 Merge branch 'main' into redsun82/bzlmod 2024-02-21 06:22:10 +01:00
Chris Smowton
f2e04c0cb2 Merge pull request #15672 from github/post-release-prep/codeql-cli-2.16.3
Post-release preparation for codeql-cli-2.16.3
2024-02-20 21:59:55 +00:00
amammad
4c769f2b09 update tests 2024-02-21 01:10:35 +04:00
amammad
3307457deb use implements predicate for io interfaces,
so we can reduce many repetitive parts of query
2024-02-21 01:07:31 +04:00
amammad
13b0a9a842 New testcase 's2Reader.ReadByte()' 2024-02-21 01:05:57 +04:00
amammad
905420143b call functions in the same order as the function declarations 2024-02-21 00:19:51 +04:00
Edward Minnix III
c5dbaa6bfd Docs team review suggestions
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
2024-02-20 14:17:06 -05:00
Ed Minnix
8be9b8b818 Add note about collapsing multiple rows into one 2024-02-20 14:17:05 -05:00
Ed Minnix
e2511cdbe4 Add neutral model note to C# documentation 2024-02-20 14:17:04 -05:00
Ed Minnix
8058096d7d Add note about neutrals to Java documentation 2024-02-20 14:17:02 -05:00
Edward Minnix III
6665248c19 Review suggestions
Co-authored-by: Michael Nebel <michaelnebel@github.com>
2024-02-20 14:17:01 -05:00
Ed Minnix
ae59ea3152 Oxford comma 2024-02-20 14:17:00 -05:00
Ed Minnix
3f10dd06f2 Correct indices in example 2024-02-20 14:16:59 -05:00
Ed Minnix
65db990c97 Remove threat model mentions 2024-02-20 14:16:57 -05:00
Ed Minnix
bb86ce5749 Remove references to model editor 2024-02-20 14:16:56 -05:00
Ed Minnix
698109ae10 Introduce C# MaD documentation 2024-02-20 14:16:55 -05:00
Ed Minnix
77ef63a051 Modify Java docs to use common models-as-data beta notice 2024-02-20 14:16:53 -05:00
Ed Minnix
54d7805e4a Modify Java threat model link to be Java-specific 2024-02-20 14:16:51 -05:00
yoff
d3ee5f65db Merge pull request #15550 from yoff/python/remove-pointsto-from-module-getAnExport
python: remove a use of points-to
2024-02-20 19:04:46 +01:00
github-actions[bot]
37f8fa3413 Post-release preparation for codeql-cli-2.16.3 2024-02-20 16:50:47 +00:00
Joe Farebrother
10da4d14d9 Add addtional arguments as sinks to certain methods 2024-02-20 16:35:29 +00:00
Pierre
2da00986c0 Merge pull request #15664 from alexrford/rb/rm-library-models-cust-docs
Ruby: remove `customizing-library-models-for-ruby.rst`
2024-02-20 17:03:18 +01:00
Ian Lynagh
fbf70c688f Kotlin 2: Accept changes in library-tests/operator-overloads
This also brings the Kotlin 2 output back in line with the Kotlin 1
output.
2024-02-20 15:41:22 +00:00
Ian Lynagh
67d0415942 Kotlin 2: Accept loc changes in library-tests/interface-delegate
We lose a location here, but this makes the Kotlin 2 results more
similar to the Kotlin 1 results.
2024-02-20 15:27:43 +00:00
Pierre
0d734983b4 Merge branch 'main' into rb/rm-library-models-cust-docs 2024-02-20 16:20:41 +01:00
Michael Nebel
d6f657cfd7 C#: Update expected test output. 2024-02-20 15:55:19 +01:00
Michael Nebel
e4d41194b4 C#: Include store steps into readonly properties. 2024-02-20 15:55:19 +01:00
Michael Nebel
3112bf4682 C#: Add some test property inititialization test cases and update expected output. 2024-02-20 15:55:19 +01:00
Geoffrey White
5787dcc82d C++: Make getStaticCallTarget() return a DataFlowCallable. 2024-02-20 14:49:51 +00:00
Geoffrey White
356214c11b C++: Implement SummaryReturnNode. 2024-02-20 14:48:02 +00:00
Geoffrey White
5683092d6a C++: Implement SummaryParameterNode. 2024-02-20 14:48:02 +00:00
Geoffrey White
1ace9ee50f C++: Create a proper class for DataFlowCallable, that includes summarized callables. 2024-02-20 14:48:02 +00:00
Geoffrey White
e1a5a84253 C++: Create a proper class for DataFlowCall, that includes summarized callables. 2024-02-20 14:48:02 +00:00
Max Schaefer
75f66c2191 Add four more sink types. 2024-02-20 13:48:20 +00:00
Anders Schack-Mulligen
5a348a5048 Dataflow: SimpleGlobal / Typetracker perf fix. 2024-02-20 14:40:28 +01:00
Alex Ford
5b46256fdb Ruby: remove customizing-library-models-for-ruby.rst 2024-02-20 13:12:23 +00:00
Asger F
29ffeb6da5 JS: Fix qldoc 2024-02-20 14:00:32 +01:00
Paolo Tranquilli
2cc762b85a Merge branch 'main' into redsun82/bzlmod 2024-02-20 13:55:57 +01:00
Rasmus Lerchedahl Petersen
22e72d2fed python: Move the rewrite out to Scope.qll 2024-02-20 10:39:29 +01:00
Rasmus Lerchedahl Petersen
de727bf1b5 Revert "python: remove a use of points-to"
This reverts commit 5cb71ce7e5.
2024-02-20 10:23:31 +01:00
Paolo Tranquilli
ec3cc6376f Merge branch 'main' into redsun82/bzlmod 2024-02-19 16:42:08 +01:00
Paolo Tranquilli
0787cc5e51 Merge branch 'main' into redsun82/bzlmod 2024-02-19 15:07:42 +01:00
Paolo Tranquilli
f842eee784 Swift: use includes in picosha2 2024-02-19 14:06:18 +01:00
Paolo Tranquilli
d0e169ebda Merge branch 'main' into redsun82/bzlmod 2024-02-19 14:05:43 +01:00
Anders Schack-Mulligen
66010b5c96 Java: Switch helper flow from Global to SimpleGlobal in StaticInitializationVectorQuery. 2024-02-19 14:04:43 +01:00
Asger F
c324b2aed8 JS: Refactor 2024-02-19 13:59:49 +01:00
Asger F
eb7d0244c2 JS: Global names don't have to be defined in externs 2024-02-19 13:59:49 +01:00
Asger F
493b37774f JS: More precise isFunctionSource 2024-02-19 13:59:49 +01:00
Asger F
6d597bea0d JS: Refactor 2024-02-19 13:59:49 +01:00
Asger F
8a5b907912 JS: Handle wrapper functions more gracefully 2024-02-19 13:59:48 +01:00
Asger F
d96f29d6c2 JS: Disallow return steps in getASinkNode 2024-02-19 13:59:48 +01:00
Asger F
51bed86778 Update EndpointNaming.expected 2024-02-19 13:59:46 +01:00
Asger F
29258ad8c2 WIP new aliasing rule 2024-02-19 13:59:15 +01:00
Asger F
4ef1ac9250 JS: Accept bad test output 2024-02-19 13:59:12 +01:00
Asger F
15bc3c282f JS: Add test with wrapper function 2024-02-19 13:58:40 +01:00
Tamas Vajk
216d6c0827 Change separator character used in environment variable 2024-02-19 13:58:09 +01:00
Paolo Tranquilli
b174aa65a3 Bazel: empty out WORKSPACE.bazel 2024-02-19 10:30:48 +01:00
Paolo Tranquilli
f41b70af78 Merge branch 'main' into redsun82/bzlmod 2024-02-19 08:35:55 +01:00
Robert Marsh
2494b7d801 C++: fix for IR CFG problem with return in if 2024-02-16 21:08:21 +00:00
Geoffrey White
6e13b877bb C++: Add FlowSummaryNode and test it. 2024-02-16 18:06:57 +00:00
Robert Marsh
2c8ed6479a C++: test for return in if 2024-02-16 17:55:34 +00:00
Benjamin Rodes
639642fb67 Formatting. 2024-02-16 11:19:02 -05:00
Benjamin Rodes
0410ed734b Adding exclusion for main's argv (I believe this and other changes were accidentally removed in prior merge with other non-const branches) 2024-02-16 11:18:06 -05:00
Benjamin Rodes
9f3dd6300f Fixing query to use path graph. 2024-02-16 11:11:48 -05:00
Paolo Tranquilli
32d6c5ac3d Javascript: fix project layout for bazel tests
On Windows, the project layout needs to match `codeql~override`, while
on POSIX we must keep on matching `ql`. We work around this by using
`*ql*` in the project layout, which matches both.
2024-02-16 17:10:20 +01:00
Paolo Tranquilli
1626344560 Merge branch 'main' into redsun82/bzlmod 2024-02-16 17:10:02 +01:00
Benjamin Rodes
aa7c677e13 Merge branch '51-2cppnon-constant-format-alter-not-const-source' into cpp-non-constant-format-as-path-query
# Conflicts:
#	cpp/ql/src/Likely Bugs/Format/NonConstantFormat.ql
2024-02-16 10:49:05 -05:00
Michael B. Gale
008585eeba Go: Include arguments in RunCmd error messages 2024-02-16 15:17:24 +00:00
Michael B. Gale
8886092cd0 Go: Try to ignore errors in go mod vendor calls 2024-02-16 15:15:58 +00:00
Mathias Vorreiter Pedersen
be54a41593 C++: Accept query test changes. 2024-02-16 15:01:50 +01:00
Tamas Vajk
c68d36eb79 Remove restored framework packages when user specified framework folders 2024-02-16 14:42:39 +01:00
Mathias Vorreiter Pedersen
b407c86d03 C++: Make Code Scanning happy. 2024-02-16 13:51:34 +01:00
Mathias Vorreiter Pedersen
57c1bf5835 C++: Add file-level QLDoc. 2024-02-16 13:47:02 +01:00
Mathias Vorreiter Pedersen
497592a4d4 C++: Add change note. 2024-02-16 13:36:25 +01:00
Tamas Vajk
ce0159c005 Add dotnet core dependencies to the integration test 2024-02-16 13:35:18 +01:00
Geoffrey White
e187a4a7d6 C++: Add flow summaries to simpleLocalFlowStep. 2024-02-16 12:31:17 +00:00
Tamas Vajk
7e912f0de0 Rename integration test 2024-02-16 13:31:08 +01:00
Mathias Vorreiter Pedersen
9b2019db6b C++: Accept test changes. 2024-02-16 13:10:41 +01:00
Mathias Vorreiter Pedersen
499ab0892f C++: Currently, to catch flow in an example such as:
```cpp
char* source();
void sink(const char*);
int sprintf(char *, const char *, ...);

void call_sprintf(char* path, char* data) {
        sprintf(path, "%s", "abc"); // (1)
        sprintf(path, "%s", data); // (2)
}

void foo() {
        char path[10];
        call_sprintf(path, source()); // (3)
        sink(path);
}
```
we identify that the `*path [post update]` node at `// (2)` is a
`ReturnNodeExt` and since `*data` flows to that node flow will be carried
out to `*path [post update]` at // (3) and thus reach `sink(path)`.

The reason `*path [post update]` at `// 2` is recognized as a `ReturnNodeExt`
is because it satisfies the following condition (which is identified by the
shared dataflow library):
There is flow from the parameter node `*path` to the pre-update node of the
post-update node `*path [post update]` at `// (2)`.

However, when we start recognizing that the call to `sprintf(path, ...)` at
`// (1)` overrides the value of `*path` and no longer provide use-use flow out
of `*path` the `*path [post update]` node at `// (2)` is no longer recognized
as a `ReturnNodeExt` (because it doesn't satisfy the above criteria).

Thus, we need to identify the flow above without relying on the dataflow
library's summary mechanism. That is, instead of relying on the dataflow
library's mechanism to summarize the `*data -> *path` flow for `call_sprintf`
we need to:
- Ensure that the write to `*path` at `// (2)` is recognized as the "final"
write to the parameter, and
- Ensure that there's flow out of that parameter and back to
`*path [post update]` at `// (3)`.

Luckiky, we do all of this already to support flow out of writes to parameters
that don't have post-update nodes. For example, in something like:
```cpp
void set(int* x, int y) {
  *x = y;
}

void test() {
  int x;
  set(&x, source());
  sink(x);
}
```
So in order to make the original example work, all we need to do is to remove
the restrictions on this mechanism so that the same mechanism that makes the
above example work also makes the original example work!
2024-02-16 13:09:45 +01:00
Joe Farebrother
9ad05fe51c Address reveiws - Add BAD example to doc, add doc example to tests and fix typo. 2024-02-16 12:00:51 +00:00
Mathias Vorreiter Pedersen
7e9bf2a880 C++: Add a model for 'partial updating' and extend models appropriately. 2024-02-16 12:56:19 +01:00
Mathias Vorreiter Pedersen
24a63ae94d C++: Block flow by default. 2024-02-16 12:56:19 +01:00
Mathias Vorreiter Pedersen
625c47fa9c C++: Add a testcase. 2024-02-16 12:56:19 +01:00
Tamas Vajk
1e75c73825 Fix failing integration test 2024-02-16 12:50:13 +01:00
Tamas Vajk
f8b29ad70e Introduce environment variable to specify framework assembly locations 2024-02-16 11:54:19 +01:00
Tamas Vajk
d358f8e4f2 Move undocumented environment variable names to a common location 2024-02-16 11:15:53 +01:00
Tamas Vajk
b996f7b3ce Change environment variable for opt-out web view extraction 2024-02-16 11:15:53 +01:00
Tamas Vajk
8f0f6963bb Change desktop dotnet assembly lookup to fall back to nuget reference assemblies 2024-02-16 11:15:53 +01:00
Tamas Vajk
04f0fb0483 Add integration test with mono assemblies as references 2024-02-16 11:15:52 +01:00
Benjamin Rodes
d6b0746b30 The non-constant format query is now a path query. Minor changes to the output alert to be more precise on what is being alerted. Minor changes to the query itself to avoid redundancies with argv. 2024-02-15 12:14:52 -05:00
Michael B. Gale
4d28c0d2a9 Go: Call go mod vendor to synchronise vendor directory when it exists 2024-02-15 16:19:07 +00:00
Joe Farebrother
e36b9f4d3c Add tests and change note 2024-02-15 15:26:20 +00:00
Joe Farebrother
37eb81097f Add additional sinks for connection methods 2024-02-14 22:42:03 +00:00
Michael B. Gale
6267506a77 Go: Postpone go.mod creation until necessary 2024-02-14 19:12:36 +00:00
Michael B. Gale
1055e773ef Go: Export InitGoModForLegacyProject 2024-02-14 19:12:35 +00:00
Michael B. Gale
4387c73d12 Go: Fix missing word in comment for discoverWorkspace 2024-02-14 19:12:35 +00:00
Michael B. Gale
6dbb5c5fdb Go: Refactor Autobuild to use pairs of scripts and tools from a reusable array 2024-02-14 19:12:35 +00:00
Michael B. Gale
e2c673417f Go: Only call EmitNewerGoVersionNeeded at most once 2024-02-14 19:12:35 +00:00
Michael B. Gale
6eac48caba Go: Refactor greatest version logic into dedicated function 2024-02-14 19:12:34 +00:00
Michael B. Gale
a9d8643f5a Go: check for extracted files in go-files-found-not-processed test 2024-02-14 19:12:34 +00:00
Michael B. Gale
a26d11bcea Go: Revert expected diagnostics for go-files-found-not-processed 2024-02-14 19:12:34 +00:00
Michael B. Gale
058bf32ad0 Go: Initialise Go modules for stray source files outside of existing modules 2024-02-14 19:12:34 +00:00
Michael B. Gale
d99ad01efa Go: Add module files which don't belong to a workspace, if there are workspaces 2024-02-14 19:12:34 +00:00
Michael B. Gale
251888a0bd Go: Tell extractor to extract subdirectories as well 2024-02-14 19:12:33 +00:00
Michael B. Gale
925e99cdb2 Go: Use GoFilesOutsideDirs to find stray source files 2024-02-14 19:12:33 +00:00
Michael B. Gale
f0df7cd5c5 Go: Add GoFilesOutsideDirs function 2024-02-14 19:12:33 +00:00
Michael B. Gale
d4ea45bdaf Go: Add comment to AnyGoFilesOutsideDirs and use slices.Contains 2024-02-14 19:12:33 +00:00
Michael B. Gale
843f7694fd Go: Only relocate project to temp dir if there is only one workspace 2024-02-14 19:12:32 +00:00
Michael B. Gale
3a982de16f Go: Workspaces only support mod=readonly 2024-02-14 19:12:32 +00:00
Michael B. Gale
9c3667dbf7 Go: Improve go.work file(s) found log message 2024-02-14 19:12:32 +00:00
Michael B. Gale
fd54350ba8 Go: Fix comment for getBuildRoots 2024-02-14 19:12:32 +00:00
Michael B. Gale
f084829154 Go: Only fail autobuilder if all projects cannot be extracted 2024-02-14 19:12:31 +00:00
Michael B. Gale
20836c7088 Go: Add test for multiple modules, where one cannot be extracted 2024-02-14 19:12:31 +00:00
Michael B. Gale
fbd7946cfd Go: Fall back to ./... if there are no modules
Fixes issues for `dep` and `glide`
2024-02-14 19:12:31 +00:00
Michael B. Gale
0b8a917584 Go: Fix crash if WorkspaceFile.Go is nil 2024-02-14 19:12:30 +00:00
Michael B. Gale
46c553e802 Go: Add test case for go.mod file without a Go version 2024-02-14 19:12:30 +00:00
Michael B. Gale
a961e276c1 Go: Initialise filesToRemove to an empty array 2024-02-14 19:12:30 +00:00
Michael B. Gale
51eb487022 Go: Handle filepath.Rel failure 2024-02-14 19:12:30 +00:00
Michael B. Gale
c96735e17a Go: Remove auto-generated go.mod files when done 2024-02-14 19:12:30 +00:00
Michael B. Gale
db1d24a900 Go: Update expected diagnostics for go-files-not-processed 2024-02-14 19:12:29 +00:00
Michael B. Gale
e79f5905e7 Go: Fix checks for dep and glide not working correctly 2024-02-14 19:12:29 +00:00
Michael B. Gale
ec902827f6 Go: Initialise go.mod for stray source files 2024-02-14 19:12:29 +00:00
Michael B. Gale
b9e96e4a27 Fixup: closing curly brace 2024-02-14 19:12:29 +00:00
Michael B. Gale
21fbb1b051 Go: Only initialise module if there are source files 2024-02-14 19:12:28 +00:00
Michael B. Gale
f48b1e57d7 Go: Check for relative paths warning even if go mod tidy is successful 2024-02-14 19:12:28 +00:00
Michael B. Gale
aa5e14f59f Go: Replace BuildInfo with GoWorkspace 2024-02-14 19:12:28 +00:00
Michael B. Gale
8b376e7a35 Go: Include ModMode in GoWorkspace 2024-02-14 19:12:28 +00:00
Michael B. Gale
025fbc874f Go: Move definition of GoVersionInfo 2024-02-14 19:12:28 +00:00
Michael B. Gale
bdae54714a Go: Change getDepMode to return GoWorkspaces 2024-02-14 19:12:27 +00:00
Michael B. Gale
64122ba867 Go: Include DependencyInstallerMode in GoWorkspace 2024-02-14 19:12:27 +00:00
Michael B. Gale
7392440475 Go: Move DependencyInstallerMode up 2024-02-14 19:12:27 +00:00
Michael B. Gale
b5ae8ace0d Go: Add a function for go mod init 2024-02-14 19:12:27 +00:00
Michael B. Gale
1bf747ef3a Go: Create go.mod file if necessary in project discovery 2024-02-14 19:12:27 +00:00
Michael B. Gale
254634075f Go: Add shared TidyModule function 2024-02-14 19:12:26 +00:00
Michael B. Gale
f013d9d373 Go: Use new workspace/module discovery 2024-02-14 19:12:26 +00:00
Michael B. Gale
fc75e44238 Go: Allow GetBuildInfo to return multiple BuildInfo objects 2024-02-14 19:12:26 +00:00
Michael B. Gale
4f5c43a3c6 Go: Add new functions for discovering workspaces and modules 2024-02-14 19:12:26 +00:00
Michael B. Gale
3f53186ad1 Go: Add helper functions for discovering go.work and go.mod files 2024-02-14 19:12:25 +00:00
Michael B. Gale
60879bd367 Go: Introduce new types for representing logical workspaces 2024-02-14 19:12:25 +00:00
Michael B. Gale
82bd1d7b0b Go: Add SupportsWorkspaces function 2024-02-14 19:12:25 +00:00
Michael B. Gale
237bf5653a Go: Move getEnvGoSemVer to toolchain.go 2024-02-14 19:12:25 +00:00
Michael B. Gale
bd36847ca2 Go: Emit relative path import diagnostic if prompted by go mod tidy
The corresponding integration test now successfully extracts the project
2024-02-14 19:12:25 +00:00
Michael B. Gale
c2571160c3 Go: Rename findGoModFiles to getBuildRoot 2024-02-14 19:12:24 +00:00
Michael B. Gale
0488d1d295 Go: Move getDirs into util and document/rename 2024-02-14 19:12:24 +00:00
Michael B. Gale
df212807a0 Go: Try to initialise go.mod file for legacy projects 2024-02-14 19:12:24 +00:00
Chris Smowton
7ed73bc4ed change note 2024-02-14 15:45:03 +00:00
Chris Smowton
9016997b51 Golang: fix flow from a map value via a range statement 2024-02-14 14:56:24 +00:00
Asger F
d94d4591da JS: Name instance methods using API nodes instead of special-casing 2024-02-14 15:08:19 +01:00
Asger F
c4a0f36a08 JS: Fix handling of unknown properties
These would shorten the expected distance to a node, but would never be usable as an edge, meaning we failed to pick a preferred predecessor.
2024-02-14 15:08:19 +01:00
Asger F
3ff950660b JS: Add test with unknown property name 2024-02-14 15:08:19 +01:00
Asger F
9838da5395 JS: Simplify isExported 2024-02-14 15:08:19 +01:00
Asger F
a3dc19fd31 JS: Check privacy earlier 2024-02-14 15:08:19 +01:00
Asger F
5c454944a9 JS: Add test for private fields 2024-02-14 15:08:19 +01:00
Asger F
2a91bb8c54 JS: Add test showing ambiguous predecessor 2024-02-14 15:08:19 +01:00
Robert Marsh
7e23ccd383 Merge branch 'main' into rdmarsh2/cpp/ir-synthetic-destructors 2024-02-13 15:45:51 +00:00
Robert Marsh
128bc99f90 C++: delete some FIXMEs that turned out fine 2024-02-13 15:34:36 +00:00
Peter Stöckli
2f7b946c9f Ruby: add sources on request object of Rails 2024-02-13 15:52:18 +01:00
Robert Marsh
b9785ea7b2 C++: autoformat 2024-02-13 01:07:41 +00:00
Robert Marsh
f791b0ebbf C++: Model for smart pointer destructors 2024-02-13 01:00:46 +00:00
Robert Marsh
b6cf64cff3 C++: simplify TranslatedBlock::getLastChild 2024-02-13 00:46:53 +00:00
Robert Marsh
7d8872bb99 C++: Fix for multiple for-loop variables with destructors 2024-02-13 00:40:19 +00:00
Robert Marsh
6663420d39 C++: test for multiple for loop variables with destructors 2024-02-13 00:35:56 +00:00
Robert Marsh
b94c4a6e1b C++: fix for destructor of while-loop condition 2024-02-13 00:13:22 +00:00
Robert Marsh
bac7e46b0f C++: tests for destructors after a while-loop condition 2024-02-12 23:55:42 +00:00
Tom Hvitved
15cf695188 C#: Fix various bad joins 2024-02-12 19:49:53 +01:00
Tom Hvitved
90f3670f3d C#: Remove all DB stats 2024-02-12 19:49:29 +01:00
Paolo Tranquilli
a944443d39 Merge branch 'main' into redsun82/bzlmod 2024-02-12 16:03:50 +01:00
Paolo Tranquilli
c0eeb7a34e Bazel: reference (and locally stub) internal module 2024-02-12 15:58:43 +01:00
Joe Farebrother
3a4a841844 Add change note + update severity 2024-02-12 14:01:27 +00:00
Joe Farebrother
16a7d68780 Add documentation 2024-02-12 13:58:01 +00:00
Joe Farebrother
2eb93b7a3b Add unit tests 2024-02-12 13:49:45 +00:00
Joe Farebrother
d8985f9f5b Move tests for local auth to a folder 2024-02-12 13:49:45 +00:00
Joe Farebrother
c79a3eb6ae Add query for insecure key generation 2024-02-12 13:49:44 +00:00
Paolo Tranquilli
53539226a8 Bazel: use internal codeql module 2024-02-12 14:27:55 +01:00
Paolo Tranquilli
19bb8fe22d Bazel: use bzlmod 2024-02-12 10:55:40 +01:00
Marcono1234
d814decc17 Ruby: Fix formatting in changelog 2024-02-10 00:23:57 +01:00
Robert Marsh
d1160f86e1 C++: Autoformat for named destructors in IR 2024-02-09 22:35:12 +00:00
Robert Marsh
1b571f8992 C++: Accept test changes 2024-02-09 22:32:08 +00:00
Geoffrey White
0c3aa7b7f2 C++: Add an inline test for interpretElement matching. 2024-02-09 18:57:05 +00:00
Geoffrey White
8bdb67cc15 C++: Allow member variables to be picked as input nodes. 2024-02-09 14:24:37 +00:00
Mathias Vorreiter Pedersen
4eae191430 C++: Accept test changes. 2024-02-09 14:07:57 +00:00
Mathias Vorreiter Pedersen
4728cf5a12 C++: Allow the 'x' in 'x = source()' to be marked as a sink in MaD. 2024-02-09 14:07:48 +00:00
Anders Schack-Mulligen
8fc4fae7d2 Java: Cache interpretElement. 2024-02-09 14:43:36 +01:00
Mathias Vorreiter Pedersen
cd41a1ca8c C++: Accept test changes. 2024-02-09 13:27:40 +00:00
Mathias Vorreiter Pedersen
3719e10ce8 C++: Add a case for global or namespace variables in 'interpretElement0'. 2024-02-09 13:27:32 +00:00
Mathias Vorreiter Pedersen
52a1d905f1 C++: Qualified import of 'cpp' to make the file compile. 2024-02-09 13:25:17 +00:00
Rasmus Lerchedahl Petersen
580e68d5de python: add support for lower bound position 2024-02-09 13:51:16 +01:00
Rasmus Lerchedahl Petersen
45bb4a0ee5 python: remove TaintStepFromSummary
as it should be covered by `SummarizedCallableFromModel`

Also move things around, to look more like the Ruby code.
2024-02-08 12:48:15 +01:00
Rasmus Lerchedahl Petersen
5cb71ce7e5 python: remove a use of points-to
This is used by `Scope::isPublic` which in turn is called by the framework model for `setuptools`.

On my current quesry, this had a dramatic effect on the most expensive predicates:

Before
```
Most expensive predicates for completed query FindUses.ql:
        time  | evals |   max @ iter | predicate
        ------|-------|--------------|----------
         1m9s |  2933 | 123ms @ 422  | PointsTo::Expressions::equalityEvaluatesTo/4#ebe72212@cab7d3xr
        43.1s |       |              | FlowSummaryImpl::Private::Steps::summaryLocalStep/3#900fb25e#ffb@8aa78a38
        41.3s |  2936 |  2.1s @ 409  | PointsTo::InterProceduralPointsTo::scope_entry_value_transfer_from_earlier/4#acb2199d@cab7ddxr
        30.2s |  2946 |  67ms @ 847  | PointsTo::PointsToInternal::multi_assignment_points_to/4#28782e93@cab7d0yr
        29.7s |  2930 |  1.9s @ 30   | Extensions::ReModulePointToExtension.pointsTo_helper/1#a84effde@cab7dn4w
        24.9s |  2933 |  84ms @ 414  | PointsTo::Expressions::inequalityEvaluatesTo/4#f0ecfab4@cab7d2xr
        17.9s |  2582 | 306ms @ 31   | MRO::ClassListList.getItem/1#b6c27115#reorder_2_0_1@cab7dw6r
         9.4s |   661 | 991ms @ 1    | SsaCompute::AdjacentUses::varBlockReaches/3#1824ad86@2b6af692
         9.2s |  2738 |  26ms @ 664  | MRO::ClassList.containsSpecial/0#c967dabb#fb@cab7dg4w
         8.9s |  2946 |  12ms @ 917  | PointsTo::Types::getBase/2#0ab04984@cab7du1w
         7.4s |  2946 | 287ms @ 3    | PointsTo::PointsToInternal::points_to_candidate/4#0a587a42@cab7d80w
         7.1s |  2934 |  14ms @ 2    | Constants::ConstantObjectInternal.attribute/3#6d9e12fc@cab7d6zr
         6.8s |  2946 |   9ms @ 48   | PointsTo::InterProceduralPointsTo::callsite_points_to/4#72419c70@cab7dqxr
         6.6s |   234 | 341ms @ 17   | ApiGraphs::API::Impl::rhs/3#2255afc6@a41b31w3
         6.6s |  2946 |  86ms @ 5    | PointsTo::Types::six_add_metaclass/4#f926a4cb@cab7da0w
         6.2s |  2930 | 341ms @ 30   | Extensions::RangeIterationVariableFact.pointsTo/3#662720c9#cpe#124@cab7di2w
         5.9s |   287 |  61ms @ 4    | DataFlowDispatch::TrackAttrReadInput::start/2#67f26627@cc7b56yn
         5.8s |       |              | DataFlowImplCommon::LambdaFlow::viableParamNonLambda/3#3123cc52_201#join_rhs@415f35h0
         5.6s |       |              | FlowSummaryImpl::Private::Steps::viableParam/4#49c13ab8@2c1fcdq1
         5.3s |       |              | FlowSummaryImpl::Private::Steps::viableParam/4#49c13ab8@22590ca9
         5.2s |   233 | 276ms @ 21   | ApiGraphs::API::Impl::use/3#e6c88b66@a41b30w3
         5.1s |  2945 | 177ms @ 4    | PointsTo::PointsToInternal::pointsTo/4#d99f16c6@cab7dj0w
         4.7s |       |              | Flow::ControlFlowNode.toString/0#dispred#e1af144b@410c23a7
         4.6s |   277 |  2.2s @ 6    | DataFlowDispatch::getCallArg/5#21589076@cc7b5vxn
         4.5s |       |              | DataFlowImplCommon::Cached::viableParam/3#61239ead@cc05a1fv
         4.3s |       |              | DataFlowImplCommon::LambdaFlow::viableParamNonLambda/3#3123cc52@cb992b2h
         4.1s |       |              | _AstExtended::AstNode.getLocation/0#dispred#6b4dcb62_10#join_rhs_DataFlowPublic::Node.getLocation/0#__#shared@6ae639js
           4s |       |              | Files::Location.toString/0#dispred#7e7e0516@b72abbo2
         3.7s |       |              | locations_ast_234501#join_rhs@0859685o
         3.7s |    10 |  1.7s @ 1    | ObjectInternal::ObjectInternal.toString/0#dispred#0b2e9429@6e8a4yh7
         3.6s |  2942 |  63ms @ 94   | PointsTo::InterProceduralPointsTo::call_points_to_from_callee/4#394022a8@cab7d90w
         3.6s |   232 | 213ms @ 18   | ApiGraphs::API::Impl::trackDefNode/2#8e3c4e6d@a41b33w3
         3.6s |  2933 |   7ms @ 884  | PointsTo::Types::getInheritedMetaclass/2#097d39df#bff@cab7dr1w
         3.6s |  2946 |  1.3s @ 13   | PointsTo::PointsToInternal::ssa_node_refinement_points_to/4#8ea6486b@cab7dnxr
         3.5s |  1319 | 387ms @ 3    | SsaCompute::SsaDefinitions::reachesEndOfBlock/4#214bd902@fce54web
         3.5s |  1320 | 385ms @ 2    | SsaCompute::SsaDefinitions::reachesEndOfBlockRec/4#63bb2cd4@fce54xeb
         3.4s |  4861 | 478ms @ 2    | SsaCompute::SsaComputeImpl::ssaDefReachesRank/4#f19c6fee@cc8515rd
         3.3s |       |              | _AstExtended::AstNode.getLocation/0#dispred#6b4dcb62_10#join_rhs_DataFlowPublic::Node.getLocation/0#__#higher_order_body@47ba63n6
         3.3s |       |              | DataFlowPublic::Node.toString/0#dispred#af9c307a@4d16e7m6
         3.3s |  2946 |  28ms @ 3    | PointsTo::PointsToInternal::reachableEdge/3#d3f53c12@cab7do7w
         2.9s |   233 | 110ms @ 19   | ApiGraphs::API::Impl::trackUseNode/2#a0b4384d@a41b32w3
         2.8s |    31 |  2.2s @ 9    | _Class::Class.getAMethod/0#dispred#66416e47_DataFlowDispatch::findFunctionAccordingToMroKnownStartin__#antijoin_rhs@L6#cc7b5
         2.8s |  2737 |  21ms @ 444  | MRO::ClassListList.removedClassParts/4#de59b06f#reorder_2_3_4_0_1@cab7d06w
         2.8s |  1322 | 462ms @ 4    | SsaCompute::Liveness::liveAtExit/2#b6aa63f4@6fd4cx73
         2.8s |  2946 | 187ms @ 5    | PointsTo::Expressions::builtinCallPointsTo/5#3aa7f48b@cab7dwwr
         2.8s |  2939 |  41ms @ 7    | PointsTo::PointsToInternal::use_points_to/4#ff1d0edd@cab7df0w
         2.7s |  2946 |  20ms @ 92   | PointsTo::Conditionals::evaluates/5#736734b2#fbffff#reorder_5_0_2_1_3_4@cab7dp5w
         2.6s |  2946 | 152ms @ 5    | Constants::callToBool/2#0b9b1e8d@cab7dn7w
         2.5s |   287 |  24ms @ 4    | DataFlowDispatch::resolveClassInstanceCall/3#6e09c292@cc7b53xn
         2.4s |  2946 |  31ms @ 5    | PointsTo::AttributePointsTo::variableAttributePointsTo/5#60adcc49@cab7dpwr

[2024-02-08 10:44:37] Total evaluation times for this run:
        * Wall-clock duration of evaluation run: 1231.1 seconds
        * Total time spent evaluating predicates: 1167.1 seconds
```

After
```
Most expensive predicates for completed query FindUses.ql:
        time  | evals |   max @ iter | predicate
        ------|-------|--------------|----------
        41.6s |       |              | FlowSummaryImpl::Private::Steps::summaryLocalStep/3#900fb25e#ffb@85aaaac1
         9.2s |   661 | 905ms @ 1    | SsaCompute::AdjacentUses::varBlockReaches/3#1824ad86@2b6af692
         7.6s |   234 | 502ms @ 19   | ApiGraphs::API::Impl::rhs/3#2255afc6@ce6d11wc
         6.7s |       |              | DataFlowImplCommon::LambdaFlow::viableParamNonLambda/3#3123cc52_201#join_rhs@fd1dc5mi
           6s |   287 |  80ms @ 113  | DataFlowDispatch::TrackAttrReadInput::start/2#67f26627@925826yr
         5.7s |       |              | FlowSummaryImpl::Private::Steps::viableParam/4#49c13ab8@851052bl
         5.6s |   233 | 289ms @ 21   | ApiGraphs::API::Impl::use/3#e6c88b66@ce6d10wc
         5.4s |       |              | FlowSummaryImpl::Private::Steps::viableParam/4#49c13ab8@f2c42d17
         4.8s |   277 |  2.4s @ 6    | DataFlowDispatch::getCallArg/5#21589076@92582vxr
         4.7s |       |              | DataFlowImplCommon::Cached::viableParam/3#61239ead@ac08e0nf
         4.7s |       |              | DataFlowImplCommon::LambdaFlow::viableParamNonLambda/3#3123cc52@82ff50ql
         4.6s |       |              | Files::Location.toString/0#dispred#7e7e0516@b72abbo2
         4.3s |       |              | Flow::ControlFlowNode.toString/0#dispred#e1af144b@410c23a7
         4.2s |   232 | 249ms @ 19   | ApiGraphs::API::Impl::trackDefNode/2#8e3c4e6d@ce6d13wc
         3.8s |       |              | _AstExtended::AstNode.getLocation/0#dispred#6b4dcb62_10#join_rhs_DataFlowPublic::Node.getLocation/0#__#shared@0ac73425
         3.6s |  1319 | 354ms @ 1    | SsaCompute::SsaDefinitions::reachesEndOfBlock/4#214bd902@fce54web
         3.6s |  1320 | 381ms @ 2    | SsaCompute::SsaDefinitions::reachesEndOfBlockRec/4#63bb2cd4@fce54xeb
         3.4s |       |              | _AstExtended::AstNode.getLocation/0#dispred#6b4dcb62_10#join_rhs_DataFlowPublic::Node.getLocation/0#__#higher_order_body@9e946ea8
         3.4s |  4861 | 474ms @ 2    | SsaCompute::SsaComputeImpl::ssaDefReachesRank/4#f19c6fee@cc8515rd
         3.1s |    31 |  2.5s @ 9    | _Class::Class.getAMethod/0#dispred#66416e47_DataFlowDispatch::findFunctionAccordingToMroKnownStartin__#antijoin_rhs@L6#92582
           3s |    53 | 114ms @ 48   | DataFlowDispatch::TrackAttrReadInput::start/2#67f26627@9ab38jw0
           3s |   233 | 126ms @ 20   | ApiGraphs::API::Impl::trackUseNode/2#a0b4384d@ce6d12wc
           3s |       |              | locations_ast_234501#join_rhs@0859685o
           3s |       |              | DataFlowPublic::Node.toString/0#dispred#af9c307a@a2145cqf
         2.8s |   234 | 206ms @ 21   | _ApiGraphs::API::Impl::MkDef#51c2f877#prev_ApiGraphs::API::Impl::trackDefNode/1#7e78e336#prev_delta___#antijoin_rhs#1@L9#ce6d1
         2.8s |  1322 | 447ms @ 4    | SsaCompute::Liveness::liveAtExit/2#b6aa63f4@6fd4cx73
         2.7s |   230 | 176ms @ 28   | ApiGraphs::API::Impl::MkDef#51c2f877@ce6d1w9c
         2.5s |   287 |  50ms @ 112  | DataFlowDispatch::resolveClassInstanceCall/3#6e09c292@925823xr
         2.4s |   234 | 246ms @ 19   | _ApiGraphs::API::Impl::MkDef#51c2f877#prev_ApiGraphs::API::Impl::trackDefNode/1#7e78e336#prev_delta___#antijoin_rhs@L4#ce6d1
         2.3s |       |              | TaintTrackingPrivate::localAdditionalTaintStep/2#a2ec8c9d@e31201hd
         2.2s |    53 |  72ms @ 15   | DataFlowDispatch::TrackAttrReadInput::start/2#67f26627@96b28jwo
         2.2s |       |              | SensitiveDataSources::SensitiveDataModeling::sensitiveString/1#fdc3ad40@41f6ee2g
           2s |       |              | DataFlowImplCommon::Cached::viableParamArg/3#4c55eddb@8f7f25oq
           2s |       |              | Flow::ControlFlowNode.getExprChild/1#e757d179#bbf@db51e8ed
         1.9s |       |              | project#FlowSummaryImpl::Private::Steps::viableParam/4#49c13ab8#2@e36c2dr8
         1.9s |       |              | DataFlowPublic::Node.hasLocationInfo/5#dispred#b79d995f@6e929dfv
         1.7s |    15 | 433ms @ 1    | PoorMansFunctionResolution::poorMansFunctionTracker/2#75430e01@e5202dnv
         1.7s |       |              | #ImportResolution::ImportResolution::allowedEssaImportStep/2#f4117c61Plus#swapped@60d9daea
         1.7s |    29 | 633ms @ 6    | _Class::Class.getAMethod/0#dispred#66416e47_Function::Function.getName/0#dispred#033700ef_10#join_rh__#antijoin_rhs@L4#92582
         1.5s |   233 |  79ms @ 24   | ApiGraphs::API::Impl::trackUseNode/1#1af3a9ea@ce6d16wc
         1.5s |       |              | ApiGraphs::API::Impl::edge/3#8453bf65@1bd8a6ja
         1.5s |       |              | ApiGraphs::API::Node.getAValueReachableFromSource/0#dispred#9a406fb1@5dbb806u
         1.3s |  1323 | 178ms @ 13   | SsaCompute::Liveness::liveAtEntry/2#bab3ea7c@6fd4cw73
         1.3s |       |              | SsaCompute::SsaComputeImpl::defUseRank/4#782a2f48@0f27919s
         1.3s |       |              | DataFlowDispatch::LibraryCallable.getACall/0#dispred#66a01171#fb@96b65frd
         1.3s |       |              | ApiGraphs::API::Node.getAValueReachableFromSource/0#dispred#9a406fb1_10#join_rhs@c1dd43nv
         1.3s |       |              | FlowSummaryImpl::Private::SummaryNode.toString/0#dispred#d499e234@63bd684g
         1.2s |       |              | DataFlowDispatch::LibraryCallable.getACall/0#dispred#66a01171#fb@eaebb27g
         1.2s |       |              | _DataFlowPublic::Node#da3b6093_DataFlowPublic::Node.asExpr/0#dispred#2845197a_py_exprs#antijoin_rhs@fcd8c3kj
         1.2s |       |              | #ImportResolution::ImportResolution::allowedEssaImportStep/2#f4117c61Plus#swapped@c3f634us

[2024-02-08 11:43:50] Total evaluation times for this run:
        * Wall-clock duration of evaluation run: 636.9 seconds
        * Total time spent evaluating predicates: 562.4 seconds
```
2024-02-08 12:20:56 +01:00
Robert Marsh
174966164d Merge branch 'main' into rdmarsh2/cpp/ir-synthetic-destructors 2024-02-07 18:25:12 +00:00
Geoffrey White
a354ab84e9 C++: More robust InterpretNode.asCall. 2024-02-07 18:00:57 +00:00
Geoffrey White
e98485df7f Update cpp/ql/lib/semmle/code/cpp/dataflow/internal/FlowSummaryImpl.qll
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2024-02-07 17:53:22 +00:00
Paolo Tranquilli
b105d0cf9a Bazel/CMake: be more lenient with aquery
It turns out `bazel aquery` is not so well behaved on Windows, so we
need to accept that it reports errors and exits with an error.
2024-02-07 16:25:54 +01:00
Paolo Tranquilli
9cfef6e42f Bazel/CMake: auto detect all cc_binary/cc_test targets 2024-02-07 11:11:30 +01:00
Robert Marsh
5653c3f972 C++: Update IR test expectations for named destructors 2024-02-06 21:04:52 +00:00
Geoffrey White
f6b412e1c9 C++: Use hasQualifiedName. 2024-02-06 17:48:42 +00:00
Geoffrey White
d1e040e27c C++: Bug fix for subclasses. 2024-02-06 17:45:14 +00:00
Geoffrey White
a9b2876b71 C++: Delete commented out code. 2024-02-06 17:34:15 +00:00
Geoffrey White
66d8943c08 C++: Minor bug fix. 2024-02-06 17:20:14 +00:00
Geoffrey White
25200b47ea C++: Implement the namespace field. 2024-02-06 16:35:48 +00:00
Geoffrey White
a5527903e9 C++: Fix some mistakes in the MAD definitions for the tests. 2024-02-06 16:34:07 +00:00
Robert Marsh
40e06b7877 C++: suppress destructor calls on delete in IR generation
This avoids an issue with duplicated qualifiers that was causing broken control flow
2024-02-06 14:55:00 +00:00
Geoffrey White
7514037464 C++: Add test cases for MAD sources, sinks and summaries in namespaces. 2024-02-06 12:12:28 +00:00
Robert Marsh
8013c2a074 C++: QLDoc and naming updates for implicit destructors in IR 2024-02-05 19:14:56 +00:00
Robert Marsh
bbabf1dfcc C++: add test for constructors in C++17 decl-in-if 2024-02-05 18:41:18 +00:00
Robert Marsh
2d010f69c6 C++: Test for destructors in declaration as if condition 2024-02-02 17:39:27 +00:00
Robert Marsh
984c7ab85a C++: test for declarations in if statement 2024-02-02 17:39:26 +00:00
Robert Marsh
4513fd1b52 C++: test for destructors in range-based for 2024-02-02 17:39:26 +00:00
Robert Marsh
820f4a5571 C++: custom destructor handling for for loops 2024-02-02 17:39:23 +00:00
Robert Marsh
85d1d079c8 C++: Add implicit named destructosrs to the IR CFG 2024-02-02 17:36:02 +00:00
Robert Marsh
3a404cec67 C++: Add getLastInstruction to IR generation 2024-02-02 17:10:47 +00:00
Robert Marsh
47720e0998 C++: generate instructions for destructor calls in IR 2024-02-02 17:05:40 +00:00
Rasmus Lerchedahl Petersen
3b1751dc8a Update supported versions 2024-02-02 11:45:21 +01:00
Rasmus Lerchedahl Petersen
f433039a25 Add change note 2024-02-02 11:23:35 +01:00
Rasmus Lerchedahl Petersen
f275531542 Add support for TS 5.4-beta 2024-02-02 11:03:44 +01:00
Geoffrey White
649af822fd C++: Fix the issue with missing return kinds when function bodies are not in the database. 2024-02-01 17:04:20 +00:00
Geoffrey White
5caa49aeab C++: Remove unused case for now, and add QLDoc. 2024-02-01 15:51:50 +00:00
Mathias Vorreiter Pedersen
2bea0adb92 C++: Solve non-monotonic issue by unfolding dataflow-related predicates until we get to the SSA implementations of them. 2024-02-01 13:14:02 +00:00
Geoffrey White
cfc1a3db22 C++: Document Node0Impl, remove a debug change. 2024-02-01 13:13:50 +00:00
Geoffrey White
e0d70e3008 C++: Resolve the TODO / unwanted change in shared code and get more results. 2024-01-24 18:09:34 +00:00
Geoffrey White
a727255a82 C++: Add a couple more test cases and correct test models again. 2024-01-24 15:18:49 +00:00
Geoffrey White
c10f41b168 C++: Use getClassAndName. 2024-01-23 15:02:59 +00:00
Geoffrey White
4c1f433073 C++: Move getIndirectionIndex to ReturnKind. 2024-01-23 14:52:44 +00:00
Geoffrey White
963e0a730d C++: Fix some off-by-one mistakes in the test. 2024-01-18 17:38:32 +00:00
Geoffrey White
42571069bf C++: Autoformat. 2024-01-18 16:01:06 +00:00
Geoffrey White
017369c6f2 C++: Remove redundant import (identified by QL-for-QL). 2024-01-18 15:59:32 +00:00
Geoffrey White
cc2b61186e C++: Document TReturnKind, NormalReturnKind and IndirectReturnKind better. 2024-01-18 13:24:57 +00:00
Geoffrey White
dd27ef7d3c C++: Add MAD source definitions for the new taint sources and update the (real) test. 2024-01-18 13:24:57 +00:00
Geoffrey White
833165f86c C++: Update the (synthetic) test. 2024-01-18 13:24:57 +00:00
Geoffrey White
c85262cfd0 C++: Add the shared MAD pack to CPP. 2024-01-18 13:24:57 +00:00
Geoffrey White
a8863e44db C++: Port implementation to CPP. 2024-01-18 13:24:57 +00:00
Geoffrey White
3aacc5ffde C++: Copy FlowSummaryImpl.qll from Swift. 2024-01-18 13:01:16 +00:00
Geoffrey White
fbf9545338 C++: Copy ExternalFlow.qll from Swift. 2024-01-18 13:01:16 +00:00
Geoffrey White
303882350b C++: Add some test cases for new (real) taint sources to be defined using models-as-data. 2024-01-18 13:01:16 +00:00
Geoffrey White
9611e4ce19 C++: Add tests for (synthetic) models-as-data sources and sinks. 2024-01-18 13:01:16 +00:00
Rasmus Wriedt Larsen
f20d4e22fe Handle only exclude 2024-01-18 13:54:45 +01:00
Rasmus Wriedt Larsen
54c7c5e8be Tree sitter extractor: Proper handling of LGTM_INDEX_FILTERS
If someone had used `LGTM_INDEX_FILTERS=exclude:**/*\ninclude:*.rb`
before, we would have mistakenly excluded all files :|
(LGTM_INDEX_FILTERS is a prioritized list where later matches take
priority over earlier ones)

This change is needed to support adding `exclude:**/*` as the first
filter if `paths` include a glob, which currently causes bad behavior in
the Python extractor. However, we can first introduce that change once
this PR has been merged.

I realize this change can cause more folders and files to be traversed
(since they are not just skipped with --exclude). We plan to make a
better long term fix which should bring back the previous performance.
2024-01-18 11:44:31 +01:00
Chad Bentz
b12f4d97f8 Merge branch 'main' into patch-1 2024-01-17 09:25:28 -05:00
amammad
a47c702171 change TN to GOOD instead of using hasValueFlow 2024-01-15 22:08:35 +04:00
amammad
65ac94320e fix Typo in tests 2024-01-15 01:14:54 +04:00
amammad
073f65d586 Merge branch 'amammad-go-bombs' of https://github.com/amammad/codeql into amammad-go-bombs 2024-01-15 01:12:40 +04:00
amammad
3c79faf37a minor change for resolving rebase conflicts 2024-01-15 01:06:36 +04:00
amammad
2fe10942da minor change for resolving rebase conflicts 2024-01-15 01:02:55 +04:00
amammad
3fcb0ee228 move MultipartAndFormRemoteSource to DecompressionBombs.qll 2024-01-15 01:01:51 +04:00
amammad
b2edf6cf3e add Inline Expectations Test, update tests accordingly 2024-01-15 00:27:06 +04:00
amammad
a1c384c57b change Decompression bombs Query structure 2024-01-15 00:22:55 +04:00
amammad
0efb00724d Add hasFlowToComparison to all sinks as a sanitizer 2024-01-15 00:05:11 +04:00
Malayke
22cb9ed063 Merge branch 'main' into main 2023-12-18 22:07:45 +08:00
amammad
79edc5c261 add sanitizer to all Read methods, add Inline tests, improve tests 2023-12-18 12:34:56 +01:00
Malayke
c90fcd19cc Merge branch 'main' into main 2023-12-18 18:38:20 +08:00
Malayke
8d8126f849 Merge branch 'github:main' into main 2023-12-18 17:52:28 +08:00
amammad
a72bd7efcc add GOOD and BAD comment to sinks, some chore improvements on tests 2023-12-17 20:07:16 +01:00
amammad
87b1028aab fix pgzip missed sink, apply isBarrier directly to CopyN sink, add new flow state for pgzip 2023-12-17 19:55:50 +01:00
Malayke
ac465b9234 Merge branch 'github:main' into main 2023-12-16 18:02:14 +08:00
Yunus AYDIN
8a7c3c19fe Merge branch 'main' into main 2023-12-15 09:05:50 +03:00
Yunus AYDIN
ec5a8b49c8 add httprouter example code and stub.go 2023-12-15 00:54:39 +03:00
Chad Bentz
ee3085e15e Update generate-code-scanning-query-list.py 2023-12-14 14:09:14 -05:00
Yunus AYDIN
ac3cb7f6c4 update camelcase 2023-12-14 15:29:28 +03:00
Yunus AYDIN
a17c704f46 update expected file 2023-12-14 15:27:27 +03:00
Yunus AYDIN
d899267acb add httprouter example code 2023-12-14 00:23:09 +03:00
Yunus AYDIN
5f6de79c09 Fix select query, Add httprouter library and update test files 2023-12-14 00:19:11 +03:00
Yunus AYDIN
a09505afc2 Update rules 2023-12-13 20:01:53 +03:00
Yunus AYDIN
5148054612 Update go/ql/src/experimental/CWE-525/WebCacheDeceptionLib.qll
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2023-12-13 19:36:07 +03:00
Yunus AYDIN
221e281f73 Update go/ql/src/experimental/CWE-525/WebCacheDeception.ql
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2023-12-13 19:35:59 +03:00
Yunus AYDIN
0ea27c6e9b Update go/ql/src/experimental/CWE-525/WebCacheDeception.ql
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2023-12-13 19:35:53 +03:00
Yunus AYDIN
da275b374f Update go/ql/src/experimental/CWE-525/WebCacheDeception.ql
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2023-12-13 19:35:36 +03:00
Yunus AYDIN
a47ffc6833 Remove unnecessary rules 2023-12-13 01:52:06 +03:00
Yunus AYDIN
bb2083d10a Remove database directory and add WebCacheDeceptionLib.qll 2023-12-13 01:50:56 +03:00
Yunus AYDIN
bc81201c2e Update expected file 2023-12-12 00:07:51 +03:00
Malayke
7121282b27 add new query for detect DOS 2023-12-11 23:05:04 +08:00
amammad
572777f11b fix a bug in stubs 2023-12-10 22:18:49 +01:00
Yunus AYDIN
cf8f2a38c3 Update expected file 2023-12-11 00:03:50 +03:00
Yunus AYDIN
a6b092d8c1 Update rules ids 2023-12-10 22:26:05 +03:00
Yunus AYDIN
4d97c42ee5 Remove debugging select on go-chi.ql 2023-12-10 22:18:48 +03:00
Yunus AYDIN
501f617eaa Update qhelp and and go-chi 2023-12-10 22:07:17 +03:00
Yunus AYDIN
34fb1c4a9f Add go-chi middleware stub to vendor 2023-12-10 22:06:23 +03:00
Am
59195cccdd Merge branch 'main' into amammad-go-bombs 2023-12-10 18:12:10 +01:00
amammad
bb5017121f Merge branch 'main' into amammad-go-bombs 2023-12-10 18:11:49 +01:00
amammad
737f3e8899 fix stubs 2023-12-10 18:10:23 +01:00
Yunus AYDIN
0813199c7f Update vendor directory and go files 2023-12-10 01:24:29 +03:00
Yunus AYDIN
a925c23d14 Add go.mod and modules.txt 2023-12-09 23:36:50 +03:00
Yunus AYDIN
6bd3c8c07b Format Document 2023-12-09 23:36:13 +03:00
Yunus AYDIN
6378c5e22f Update Fiber Rule for checking files 2023-12-09 23:35:42 +03:00
Yunus AYDIN
63123f3984 Add GoChi Rule 2023-12-09 23:34:48 +03:00
Yunus AYDIN
ba4f8612eb Add GoChi Test Cases 2023-12-09 23:33:18 +03:00
Yunus AYDIN
ad1284853b remove unnecessary file 2023-12-09 19:49:21 +03:00
Yunus AYDIN
eb25d0df66 Add test cases 2023-12-09 19:44:58 +03:00
Yunus AYDIN
85636ccab7 Add Web Cache Deception QHelp and Example Code Snippet for Vulnerable Go Fiber usage 2023-12-09 19:12:20 +03:00
amammad
2cb0afee73 fix some qldocs and some spells 2023-12-08 11:12:57 +01:00
amammad
1aa4494dbc stash 2023-11-24 10:09:21 +01:00
amammad
fabde6e0ff fix tests and remove tarfile tar.Reader as sink 2023-11-21 20:54:38 +01:00
amammad
75e01d3648 Thanks to @owen-mc that provided a good solution of that I couldn't solve that myself 2023-11-21 20:15:27 +01:00
amammad
b8c800608e add an extended Class of string for FlowState 2023-11-06 11:01:01 +01:00
amammad
7af4b8de7b fix isBarrier according to code review 2023-11-06 10:58:00 +01:00
amammad
e421c49440 fix multipart mistake :( 2023-11-06 10:53:52 +01:00
amammad
bd1ee9b937 fix tests 2023-11-02 21:26:05 +01:00
amammad
1fc18bee5d Merge branch 'main' into amammad-go-bombs 2023-11-02 23:33:27 +03:30
amammad
a1a49bdddf Merge branch 'main' into amammad-go-bombs 2023-11-02 21:01:13 +01:00
amammad
761aede2df perfomed review suggestions, make Decompression Sink simpler, uncomment the isBarrier, fix some naming issues in tests 2023-11-02 21:01:05 +01:00
Chad Bentz
53e96e5adf Merge branch 'main' into patch-1 2023-10-25 10:00:16 -04:00
amammad
ac5e9c75e1 fix a mistake: remove vendor dir from go root directory 2023-10-12 08:06:45 +02:00
amammad
7d60f03131 fix tests 2023-10-11 18:04:35 +02:00
amammad
8e5be13466 fix conflict 2023-10-11 18:02:55 +02:00
amammad
46616d6b42 fix a qldoc isuse 2023-10-11 14:53:08 +02:00
amammad
c630300374 fix a tests 2023-10-11 13:18:55 +02:00
amammad
d63b33bb08 fix a tests 2023-10-11 13:16:30 +02:00
amammad
14d1e08051 reformat 2023-10-10 22:34:26 +02:00
Marcono1234
b8f6877aba Merge branch 'main' into patch-1 2023-10-07 03:46:12 +02:00
amammad
13577f71d6 fix tests, add more comments 2023-10-06 22:34:31 +02:00
amammad
21f477a674 revert go/vendor/ :( 2023-10-06 19:39:18 +02:00
amammad
d4b2ca5cee add vendor for tests, update test results, revert go/vendor/modules.txt :( 2023-10-06 19:34:13 +02:00
amammad
31cae204f6 make DecompressionBombs module and extention points 2023-10-06 18:14:05 +02:00
amammad
00d1b11b0b chore fix document example 2023-10-01 02:45:51 +10:00
amammad
d99c0a2382 update tests 2023-10-01 02:25:38 +10:00
amammad
9245e1c2a4 remove CLI sources Library file & qldoc warnings 2023-10-01 00:37:56 +10:00
amammad
2961b79fb9 add multipart sources 2023-09-30 03:09:02 +10:00
amammad
2e7529cc70 remove local sources 2023-09-30 02:41:47 +10:00
amammad
e1d5c9d45b fix grammar mistake 2023-09-15 06:32:23 +10:00
amammad
5a3a8d781a fix some flowstate bug which Had caused to FP 2023-09-15 02:09:40 +10:00
amammad
08f78a2df4 fix some flowstate bug which Had caused to FP 2023-09-15 01:56:46 +10:00
amammad
0f540f4c25 add sources to detect CVE completely 2023-09-07 18:25:48 +10:00
amammad
f6f99fb459 remove parameter as source 2023-09-07 17:47:55 +10:00
amammad
c76d0d364d fix a mistake ioutil => io/ioutil 2023-09-06 03:38:06 +10:00
Chad Bentz
6f60eb9e1a Merge branch 'main' into patch-1 2023-08-09 14:31:26 -04:00
amammad
f79bd2a071 added remote flow sources related to multipart upload, added flag package command line source 2023-08-06 06:49:35 +10:00
Chad Bentz
845f384df6 Merge branch 'main' into patch-1 2023-08-04 17:57:53 -04:00
amammad
7ce825c5ea convert to module based dataflow 2023-07-31 22:43:45 +10:00
amammad
ab7e797fff it seems that I must use both isSink and isSource with flow states! 2023-07-31 20:00:59 +10:00
amammad
26f1091d5f fix a mistake :( 2023-07-31 19:48:21 +10:00
amammad
56d0254d2b fix ReadAll argumrnt number 2023-07-31 19:37:28 +10:00
amammad
4ee54738fa fix a mistake :( 2023-07-31 19:36:21 +10:00
amammad
260c111932 put comment about detecting https://github.com/advisories/GHSA-jpxj-2jvg-6jv9 2023-07-31 19:32:22 +10:00
amammad
1b598c8683 v1.2 make better sinks 2023-07-31 19:26:18 +10:00
amammad
f1918fb4e0 v1.1 2023-07-31 05:11:09 +10:00
Marcono1234
09fa2a7d50 Move imports to usage sections 2023-07-15 16:59:46 +02:00
Marcono1234
94e9848d61 Mention needed imports at top of "Analyzing data flow in Java"
Currently the guide just starts using the classes from these libraries
without having mentioned that you have to import the libraries first.
2023-07-08 18:56:37 +02:00
amammad
fbfc959f82 V1 Bombs 2023-06-25 01:21:09 +10:00
Chad Bentz
39c52c9ecf add security-severity to code scanning query list 2023-03-16 11:27:23 -04:00
5395 changed files with 384827 additions and 425917 deletions

View File

@@ -1,4 +1,12 @@
common --enable_platform_specific_config
common --enable_bzlmod
# because we use --override_module with `%workspace%`, the lock file is not stable
common --lockfile_mode=off
# when building from this repository in isolation, the internal repository will not be found at ..
# where `MODULE.bazel` looks for it. The following will get us past the module loading phase, so
# that we can build things that do not rely on that
common --override_module=semmle_code=%workspace%/misc/bazel/semmle_code_stub
build --repo_env=CC=clang --repo_env=CXX=clang++
@@ -6,4 +14,11 @@ build:linux --cxxopt=-std=c++20
build:macos --cxxopt=-std=c++20 --cpu=darwin_x86_64
build:windows --cxxopt=/std:c++20 --cxxopt=/Zc:preprocessor
# this requires developer mode, but is required to have pack installer functioning
startup --windows_enable_symlinks
common --enable_runfiles
common --registry=file:///%workspace%/misc/bazel/registry
common --registry=https://bcr.bazel.build
try-import %workspace%/local.bazelrc

4
.bazelrc.internal Normal file
View File

@@ -0,0 +1,4 @@
# this file should contain bazel settings required to build things from `semmle-code`
common --registry=file:///%workspace%/ql/misc/bazel/registry
common --registry=https://bcr.bazel.build

View File

@@ -1 +1 @@
6.3.1
7.1.0

9
.gitattributes vendored
View File

@@ -67,10 +67,9 @@ go/extractor/opencsv/CSVReader.java -text
# for those testing dbscheme files.
*/ql/lib/upgrades/initial/*.dbscheme -text
# Generated test files - these are synced from the standard JavaScript libraries using
# `javascript/ql/experimental/adaptivethreatmodeling/test/update_endpoint_test_files.py`.
javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/autogenerated/**/*.js linguist-generated=true -merge
javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/autogenerated/**/*.ts linguist-generated=true -merge
# Auto-generated modeling for Python
python/ql/lib/semmle/python/frameworks/data/internal/subclass-capture/*.yml linguist-generated=true
# auto-generated bazel lock file
ruby/extractor/cargo-bazel-lock.json linguist-generated=true
ruby/extractor/cargo-bazel-lock.json -merge

7
.github/labeler.yml vendored
View File

@@ -15,12 +15,12 @@ Java:
- change-notes/**/*java.*
JS:
- any: [ 'javascript/**/*', '!javascript/ql/experimental/adaptivethreatmodeling/**/*' ]
- any: [ 'javascript/**/*' ]
- change-notes/**/*javascript*
Kotlin:
- java/kotlin-extractor/**/*
- java/ql/test/kotlin/**/*
- java/ql/test-kotlin*/**/*
Python:
- python/**/*
@@ -46,6 +46,3 @@ documentation:
# Since these are all shared files that need to be synced, just pick _one_ copy of each.
"DataFlow Library":
- "shared/dataflow/**/*"
"ATM":
- javascript/ql/experimental/adaptivethreatmodeling/**/*

28
.github/workflows/buildifier.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: Check bazel formatting
on:
pull_request:
paths:
- "**.bazel"
- "**.bzl"
branches:
- main
- "rc/*"
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check bazel formatting
uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507
with:
extra_args: >
buildifier --all-files 2>&1 ||
(
echo -e "In order to format all bazel files, please run:\n bazel run //misc/bazel:buildifier"; exit 1
)

View File

@@ -28,7 +28,7 @@ jobs:
with:
key: all-queries
- name: check formatting
run: find */ql -type f \( -name "*.qll" -o -name "*.ql" \) -print0 | xargs -0 -n 3000 -P 10 codeql query format -q --check-only
run: find shared */ql -type f \( -name "*.qll" -o -name "*.ql" \) -print0 | xargs -0 -n 3000 -P 10 codeql query format -q --check-only
- name: compile queries - check-only
# run with --check-only if running in a PR (github.sha != main)
if : ${{ github.event_name == 'pull_request' }}

View File

@@ -0,0 +1,55 @@
name: "Code scanning - C++"
on:
push:
branches:
- main
- 'rc/*'
pull_request:
branches:
- main
- 'rc/*'
paths:
- 'swift/**'
- '.github/codeql/**'
- '.github/workflows/cpp-swift-analysis.yml'
schedule:
- cron: '0 9 * * 1'
jobs:
CodeQL-Build:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
pull-requests: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@main
# Override language selection by uncommenting this and choosing your languages
with:
languages: cpp
config-file: ./.github/codeql/codeql-config.yml
- name: "[Ubuntu] Remove GCC 13 from runner image"
shell: bash
run: |
sudo rm -f /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-jammy.list
sudo apt-get update
sudo apt-get install -y --allow-downgrades libc6=2.35-* libc6-dev=2.35-* libstdc++6=12.3.0-* libgcc-s1=12.3.0-*
- name: "Build Swift extractor using Bazel"
run: |
bazel clean --expunge
bazel run //swift:create-extractor-pack --nouse_action_cache --noremote_accept_cached --noremote_upload_local_results --spawn_strategy=local --features=-layering_check
bazel shutdown
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@main

View File

@@ -7,8 +7,6 @@ on:
- .github/workflows/go-tests-other-os.yml
- .github/actions/**
- codeql-workspace.yml
env:
GO_VERSION: '~1.22.0'
permissions:
contents: read
@@ -18,72 +16,17 @@ jobs:
name: Test MacOS
runs-on: macos-latest
steps:
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Set up CodeQL CLI
uses: ./.github/actions/fetch-codeql
- name: Enable problem matchers in repository
shell: bash
run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;'
- name: Build
run: |
cd go
make
- name: Cache compilation cache
id: query-cache
uses: ./.github/actions/cache-query-compilation
with:
key: go-qltest
- name: Test
run: |
cd go
make test cache="${{ steps.query-cache.outputs.cache-dir }}"
- name: Run tests
uses: ./go/actions/test
test-win:
if: github.repository_owner == 'github'
name: Test Windows
runs-on: windows-latest-xl
steps:
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Set up CodeQL CLI
uses: ./.github/actions/fetch-codeql
- name: Enable problem matchers in repository
shell: bash
run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;'
- name: Build
run: |
cd go
make
- name: Cache compilation cache
id: query-cache
uses: ./.github/actions/cache-query-compilation
with:
key: go-qltest
- name: Test
run: |
cd go
make test cache="${{ steps.query-cache.outputs.cache-dir }}"
- name: Run tests
uses: ./go/actions/test

View File

@@ -16,9 +16,6 @@ on:
- .github/actions/**
- codeql-workspace.yml
env:
GO_VERSION: '~1.22.0'
permissions:
contents: read
@@ -28,51 +25,9 @@ jobs:
name: Test Linux (Ubuntu)
runs-on: ubuntu-latest-xl
steps:
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Set up CodeQL CLI
uses: ./.github/actions/fetch-codeql
- name: Enable problem matchers in repository
shell: bash
run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;'
- name: Build
run: |
cd go
make
- name: Check that all Go code is autoformatted
run: |
cd go
make check-formatting
- name: Compile qhelp files to markdown
run: |
cd go
env QHELP_OUT_DIR=qhelp-out make qhelp-to-markdown
- name: Upload qhelp markdown
uses: actions/upload-artifact@v3
- name: Run tests
uses: ./go/actions/test
with:
name: qhelp-markdown
path: go/qhelp-out/**/*.md
- name: Cache compilation cache
id: query-cache
uses: ./.github/actions/cache-query-compilation
with:
key: go-qltest
- name: Test
run: |
cd go
make test cache="${{ steps.query-cache.outputs.cache-dir }}"
run-code-checks: true

View File

@@ -51,9 +51,11 @@ jobs:
run: |
brew install gnu-tar
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
- name: Install cargo-cross
if: runner.os == 'Linux'
run: cargo install cross --version 0.2.5
- name: Prepare Windows
if: runner.os == 'Windows'
shell: powershell
run: |
git config --global core.longpaths true
- uses: ./.github/actions/os-version
id: os_version
- name: Cache entire extractor
@@ -82,16 +84,8 @@ jobs:
- name: Run tests
if: steps.cache-extractor.outputs.cache-hit != 'true'
run: cd extractor && cargo test --verbose
# On linux, build the extractor via cross in a centos7 container.
# This ensures we don't depend on glibc > 2.17.
- name: Release build (linux)
if: steps.cache-extractor.outputs.cache-hit != 'true' && runner.os == 'Linux'
run: |
cd extractor
cross build --release
mv target/x86_64-unknown-linux-gnu/release/codeql-extractor-ruby target/release/
- name: Release build (windows and macos)
if: steps.cache-extractor.outputs.cache-hit != 'true' && runner.os != 'Linux'
- name: Release build
if: steps.cache-extractor.outputs.cache-hit != 'true'
run: cd extractor && cargo build --release
- name: Generate dbscheme
if: ${{ matrix.os == 'ubuntu-latest' && steps.cache-extractor.outputs.cache-hit != 'true'}}
@@ -123,7 +117,7 @@ jobs:
- name: Cache compilation cache
id: query-cache
uses: ./.github/actions/cache-query-compilation
with:
with:
key: ruby-build
- name: Build Query Pack
run: |
@@ -235,54 +229,3 @@ jobs:
shell: bash
run: |
codeql database analyze --search-path "${{ runner.temp }}/ruby-bundle" --format=sarifv2.1.0 --output=out.sarif ../database ruby-code-scanning.qls
# This is a copy of the 'test' job that runs in a centos7 container.
# This tests that the extractor works correctly on systems with an old glibc.
test-centos7:
defaults:
run:
working-directory: ${{ github.workspace }}
strategy:
fail-fast: false
runs-on: ubuntu-latest
container:
image: centos:centos7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
needs: [package]
steps:
- name: Install gh cli
run: |
yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
# fetch-codeql requires unzip and jq
# jq is available in epel-release (https://docs.fedoraproject.org/en-US/epel/)
yum install -y gh unzip epel-release
yum install -y jq
- uses: actions/checkout@v3
- name: Fetch CodeQL
uses: ./.github/actions/fetch-codeql
# Due to a bug in Actions, we can't use runner.temp in the run blocks here.
# https://github.com/actions/runner/issues/2185
- name: Download Ruby bundle
uses: actions/download-artifact@v3
with:
name: codeql-ruby-bundle
path: ${{ runner.temp }}
- name: Unzip Ruby bundle
shell: bash
run: unzip -q -d "$RUNNER_TEMP"/ruby-bundle "$RUNNER_TEMP"/codeql-ruby-bundle.zip
- name: Run QL test
shell: bash
run: |
codeql test run --search-path "$RUNNER_TEMP"/ruby-bundle --additional-packs "$RUNNER_TEMP"/ruby-bundle ruby/ql/test/library-tests/ast/constants/
- name: Create database
shell: bash
run: |
codeql database create --search-path "$RUNNER_TEMP"/ruby-bundle --language ruby --source-root ruby/ql/test/library-tests/ast/constants/ ../database
- name: Analyze database
shell: bash
run: |
codeql database analyze --search-path "$RUNNER_TEMP"/ruby-bundle --format=sarifv2.1.0 --output=out.sarif ../database ruby-code-scanning.qls

View File

@@ -6,6 +6,7 @@ on:
- "swift/**"
- "misc/bazel/**"
- "misc/codegen/**"
- "shared/**"
- "*.bazel*"
- .github/workflows/swift.yml
- .github/actions/**
@@ -22,10 +23,12 @@ on:
- "swift/**"
- "misc/bazel/**"
- "misc/codegen/**"
- "shared/**"
- "*.bazel*"
- .github/workflows/swift.yml
- .github/actions/**
- codeql-workspace.yml
- .pre-commit-config.yaml
- "!**/*.md"
- "!**/*.qhelp"
branches:

3
.gitignore vendored
View File

@@ -39,6 +39,9 @@
# local bazel options
/local.bazelrc
# generated cmake directory
/.bazel-cmake
# CLion project files
/.clwb

5
.lfsconfig Normal file
View File

@@ -0,0 +1,5 @@
[lfs]
# codeql is publicly forked by many users, and we don't want any LFS file polluting their working
# copies. We therefore exclude everything by default.
# For files required by bazel builds, use rules in `misc/bazel/lfs.bzl` to download them on demand.
fetchinclude = /nothing

View File

@@ -20,13 +20,23 @@ repos:
- id: autopep8
files: ^misc/codegen/.*\.py
- repo: https://github.com/warchant/pre-commit-buildifier
rev: 0.0.2
hooks:
- id: buildifier
- repo: local
hooks:
- id: buildifier
name: Format bazel files
files: \.(bazel|bzl)
language: system
entry: bazel run //misc/bazel:buildifier
pass_filenames: false
# DISABLED: can be enabled by copying this config and installing `pre-commit` with `--config` on the copy
# - id: go-gen
# name: Check checked in generated files in go
# files: ^go/.*
# language: system
# entry: bazel run //go:gen
# pass_filenames: false
- id: codeql-format
name: Fix QL file formatting
files: \.qll?$

View File

@@ -1,4 +1,5 @@
/cpp/ @github/codeql-c-analysis
/cpp/autobuilder/ @github/codeql-c-extractor
/csharp/ @github/codeql-csharp
/go/ @github/codeql-go
/java/ @github/codeql-java
@@ -11,9 +12,6 @@
/java/ql/test-kotlin1/ @github/codeql-kotlin
/java/ql/test-kotlin2/ @github/codeql-kotlin
# ML-powered queries
/javascript/ql/experimental/adaptivethreatmodeling/ @github/codeql-ml-powered-queries-reviewers
# CodeQL tools and associated docs
/docs/codeql/codeql-cli/ @github/codeql-cli-reviewers
/docs/codeql/codeql-for-visual-studio-code/ @github/codeql-vscode-reviewers
@@ -25,6 +23,7 @@
# Bazel (excluding BUILD.bazel files)
WORKSPACE.bazel @github/codeql-ci-reviewers
MODULE.bazel @github/codeql-ci-reviewers
.bazelversion @github/codeql-ci-reviewers
.bazelrc @github/codeql-ci-reviewers
**/*.bzl @github/codeql-ci-reviewers
@@ -35,9 +34,7 @@ WORKSPACE.bazel @github/codeql-ci-reviewers
# Workflows
/.github/workflows/ @github/codeql-ci-reviewers
/.github/workflows/atm-* @github/codeql-ml-powered-queries-reviewers
/.github/workflows/go-* @github/codeql-go
/.github/workflows/js-ml-tests.yml @github/codeql-ml-powered-queries-reviewers
/.github/workflows/ql-for-ql-* @github/codeql-ql-for-ql-reviewers
/.github/workflows/ruby-* @github/codeql-ruby
/.github/workflows/swift.yml @github/codeql-swift

View File

@@ -4,6 +4,8 @@ We welcome contributions to our CodeQL libraries and queries. Got an idea for a
There is lots of useful documentation to help you write queries, ranging from information about query file structure to tutorials for specific target languages. For more information on the documentation available, see [CodeQL queries](https://codeql.github.com/docs/writing-codeql-queries/codeql-queries) on [codeql.github.com](https://codeql.github.com).
Note that the CodeQL for Visual Studio Code documentation has been migrated to https://docs.github.com/en/code-security/codeql-for-vs-code/, but you can still contribute to it via a different repository. For more information, see [Contributing to GitHub Docs documentation](https://docs.github.com/en/contributing)."
## Change notes
Any nontrivial user-visible change to a query pack or library pack should have a change note. For details on how to add a change note for your change, see [this guide](docs/change-notes.md).
@@ -43,7 +45,7 @@ If you have an idea for a query that you would like to share with other CodeQL u
3. **Formatting**
- The queries and libraries must be autoformatted, for example using the "Format Document" command in [CodeQL for Visual Studio Code](https://codeql.github.com/docs/codeql-for-visual-studio-code/about-codeql-for-visual-studio-code).
- The queries and libraries must be autoformatted, for example using the "Format Document" command in [CodeQL for Visual Studio Code](https://docs.github.com/en/code-security/codeql-for-vs-code/).
If you prefer, you can either:
1. install the [pre-commit framework](https://pre-commit.com/) and install the configured hooks on this repo via `pre-commit install`, or

62
MODULE.bazel Normal file
View File

@@ -0,0 +1,62 @@
module(
name = "codeql",
version = "0.0",
)
# this points to our internal repository when `codeql` is checked out as a submodule thereof
# when building things from `codeql` independently this is stubbed out in `.bazelrc`
bazel_dep(name = "semmle_code", version = "0.0")
local_path_override(
module_name = "semmle_code",
path = "..",
)
# see https://registry.bazel.build/ for a list of available packages
bazel_dep(name = "platforms", version = "0.0.9")
bazel_dep(name = "rules_go", version = "0.47.0")
bazel_dep(name = "rules_pkg", version = "0.10.1")
bazel_dep(name = "rules_nodejs", version = "6.0.3")
bazel_dep(name = "rules_python", version = "0.31.0")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "abseil-cpp", version = "20240116.0", repo_name = "absl")
bazel_dep(name = "nlohmann_json", version = "3.11.3", repo_name = "json")
bazel_dep(name = "fmt", version = "10.0.0")
bazel_dep(name = "gazelle", version = "0.36.0")
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "codegen_deps",
python_version = "3.11",
requirements_lock = "//misc/codegen:requirements_lock.txt",
)
use_repo(pip, "codegen_deps")
swift_deps = use_extension("//swift/third_party:load.bzl", "swift_deps")
# following list can be kept in sync with `bazel mod tidy`
use_repo(
swift_deps,
"binlog",
"picosha2",
"swift_prebuilt_darwin_x86_64",
"swift_prebuilt_linux",
"swift_toolchain_linux",
"swift_toolchain_macos",
)
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(
name = "nodejs",
node_version = "18.15.0",
)
use_repo(node, "nodejs", "nodejs_toolchains")
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.22.2")
register_toolchains(
"@nodejs_toolchains//:all",
)

View File

@@ -4,7 +4,7 @@ This open source repository contains the standard CodeQL libraries and queries t
## How do I learn CodeQL and run queries?
There is [extensive documentation](https://codeql.github.com/docs/) on getting started with writing CodeQL using the [CodeQL extension for Visual Studio Code](https://codeql.github.com/docs/codeql-for-visual-studio-code/) and the [CodeQL CLI](https://codeql.github.com/docs/codeql-cli/).
There is extensive documentation about the [CodeQL language](https://codeql.github.com/docs/), writing CodeQL using the [CodeQL extension for Visual Studio Code](https://docs.github.com/en/code-security/codeql-for-vs-code/) and using the [CodeQL CLI](https://docs.github.com/en/code-security/codeql-cli).
## Contributing

View File

@@ -1,12 +1,2 @@
# Please notice that any bazel targets and definitions in this repository are currently experimental
# and for internal use only.
workspace(name = "codeql")
load("//misc/bazel:workspace.bzl", "codeql_workspace")
codeql_workspace()
load("//misc/bazel:workspace_deps.bzl", "codeql_workspace_deps")
codeql_workspace_deps()
# please use MODULE.bazel to add dependencies
# this empty file is required by internal repositories, don't remove it

View File

@@ -6,20 +6,11 @@ provide:
- "*/ql/consistency-queries/qlpack.yml"
- "*/ql/automodel/src/qlpack.yml"
- "*/ql/automodel/test/qlpack.yml"
- "python/extractor/qlpack.yml"
- "shared/**/qlpack.yml"
- "cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/tainted/qlpack.yml"
- "go/ql/config/legacy-support/qlpack.yml"
- "go/build/codeql-extractor-go/codeql-extractor.yml"
- "javascript/ql/experimental/adaptivethreatmodeling/lib/qlpack.yml"
# This pack is explicitly excluded from the workspace since most users
# will want to use a version of this pack from the package cache. Internal
# users can uncomment the following line and place a custom ML model
# in the corresponding pack to test a custom ML model within their local
# checkout.
# - "javascript/ql/experimental/adaptivethreatmodeling/model/qlpack.yml"
- "javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/qlpack.yml"
- "javascript/ql/experimental/adaptivethreatmodeling/src/qlpack.yml"
- "javascript/ql/experimental/adaptivethreatmodeling/test/qlpack.yml"
- "csharp/ql/campaigns/Solorigate/lib/qlpack.yml"
- "csharp/ql/campaigns/Solorigate/src/qlpack.yml"
- "csharp/ql/campaigns/Solorigate/test/qlpack.yml"
@@ -27,7 +18,6 @@ provide:
- "misc/suite-helpers/qlpack.yml"
- "ruby/extractor-pack/codeql-extractor.yml"
- "swift/extractor-pack/codeql-extractor.yml"
- "swift/integration-tests/qlpack.yml"
- "ql/extractor-pack/codeql-extractor.yml"
- ".github/codeql/extensions/**/codeql-pack.yml"

View File

@@ -88,123 +88,46 @@
"IR Instruction": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/Instruction.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/Instruction.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/Instruction.qll",
"csharp/ql/src/experimental/ir/implementation/raw/Instruction.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/Instruction.qll"
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/Instruction.qll"
],
"IR IRBlock": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/IRBlock.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/IRBlock.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/IRBlock.qll",
"csharp/ql/src/experimental/ir/implementation/raw/IRBlock.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/IRBlock.qll"
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/IRBlock.qll"
],
"IR IRVariable": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/IRVariable.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/IRVariable.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/IRVariable.qll",
"csharp/ql/src/experimental/ir/implementation/raw/IRVariable.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/IRVariable.qll"
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/IRVariable.qll"
],
"IR IRFunction": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/IRFunction.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/IRFunction.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/IRFunction.qll",
"csharp/ql/src/experimental/ir/implementation/raw/IRFunction.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/IRFunction.qll"
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/IRFunction.qll"
],
"IR Operand": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/Operand.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/Operand.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/Operand.qll",
"csharp/ql/src/experimental/ir/implementation/raw/Operand.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/Operand.qll"
],
"IR IRType": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/IRType.qll",
"csharp/ql/src/experimental/ir/implementation/IRType.qll"
],
"IR IRConfiguration": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/IRConfiguration.qll",
"csharp/ql/src/experimental/ir/implementation/IRConfiguration.qll"
],
"IR UseSoundEscapeAnalysis": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/UseSoundEscapeAnalysis.qll",
"csharp/ql/src/experimental/ir/implementation/UseSoundEscapeAnalysis.qll"
],
"IR IRFunctionBase": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/internal/IRFunctionBase.qll",
"csharp/ql/src/experimental/ir/implementation/internal/IRFunctionBase.qll"
],
"IR Operand Tag": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/internal/OperandTag.qll",
"csharp/ql/src/experimental/ir/implementation/internal/OperandTag.qll"
],
"IR TInstruction": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/internal/TInstruction.qll",
"csharp/ql/src/experimental/ir/implementation/internal/TInstruction.qll"
],
"IR TIRVariable": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/internal/TIRVariable.qll",
"csharp/ql/src/experimental/ir/implementation/internal/TIRVariable.qll"
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/Operand.qll"
],
"IR IR": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/IR.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/IR.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/IR.qll",
"csharp/ql/src/experimental/ir/implementation/raw/IR.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/IR.qll"
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/IR.qll"
],
"IR IRConsistency": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/IRConsistency.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/IRConsistency.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/IRConsistency.qll",
"csharp/ql/src/experimental/ir/implementation/raw/IRConsistency.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/IRConsistency.qll"
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/IRConsistency.qll"
],
"IR PrintIR": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/PrintIR.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/PrintIR.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/PrintIR.qll",
"csharp/ql/src/experimental/ir/implementation/raw/PrintIR.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/PrintIR.qll"
],
"IR IntegerConstant": [
"cpp/ql/lib/semmle/code/cpp/ir/internal/IntegerConstant.qll",
"csharp/ql/src/experimental/ir/internal/IntegerConstant.qll"
],
"IR IntegerInteval": [
"cpp/ql/lib/semmle/code/cpp/ir/internal/IntegerInterval.qll",
"csharp/ql/src/experimental/ir/internal/IntegerInterval.qll"
],
"IR IntegerPartial": [
"cpp/ql/lib/semmle/code/cpp/ir/internal/IntegerPartial.qll",
"csharp/ql/src/experimental/ir/internal/IntegerPartial.qll"
],
"IR Overlap": [
"cpp/ql/lib/semmle/code/cpp/ir/internal/Overlap.qll",
"csharp/ql/src/experimental/ir/internal/Overlap.qll"
],
"IR EdgeKind": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/EdgeKind.qll",
"csharp/ql/src/experimental/ir/implementation/EdgeKind.qll"
],
"IR MemoryAccessKind": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/MemoryAccessKind.qll",
"csharp/ql/src/experimental/ir/implementation/MemoryAccessKind.qll"
],
"IR TempVariableTag": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/TempVariableTag.qll",
"csharp/ql/src/experimental/ir/implementation/TempVariableTag.qll"
],
"IR Opcode": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/Opcode.qll",
"csharp/ql/src/experimental/ir/implementation/Opcode.qll"
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/PrintIR.qll"
],
"IR SSAConsistency": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSAConsistency.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SSAConsistency.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/internal/SSAConsistency.qll"
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SSAConsistency.qll"
],
"C++ IR InstructionImports": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/InstructionImports.qll",
@@ -252,8 +175,7 @@
],
"SSA AliasAnalysis": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/AliasAnalysis.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/AliasAnalysis.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/internal/AliasAnalysis.qll"
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/AliasAnalysis.qll"
],
"SSA PrintAliasAnalysis": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/PrintAliasAnalysis.qll",
@@ -268,44 +190,28 @@
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/gvn/internal/ValueNumberingImports.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/gvn/internal/ValueNumberingImports.qll"
],
"IR SSA SimpleSSA": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SimpleSSA.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/internal/SimpleSSA.qll"
],
"IR AliasConfiguration (unaliased_ssa)": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/AliasConfiguration.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/internal/AliasConfiguration.qll"
],
"IR SSA SSAConstruction": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SSAConstruction.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll"
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SSAConstruction.qll"
],
"IR SSA PrintSSA": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/PrintSSA.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/PrintSSA.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/internal/PrintSSA.qll"
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/PrintSSA.qll"
],
"IR ValueNumberInternal": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/gvn/internal/ValueNumberingInternal.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/gvn/internal/ValueNumberingInternal.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/gvn/internal/ValueNumberingInternal.qll",
"csharp/ql/src/experimental/ir/implementation/raw/gvn/internal/ValueNumberingInternal.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/gvn/internal/ValueNumberingInternal.qll"
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/gvn/internal/ValueNumberingInternal.qll"
],
"C++ IR ValueNumber": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/gvn/ValueNumbering.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/gvn/ValueNumbering.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/gvn/ValueNumbering.qll",
"csharp/ql/src/experimental/ir/implementation/raw/gvn/ValueNumbering.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/gvn/ValueNumbering.qll"
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/gvn/ValueNumbering.qll"
],
"C++ IR PrintValueNumbering": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/gvn/PrintValueNumbering.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/gvn/PrintValueNumbering.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/gvn/PrintValueNumbering.qll",
"csharp/ql/src/experimental/ir/implementation/raw/gvn/PrintValueNumbering.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/gvn/PrintValueNumbering.qll"
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/gvn/PrintValueNumbering.qll"
],
"C++ IR ConstantAnalysis": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/constant/ConstantAnalysis.qll",
@@ -333,38 +239,6 @@
"cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/reachability/PrintDominance.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/reachability/PrintDominance.qll"
],
"C# IR InstructionImports": [
"csharp/ql/src/experimental/ir/implementation/raw/internal/InstructionImports.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/internal/InstructionImports.qll"
],
"C# IR IRImports": [
"csharp/ql/src/experimental/ir/implementation/raw/internal/IRImports.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/internal/IRImports.qll"
],
"C# IR IRBlockImports": [
"csharp/ql/src/experimental/ir/implementation/raw/internal/IRBlockImports.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/internal/IRBlockImports.qll"
],
"C# IR IRFunctionImports": [
"csharp/ql/src/experimental/ir/implementation/raw/internal/IRFunctionImports.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/internal/IRFunctionImports.qll"
],
"C# IR IRVariableImports": [
"csharp/ql/src/experimental/ir/implementation/raw/internal/IRVariableImports.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/internal/IRVariableImports.qll"
],
"C# IR OperandImports": [
"csharp/ql/src/experimental/ir/implementation/raw/internal/OperandImports.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/internal/OperandImports.qll"
],
"C# IR PrintIRImports": [
"csharp/ql/src/experimental/ir/implementation/raw/internal/PrintIRImports.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/internal/PrintIRImports.qll"
],
"C# IR ValueNumberingImports": [
"csharp/ql/src/experimental/ir/implementation/raw/gvn/internal/ValueNumberingImports.qll",
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/gvn/internal/ValueNumberingImports.qll"
],
"C# ControlFlowReachability": [
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/ControlFlowReachability.qll",
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/ControlFlowReachability.qll"
@@ -377,13 +251,6 @@
"cpp/ql/src/Security/CWE/CWE-020/SafeExternalAPIFunction.qll",
"cpp/ql/src/Security/CWE/CWE-020/ir/SafeExternalAPIFunction.qll"
],
"XML": [
"cpp/ql/lib/semmle/code/cpp/XML.qll",
"csharp/ql/lib/semmle/code/csharp/XML.qll",
"java/ql/lib/semmle/code/xml/XML.qll",
"javascript/ql/lib/semmle/javascript/XML.qll",
"python/ql/lib/semmle/python/xml/XML.qll"
],
"DuplicationProblems.inc.qhelp": [
"cpp/ql/src/Metrics/Files/DuplicationProblems.inc.qhelp",
"javascript/ql/src/Metrics/DuplicationProblems.inc.qhelp",
@@ -431,13 +298,6 @@
"java/ql/src/experimental/Security/CWE/CWE-400/LocalThreadResourceAbuse.qhelp",
"java/ql/src/experimental/Security/CWE/CWE-400/ThreadResourceAbuse.qhelp"
],
"IDE Contextual Queries": [
"cpp/ql/lib/IDEContextual.qll",
"csharp/ql/lib/IDEContextual.qll",
"java/ql/lib/IDEContextual.qll",
"javascript/ql/lib/IDEContextual.qll",
"python/ql/lib/analysis/IDEContextual.qll"
],
"CryptoAlgorithms Python/JS/Ruby": [
"javascript/ql/lib/semmle/javascript/security/CryptoAlgorithms.qll",
"python/ql/lib/semmle/python/concepts/CryptoAlgorithms.qll",
@@ -502,7 +362,7 @@
"java/ql/lib/semmle/code/java/security/internal/EncryptionKeySizes.qll"
],
"Python model summaries test extension": [
"python/ql/test/experimental/dataflow/model-summaries/InlineTaintTest.ext.yml",
"python/ql/test/experimental/dataflow/model-summaries/NormalDataflowTest.ext.yml"
"python/ql/test/library-tests/dataflow/model-summaries/InlineTaintTest.ext.yml",
"python/ql/test/library-tests/dataflow/model-summaries/NormalDataflowTest.ext.yml"
]
}
}

View File

@@ -1,4 +1,4 @@
load("@rules_pkg//:mappings.bzl", "pkg_filegroup")
load("@rules_pkg//pkg:mappings.bzl", "pkg_filegroup")
package(default_visibility = ["//visibility:public"])

View File

@@ -203,6 +203,8 @@ namespace Semmle.Autobuild.Cpp.Tests
public IList<DiagnosticMessage> Diagnostics { get; } = new List<DiagnosticMessage>();
public void AddEntry(DiagnosticMessage message) => this.Diagnostics.Add(message);
public void Dispose() { }
}
/// <summary>
@@ -250,12 +252,7 @@ namespace Semmle.Autobuild.Cpp.Tests
EndCallbackIn.Add(s);
}
CppAutobuilder CreateAutoBuilder(bool isWindows,
string? buildless = null, string? solution = null, string? buildCommand = null, string? ignoreErrors = null,
string? msBuildArguments = null, string? msBuildPlatform = null, string? msBuildConfiguration = null, string? msBuildTarget = null,
string? dotnetArguments = null, string? dotnetVersion = null, string? vsToolsVersion = null,
string? nugetRestore = null, string? allSolutions = null,
string cwd = @"C:\Project")
CppAutobuilder CreateAutoBuilder(bool isWindows, string? dotnetVersion = null, string cwd = @"C:\Project")
{
string codeqlUpperLanguage = Language.Cpp.UpperCaseName;
Actions.GetEnvironmentVariable[$"CODEQL_AUTOBUILDER_{codeqlUpperLanguage}_NO_INDEXING"] = "false";
@@ -265,22 +262,7 @@ namespace Semmle.Autobuild.Cpp.Tests
Actions.GetEnvironmentVariable[$"CODEQL_EXTRACTOR_{codeqlUpperLanguage}_DIAGNOSTIC_DIR"] = "";
Actions.GetEnvironmentVariable["CODEQL_JAVA_HOME"] = @"C:\codeql\tools\java";
Actions.GetEnvironmentVariable["CODEQL_PLATFORM"] = "win64";
Actions.GetEnvironmentVariable["SEMMLE_DIST"] = @"C:\odasa";
Actions.GetEnvironmentVariable["SEMMLE_JAVA_HOME"] = @"C:\odasa\tools\java";
Actions.GetEnvironmentVariable["SEMMLE_PLATFORM_TOOLS"] = @"C:\odasa\tools";
Actions.GetEnvironmentVariable["LGTM_INDEX_VSTOOLS_VERSION"] = vsToolsVersion;
Actions.GetEnvironmentVariable["LGTM_INDEX_MSBUILD_ARGUMENTS"] = msBuildArguments;
Actions.GetEnvironmentVariable["LGTM_INDEX_MSBUILD_PLATFORM"] = msBuildPlatform;
Actions.GetEnvironmentVariable["LGTM_INDEX_MSBUILD_CONFIGURATION"] = msBuildConfiguration;
Actions.GetEnvironmentVariable["LGTM_INDEX_MSBUILD_TARGET"] = msBuildTarget;
Actions.GetEnvironmentVariable["LGTM_INDEX_DOTNET_ARGUMENTS"] = dotnetArguments;
Actions.GetEnvironmentVariable["LGTM_INDEX_DOTNET_VERSION"] = dotnetVersion;
Actions.GetEnvironmentVariable["LGTM_INDEX_BUILD_COMMAND"] = buildCommand;
Actions.GetEnvironmentVariable["LGTM_INDEX_SOLUTION"] = solution;
Actions.GetEnvironmentVariable["LGTM_INDEX_IGNORE_ERRORS"] = ignoreErrors;
Actions.GetEnvironmentVariable["LGTM_INDEX_BUILDLESS"] = buildless;
Actions.GetEnvironmentVariable["LGTM_INDEX_ALL_SOLUTIONS"] = allSolutions;
Actions.GetEnvironmentVariable["LGTM_INDEX_NUGET_RESTORE"] = nugetRestore;
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_OPTION_DOTNET_VERSION"] = dotnetVersion;
Actions.GetEnvironmentVariable["ProgramFiles(x86)"] = isWindows ? @"C:\Program Files (x86)" : null;
Actions.GetCurrentDirectory = cwd;
Actions.IsWindows = isWindows;

View File

@@ -26,9 +26,6 @@ namespace Semmle.Autobuild.Cpp
public override BuildScript GetBuildScript()
{
if (Options.BuildCommand != null)
return new BuildCommandRule((_, f) => f(null)).Analyse(this, false);
return
// First try MSBuild
new MsBuildRule().Analyse(this, true) |

View File

@@ -1,5 +1,7 @@
using System;
using Semmle.Autobuild.Shared;
using Semmle.Util;
namespace Semmle.Autobuild.Cpp
{
@@ -15,7 +17,7 @@ namespace Semmle.Autobuild.Cpp
try
{
Console.WriteLine("CodeQL C++ autobuilder");
var builder = new CppAutobuilder(actions, options);
using var builder = new CppAutobuilder(actions, options);
return builder.AttemptBuild();
}
catch (InvalidEnvironmentException ex)

View File

@@ -1,4 +1,4 @@
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix")
pkg_files(
name = "downgrades",

View File

@@ -0,0 +1,13 @@
class Expr extends @expr {
string toString() { none() }
}
class Location extends @location_expr {
string toString() { none() }
}
from Expr expr, int kind, int kind_new, Location loc
where
exprs(expr, kind, loc) and
if kind = 363 then kind_new = 1 else kind_new = kind
select expr, kind_new, loc

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
description: Introduce re-use expressions
compatibility: partial
expr_reuse.rel: delete
exprs.rel: run exprs.qlo

View File

@@ -0,0 +1,7 @@
class Expr extends @expr {
string toString() { none() }
}
from Expr reuse, Expr original
where expr_reuse(reuse, original, _)
select reuse, original

View File

@@ -0,0 +1,22 @@
class Expr extends @expr {
string toString() { none() }
}
class Type extends @type {
string toString() { none() }
}
predicate existingType(Expr expr, Type type, int value_category) {
expr_types(expr, type, value_category)
}
predicate reuseType(Expr reuse, Type type, int value_category) {
exists(Expr original |
expr_reuse(reuse, original, value_category) and
expr_types(original, type, _)
)
}
from Expr expr, Type type, int value_category
where existingType(expr, type, value_category) or reuseType(expr, type, value_category)
select expr, type, value_category

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
description: Add value category to expr_reuse table
compatibility: full
expr_reuse.rel: run expr_reuse.qlo
expr_types.rel: run expr_types.qlo

View File

@@ -1,4 +1,4 @@
load("@rules_pkg//:mappings.bzl", "pkg_files")
load("@rules_pkg//pkg:mappings.bzl", "pkg_files")
package(default_visibility = ["//cpp:__pkg__"])

View File

@@ -1,3 +1,57 @@
## 0.13.1
No user-facing changes.
## 0.13.0
### Breaking Changes
* Deleted the deprecated `GlobalValueNumberingImpl.qll` implementation.
### New Features
* Models-as-Data support has been added for C/C++. This feature allows flow sources, sinks and summaries to be expressed in compact strings as an alternative to modelling each source / sink / summary with explicit QL. See `dataflow/ExternalFlow.qll` for documentation and specification of the model format, and `models/implementations/ZMQ.qll` for a simple example of models. Importing models from `.yml` is not yet supported.
### Minor Analysis Improvements
* Source models have been added for the standard library function `getc` (and variations).
* Source, sink and flow models for the ZeroMQ (ZMQ) networking library have been added.
* Parameters of functions without definitions now have `ParameterNode`s.
* The alias analysis used internally by various libraries has been improved to answer alias questions more conservatively. As a result, some queries may report fewer false positives.
## 0.12.11
No user-facing changes.
## 0.12.10
### New Features
* Added a `TaintInheritingContent` class that can be extended to model taint flowing from a qualifier to a field.
* Added a predicate `GuardCondition.comparesEq/4` to query whether an expression is compared to a constant.
* Added a predicate `GuardCondition.ensuresEq/4` to query whether a basic block is guarded by an expression being equal to a constant.
* Added a predicate `GuardCondition.comparesLt/4` to query whether an expression is compared to a constant.
* Added a predicate `GuardCondition.ensuresLt/4` to query whether a basic block is guarded by an expression being less than a constant.
* Added a predicate `GuardCondition.valueControls` to query whether a basic block is guarded by a particular `case` of a `switch` statement.
### Minor Analysis Improvements
* Added destructors for temporary objects with extended lifetimes to the intermediate representation.
## 0.12.9
No user-facing changes.
## 0.12.8
No user-facing changes.
## 0.12.7
### Minor Analysis Improvements
* Added destructors for named objects to the intermediate representation.
## 0.12.6
### New Features

View File

@@ -3,6 +3,7 @@
*/
import semmle.files.FileSystem
private import codeql.util.FileSystem
/**
* Returns the `File` matching the given source file name as encoded by the VS
@@ -10,13 +11,5 @@ import semmle.files.FileSystem
*/
cached
File getFileBySourceArchiveName(string name) {
// The name provided for a file in the source archive by the VS Code extension
// has some differences from the absolute path in the database:
// 1. colons are replaced by underscores
// 2. there's a leading slash, even for Windows paths: "C:/foo/bar" ->
// "/C_/foo/bar"
// 3. double slashes in UNC prefixes are replaced with a single slash
// We can handle 2 and 3 together by unconditionally adding a leading slash
// before replacing double slashes.
name = ("/" + result.getAbsolutePath().replaceAll(":", "_")).replaceAll("//", "/")
result = IdeContextual<File>::getFileBySourceArchiveName(name)
}

View File

@@ -0,0 +1,14 @@
## 0.12.10
### New Features
* Added a `TaintInheritingContent` class that can be extended to model taint flowing from a qualifier to a field.
* Added a predicate `GuardCondition.comparesEq/4` to query whether an expression is compared to a constant.
* Added a predicate `GuardCondition.ensuresEq/4` to query whether a basic block is guarded by an expression being equal to a constant.
* Added a predicate `GuardCondition.comparesLt/4` to query whether an expression is compared to a constant.
* Added a predicate `GuardCondition.ensuresLt/4` to query whether a basic block is guarded by an expression being less than a constant.
* Added a predicate `GuardCondition.valueControls` to query whether a basic block is guarded by a particular `case` of a `switch` statement.
### Minor Analysis Improvements
* Added destructors for temporary objects with extended lifetimes to the intermediate representation.

View File

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

View File

@@ -0,0 +1,5 @@
## 0.12.7
### Minor Analysis Improvements
* Added destructors for named objects to the intermediate representation.

View File

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

View File

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

View File

@@ -0,0 +1,16 @@
## 0.13.0
### Breaking Changes
* Deleted the deprecated `GlobalValueNumberingImpl.qll` implementation.
### New Features
* Models-as-Data support has been added for C/C++. This feature allows flow sources, sinks and summaries to be expressed in compact strings as an alternative to modelling each source / sink / summary with explicit QL. See `dataflow/ExternalFlow.qll` for documentation and specification of the model format, and `models/implementations/ZMQ.qll` for a simple example of models. Importing models from `.yml` is not yet supported.
### Minor Analysis Improvements
* Source models have been added for the standard library function `getc` (and variations).
* Source, sink and flow models for the ZeroMQ (ZMQ) networking library have been added.
* Parameters of functions without definitions now have `ParameterNode`s.
* The alias analysis used internally by various libraries has been improved to answer alias questions more conservatively. As a result, some queries may report fewer false positives.

View File

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

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 0.12.6
lastReleaseVersion: 0.13.1

View File

@@ -1,5 +1,5 @@
name: codeql/cpp-all
version: 0.12.6
version: 0.13.1
groups: cpp
dbscheme: semmlecode.cpp.dbscheme
extractor: cpp
@@ -7,8 +7,11 @@ library: true
upgrades: upgrades
dependencies:
codeql/dataflow: ${workspace}
codeql/mad: ${workspace}
codeql/rangeanalysis: ${workspace}
codeql/ssa: ${workspace}
codeql/typeflow: ${workspace}
codeql/tutorial: ${workspace}
codeql/util: ${workspace}
codeql/xml: ${workspace}
warnOnImplicitThis: true

View File

@@ -60,4 +60,6 @@ Element exprEnclosingElement(Expr e) {
)
else result = de.getDeclaration()
)
or
result.(Stmt).getAnImplicitDestructorCall() = e
}

View File

@@ -309,9 +309,12 @@ class ExprNode extends AstNode {
override AstNode getChildInternal(int childIndex) {
result.getAst() = expr.getChild(childIndex)
or
childIndex = max(int index | exists(expr.getChild(index)) or index = 0) + 1 and
result.getAst() = expr.(ConditionDeclExpr).getInitializingExpr()
or
exists(int destructorIndex |
result.getAst() = expr.getImplicitDestructorCall(destructorIndex) and
childIndex = destructorIndex + max(int index | exists(expr.getChild(index)) or index = 0) + 1
childIndex = destructorIndex + max(int index | exists(expr.getChild(index)) or index = 0) + 2
)
}
@@ -361,6 +364,8 @@ class ConversionNode extends ExprNode {
childIndex = 0 and
result.getAst() = conv.getExpr() and
conv.getExpr() instanceof Conversion
or
result.getAst() = expr.getImplicitDestructorCall(childIndex - 1)
}
}
@@ -458,6 +463,25 @@ class StmtNode extends AstNode {
}
}
/**
* A node representing a child of a `Stmt` that is itself a `Stmt`.
*/
class ChildStmtNode extends StmtNode {
Stmt childStmt;
ChildStmtNode() { exists(Stmt parent | parent.getAChild() = childStmt and childStmt = ast) }
override BaseAstNode getChildInternal(int childIndex) {
result = super.getChildInternal(childIndex)
or
exists(int destructorIndex |
result.getAst() = childStmt.getImplicitDestructorCall(destructorIndex) and
childIndex =
destructorIndex + max(int index | exists(childStmt.getChild(index)) or index = 0) + 1
)
}
}
/**
* A node representing a `DeclStmt`.
*/
@@ -669,6 +693,13 @@ class FunctionNode extends FunctionOrGlobalOrNamespaceVariableNode {
private string getChildAccessorWithoutConversions(Locatable parent, Element child) {
shouldPrintDeclaration(getAnEnclosingDeclaration(parent)) and
(
exists(Stmt s, int i | s.getChild(i) = parent |
exists(int n |
s.getChild(i).(Stmt).getImplicitDestructorCall(n) = child and
result = "getImplicitDestructorCall(" + n + ")"
)
)
or
exists(Stmt s | s = parent |
namedStmtChildPredicates(s, child, result)
or
@@ -686,6 +717,8 @@ private string getChildAccessorWithoutConversions(Locatable parent, Element chil
not namedExprChildPredicates(expr, child, _) and
exists(int n | expr.getChild(n) = child and result = "getChild(" + n + ")")
or
expr.(ConditionDeclExpr).getInitializingExpr() = child and result = "getInitializingExpr()"
or
exists(int n |
expr.getImplicitDestructorCall(n) = child and
result = "getImplicitDestructorCall(" + n + ")"
@@ -857,7 +890,7 @@ private predicate namedExprChildPredicates(Expr expr, Element ele, string pred)
or
expr.(DeleteOrDeleteArrayExpr).getDestructorCall() = ele and pred = "getDestructorCall()"
or
expr.(DeleteOrDeleteArrayExpr).getExpr() = ele and pred = "getExpr()"
expr.(DeleteOrDeleteArrayExpr).getExprWithReuse() = ele and pred = "getExprWithReuse()"
or
expr.(DestructorFieldDestruction).getExpr() = ele and pred = "getExpr()"
or

View File

@@ -590,6 +590,33 @@ class TemplateVariable extends Variable {
Variable getAnInstantiation() { result.isConstructedFrom(this) }
}
/**
* A variable that is an instantiation of a template. For example
* the instantiation `myTemplateVariable<int>` in the following code:
* ```
* template<class T>
* T myTemplateVariable;
*
* void caller(int i) {
* myTemplateVariable<int> = i;
* }
* ```
*/
class VariableTemplateInstantiation extends Variable {
TemplateVariable tv;
VariableTemplateInstantiation() { tv.getAnInstantiation() = this }
override string getAPrimaryQlClass() { result = "VariableTemplateInstantiation" }
/**
* Gets the variable template from which this instantiation was instantiated.
*
* Example: For `int x<int>`, returns `T x`.
*/
TemplateVariable getTemplate() { result = tv }
}
/**
* A non-static local variable or parameter that is not part of an
* uninstantiated template. Uninstantiated templates are purely syntax, and

View File

@@ -3,305 +3,67 @@
*/
import semmle.files.FileSystem
private import codeql.xml.Xml
private class TXmlLocatable =
@xmldtd or @xmlelement or @xmlattribute or @xmlnamespace or @xmlcomment or @xmlcharacters;
private module Input implements InputSig<File, Location> {
class XmlLocatableBase = @xmllocatable or @xmlnamespaceable;
/** An XML element that has a location. */
class XmlLocatable extends @xmllocatable, TXmlLocatable {
/** Gets the source location for this element. */
Location getLocation() { xmllocations(this, result) }
predicate xmllocations_(XmlLocatableBase e, Location loc) { xmllocations(e, loc) }
/**
* Holds if this element is at the specified location.
* The location spans column `startcolumn` of line `startline` to
* column `endcolumn` of line `endline` in file `filepath`.
* For more information, see
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
*/
predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
class XmlParentBase = @xmlparent;
class XmlNamespaceableBase = @xmlnamespaceable;
class XmlElementBase = @xmlelement;
class XmlFileBase = File;
predicate xmlEncoding_(XmlFileBase f, string enc) { xmlEncoding(f, enc) }
class XmlDtdBase = @xmldtd;
predicate xmlDTDs_(XmlDtdBase e, string root, string publicId, string systemId, XmlFileBase file) {
xmlDTDs(e, root, publicId, systemId, file)
}
predicate xmlElements_(
XmlElementBase e, string name, XmlParentBase parent, int idx, XmlFileBase file
) {
exists(File f, Location l | l = this.getLocation() |
locations_default(l, f, startline, startcolumn, endline, endcolumn) and
filepath = f.getAbsolutePath()
)
xmlElements(e, name, parent, idx, file)
}
/** Gets a textual representation of this element. */
string toString() { none() } // overridden in subclasses
}
class XmlAttributeBase = @xmlattribute;
/**
* An `XmlParent` is either an `XmlElement` or an `XmlFile`,
* both of which can contain other elements.
*/
class XmlParent extends @xmlparent {
XmlParent() {
// explicitly restrict `this` to be either an `XmlElement` or an `XmlFile`;
// the type `@xmlparent` currently also includes non-XML files
this instanceof @xmlelement or xmlEncoding(this, _)
predicate xmlAttrs_(
XmlAttributeBase e, XmlElementBase elementid, string name, string value, int idx,
XmlFileBase file
) {
xmlAttrs(e, elementid, name, value, idx, file)
}
/**
* Gets a printable representation of this XML parent.
* (Intended to be overridden in subclasses.)
*/
string getName() { none() } // overridden in subclasses
class XmlNamespaceBase = @xmlnamespace;
/** Gets the file to which this XML parent belongs. */
XmlFile getFile() { result = this or xmlElements(this, _, _, _, result) }
/** Gets the child element at a specified index of this XML parent. */
XmlElement getChild(int index) { xmlElements(result, _, this, index, _) }
/** Gets a child element of this XML parent. */
XmlElement getAChild() { xmlElements(result, _, this, _, _) }
/** Gets a child element of this XML parent with the given `name`. */
XmlElement getAChild(string name) { xmlElements(result, _, this, _, _) and result.hasName(name) }
/** Gets a comment that is a child of this XML parent. */
XmlComment getAComment() { xmlComments(result, _, this, _) }
/** Gets a character sequence that is a child of this XML parent. */
XmlCharacters getACharactersSet() { xmlChars(result, _, this, _, _, _) }
/** Gets the depth in the tree. (Overridden in XmlElement.) */
int getDepth() { result = 0 }
/** Gets the number of child XML elements of this XML parent. */
int getNumberOfChildren() { result = count(XmlElement e | xmlElements(e, _, this, _, _)) }
/** Gets the number of places in the body of this XML parent where text occurs. */
int getNumberOfCharacterSets() { result = count(int pos | xmlChars(_, _, this, pos, _, _)) }
/**
* Gets the result of appending all the character sequences of this XML parent from
* left to right, separated by a space.
*/
string allCharactersString() {
result =
concat(string chars, int pos | xmlChars(_, chars, this, pos, _, _) | chars, " " order by pos)
predicate xmlNs_(XmlNamespaceBase e, string prefixName, string uri, XmlFileBase file) {
xmlNs(e, prefixName, uri, file)
}
/** Gets the text value contained in this XML parent. */
string getTextValue() { result = this.allCharactersString() }
predicate xmlHasNs_(XmlNamespaceableBase e, XmlNamespaceBase ns, XmlFileBase file) {
xmlHasNs(e, ns, file)
}
/** Gets a printable representation of this XML parent. */
string toString() { result = this.getName() }
}
class XmlCommentBase = @xmlcomment;
/** An XML file. */
class XmlFile extends XmlParent, File {
XmlFile() { xmlEncoding(this, _) }
predicate xmlComments_(XmlCommentBase e, string text, XmlParentBase parent, XmlFileBase file) {
xmlComments(e, text, parent, file)
}
/** Gets a printable representation of this XML file. */
override string toString() { result = this.getName() }
class XmlCharactersBase = @xmlcharacters;
/** Gets the name of this XML file. */
override string getName() { result = File.super.getAbsolutePath() }
/** Gets the encoding of this XML file. */
string getEncoding() { xmlEncoding(this, result) }
/** Gets the XML file itself. */
override XmlFile getFile() { result = this }
/** Gets a top-most element in an XML file. */
XmlElement getARootElement() { result = this.getAChild() }
/** Gets a DTD associated with this XML file. */
XmlDtd getADtd() { xmlDTDs(result, _, _, _, this) }
}
/**
* An XML document type definition (DTD).
*
* Example:
*
* ```
* <!ELEMENT person (firstName, lastName?)>
* <!ELEMENT firstName (#PCDATA)>
* <!ELEMENT lastName (#PCDATA)>
* ```
*/
class XmlDtd extends XmlLocatable, @xmldtd {
/** Gets the name of the root element of this DTD. */
string getRoot() { xmlDTDs(this, result, _, _, _) }
/** Gets the public ID of this DTD. */
string getPublicId() { xmlDTDs(this, _, result, _, _) }
/** Gets the system ID of this DTD. */
string getSystemId() { xmlDTDs(this, _, _, result, _) }
/** Holds if this DTD is public. */
predicate isPublic() { not xmlDTDs(this, _, "", _, _) }
/** Gets the parent of this DTD. */
XmlParent getParent() { xmlDTDs(this, _, _, _, result) }
override string toString() {
this.isPublic() and
result = this.getRoot() + " PUBLIC '" + this.getPublicId() + "' '" + this.getSystemId() + "'"
or
not this.isPublic() and
result = this.getRoot() + " SYSTEM '" + this.getSystemId() + "'"
predicate xmlChars_(
XmlCharactersBase e, string text, XmlParentBase parent, int idx, int isCDATA, XmlFileBase file
) {
xmlChars(e, text, parent, idx, isCDATA, file)
}
}
/**
* An XML element in an XML file.
*
* Example:
*
* ```
* <manifest xmlns:android="http://schemas.android.com/apk/res/android"
* package="com.example.exampleapp" android:versionCode="1">
* </manifest>
* ```
*/
class XmlElement extends @xmlelement, XmlParent, XmlLocatable {
/** Holds if this XML element has the given `name`. */
predicate hasName(string name) { name = this.getName() }
/** Gets the name of this XML element. */
override string getName() { xmlElements(this, result, _, _, _) }
/** Gets the XML file in which this XML element occurs. */
override XmlFile getFile() { xmlElements(this, _, _, _, result) }
/** Gets the parent of this XML element. */
XmlParent getParent() { xmlElements(this, _, result, _, _) }
/** Gets the index of this XML element among its parent's children. */
int getIndex() { xmlElements(this, _, _, result, _) }
/** Holds if this XML element has a namespace. */
predicate hasNamespace() { xmlHasNs(this, _, _) }
/** Gets the namespace of this XML element, if any. */
XmlNamespace getNamespace() { xmlHasNs(this, result, _) }
/** Gets the index of this XML element among its parent's children. */
int getElementPositionIndex() { xmlElements(this, _, _, result, _) }
/** Gets the depth of this element within the XML file tree structure. */
override int getDepth() { result = this.getParent().getDepth() + 1 }
/** Gets an XML attribute of this XML element. */
XmlAttribute getAnAttribute() { result.getElement() = this }
/** Gets the attribute with the specified `name`, if any. */
XmlAttribute getAttribute(string name) { result.getElement() = this and result.getName() = name }
/** Holds if this XML element has an attribute with the specified `name`. */
predicate hasAttribute(string name) { exists(this.getAttribute(name)) }
/** Gets the value of the attribute with the specified `name`, if any. */
string getAttributeValue(string name) { result = this.getAttribute(name).getValue() }
/** Gets a printable representation of this XML element. */
override string toString() { result = this.getName() }
}
/**
* An attribute that occurs inside an XML element.
*
* Examples:
*
* ```
* package="com.example.exampleapp"
* android:versionCode="1"
* ```
*/
class XmlAttribute extends @xmlattribute, XmlLocatable {
/** Gets the name of this attribute. */
string getName() { xmlAttrs(this, _, result, _, _, _) }
/** Gets the XML element to which this attribute belongs. */
XmlElement getElement() { xmlAttrs(this, result, _, _, _, _) }
/** Holds if this attribute has a namespace. */
predicate hasNamespace() { xmlHasNs(this, _, _) }
/** Gets the namespace of this attribute, if any. */
XmlNamespace getNamespace() { xmlHasNs(this, result, _) }
/** Gets the value of this attribute. */
string getValue() { xmlAttrs(this, _, _, result, _, _) }
/** Gets a printable representation of this XML attribute. */
override string toString() { result = this.getName() + "=" + this.getValue() }
}
/**
* A namespace used in an XML file.
*
* Example:
*
* ```
* xmlns:android="http://schemas.android.com/apk/res/android"
* ```
*/
class XmlNamespace extends XmlLocatable, @xmlnamespace {
/** Gets the prefix of this namespace. */
string getPrefix() { xmlNs(this, result, _, _) }
/** Gets the URI of this namespace. */
string getUri() { xmlNs(this, _, result, _) }
/** Holds if this namespace has no prefix. */
predicate isDefault() { this.getPrefix() = "" }
override string toString() {
this.isDefault() and result = this.getUri()
or
not this.isDefault() and result = this.getPrefix() + ":" + this.getUri()
}
}
/**
* A comment in an XML file.
*
* Example:
*
* ```
* <!-- This is a comment. -->
* ```
*/
class XmlComment extends @xmlcomment, XmlLocatable {
/** Gets the text content of this XML comment. */
string getText() { xmlComments(this, result, _, _) }
/** Gets the parent of this XML comment. */
XmlParent getParent() { xmlComments(this, _, result, _) }
/** Gets a printable representation of this XML comment. */
override string toString() { result = this.getText() }
}
/**
* A sequence of characters that occurs between opening and
* closing tags of an XML element, excluding other elements.
*
* Example:
*
* ```
* <content>This is a sequence of characters.</content>
* ```
*/
class XmlCharacters extends @xmlcharacters, XmlLocatable {
/** Gets the content of this character sequence. */
string getCharacters() { xmlChars(this, result, _, _, _, _) }
/** Gets the parent of this character sequence. */
XmlParent getParent() { xmlChars(this, _, result, _, _, _) }
/** Holds if this character sequence is CDATA. */
predicate isCDATA() { xmlChars(this, _, _, _, 1, _) }
/** Gets a printable representation of this XML character sequence. */
override string toString() { result = this.getCharacters() }
}
import Make<File, Location, Input>

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
// NOTE: There are two copies of this file, and they must be kept identical:
// - semmle/code/cpp/controlflow/SubBasicBlocks.qll
// - semmle/code/cpp/dataflow/internal/SubBasicBlocks.qll
// - semmle/code/cpp/dataflow/internal/SubBasicBlocks.qll [now DEPRECATED]
//
// The second one is a private copy of the `SubBasicBlocks` library for
// internal use by the data flow library. Having an extra copy prevents

View File

@@ -28,6 +28,6 @@ import cpp
deprecated module DataFlow {
private import semmle.code.cpp.dataflow.internal.DataFlowImplSpecific
private import codeql.dataflow.DataFlow
import DataFlowMake<CppOldDataFlow>
import DataFlowMake<Location, CppOldDataFlow>
import semmle.code.cpp.dataflow.internal.DataFlowImpl1
}

View File

@@ -0,0 +1,556 @@
/**
* INTERNAL use only. This is an experimental API subject to change without notice.
*
* Provides classes and predicates for dealing with flow models specified in CSV format.
*
* The CSV specification has the following columns:
* - Sources:
* `namespace; type; subtypes; name; signature; ext; output; kind`
* - Sinks:
* `namespace; type; subtypes; name; signature; ext; input; kind`
* - Summaries:
* `namespace; type; subtypes; name; signature; ext; input; output; kind`
*
* The interpretation of a row is similar to API-graphs with a left-to-right
* reading.
* 1. The `namespace` column selects a namespace.
* 2. The `type` column selects a type within that namespace.
* 3. The `subtypes` is a boolean that indicates whether to jump to an
* arbitrary subtype of that type. Set this to `false` if leaving the `type`
* blank (for example, a free function).
* 4. The `name` column optionally selects a specific named member of the type.
* 5. The `signature` column optionally restricts the named member. If
* `signature` is blank then no such filtering is done. The format of the
* signature is a comma-separated list of types enclosed in parentheses. The
* types can be short names or fully qualified names (mixing these two options
* is not allowed within a single signature).
* 6. The `ext` column specifies additional API-graph-like edges. Currently
* there is only one valid value: "".
* 7. The `input` column specifies how data enters the element selected by the
* first 6 columns, and the `output` column specifies how data leaves the
* element selected by the first 6 columns. An `input` can be either:
* - "": Selects a write to the selected element in case this is a field.
* - "Argument[n]": Selects an argument in a call to the selected element.
* The arguments are zero-indexed, and `-1` specifies the qualifier object,
* that is, `*this`.
* - one or more "*" can be added in front of the argument index to indicate
* indirection, for example, `Argument[*0]` indicates the first indirection
* of the 0th argument.
* - `n1..n2` syntax can be used to indicate a range of arguments, inclusive
* at both ends. One or more "*"s can be added in front of the whole range
* to indicate that every argument in the range is indirect, for example
* `*0..1` is the first indirection of both arguments 0 and 1.
* - "ReturnValue": Selects a value being returned by the selected element.
* One or more "*" can be added as an argument to indicate indirection, for
* example, "ReturnValue[*]" indicates the first indirection of the return
* value.
*
* An `output` can be either:
* - "": Selects a read of a selected field.
* - "Argument[n]": Selects the post-update value of an argument in a call to
* the selected element. That is, the value of the argument after the call
* returns. The arguments are zero-indexed, and `-1` specifies the qualifier
* object, that is, `*this`.
* - one or more "*" can be added in front of the argument index to indicate
* indirection, for example, `Argument[*0]` indicates the first indirection
* of the 0th argument.
* - `n1..n2` syntax can be used to indicate a range of arguments, inclusive
* at both ends. One or more "*"s can be added in front of the whole range
* to indicate that every argument in the range is indirect, for example
* `*0..1` is the first indirection of both arguments 0 and 1.
* - "Parameter[n]": Selects the value of a parameter of the selected element.
* The syntax is the same as for "Argument", for example "Parameter[0]",
* "Parameter[*0]", "Parameter[0..2]" etc.
* - "ReturnValue": Selects a value being returned by the selected element.
* One or more "*" can be added as an argument to indicate indirection, for
* example, "ReturnValue[*]" indicates the first indirection of the return
* value.
* 8. The `kind` column is a tag that can be referenced from QL to determine to
* which classes the interpreted elements should be added. For example, for
* sources "remote" indicates a default remote flow source, and for summaries
* "taint" indicates a default additional taint step and "value" indicates a
* globally applicable value-preserving step.
*/
import cpp
private import new.DataFlow
private import internal.FlowSummaryImpl
private import internal.FlowSummaryImpl::Public
private import internal.FlowSummaryImpl::Private
private import internal.FlowSummaryImpl::Private::External
private import codeql.mad.ModelValidation as SharedModelVal
private import codeql.util.Unit
/**
* A unit class for adding additional source model rows.
*
* Extend this class to add additional source definitions.
*/
class SourceModelCsv extends Unit {
/** Holds if `row` specifies a source definition. */
abstract predicate row(string row);
}
/**
* A unit class for adding additional sink model rows.
*
* Extend this class to add additional sink definitions.
*/
class SinkModelCsv extends Unit {
/** Holds if `row` specifies a sink definition. */
abstract predicate row(string row);
}
/**
* A unit class for adding additional summary model rows.
*
* Extend this class to add additional flow summary definitions.
*/
class SummaryModelCsv extends Unit {
/** Holds if `row` specifies a summary definition. */
abstract predicate row(string row);
}
/** Holds if `row` is a source model. */
predicate sourceModel(string row) { any(SourceModelCsv s).row(row) }
/** Holds if `row` is a sink model. */
predicate sinkModel(string row) { any(SinkModelCsv s).row(row) }
/** Holds if `row` is a summary model. */
predicate summaryModel(string row) { any(SummaryModelCsv s).row(row) }
/** Holds if a source model exists for the given parameters. */
predicate sourceModel(
string namespace, string type, boolean subtypes, string name, string signature, string ext,
string output, string kind, string provenance
) {
exists(string row |
sourceModel(row) and
row.splitAt(";", 0) = namespace and
row.splitAt(";", 1) = type and
row.splitAt(";", 2) = subtypes.toString() and
subtypes = [true, false] and
row.splitAt(";", 3) = name and
row.splitAt(";", 4) = signature and
row.splitAt(";", 5) = ext and
row.splitAt(";", 6) = output and
row.splitAt(";", 7) = kind
) and
provenance = "manual"
}
/** Holds if a sink model exists for the given parameters. */
predicate sinkModel(
string namespace, string type, boolean subtypes, string name, string signature, string ext,
string input, string kind, string provenance
) {
exists(string row |
sinkModel(row) and
row.splitAt(";", 0) = namespace and
row.splitAt(";", 1) = type and
row.splitAt(";", 2) = subtypes.toString() and
subtypes = [true, false] and
row.splitAt(";", 3) = name and
row.splitAt(";", 4) = signature and
row.splitAt(";", 5) = ext and
row.splitAt(";", 6) = input and
row.splitAt(";", 7) = kind
) and
provenance = "manual"
}
/** Holds if a summary model exists for the given parameters. */
predicate summaryModel(
string namespace, string type, boolean subtypes, string name, string signature, string ext,
string input, string output, string kind, string provenance
) {
exists(string row |
summaryModel(row) and
row.splitAt(";", 0) = namespace and
row.splitAt(";", 1) = type and
row.splitAt(";", 2) = subtypes.toString() and
subtypes = [true, false] and
row.splitAt(";", 3) = name and
row.splitAt(";", 4) = signature and
row.splitAt(";", 5) = ext and
row.splitAt(";", 6) = input and
row.splitAt(";", 7) = output and
row.splitAt(";", 8) = kind
) and
provenance = "manual"
}
private predicate relevantNamespace(string namespace) {
sourceModel(namespace, _, _, _, _, _, _, _, _) or
sinkModel(namespace, _, _, _, _, _, _, _, _) or
summaryModel(namespace, _, _, _, _, _, _, _, _, _)
}
private predicate namespaceLink(string shortns, string longns) {
relevantNamespace(shortns) and
relevantNamespace(longns) and
longns.prefix(longns.indexOf("::")) = shortns
}
private predicate canonicalNamespace(string namespace) {
relevantNamespace(namespace) and not namespaceLink(_, namespace)
}
private predicate canonicalNamespaceLink(string namespace, string subns) {
canonicalNamespace(namespace) and
(subns = namespace or namespaceLink(namespace, subns))
}
/**
* Holds if CSV framework coverage of `namespace` is `n` api endpoints of the
* kind `(kind, part)`.
*/
predicate modelCoverage(string namespace, int namespaces, string kind, string part, int n) {
namespaces = strictcount(string subns | canonicalNamespaceLink(namespace, subns)) and
(
part = "source" and
n =
strictcount(string subns, string type, boolean subtypes, string name, string signature,
string ext, string output, string provenance |
canonicalNamespaceLink(namespace, subns) and
sourceModel(subns, type, subtypes, name, signature, ext, output, kind, provenance)
)
or
part = "sink" and
n =
strictcount(string subns, string type, boolean subtypes, string name, string signature,
string ext, string input, string provenance |
canonicalNamespaceLink(namespace, subns) and
sinkModel(subns, type, subtypes, name, signature, ext, input, kind, provenance)
)
or
part = "summary" and
n =
strictcount(string subns, string type, boolean subtypes, string name, string signature,
string ext, string input, string output, string provenance |
canonicalNamespaceLink(namespace, subns) and
summaryModel(subns, type, subtypes, name, signature, ext, input, output, kind, provenance)
)
)
}
/** Provides a query predicate to check the CSV data for validation errors. */
module CsvValidation {
private string getInvalidModelInput() {
exists(string pred, AccessPath input, string part |
sinkModel(_, _, _, _, _, _, input, _, _) and pred = "sink"
or
summaryModel(_, _, _, _, _, _, input, _, _, _) and pred = "summary"
|
(
invalidSpecComponent(input, part) and
not part = "" and
not (part = "Argument" and pred = "sink") and
not parseArg(part, _)
or
part = input.getToken(_) and
parseParam(part, _)
) and
result = "Unrecognized input specification \"" + part + "\" in " + pred + " model."
)
}
private string getInvalidModelOutput() {
exists(string pred, string output, string part |
sourceModel(_, _, _, _, _, _, output, _, _) and pred = "source"
or
summaryModel(_, _, _, _, _, _, _, output, _, _) and pred = "summary"
|
invalidSpecComponent(output, part) and
not part = "" and
not (part = ["Argument", "Parameter"] and pred = "source") and
result = "Unrecognized output specification \"" + part + "\" in " + pred + " model."
)
}
private module KindValConfig implements SharedModelVal::KindValidationConfigSig {
predicate summaryKind(string kind) { summaryModel(_, _, _, _, _, _, _, _, kind, _) }
predicate sinkKind(string kind) { sinkModel(_, _, _, _, _, _, _, kind, _) }
predicate sourceKind(string kind) { sourceModel(_, _, _, _, _, _, _, kind, _) }
}
private module KindVal = SharedModelVal::KindValidation<KindValConfig>;
private string getInvalidModelSubtype() {
exists(string pred, string row |
sourceModel(row) and pred = "source"
or
sinkModel(row) and pred = "sink"
or
summaryModel(row) and pred = "summary"
|
exists(string b |
b = row.splitAt(";", 2) and
not b = ["true", "false"] and
result = "Invalid boolean \"" + b + "\" in " + pred + " model."
)
)
}
private string getInvalidModelColumnCount() {
exists(string pred, string row, int expect |
sourceModel(row) and expect = 8 and pred = "source"
or
sinkModel(row) and expect = 8 and pred = "sink"
or
summaryModel(row) and expect = 9 and pred = "summary"
|
exists(int cols |
cols = 1 + max(int n | exists(row.splitAt(";", n))) and
cols != expect and
result =
"Wrong number of columns in " + pred + " model row, expected " + expect + ", got " + cols +
"."
)
)
}
private string getInvalidModelSignature() {
exists(string pred, string namespace, string type, string name, string signature, string ext |
sourceModel(namespace, type, _, name, signature, ext, _, _, _) and pred = "source"
or
sinkModel(namespace, type, _, name, signature, ext, _, _, _) and pred = "sink"
or
summaryModel(namespace, type, _, name, signature, ext, _, _, _, _) and pred = "summary"
|
not namespace.regexpMatch("[a-zA-Z0-9_\\.]+") and
result = "Dubious namespace \"" + namespace + "\" in " + pred + " model."
or
not type.regexpMatch("[a-zA-Z0-9_<>,\\+]+") and
result = "Dubious type \"" + type + "\" in " + pred + " model."
or
not name.regexpMatch("[a-zA-Z0-9_<>,]*") and
result = "Dubious member name \"" + name + "\" in " + pred + " model."
or
not signature.regexpMatch("|\\([a-zA-Z0-9_<>\\.\\+\\*,\\[\\]]*\\)") and
result = "Dubious signature \"" + signature + "\" in " + pred + " model."
or
not ext.regexpMatch("|Attribute") and
result = "Unrecognized extra API graph element \"" + ext + "\" in " + pred + " model."
)
}
/** Holds if some row in a CSV-based flow model appears to contain typos. */
query predicate invalidModelRow(string msg) {
msg =
[
getInvalidModelSignature(), getInvalidModelInput(), getInvalidModelOutput(),
getInvalidModelSubtype(), getInvalidModelColumnCount(), KindVal::getInvalidModelKind()
]
}
}
private predicate elementSpec(
string namespace, string type, boolean subtypes, string name, string signature, string ext
) {
sourceModel(namespace, type, subtypes, name, signature, ext, _, _, _) or
sinkModel(namespace, type, subtypes, name, signature, ext, _, _, _) or
summaryModel(namespace, type, subtypes, name, signature, ext, _, _, _, _)
}
private string paramsStringPart(Function c, int i) {
i = -1 and result = "(" and exists(c)
or
exists(int n, string p | c.getParameter(n).getType().toString() = p |
i = 2 * n and result = p
or
i = 2 * n - 1 and result = "," and n != 0
)
or
i = 2 * c.getNumberOfParameters() and result = ")"
}
/**
* Gets a parenthesized string containing all parameter types of this callable, separated by a comma.
*
* Returns the empty string if the callable has no parameters.
* Parameter types are represented by their type erasure.
*/
cached
private string paramsString(Function c) {
result = concat(int i | | paramsStringPart(c, i) order by i)
}
bindingset[func]
private predicate matchesSignature(Function func, string signature) {
signature = "" or
paramsString(func) = signature
}
/**
* Gets the element in module `namespace` that satisfies the following properties:
* 1. If the element is a member of a class-like type, then the class-like type has name `type`
* 2. If `subtypes = true` and the element is a member of a class-like type, then overrides of the element
* are also returned.
* 3. The element has name `name`
* 4. If `signature` is non-empty, then the element has a list of parameter types described by `signature`.
*
* NOTE: `namespace` is currently not used (since we don't properly extract modules yet).
*/
pragma[nomagic]
private Element interpretElement0(
string namespace, string type, boolean subtypes, string name, string signature
) {
elementSpec(namespace, type, subtypes, name, signature, _) and
(
// Non-member functions
exists(Function func |
func.hasQualifiedName(namespace, name) and
type = "" and
matchesSignature(func, signature) and
subtypes = false and
not exists(func.getDeclaringType()) and
result = func
)
or
// Member functions
exists(Class namedClass, Class classWithMethod, Function method |
classWithMethod = method.getClassAndName(name) and
namedClass.hasQualifiedName(namespace, type) and
matchesSignature(method, signature) and
result = method
|
// member declared in the named type or a subtype of it
subtypes = true and
classWithMethod = namedClass.getADerivedClass*()
or
// member declared directly in the named type
subtypes = false and
classWithMethod = namedClass
)
or
// Member variables
signature = "" and
exists(Class namedClass, Class classWithMember, MemberVariable member |
member.getName() = name and
member = classWithMember.getAMember() and
namedClass.hasQualifiedName(namespace, type) and
result = member
|
// field declared in the named type or a subtype of it (or an extension of any)
subtypes = true and
classWithMember = namedClass.getADerivedClass*()
or
// field declared directly in the named type (or an extension of it)
subtypes = false and
classWithMember = namedClass
)
or
// Global or namespace variables
signature = "" and
type = "" and
subtypes = false and
result = any(GlobalOrNamespaceVariable v | v.hasQualifiedName(namespace, name))
)
}
/** Gets the source/sink/summary element corresponding to the supplied parameters. */
Element interpretElement(
string namespace, string type, boolean subtypes, string name, string signature, string ext
) {
elementSpec(namespace, type, subtypes, name, signature, ext) and
exists(Element e | e = interpretElement0(namespace, type, subtypes, name, signature) |
ext = "" and result = e
)
}
cached
private module Cached {
/**
* Holds if `node` is specified as a source with the given kind in a CSV flow
* model.
*/
cached
predicate sourceNode(DataFlow::Node node, string kind) {
exists(SourceSinkInterpretationInput::InterpretNode n |
isSourceNode(n, kind, _) and n.asNode() = node // TODO
)
}
/**
* Holds if `node` is specified as a sink with the given kind in a CSV flow
* model.
*/
cached
predicate sinkNode(DataFlow::Node node, string kind) {
exists(SourceSinkInterpretationInput::InterpretNode n |
isSinkNode(n, kind, _) and n.asNode() = node // TODO
)
}
}
import Cached
private predicate interpretSummary(
Function f, string input, string output, string kind, string provenance
) {
exists(
string namespace, string type, boolean subtypes, string name, string signature, string ext
|
summaryModel(namespace, type, subtypes, name, signature, ext, input, output, kind, provenance) and
f = interpretElement(namespace, type, subtypes, name, signature, ext)
)
}
// adapter class for converting Mad summaries to `SummarizedCallable`s
private class SummarizedCallableAdapter extends SummarizedCallable {
SummarizedCallableAdapter() { interpretSummary(this, _, _, _, _) }
private predicate relevantSummaryElementManual(string input, string output, string kind) {
exists(Provenance provenance |
interpretSummary(this, input, output, kind, provenance) and
provenance.isManual()
)
}
private predicate relevantSummaryElementGenerated(string input, string output, string kind) {
exists(Provenance provenance |
interpretSummary(this, input, output, kind, provenance) and
provenance.isGenerated()
)
}
override predicate propagatesFlow(
string input, string output, boolean preservesValue, string model
) {
exists(string kind |
this.relevantSummaryElementManual(input, output, kind)
or
not this.relevantSummaryElementManual(_, _, _) and
this.relevantSummaryElementGenerated(input, output, kind)
|
if kind = "value" then preservesValue = true else preservesValue = false
) and
model = "" // TODO
}
override predicate hasProvenance(Provenance provenance) {
interpretSummary(this, _, _, _, provenance)
}
}
// adapter class for converting Mad neutrals to `NeutralCallable`s
private class NeutralCallableAdapter extends NeutralCallable {
string kind;
string provenance_;
NeutralCallableAdapter() {
// Neutral models have not been implemented for CPP.
none() and
exists(this) and
exists(kind) and
exists(provenance_)
}
override string getKind() { result = kind }
override predicate hasProvenance(Provenance provenance) { provenance = provenance_ }
}

View File

@@ -29,6 +29,6 @@ deprecated module TaintTracking {
private import semmle.code.cpp.dataflow.internal.DataFlowImplSpecific
private import semmle.code.cpp.dataflow.internal.TaintTrackingImplSpecific
private import codeql.dataflow.TaintTracking
import TaintFlowMake<CppOldDataFlow, CppOldTaintTracking>
import TaintFlowMake<Location, CppOldDataFlow, CppOldTaintTracking>
import semmle.code.cpp.dataflow.internal.tainttracking1.TaintTrackingImpl
}

View File

@@ -1,4 +1,6 @@
/**
* DEPRECATED: Use `semmle.code.cpp.dataflow.new.DataFlow` instead.
*
* Provides a local analysis for identifying where a variable address
* is effectively taken. Array-like offsets are allowed to pass through but
* not field-like offsets.

View File

@@ -1,3 +1,7 @@
/**
* DEPRECATED: Use `semmle.code.cpp.dataflow.new.DataFlow` instead.
*/
private import cpp
private import DataFlowPrivate
private import DataFlowUtil

View File

@@ -1,3 +1,8 @@
/**
* DEPRECATED: Use `semmle.code.cpp.dataflow.new.DataFlow` instead.
*/
private import semmle.code.cpp.Location
private import DataFlowImplSpecific
private import codeql.dataflow.internal.DataFlowImpl
import MakeImpl<CppOldDataFlow>
import MakeImpl<Location, CppOldDataFlow>

View File

@@ -263,9 +263,10 @@ deprecated private module Config implements FullStateConfigSig {
predicate isBarrierOut(Node node, FlowState state) { none() }
predicate isAdditionalFlowStep(Node node1, Node node2) {
predicate isAdditionalFlowStep(Node node1, Node node2, string model) {
singleConfiguration() and
any(Configuration config).isAdditionalFlowStep(node1, node2)
any(Configuration config).isAdditionalFlowStep(node1, node2) and
model = ""
}
predicate isAdditionalFlowStep(Node node1, FlowState state1, Node node2, FlowState state2) {
@@ -285,6 +286,8 @@ deprecated private module Config implements FullStateConfigSig {
int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) }
int accessPathLimit() { result = 5 }
FlowFeature getAFeature() { result = any(Configuration config).getAFeature() }
predicate sourceGrouping(Node source, string sourceGroup) {

View File

@@ -263,9 +263,10 @@ deprecated private module Config implements FullStateConfigSig {
predicate isBarrierOut(Node node, FlowState state) { none() }
predicate isAdditionalFlowStep(Node node1, Node node2) {
predicate isAdditionalFlowStep(Node node1, Node node2, string model) {
singleConfiguration() and
any(Configuration config).isAdditionalFlowStep(node1, node2)
any(Configuration config).isAdditionalFlowStep(node1, node2) and
model = ""
}
predicate isAdditionalFlowStep(Node node1, FlowState state1, Node node2, FlowState state2) {
@@ -285,6 +286,8 @@ deprecated private module Config implements FullStateConfigSig {
int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) }
int accessPathLimit() { result = 5 }
FlowFeature getAFeature() { result = any(Configuration config).getAFeature() }
predicate sourceGrouping(Node source, string sourceGroup) {

View File

@@ -263,9 +263,10 @@ deprecated private module Config implements FullStateConfigSig {
predicate isBarrierOut(Node node, FlowState state) { none() }
predicate isAdditionalFlowStep(Node node1, Node node2) {
predicate isAdditionalFlowStep(Node node1, Node node2, string model) {
singleConfiguration() and
any(Configuration config).isAdditionalFlowStep(node1, node2)
any(Configuration config).isAdditionalFlowStep(node1, node2) and
model = ""
}
predicate isAdditionalFlowStep(Node node1, FlowState state1, Node node2, FlowState state2) {
@@ -285,6 +286,8 @@ deprecated private module Config implements FullStateConfigSig {
int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) }
int accessPathLimit() { result = 5 }
FlowFeature getAFeature() { result = any(Configuration config).getAFeature() }
predicate sourceGrouping(Node source, string sourceGroup) {

View File

@@ -263,9 +263,10 @@ deprecated private module Config implements FullStateConfigSig {
predicate isBarrierOut(Node node, FlowState state) { none() }
predicate isAdditionalFlowStep(Node node1, Node node2) {
predicate isAdditionalFlowStep(Node node1, Node node2, string model) {
singleConfiguration() and
any(Configuration config).isAdditionalFlowStep(node1, node2)
any(Configuration config).isAdditionalFlowStep(node1, node2) and
model = ""
}
predicate isAdditionalFlowStep(Node node1, FlowState state1, Node node2, FlowState state2) {
@@ -285,6 +286,8 @@ deprecated private module Config implements FullStateConfigSig {
int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) }
int accessPathLimit() { result = 5 }
FlowFeature getAFeature() { result = any(Configuration config).getAFeature() }
predicate sourceGrouping(Node source, string sourceGroup) {

View File

@@ -1,3 +1,8 @@
/**
* DEPRECATED: Use `semmle.code.cpp.dataflow.new.DataFlow` instead.
*/
private import semmle.code.cpp.Location
private import DataFlowImplSpecific
private import codeql.dataflow.internal.DataFlowImplCommon
import MakeImplCommon<CppOldDataFlow>
import MakeImplCommon<Location, CppOldDataFlow>

View File

@@ -1,4 +1,6 @@
/**
* DEPRECATED: Use `semmle.code.cpp.dataflow.new.DataFlow` instead.
*
* Provides consistency queries for checking invariants in the language-specific
* data-flow classes and predicates.
*/
@@ -8,7 +10,7 @@ private import DataFlowImplSpecific
private import TaintTrackingImplSpecific
private import codeql.dataflow.internal.DataFlowImplConsistency
private module Input implements InputSig<CppOldDataFlow> {
private module Input implements InputSig<Location, CppOldDataFlow> {
predicate argHasPostUpdateExclude(Private::ArgumentNode n) {
// Is the null pointer (or something that's not really a pointer)
exists(n.asExpr().getValue())
@@ -24,4 +26,4 @@ private module Input implements InputSig<CppOldDataFlow> {
}
}
module Consistency = MakeConsistency<CppOldDataFlow, CppOldTaintTracking, Input>;
module Consistency = MakeConsistency<Location, CppOldDataFlow, CppOldTaintTracking, Input>;

View File

@@ -263,9 +263,10 @@ deprecated private module Config implements FullStateConfigSig {
predicate isBarrierOut(Node node, FlowState state) { none() }
predicate isAdditionalFlowStep(Node node1, Node node2) {
predicate isAdditionalFlowStep(Node node1, Node node2, string model) {
singleConfiguration() and
any(Configuration config).isAdditionalFlowStep(node1, node2)
any(Configuration config).isAdditionalFlowStep(node1, node2) and
model = ""
}
predicate isAdditionalFlowStep(Node node1, FlowState state1, Node node2, FlowState state2) {
@@ -285,6 +286,8 @@ deprecated private module Config implements FullStateConfigSig {
int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) }
int accessPathLimit() { result = 5 }
FlowFeature getAFeature() { result = any(Configuration config).getAFeature() }
predicate sourceGrouping(Node source, string sourceGroup) {

View File

@@ -1,7 +1,10 @@
/**
* DEPRECATED: Use `semmle.code.cpp.dataflow.new.DataFlow` instead.
*
* Provides C++-specific definitions for use in the data flow library.
*/
private import semmle.code.cpp.Location
private import codeql.dataflow.DataFlow
module Private {
@@ -13,7 +16,7 @@ module Public {
import DataFlowUtil
}
module CppOldDataFlow implements InputSig {
module CppOldDataFlow implements InputSig<Location> {
import Private
import Public

View File

@@ -1,3 +1,7 @@
/**
* DEPRECATED: Use `semmle.code.cpp.dataflow.new.DataFlow` instead.
*/
private import cpp
private import DataFlowUtil
private import DataFlowDispatch
@@ -282,6 +286,12 @@ predicate lambdaCall(DataFlowCall call, LambdaCallKind kind, Node receiver) { no
/** Extra data-flow steps needed for lambda flow analysis. */
predicate additionalLambdaFlowStep(Node nodeFrom, Node nodeTo, boolean preservesValue) { none() }
predicate knownSourceModel(Node source, string model) { none() }
predicate knownSinkModel(Node sink, string model) { none() }
class DataFlowSecondLevelScope = Unit;
/**
* Holds if flow is allowed to pass from parameter `p` and back to itself as a
* side-effect, resulting in a summary from `p` to itself.

View File

@@ -1,4 +1,6 @@
/**
* DEPRECATED: Use `semmle.code.cpp.dataflow.new.DataFlow` instead.
*
* Provides C++-specific definitions for use in the data flow library.
*/
@@ -103,7 +105,7 @@ class Node extends TNode {
* For more information, see
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
*/
predicate hasLocationInfo(
deprecated predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
@@ -514,7 +516,7 @@ private module ThisFlow {
*/
cached
predicate localFlowStep(Node nodeFrom, Node nodeTo) {
simpleLocalFlowStep(nodeFrom, nodeTo)
simpleLocalFlowStep(nodeFrom, nodeTo, _)
or
// Field flow is not strictly a "step" but covers the whole function
// transitively. There's no way to get a step-like relation out of the global
@@ -528,64 +530,67 @@ predicate localFlowStep(Node nodeFrom, Node nodeTo) {
* This is the local flow predicate that's used as a building block in global
* data flow. It may have less flow than the `localFlowStep` predicate.
*/
predicate simpleLocalFlowStep(Node nodeFrom, Node nodeTo) {
// Expr -> Expr
exprToExprStep_nocfg(nodeFrom.asExpr(), nodeTo.asExpr())
or
// Assignment -> LValue post-update node
//
// This is used for assignments whose left-hand side is not a variable
// assignment or a storeStep but is still modeled by other means. It could be
// a call to `operator*` or `operator[]` where taint should flow to the
// post-update node of the qualifier.
exists(AssignExpr assign |
nodeFrom.asExpr() = assign and
nodeTo.(PostUpdateNode).getPreUpdateNode().asExpr() = assign.getLValue()
)
or
// Node -> FlowVar -> VariableAccess
exists(FlowVar var |
(
exprToVarStep(nodeFrom.asExpr(), var)
or
varSourceBaseCase(var, nodeFrom.asParameter())
or
varSourceBaseCase(var, nodeFrom.asUninitialized())
or
var.definedPartiallyAt(nodeFrom.asPartialDefinition())
) and
varToNodeStep(var, nodeTo)
)
or
// Expr -> DefinitionByReferenceNode
exprToDefinitionByReferenceStep(nodeFrom.asExpr(), nodeTo.asDefiningArgument())
or
// `this` -> adjacent-`this`
ThisFlow::adjacentThisRefs(nodeFrom, nodeTo)
or
// post-update-`this` -> following-`this`-ref
ThisFlow::adjacentThisRefs(nodeFrom.(PostUpdateNode).getPreUpdateNode(), nodeTo)
or
// In `f(&x->a)`, this step provides the flow from post-`&` to post-`x->a`,
// from which there is field flow to `x` via reverse read.
exists(PartialDefinition def, Expr inner, Expr outer |
def.definesExpressions(inner, outer) and
inner = nodeTo.(InnerPartialDefinitionNode).getPreUpdateNode().asExpr() and
outer = nodeFrom.(PartialDefinitionNode).getPreUpdateNode().asExpr()
)
or
// Reverse flow: data that flows from the post-update node of a reference
// returned by a function call, back into the qualifier of that function.
// This allows data to flow 'in' through references returned by a modeled
// function such as `operator[]`.
exists(DataFlowFunction f, Call call, FunctionInput inModel, FunctionOutput outModel |
call.getTarget() = f and
inModel.isReturnValueDeref() and
outModel.isQualifierObject() and
f.hasDataFlow(inModel, outModel) and
nodeFrom.(PostUpdateNode).getPreUpdateNode().asExpr() = call and
nodeTo.asDefiningArgument() = call.getQualifier()
)
predicate simpleLocalFlowStep(Node nodeFrom, Node nodeTo, string model) {
(
// Expr -> Expr
exprToExprStep_nocfg(nodeFrom.asExpr(), nodeTo.asExpr())
or
// Assignment -> LValue post-update node
//
// This is used for assignments whose left-hand side is not a variable
// assignment or a storeStep but is still modeled by other means. It could be
// a call to `operator*` or `operator[]` where taint should flow to the
// post-update node of the qualifier.
exists(AssignExpr assign |
nodeFrom.asExpr() = assign and
nodeTo.(PostUpdateNode).getPreUpdateNode().asExpr() = assign.getLValue()
)
or
// Node -> FlowVar -> VariableAccess
exists(FlowVar var |
(
exprToVarStep(nodeFrom.asExpr(), var)
or
varSourceBaseCase(var, nodeFrom.asParameter())
or
varSourceBaseCase(var, nodeFrom.asUninitialized())
or
var.definedPartiallyAt(nodeFrom.asPartialDefinition())
) and
varToNodeStep(var, nodeTo)
)
or
// Expr -> DefinitionByReferenceNode
exprToDefinitionByReferenceStep(nodeFrom.asExpr(), nodeTo.asDefiningArgument())
or
// `this` -> adjacent-`this`
ThisFlow::adjacentThisRefs(nodeFrom, nodeTo)
or
// post-update-`this` -> following-`this`-ref
ThisFlow::adjacentThisRefs(nodeFrom.(PostUpdateNode).getPreUpdateNode(), nodeTo)
or
// In `f(&x->a)`, this step provides the flow from post-`&` to post-`x->a`,
// from which there is field flow to `x` via reverse read.
exists(PartialDefinition def, Expr inner, Expr outer |
def.definesExpressions(inner, outer) and
inner = nodeTo.(InnerPartialDefinitionNode).getPreUpdateNode().asExpr() and
outer = nodeFrom.(PartialDefinitionNode).getPreUpdateNode().asExpr()
)
or
// Reverse flow: data that flows from the post-update node of a reference
// returned by a function call, back into the qualifier of that function.
// This allows data to flow 'in' through references returned by a modeled
// function such as `operator[]`.
exists(DataFlowFunction f, Call call, FunctionInput inModel, FunctionOutput outModel |
call.getTarget() = f and
inModel.isReturnValueDeref() and
outModel.isQualifierObject() and
f.hasDataFlow(inModel, outModel) and
nodeFrom.(PostUpdateNode).getPreUpdateNode().asExpr() = call and
nodeTo.asDefiningArgument() = call.getQualifier()
)
) and
model = ""
}
/**

View File

@@ -0,0 +1,271 @@
/**
* Provides classes and predicates for defining flow summaries.
*/
private import cpp as Cpp
private import codeql.dataflow.internal.FlowSummaryImpl
private import codeql.dataflow.internal.AccessPathSyntax as AccessPath
private import semmle.code.cpp.ir.dataflow.internal.DataFlowPrivate
private import semmle.code.cpp.ir.dataflow.internal.DataFlowUtil
private import semmle.code.cpp.ir.dataflow.internal.DataFlowImplSpecific as DataFlowImplSpecific
private import semmle.code.cpp.dataflow.ExternalFlow
private import semmle.code.cpp.ir.IR
module Input implements InputSig<Location, DataFlowImplSpecific::CppDataFlow> {
class SummarizedCallableBase = Function;
ArgumentPosition callbackSelfParameterPosition() { result = TDirectPosition(-1) }
ReturnKind getStandardReturnValueKind() { result.(NormalReturnKind).getIndirectionIndex() = 0 }
string encodeParameterPosition(ParameterPosition pos) { result = pos.toString() }
string encodeArgumentPosition(ArgumentPosition pos) { result = pos.toString() }
string encodeReturn(ReturnKind rk, string arg) {
rk != getStandardReturnValueKind() and
result = "ReturnValue" and
arg = repeatStars(rk.(NormalReturnKind).getIndirectionIndex())
}
string encodeContent(ContentSet cs, string arg) {
exists(FieldContent c |
cs.isSingleton(c) and
// FieldContent indices have 0 for the address, 1 for content, so we need to subtract one.
result = "Field" and
arg = repeatStars(c.getIndirectionIndex() - 1) + c.getField().getName()
)
}
string encodeWithoutContent(ContentSet c, string arg) {
// used for type tracking, not currently used in C/C++.
result = "WithoutContent" + c and arg = ""
}
string encodeWithContent(ContentSet c, string arg) {
// used for type tracking, not currently used in C/C++.
result = "WithContent" + c and arg = ""
}
/**
* Decodes an argument / parameter position string, for example the `0` in `Argument[0]`.
* Supports ranges (`Argument[x..y]`), qualifiers (`Argument[-1]`), indirections
* (`Argument[*x]`) and combinations (such as `Argument[**0..1]`).
*/
bindingset[argString]
private TPosition decodePosition(string argString) {
exists(int indirection, string posString, int pos |
argString = repeatStars(indirection) + posString and
pos = AccessPath::parseInt(posString) and
(
pos >= 0 and indirection = 0 and result = TDirectPosition(pos)
or
pos >= 0 and indirection > 0 and result = TIndirectionPosition(pos, indirection)
or
// `Argument[-1]` / `Parameter[-1]` is the qualifier object `*this`, not the `this` pointer itself.
pos = -1 and result = TIndirectionPosition(pos, indirection + 1)
)
)
}
bindingset[token]
ParameterPosition decodeUnknownParameterPosition(AccessPath::AccessPathTokenBase token) {
token.getName() = "Argument" and
result = decodePosition(token.getAnArgument())
}
bindingset[token]
ArgumentPosition decodeUnknownArgumentPosition(AccessPath::AccessPathTokenBase token) {
token.getName() = "Parameter" and
result = decodePosition(token.getAnArgument())
}
bindingset[token]
ContentSet decodeUnknownContent(AccessPath::AccessPathTokenBase token) {
// field content (no indirection support)
exists(FieldContent c |
result.isSingleton(c) and
token.getName() = c.getField().getName() and
not exists(token.getArgumentList()) and
c.getIndirectionIndex() = 1
)
or
// field content (with indirection support)
exists(FieldContent c |
result.isSingleton(c) and
token.getName() = c.getField().getName() and
// FieldContent indices have 0 for the address, 1 for content, so we need to subtract one.
token.getAnArgument() = repeatStars(c.getIndirectionIndex() - 1)
)
}
}
private import Make<Location, DataFlowImplSpecific::CppDataFlow, Input> as Impl
private module StepsInput implements Impl::Private::StepsInputSig {
DataFlowCall getACall(Public::SummarizedCallable sc) {
result.getStaticCallTarget().getUnderlyingCallable() = sc
}
}
module SourceSinkInterpretationInput implements
Impl::Private::External::SourceSinkInterpretationInputSig
{
class Element = Cpp::Element;
class SourceOrSinkElement = Element;
/**
* Holds if an external source specification exists for `e` with output specification
* `output`, kind `kind`, and provenance `provenance`.
*/
predicate sourceElement(
SourceOrSinkElement e, string output, string kind, Public::Provenance provenance, string model
) {
exists(
string namespace, string type, boolean subtypes, string name, string signature, string ext
|
sourceModel(namespace, type, subtypes, name, signature, ext, output, kind, provenance) and
e = interpretElement(namespace, type, subtypes, name, signature, ext) and
model = "" // TODO
)
}
/**
* Holds if an external sink specification exists for `e` with input specification
* `input`, kind `kind` and provenance `provenance`.
*/
predicate sinkElement(
SourceOrSinkElement e, string input, string kind, Public::Provenance provenance, string model
) {
exists(
string package, string type, boolean subtypes, string name, string signature, string ext
|
sinkModel(package, type, subtypes, name, signature, ext, input, kind, provenance) and
e = interpretElement(package, type, subtypes, name, signature, ext) and
model = "" // TODO
)
}
private newtype TInterpretNode =
TElement_(Element n) or
TNode_(Node n)
/** An entity used to interpret a source/sink specification. */
class InterpretNode extends TInterpretNode {
/** Gets the element that this node corresponds to, if any. */
SourceOrSinkElement asElement() { this = TElement_(result) }
/** Gets the data-flow node that this node corresponds to, if any. */
Node asNode() { this = TNode_(result) }
/** Gets the call that this node corresponds to, if any. */
DataFlowCall asCall() {
this.asElement() = result.asCallInstruction().getUnconvertedResultExpression()
}
/** Gets the callable that this node corresponds to, if any. */
DataFlowCallable asCallable() { result.getUnderlyingCallable() = this.asElement() }
/** Gets the target of this call, if any. */
Element getCallTarget() { result = this.asCall().getStaticCallTarget().getUnderlyingCallable() }
/** Gets a textual representation of this node. */
string toString() {
result = this.asElement().toString()
or
result = this.asNode().toString()
or
result = this.asCall().toString()
}
/** Gets the location of this node. */
Location getLocation() {
result = this.asElement().getLocation()
or
result = this.asNode().getLocation()
or
result = this.asCall().getLocation()
}
}
/** Provides additional sink specification logic. */
bindingset[c]
predicate interpretOutput(string c, InterpretNode mid, InterpretNode node) {
// Allow variables to be picked as output nodes.
exists(Node n, Element ast |
n = node.asNode() and
ast = mid.asElement()
|
c = "" and
n.asExpr().(VariableAccess).getTarget() = ast
)
}
/** Provides additional source specification logic. */
bindingset[c]
predicate interpretInput(string c, InterpretNode mid, InterpretNode node) {
exists(Node n, Element ast, VariableAccess e |
n = node.asNode() and
ast = mid.asElement() and
e.getTarget() = ast
|
// Allow variables to be picked as input nodes.
// We could simply do this as `e = n.asExpr()`, but that would not allow
// us to pick `x` as a sink in an example such as `x = source()` (but
// only subsequent uses of `x`) since the variable access on `x` doesn't
// actually load the value of `x`. So instead, we pick the instruction
// node corresponding to the generated `StoreInstruction` and use the
// expression associated with the destination instruction. This means
// that the `x` in `x = source()` can be marked as an input.
c = "" and
exists(StoreInstruction store |
store.getDestinationAddress().getUnconvertedResultExpression() = e and
n.asInstruction() = store
)
)
}
}
module Private {
import Impl::Private
module Steps = Impl::Private::Steps<StepsInput>;
module External {
import Impl::Private::External
import Impl::Private::External::SourceSinkInterpretation<SourceSinkInterpretationInput>
}
/**
* Provides predicates for constructing summary components.
*/
module SummaryComponent {
private import Impl::Private::SummaryComponent as SC
predicate parameter = SC::parameter/1;
predicate argument = SC::argument/1;
predicate content = SC::content/1;
predicate withoutContent = SC::withoutContent/1;
predicate withContent = SC::withContent/1;
}
/**
* Provides predicates for constructing stacks of summary components.
*/
module SummaryComponentStack {
private import Impl::Private::SummaryComponentStack as SCS
predicate singleton = SCS::singleton/1;
predicate push = SCS::push/2;
predicate argument = SCS::argument/1;
}
}
module Public = Impl::Public;

View File

@@ -1,4 +1,6 @@
/**
* DEPRECATED: Use `semmle.code.cpp.dataflow.new.DataFlow` instead.
*
* Provides a class for handling variables in the data flow analysis.
*/

View File

@@ -1,6 +1,6 @@
// NOTE: There are two copies of this file, and they must be kept identical:
// - semmle/code/cpp/controlflow/SubBasicBlocks.qll
// - semmle/code/cpp/dataflow/internal/SubBasicBlocks.qll
// - semmle/code/cpp/dataflow/internal/SubBasicBlocks.qll [now DEPRECATED]
//
// The second one is a private copy of the `SubBasicBlocks` library for
// internal use by the data flow library. Having an extra copy prevents

View File

@@ -1,10 +1,13 @@
/**
* DEPRECATED: Use `semmle.code.cpp.dataflow.new.DataFlow` instead.
*
* Provides C++-specific definitions for use in the taint tracking library.
*/
private import semmle.code.cpp.Location
private import codeql.dataflow.TaintTracking
private import DataFlowImplSpecific
module CppOldTaintTracking implements InputSig<CppOldDataFlow> {
module CppOldTaintTracking implements InputSig<Location, CppOldDataFlow> {
import TaintTrackingUtil
}

View File

@@ -1,4 +1,6 @@
/**
* DEPRECATED: Use `semmle.code.cpp.dataflow.new.DataFlow` instead.
*
* Provides classes for performing local (intra-procedural) and
* global (inter-procedural) taint-tracking analyses.
*
@@ -30,8 +32,8 @@ predicate localTaintStep(DataFlow::Node src, DataFlow::Node sink) {
* Holds if the additional step from `src` to `sink` should be included in all
* global taint flow configurations.
*/
predicate defaultAdditionalTaintStep(DataFlow::Node src, DataFlow::Node sink) {
localAdditionalTaintStep(src, sink)
predicate defaultAdditionalTaintStep(DataFlow::Node src, DataFlow::Node sink, string model) {
localAdditionalTaintStep(src, sink) and model = ""
}
/**

View File

@@ -127,7 +127,7 @@ abstract deprecated class Configuration extends DataFlow::Configuration {
final override predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) {
this.isAdditionalTaintStep(node1, node2) or
defaultAdditionalTaintStep(node1, node2)
defaultAdditionalTaintStep(node1, node2, _)
}
/**

View File

@@ -1,3 +1,7 @@
/**
* DEPRECATED: Use `Global` and `GlobalWithState` instead.
*/
import semmle.code.cpp.dataflow.internal.TaintTrackingUtil as Public
module Private {

View File

@@ -127,7 +127,7 @@ abstract deprecated class Configuration extends DataFlow::Configuration {
final override predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) {
this.isAdditionalTaintStep(node1, node2) or
defaultAdditionalTaintStep(node1, node2)
defaultAdditionalTaintStep(node1, node2, _)
}
/**

View File

@@ -1,3 +1,7 @@
/**
* DEPRECATED: Use `Global` and `GlobalWithState` instead.
*/
import semmle.code.cpp.dataflow.internal.TaintTrackingUtil as Public
module Private {

View File

@@ -28,6 +28,6 @@ import cpp
module DataFlow {
private import semmle.code.cpp.ir.dataflow.internal.DataFlowImplSpecific
private import codeql.dataflow.DataFlow
import DataFlowMake<CppDataFlow>
import DataFlowMake<Location, CppDataFlow>
import semmle.code.cpp.ir.dataflow.internal.DataFlowImpl1
}

View File

@@ -27,6 +27,7 @@ module TaintTracking {
private import semmle.code.cpp.ir.dataflow.internal.DataFlowImplSpecific
private import semmle.code.cpp.ir.dataflow.internal.TaintTrackingImplSpecific
private import codeql.dataflow.TaintTracking
import TaintFlowMake<CppDataFlow, CppTaintTracking>
private import semmle.code.cpp.Location
import TaintFlowMake<Location, CppDataFlow, CppTaintTracking>
import semmle.code.cpp.ir.dataflow.internal.tainttracking1.TaintTrackingImpl
}

View File

@@ -63,6 +63,12 @@ class Expr extends StmtParent, @expr {
* order of destruction.
*/
DestructorCall getImplicitDestructorCall(int n) {
exists(Expr e |
e = this.(TemporaryObjectExpr).getExpr() and
synthetic_destructor_call(e, max(int i | synthetic_destructor_call(e, i, _)) - n, result)
)
or
not this = any(TemporaryObjectExpr temp).getExpr() and
synthetic_destructor_call(this, max(int i | synthetic_destructor_call(this, i, _)) - n, result)
}
@@ -1015,8 +1021,33 @@ class DeleteOrDeleteArrayExpr extends Expr, TDeleteOrDeleteArrayExpr {
Expr getExpr() {
// If there is a destructor call, the object being deleted is the qualifier
// otherwise it is the third child.
result = this.getChild(3) or result = this.getDestructorCall().getQualifier()
exists(Expr exprWithReuse | exprWithReuse = this.getExprWithReuse() |
if not exprWithReuse instanceof ReuseExpr
then result = exprWithReuse
else result = this.getDestructorCall().getQualifier()
)
}
/**
* Gets the object or array being deleted, and gets a `ReuseExpr` when there
* is a destructor call and the object is also the qualifier of the call.
*
* For example, given:
* ```
* struct HasDestructor { ~HasDestructor(); };
* struct PlainOldData { int x, char y; };
*
* void f(HasDestructor* hasDestructor, PlainOldData* pod) {
* delete hasDestructor;
* delete pod;
* }
* ```
* This predicate yields a `ReuseExpr` for `delete hasDestructor`, as the
* the deleted expression has a destructor, and that expression is also
* the qualifier of the destructor call. In the case of `delete pod` the
* predicate does not yield a `ReuseExpr`, as there is no destructor call.
*/
Expr getExprWithReuse() { result = this.getChild(3) }
}
/**
@@ -1307,6 +1338,24 @@ class CoAwaitExpr extends UnaryOperation, @co_await {
override string getOperator() { result = "co_await" }
override int getPrecedence() { result = 16 }
/**
* Gets the Boolean expression that is used to decide if the enclosing
* coroutine should be suspended.
*/
Expr getAwaitReady() { result = this.getChild(1) }
/**
* Gets the expression that represents the resume point if the enclosing
* coroutine was suspended.
*/
Expr getAwaitResume() { result = this.getChild(2) }
/**
* Gets the expression that is evaluated when the enclosing coroutine is
* suspended.
*/
Expr getAwaitSuspend() { result = this.getChild(3) }
}
/**
@@ -1321,4 +1370,50 @@ class CoYieldExpr extends UnaryOperation, @co_yield {
override string getOperator() { result = "co_yield" }
override int getPrecedence() { result = 2 }
/**
* Gets the Boolean expression that is used to decide if the enclosing
* coroutine should be suspended.
*/
Expr getAwaitReady() { result = this.getChild(1) }
/**
* Gets the expression that represents the resume point if the enclosing
* coroutine was suspended.
*/
Expr getAwaitResume() { result = this.getChild(2) }
/**
* Gets the expression that is evaluated when the enclosing coroutine is
* suspended.
*/
Expr getAwaitSuspend() { result = this.getChild(3) }
}
/**
* An expression representing the re-use of another expression.
*
* In some specific cases an expression may be referred to outside its
* original context. A re-use expression wraps any such reference. A
* re-use expression can for example occur as the qualifier of an implicit
* destructor called on a temporary object, where the original use of the
* expression is in the definition of the temporary.
*/
class ReuseExpr extends Expr, @reuseexpr {
override string getAPrimaryQlClass() { result = "ReuseExpr" }
override string toString() { result = "reuse of " + this.getReusedExpr().toString() }
/**
* Gets the expression that is being re-used.
*/
Expr getReusedExpr() { expr_reuse(underlyingElement(this), unresolveElement(result), _) }
override Type getType() { result = this.getReusedExpr().getType() }
override predicate isLValueCategory() { expr_reuse(underlyingElement(this), _, 3) }
override predicate isXValueCategory() { expr_reuse(underlyingElement(this), _, 2) }
override predicate isPRValueCategory() { expr_reuse(underlyingElement(this), _, 1) }
}

View File

@@ -24,6 +24,6 @@ import cpp
module DataFlow {
private import semmle.code.cpp.ir.dataflow.internal.DataFlowImplSpecific
private import codeql.dataflow.DataFlow
import DataFlowMake<CppDataFlow>
import DataFlowMake<Location, CppDataFlow>
import semmle.code.cpp.ir.dataflow.internal.DataFlowImpl1
}

View File

@@ -0,0 +1,20 @@
/**
* This file provides an abstract class that can be used to model additional
* object-to-field taint-flow.
*/
private import codeql.util.Unit
private import semmle.code.cpp.dataflow.new.DataFlow
/**
* A `Content` that should be implicitly regarded as tainted whenever an object with such `Content`
* is itself tainted.
*
* For example, if we had a type `struct Container { int field; }`, then by default a tainted
* `Container` and a `Container` with a tainted `int` stored in its `field` are distinct.
*
* If `any(DataFlow::FieldContent fc | fc.getField().hasQualifiedName("Container", "field"))` was
* included in this type however, then a tainted `Container` would imply that its `field` is also
* tainted (but not vice versa).
*/
abstract class TaintInheritingContent extends DataFlow::Content { }

View File

@@ -7,6 +7,7 @@ import cpp
private import semmle.code.cpp.ir.ValueNumbering
private import internal.DataFlowDispatch
private import semmle.code.cpp.ir.IR
private import semmle.code.cpp.ir.dataflow.internal.DataFlowPrivate
/**
* Resolve potential target function(s) for `call`.
@@ -16,8 +17,9 @@ private import semmle.code.cpp.ir.IR
* to identify the possible target(s).
*/
Function resolveCall(Call call) {
exists(CallInstruction callInstruction |
exists(DataFlowCall dataFlowCall, CallInstruction callInstruction |
callInstruction.getAst() = call and
result = viableCallable(callInstruction)
callInstruction = dataFlowCall.asCallInstruction() and
result = viableCallable(dataFlowCall).getUnderlyingCallable()
)
}

View File

@@ -23,6 +23,6 @@ module TaintTracking {
private import semmle.code.cpp.ir.dataflow.internal.DataFlowImplSpecific
private import semmle.code.cpp.ir.dataflow.internal.TaintTrackingImplSpecific
private import codeql.dataflow.TaintTracking
import TaintFlowMake<CppDataFlow, CppTaintTracking>
import TaintFlowMake<Location, CppDataFlow, CppTaintTracking>
import semmle.code.cpp.ir.dataflow.internal.tainttracking1.TaintTrackingImpl
}

View File

@@ -23,13 +23,13 @@ DataFlowCallable defaultViableCallable(DataFlowCall call) {
// function with the right signature is present in the database, we return
// that as a potential callee.
exists(string qualifiedName, int nparams |
callSignatureWithoutBody(qualifiedName, nparams, call) and
functionSignatureWithBody(qualifiedName, nparams, result) and
callSignatureWithoutBody(qualifiedName, nparams, call.asCallInstruction()) and
functionSignatureWithBody(qualifiedName, nparams, result.getUnderlyingCallable()) and
strictcount(Function other | functionSignatureWithBody(qualifiedName, nparams, other)) = 1
)
or
// Virtual dispatch
result = call.(VirtualDispatch::DataSensitiveCall).resolve()
result.asSourceCallable() = call.(VirtualDispatch::DataSensitiveCall).resolve()
}
/**
@@ -40,7 +40,9 @@ DataFlowCallable viableCallable(DataFlowCall call) {
result = defaultViableCallable(call)
or
// Additional call targets
result = any(AdditionalCallTarget additional).viableTarget(call.getUnconvertedResultExpression())
result.getUnderlyingCallable() =
any(AdditionalCallTarget additional)
.viableTarget(call.asCallInstruction().getUnconvertedResultExpression())
}
/**
@@ -150,7 +152,7 @@ private module VirtualDispatch {
ReturnNode node, ReturnKind kind, DataFlowCallable callable
) {
node.getKind() = kind and
node.getEnclosingCallable() = callable
node.getEnclosingCallable() = callable.getUnderlyingCallable()
}
/** Call through a function pointer. */
@@ -176,10 +178,15 @@ private module VirtualDispatch {
/** Call to a virtual function. */
private class DataSensitiveOverriddenFunctionCall extends DataSensitiveCall {
DataSensitiveOverriddenFunctionCall() {
exists(this.getStaticCallTarget().(VirtualFunction).getAnOverridingFunction())
exists(
this.getStaticCallTarget()
.getUnderlyingCallable()
.(VirtualFunction)
.getAnOverridingFunction()
)
}
override DataFlow::Node getDispatchValue() { result.asInstruction() = this.getThisArgument() }
override DataFlow::Node getDispatchValue() { result.asInstruction() = this.getArgument(-1) }
override MemberFunction resolve() {
exists(Class overridingClass |
@@ -194,7 +201,8 @@ private module VirtualDispatch {
*/
pragma[noinline]
private predicate overrideMayAffectCall(Class overridingClass, MemberFunction overridingFunction) {
overridingFunction.getAnOverriddenFunction+() = this.getStaticCallTarget().(VirtualFunction) and
overridingFunction.getAnOverriddenFunction+() =
this.getStaticCallTarget().getUnderlyingCallable().(VirtualFunction) and
overridingFunction.getDeclaringType() = overridingClass
}
@@ -256,12 +264,12 @@ predicate mayBenefitFromCallContext(DataFlowCall call) { mayBenefitFromCallConte
* value is given as the `arg`'th argument to `f`.
*/
private predicate mayBenefitFromCallContext(
VirtualDispatch::DataSensitiveCall call, Function f, int arg
VirtualDispatch::DataSensitiveCall call, DataFlowCallable f, int arg
) {
f = pragma[only_bind_out](call).getEnclosingCallable() and
exists(InitializeParameterInstruction init |
not exists(call.getStaticCallTarget()) and
init.getEnclosingFunction() = f and
init.getEnclosingFunction() = f.getUnderlyingCallable() and
call.flowsFrom(DataFlow::instructionNode(init), _) and
init.getParameter().getIndex() = arg
)
@@ -273,10 +281,11 @@ private predicate mayBenefitFromCallContext(
*/
DataFlowCallable viableImplInCallContext(DataFlowCall call, DataFlowCall ctx) {
result = viableCallable(call) and
exists(int i, Function f |
exists(int i, DataFlowCallable f |
mayBenefitFromCallContext(pragma[only_bind_into](call), f, i) and
f = ctx.getStaticCallTarget() and
result = ctx.getArgument(i).getUnconvertedResultExpression().(FunctionAccess).getTarget()
result.asSourceCallable() =
ctx.getArgument(i).getUnconvertedResultExpression().(FunctionAccess).getTarget()
)
}

View File

@@ -1,3 +1,4 @@
private import semmle.code.cpp.Location
private import DataFlowImplSpecific
private import codeql.dataflow.internal.DataFlowImpl
import MakeImpl<CppDataFlow>
import MakeImpl<Location, CppDataFlow>

View File

@@ -263,9 +263,10 @@ deprecated private module Config implements FullStateConfigSig {
predicate isBarrierOut(Node node, FlowState state) { none() }
predicate isAdditionalFlowStep(Node node1, Node node2) {
predicate isAdditionalFlowStep(Node node1, Node node2, string model) {
singleConfiguration() and
any(Configuration config).isAdditionalFlowStep(node1, node2)
any(Configuration config).isAdditionalFlowStep(node1, node2) and
model = ""
}
predicate isAdditionalFlowStep(Node node1, FlowState state1, Node node2, FlowState state2) {
@@ -285,6 +286,8 @@ deprecated private module Config implements FullStateConfigSig {
int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) }
int accessPathLimit() { result = 5 }
FlowFeature getAFeature() { result = any(Configuration config).getAFeature() }
predicate sourceGrouping(Node source, string sourceGroup) {

View File

@@ -263,9 +263,10 @@ deprecated private module Config implements FullStateConfigSig {
predicate isBarrierOut(Node node, FlowState state) { none() }
predicate isAdditionalFlowStep(Node node1, Node node2) {
predicate isAdditionalFlowStep(Node node1, Node node2, string model) {
singleConfiguration() and
any(Configuration config).isAdditionalFlowStep(node1, node2)
any(Configuration config).isAdditionalFlowStep(node1, node2) and
model = ""
}
predicate isAdditionalFlowStep(Node node1, FlowState state1, Node node2, FlowState state2) {
@@ -285,6 +286,8 @@ deprecated private module Config implements FullStateConfigSig {
int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) }
int accessPathLimit() { result = 5 }
FlowFeature getAFeature() { result = any(Configuration config).getAFeature() }
predicate sourceGrouping(Node source, string sourceGroup) {

View File

@@ -263,9 +263,10 @@ deprecated private module Config implements FullStateConfigSig {
predicate isBarrierOut(Node node, FlowState state) { none() }
predicate isAdditionalFlowStep(Node node1, Node node2) {
predicate isAdditionalFlowStep(Node node1, Node node2, string model) {
singleConfiguration() and
any(Configuration config).isAdditionalFlowStep(node1, node2)
any(Configuration config).isAdditionalFlowStep(node1, node2) and
model = ""
}
predicate isAdditionalFlowStep(Node node1, FlowState state1, Node node2, FlowState state2) {
@@ -285,6 +286,8 @@ deprecated private module Config implements FullStateConfigSig {
int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) }
int accessPathLimit() { result = 5 }
FlowFeature getAFeature() { result = any(Configuration config).getAFeature() }
predicate sourceGrouping(Node source, string sourceGroup) {

View File

@@ -263,9 +263,10 @@ deprecated private module Config implements FullStateConfigSig {
predicate isBarrierOut(Node node, FlowState state) { none() }
predicate isAdditionalFlowStep(Node node1, Node node2) {
predicate isAdditionalFlowStep(Node node1, Node node2, string model) {
singleConfiguration() and
any(Configuration config).isAdditionalFlowStep(node1, node2)
any(Configuration config).isAdditionalFlowStep(node1, node2) and
model = ""
}
predicate isAdditionalFlowStep(Node node1, FlowState state1, Node node2, FlowState state2) {
@@ -285,6 +286,8 @@ deprecated private module Config implements FullStateConfigSig {
int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) }
int accessPathLimit() { result = 5 }
FlowFeature getAFeature() { result = any(Configuration config).getAFeature() }
predicate sourceGrouping(Node source, string sourceGroup) {

View File

@@ -1,3 +1,4 @@
private import semmle.code.cpp.Location
private import DataFlowImplSpecific
private import codeql.dataflow.internal.DataFlowImplCommon
import MakeImplCommon<CppDataFlow>
import MakeImplCommon<Location, CppDataFlow>

View File

@@ -8,7 +8,7 @@ private import DataFlowImplSpecific
private import TaintTrackingImplSpecific
private import codeql.dataflow.internal.DataFlowImplConsistency
private module Input implements InputSig<CppDataFlow> {
private module Input implements InputSig<Location, CppDataFlow> {
predicate argHasPostUpdateExclude(Private::ArgumentNode n) {
// The rules for whether an IR argument gets a post-update node are too
// complex to model here.
@@ -16,4 +16,4 @@ private module Input implements InputSig<CppDataFlow> {
}
}
module Consistency = MakeConsistency<CppDataFlow, CppTaintTracking, Input>;
module Consistency = MakeConsistency<Location, CppDataFlow, CppTaintTracking, Input>;

View File

@@ -3,6 +3,7 @@
*/
private import codeql.dataflow.DataFlow
private import semmle.code.cpp.Location
module Private {
import DataFlowPrivate
@@ -13,7 +14,7 @@ module Public {
import DataFlowUtil
}
module CppDataFlow implements InputSig {
module CppDataFlow implements InputSig<Location> {
import Private
import Public
@@ -21,9 +22,13 @@ module CppDataFlow implements InputSig {
predicate getAdditionalFlowIntoCallNodeTerm = Private::getAdditionalFlowIntoCallNodeTerm/2;
predicate getSecondLevelScope = Private::getSecondLevelScope/1;
predicate validParameterAliasStep = Private::validParameterAliasStep/2;
predicate mayBenefitFromCallContext = Private::mayBenefitFromCallContext/1;
predicate viableImplInCallContext = Private::viableImplInCallContext/2;
predicate neverSkipInPathGraph = Private::neverSkipInPathGraph/1;
}

View File

@@ -10,6 +10,7 @@ private import semmle.code.cpp.ir.ValueNumbering
private import semmle.code.cpp.ir.IR
private import semmle.code.cpp.controlflow.IRGuards
private import semmle.code.cpp.models.interfaces.DataFlow
private import semmle.code.cpp.dataflow.internal.FlowSummaryImpl as FlowSummaryImpl
private import DataFlowPrivate
private import ModelUtil
private import SsaInternals as Ssa
@@ -34,7 +35,7 @@ private import Node0ToString
cached
private newtype TIRDataFlowNode =
TNode0(Node0Impl node) { DataFlowImplCommon::forceCachingInSameStage() } or
TVariableNode(Variable var, int indirectionIndex) {
TGlobalLikeVariableNode(GlobalLikeVariable var, int indirectionIndex) {
indirectionIndex =
[getMinIndirectionsForType(var.getUnspecifiedType()) .. Ssa::getMaxIndirectionsForType(var.getUnspecifiedType())]
} or
@@ -45,6 +46,7 @@ private newtype TIRDataFlowNode =
Ssa::isModifiableByCall(operand, indirectionIndex)
} or
TSsaPhiNode(Ssa::PhiNode phi) or
TSsaIteratorNode(IteratorFlow::IteratorFlowNode n) or
TRawIndirectOperand0(Node0Impl node, int indirectionIndex) {
Ssa::hasRawIndirectOperand(node.asOperand(), indirectionIndex)
} or
@@ -55,28 +57,21 @@ private newtype TIRDataFlowNode =
TFinalParameterNode(Parameter p, int indirectionIndex) {
exists(Ssa::FinalParameterUse use |
use.getParameter() = p and
use.getIndirectionIndex() = indirectionIndex and
parameterIsRedefined(p)
use.getIndirectionIndex() = indirectionIndex
)
} or
TFinalGlobalValue(Ssa::GlobalUse globalUse) or
TInitialGlobalValue(Ssa::GlobalDef globalUse)
/**
* Holds if the value of `*p` (or `**p`, `***p`, etc.) is redefined somewhere in the body
* of the enclosing function of `p`.
*
* Only parameters satisfying this predicate will generate a `FinalParameterNode` transferring
* flow out of the function.
*/
private predicate parameterIsRedefined(Parameter p) {
exists(Ssa::Def def |
def.getSourceVariable().getBaseVariable().(Ssa::BaseIRVariable).getIRVariable().getAst() = p and
def.getIndirectionIndex() = 0 and
def.getIndirection() > 1 and
not def.getValue().asInstruction() instanceof InitializeParameterInstruction
)
}
TInitialGlobalValue(Ssa::GlobalDef globalUse) or
TBodyLessParameterNodeImpl(Parameter p, int indirectionIndex) {
// Rule out parameters of catch blocks.
not exists(p.getCatchBlock()) and
// We subtract one because `getMaxIndirectionsForType` returns the maximum
// indirection for a glvalue of a given type, and this doesn't apply to
// parameters.
indirectionIndex = [0 .. Ssa::getMaxIndirectionsForType(p.getUnspecifiedType()) - 1] and
not any(InitializeParameterInstruction init).getParameter() = p
} or
TFlowSummaryNode(FlowSummaryImpl::Private::SummaryNode sn)
/**
* An operand that is defined by a `FieldAddressInstruction`.
@@ -404,7 +399,7 @@ class Node extends TIRDataFlowNode {
index = 0 and
result = this.(ExplicitParameterNode).getParameter()
or
this.(IndirectParameterNode).hasInstructionAndIndirectionIndex(_, index) and
this.(IndirectParameterNode).getIndirectionIndex() = index and
result = this.(IndirectParameterNode).getParameter()
}
@@ -413,7 +408,7 @@ class Node extends TIRDataFlowNode {
* modeling flow in and out of global variables.
*/
Variable asVariable() {
this = TVariableNode(result, getMinIndirectionsForType(result.getUnspecifiedType()))
this = TGlobalLikeVariableNode(result, getMinIndirectionsForType(result.getUnspecifiedType()))
}
/**
@@ -423,7 +418,7 @@ class Node extends TIRDataFlowNode {
*/
Variable asIndirectVariable(int indirectionIndex) {
indirectionIndex > getMinIndirectionsForType(result.getUnspecifiedType()) and
this = TVariableNode(result, indirectionIndex)
this = TGlobalLikeVariableNode(result, indirectionIndex)
}
/** Gets an indirection of this node's underlying variable, if any. */
@@ -465,7 +460,7 @@ class Node extends TIRDataFlowNode {
* For more information, see
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
*/
predicate hasLocationInfo(
deprecated predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
@@ -659,6 +654,30 @@ class SsaPhiNode extends Node, TSsaPhiNode {
predicate isPhiRead() { phi.isPhiRead() }
}
/**
* INTERNAL: do not use.
*
* Dataflow nodes necessary for iterator flow
*/
class SsaIteratorNode extends Node, TSsaIteratorNode {
IteratorFlow::IteratorFlowNode node;
SsaIteratorNode() { this = TSsaIteratorNode(node) }
/** Gets the phi node associated with this node. */
IteratorFlow::IteratorFlowNode getIteratorFlowNode() { result = node }
override Declaration getEnclosingCallable() { result = this.getFunction() }
override Declaration getFunction() { result = node.getFunction() }
override DataFlowType getType() { result = node.getType() }
final override Location getLocationImpl() { result = node.getLocation() }
override string toStringImpl() { result = node.toString() }
}
/**
* INTERNAL: do not use.
*
@@ -755,37 +774,65 @@ class InitialGlobalValue extends Node, TInitialGlobalValue {
/**
* INTERNAL: do not use.
*
* A node representing an indirection of a parameter.
* A node representing a parameter for a function with no body.
*/
class IndirectParameterNode extends Node instanceof IndirectInstruction {
InitializeParameterInstruction init;
class BodyLessParameterNodeImpl extends Node, TBodyLessParameterNodeImpl {
Parameter p;
int indirectionIndex;
IndirectParameterNode() { IndirectInstruction.super.hasInstructionAndIndirectionIndex(init, _) }
int getArgumentIndex() { init.hasIndex(result) }
/** Gets the parameter whose indirection is initialized. */
Parameter getParameter() { result = init.getParameter() }
BodyLessParameterNodeImpl() { this = TBodyLessParameterNodeImpl(p, indirectionIndex) }
override Declaration getEnclosingCallable() { result = this.getFunction() }
override Declaration getFunction() { result = init.getEnclosingFunction() }
override Declaration getFunction() { result = p.getFunction() }
/** Gets the underlying operand and the underlying indirection index. */
predicate hasInstructionAndIndirectionIndex(Instruction instr, int index) {
IndirectInstruction.super.hasInstructionAndIndirectionIndex(instr, index)
/** Gets the indirection index of this node. */
int getIndirectionIndex() { result = indirectionIndex }
override DataFlowType getType() {
result = getTypeImpl(p.getUnderlyingType(), this.getIndirectionIndex())
}
override Location getLocationImpl() { result = this.getParameter().getLocation() }
override string toStringImpl() {
exists(string prefix | prefix = stars(this) |
result = prefix + this.getParameter().toString()
or
not exists(this.getParameter()) and
result = prefix + "this"
)
final override Location getLocationImpl() {
result = unique( | | p.getLocation())
or
count(p.getLocation()) != 1 and
result instanceof UnknownDefaultLocation
}
final override string toStringImpl() {
exists(string prefix | prefix = stars(this) | result = prefix + p.toString())
}
}
/**
* A data-flow node used to model flow summaries. That is, a dataflow node
* that is synthesized to represent a parameter, return value, or other part
* of a models-as-data modeled function.
*/
class FlowSummaryNode extends Node, TFlowSummaryNode {
/**
* Gets the models-as-data `SummaryNode` associated with this dataflow
* `FlowSummaryNode`.
*/
FlowSummaryImpl::Private::SummaryNode getSummaryNode() { this = TFlowSummaryNode(result) }
/**
* Gets the summarized callable that this node belongs to.
*/
FlowSummaryImpl::Public::SummarizedCallable getSummarizedCallable() {
result = this.getSummaryNode().getSummarizedCallable()
}
/**
* Gets the enclosing callable. For a `FlowSummaryNode` this is always the
* summarized function this node is part of.
*/
override Declaration getEnclosingCallable() { result = this.getSummarizedCallable() }
override Location getLocationImpl() { result = this.getSummarizedCallable().getLocation() }
override string toStringImpl() { result = this.getSummaryNode().toString() }
}
/**
@@ -843,6 +890,9 @@ class IndirectArgumentOutNode extends PostUpdateNodeImpl {
CallInstruction getCallInstruction() { result.getAnArgumentOperand() = operand }
/**
* Gets the `Function` that the call targets, if this is statically known.
*/
Function getStaticCallTarget() { result = this.getCallInstruction().getStaticCallTarget() }
override string toStringImpl() {
@@ -1165,11 +1215,11 @@ class UninitializedNode extends Node {
LocalVariable v;
UninitializedNode() {
exists(Ssa::Def def |
exists(Ssa::Def def, Ssa::SourceVariable sv |
def.getIndirectionIndex() = 0 and
def.getValue().asInstruction() instanceof UninitializedInstruction and
Ssa::nodeToDefOrUse(this, def, _) and
v = def.getSourceVariable().getBaseVariable().(Ssa::BaseIRVariable).getIRVariable().getAst()
Ssa::defToNode(this, def, sv, _, _, _) and
v = sv.getBaseVariable().(Ssa::BaseIRVariable).getIRVariable().getAst()
)
}
@@ -1348,6 +1398,7 @@ private import GetConvertedResultExpression
/** Holds if `node` is an `OperandNode` that should map `node.asExpr()` to `e`. */
predicate exprNodeShouldBeOperand(OperandNode node, Expr e, int n) {
not exprNodeShouldBeIndirectOperand(_, e, n) and
exists(Instruction def |
unique( | | getAUse(def)) = node.getOperand() and
e = getConvertedResultExpression(def, n)
@@ -1364,6 +1415,22 @@ private predicate indirectExprNodeShouldBeIndirectOperand(
)
}
/** Holds if `node` should be an `IndirectOperand` that maps `node.asExpr()` to `e`. */
private predicate exprNodeShouldBeIndirectOperand(IndirectOperand node, Expr e, int n) {
exists(ArgumentOperand operand |
// When an argument (qualifier or positional) is a prvalue and the
// parameter (qualifier or positional) is a (const) reference, IR
// construction introduces a temporary `IRVariable`. The `VariableAddress`
// instruction has the argument as its `getConvertedResultExpression`
// result. However, the instruction actually represents the _address_ of
// the argument. So to fix this mismatch, we have the indirection of the
// `VariableAddressInstruction` map to the expression.
node.hasOperandAndIndirectionIndex(operand, 1) and
e = getConvertedResultExpression(operand.getDef(), n) and
operand.getDef().(VariableAddressInstruction).getIRVariable() instanceof IRTempVariable
)
}
private predicate exprNodeShouldBeIndirectOutNode(IndirectArgumentOutNode node, Expr e, int n) {
exists(CallInstruction call |
call.getStaticCallTarget() instanceof Constructor and
@@ -1376,6 +1443,7 @@ private predicate exprNodeShouldBeIndirectOutNode(IndirectArgumentOutNode node,
predicate exprNodeShouldBeInstruction(Node node, Expr e, int n) {
not exprNodeShouldBeOperand(_, e, n) and
not exprNodeShouldBeIndirectOutNode(_, e, n) and
not exprNodeShouldBeIndirectOperand(_, e, n) and
e = getConvertedResultExpression(node.asInstruction(), n)
}
@@ -1408,7 +1476,8 @@ abstract private class ExprNodeBase extends Node {
private predicate exprNodeShouldBe(Expr e, int n) {
exprNodeShouldBeInstruction(_, e, n) or
exprNodeShouldBeOperand(_, e, n) or
exprNodeShouldBeIndirectOutNode(_, e, n)
exprNodeShouldBeIndirectOutNode(_, e, n) or
exprNodeShouldBeIndirectOperand(_, e, n)
}
private class InstructionExprNode extends ExprNodeBase, InstructionNode {
@@ -1550,6 +1619,12 @@ private class IndirectArgumentOutExprNode extends ExprNodeBase, IndirectArgument
final override Expr getConvertedExpr(int n) { exprNodeShouldBeIndirectOutNode(this, result, n) }
}
private class IndirectOperandExprNode extends ExprNodeBase instanceof IndirectOperand {
IndirectOperandExprNode() { exprNodeShouldBeIndirectOperand(this, _, _) }
final override Expr getConvertedExpr(int n) { exprNodeShouldBeIndirectOperand(this, result, n) }
}
/**
* An expression, viewed as a node in a data flow graph.
*/
@@ -1612,68 +1687,36 @@ class IndirectExprNode extends Node instanceof IndirectExprNodeBase {
}
}
/**
* The value of a parameter at function entry, viewed as a node in a data
* flow graph. This includes both explicit parameters such as `x` in `f(x)`
* and implicit parameters such as `this` in `x.f()`.
*
* To match a specific kind of parameter, consider using one of the subclasses
* `ExplicitParameterNode`, `ThisParameterNode`, or
* `ParameterIndirectionNode`.
*/
class ParameterNode extends Node {
ParameterNode() {
// To avoid making this class abstract, we enumerate its values here
this.asInstruction() instanceof InitializeParameterInstruction
or
this instanceof IndirectParameterNode
}
abstract private class AbstractParameterNode extends Node {
/**
* Holds if this node is the parameter of `f` at the specified position. The
* implicit `this` parameter is considered to have position `-1`, and
* pointer-indirection parameters are at further negative positions.
*/
predicate isParameterOf(Function f, ParameterPosition pos) { none() } // overridden by subclasses
abstract predicate isParameterOf(DataFlowCallable f, ParameterPosition pos);
/** Gets the `Parameter` associated with this node, if it exists. */
Parameter getParameter() { none() } // overridden by subclasses
}
/** An explicit positional parameter, including `this`, but not `...`. */
class DirectParameterNode extends InstructionNode {
override InitializeParameterInstruction instr;
/**
* INTERNAL: Do not use.
*
* Gets the `IRVariable` that this parameter references.
*/
IRVariable getIRVariable() { result = instr.getIRVariable() }
abstract private class AbstractIndirectParameterNode extends AbstractParameterNode {
/** Gets the indirection index of this parameter node. */
abstract int getIndirectionIndex();
}
/** An explicit positional parameter, not including `this` or `...`. */
private class ExplicitParameterNode extends ParameterNode, DirectParameterNode {
ExplicitParameterNode() { exists(instr.getParameter()) }
/**
* INTERNAL: do not use.
*
* A node representing an indirection of a parameter.
*/
final class IndirectParameterNode = AbstractIndirectParameterNode;
override predicate isParameterOf(Function f, ParameterPosition pos) {
f.getParameter(pos.(DirectPosition).getIndex()) = instr.getParameter()
}
override string toStringImpl() { result = instr.getParameter().toString() }
override Parameter getParameter() { result = instr.getParameter() }
}
/** An implicit `this` parameter. */
class ThisParameterNode extends ParameterNode, DirectParameterNode {
ThisParameterNode() { instr.getIRVariable() instanceof IRThisVariable }
override predicate isParameterOf(Function f, ParameterPosition pos) {
pos.(DirectPosition).getIndex() = -1 and instr.getEnclosingFunction() = f
}
override string toStringImpl() { result = "this" }
pragma[noinline]
private predicate indirectParameterNodeHasArgumentIndexAndIndex(
IndirectInstructionParameterNode node, int argumentIndex, int indirectionIndex
) {
node.hasInstructionAndIndirectionIndex(_, indirectionIndex) and
node.getArgumentIndex() = argumentIndex
}
pragma[noinline]
@@ -1684,23 +1727,167 @@ private predicate indirectPositionHasArgumentIndexAndIndex(
pos.getIndirectionIndex() = indirectionIndex
}
pragma[noinline]
private predicate indirectParameterNodeHasArgumentIndexAndIndex(
IndirectParameterNode node, int argumentIndex, int indirectionIndex
) {
node.hasInstructionAndIndirectionIndex(_, indirectionIndex) and
node.getArgumentIndex() = argumentIndex
}
private class IndirectInstructionParameterNode extends AbstractIndirectParameterNode instanceof IndirectInstruction
{
InitializeParameterInstruction init;
/** A synthetic parameter to model the pointed-to object of a pointer parameter. */
class ParameterIndirectionNode extends ParameterNode instanceof IndirectParameterNode {
override predicate isParameterOf(Function f, ParameterPosition pos) {
IndirectParameterNode.super.getEnclosingCallable() = f and
IndirectInstructionParameterNode() {
IndirectInstruction.super.hasInstructionAndIndirectionIndex(init, _)
}
int getArgumentIndex() { init.hasIndex(result) }
override string toStringImpl() {
exists(string prefix | prefix = stars(this) |
result = prefix + this.getParameter().toString()
or
not exists(this.getParameter()) and
result = prefix + "this"
)
}
/** Gets the parameter whose indirection is initialized. */
override Parameter getParameter() { result = init.getParameter() }
override Declaration getEnclosingCallable() { result = this.getFunction() }
override Declaration getFunction() { result = init.getEnclosingFunction() }
override predicate isParameterOf(DataFlowCallable f, ParameterPosition pos) {
this.getEnclosingCallable() = f.getUnderlyingCallable() and
exists(int argumentIndex, int indirectionIndex |
indirectPositionHasArgumentIndexAndIndex(pos, argumentIndex, indirectionIndex) and
indirectParameterNodeHasArgumentIndexAndIndex(this, argumentIndex, indirectionIndex)
)
}
/** Gets the underlying operand and the underlying indirection index. */
predicate hasInstructionAndIndirectionIndex(Instruction instr, int index) {
IndirectInstruction.super.hasInstructionAndIndirectionIndex(instr, index)
}
final override int getIndirectionIndex() { this.hasInstructionAndIndirectionIndex(init, result) }
}
/**
* The value of a parameter at function entry, viewed as a node in a data
* flow graph. This includes both explicit parameters such as `x` in `f(x)`
* and implicit parameters such as `this` in `x.f()`.
*
* To match a specific kind of parameter, consider using one of the subclasses
* `ExplicitParameterNode`, `ThisParameterNode`, or
* `ParameterIndirectionNode`.
*/
final class ParameterNode = AbstractParameterNode;
abstract private class AbstractDirectParameterNode extends AbstractParameterNode { }
/** An explicit positional parameter, including `this`, but not `...`. */
final class DirectParameterNode = AbstractDirectParameterNode;
/**
* INTERNAL: Do not use.
*
* A non-indirect parameter node that is represented as an `Instruction`.
*/
abstract class InstructionDirectParameterNode extends InstructionNode, AbstractDirectParameterNode {
final override InitializeParameterInstruction instr;
/**
* INTERNAL: Do not use.
*
* Gets the `IRVariable` that this parameter references.
*/
final IRVariable getIRVariable() { result = instr.getIRVariable() }
}
abstract private class AbstractExplicitParameterNode extends AbstractDirectParameterNode { }
final class ExplicitParameterNode = AbstractExplicitParameterNode;
/** An explicit positional parameter, not including `this` or `...`. */
private class ExplicitParameterInstructionNode extends AbstractExplicitParameterNode,
InstructionDirectParameterNode
{
ExplicitParameterInstructionNode() { exists(instr.getParameter()) }
override predicate isParameterOf(DataFlowCallable f, ParameterPosition pos) {
f.getUnderlyingCallable().(Function).getParameter(pos.(DirectPosition).getIndex()) =
instr.getParameter()
}
override string toStringImpl() { result = instr.getParameter().toString() }
override Parameter getParameter() { result = instr.getParameter() }
}
/** An implicit `this` parameter. */
class ThisParameterInstructionNode extends AbstractExplicitParameterNode,
InstructionDirectParameterNode
{
ThisParameterInstructionNode() { instr.getIRVariable() instanceof IRThisVariable }
override predicate isParameterOf(DataFlowCallable f, ParameterPosition pos) {
pos.(DirectPosition).getIndex() = -1 and
instr.getEnclosingFunction() = f.getUnderlyingCallable()
}
override string toStringImpl() { result = "this" }
}
/**
* A parameter node that is part of a summary.
*/
class SummaryParameterNode extends AbstractParameterNode, FlowSummaryNode {
SummaryParameterNode() {
FlowSummaryImpl::Private::summaryParameterNode(this.getSummaryNode(), _)
}
private ParameterPosition getPosition() {
FlowSummaryImpl::Private::summaryParameterNode(this.getSummaryNode(), result)
}
override predicate isParameterOf(DataFlowCallable c, ParameterPosition p) {
c.getUnderlyingCallable() = this.getSummarizedCallable() and
p = this.getPosition()
}
}
private class DirectBodyLessParameterNode extends AbstractExplicitParameterNode,
BodyLessParameterNodeImpl
{
DirectBodyLessParameterNode() { indirectionIndex = 0 }
override predicate isParameterOf(DataFlowCallable f, ParameterPosition pos) {
exists(Function func |
this.getFunction() = func and
f.asSourceCallable() = func and
func.getParameter(pos.(DirectPosition).getIndex()) = p
)
}
override Parameter getParameter() { result = p }
}
private class IndirectBodyLessParameterNode extends AbstractIndirectParameterNode,
BodyLessParameterNodeImpl
{
IndirectBodyLessParameterNode() { not this instanceof DirectBodyLessParameterNode }
override predicate isParameterOf(DataFlowCallable f, ParameterPosition pos) {
exists(Function func, int argumentPosition |
this.getFunction() = func and
f.asSourceCallable() = func and
indirectPositionHasArgumentIndexAndIndex(pos, argumentPosition, indirectionIndex) and
func.getParameter(argumentPosition) = p
)
}
override int getIndirectionIndex() {
result = BodyLessParameterNodeImpl.super.getIndirectionIndex()
}
override Parameter getParameter() { result = p }
}
/**
@@ -1745,6 +1932,22 @@ abstract private class PartialDefinitionNode extends PostUpdateNode {
abstract Expr getDefinedExpr();
}
/**
* A `PostUpdateNode` that is part of a flow summary. These are synthesized,
* for example, when a models-as-data summary models a write to a field since
* the write needs to target a `PostUpdateNode`.
*/
class SummaryPostUpdateNode extends FlowSummaryNode, PostUpdateNode {
SummaryPostUpdateNode() {
FlowSummaryImpl::Private::summaryPostUpdateNode(this.getSummaryNode(), _)
}
override Node getPreUpdateNode() {
FlowSummaryImpl::Private::summaryPostUpdateNode(this.getSummaryNode(),
result.(FlowSummaryNode).getSummaryNode())
}
}
/**
* A node that represents the value of a variable after a function call that
* may have changed the variable because it's passed by reference.
@@ -1768,15 +1971,18 @@ class DefinitionByReferenceNode extends IndirectArgumentOutNode {
}
/**
* A `Node` corresponding to a variable in the program, as opposed to the
* value of that variable at some particular point. This can be used for
* modeling flow in and out of global variables.
* A `Node` corresponding to a global (or `static` local) variable in the
* program, as opposed to the value of that variable at some particular point.
* This is used to model flow through global variables (and `static` local
* variables).
*
* There is no `VariableNode` for non-`static` local variables.
*/
class VariableNode extends Node, TVariableNode {
class VariableNode extends Node, TGlobalLikeVariableNode {
Variable v;
int indirectionIndex;
VariableNode() { this = TVariableNode(v, indirectionIndex) }
VariableNode() { this = TGlobalLikeVariableNode(v, indirectionIndex) }
/** Gets the variable corresponding to this node. */
Variable getVariable() { result = v }
@@ -1878,10 +2084,20 @@ cached
private module Cached {
/**
* Holds if data flows from `nodeFrom` to `nodeTo` in exactly one local
* (intra-procedural) step.
* (intra-procedural) step. This relation is only used for local dataflow
* (for example `DataFlow::localFlow(source, sink)`) so it contains
* special cases that should only apply to local dataflow.
*/
cached
predicate localFlowStep(Node nodeFrom, Node nodeTo) { simpleLocalFlowStep(nodeFrom, nodeTo) }
predicate localFlowStep(Node nodeFrom, Node nodeTo) {
// common dataflow steps
simpleLocalFlowStep(nodeFrom, nodeTo, _)
or
// models-as-data summarized flow for local data flow (i.e. special case for flow
// through calls to modeled functions, without relying on global dataflow to join
// the dots).
FlowSummaryImpl::Private::Steps::summaryThroughStepValue(nodeFrom, nodeTo, _)
}
private predicate indirectionOperandFlow(RawIndirectOperand nodeFrom, Node nodeTo) {
nodeFrom != nodeTo and
@@ -1947,45 +2163,56 @@ private module Cached {
/**
* INTERNAL: do not use.
*
* This is the local flow predicate that's used as a building block in global
* data flow. It may have less flow than the `localFlowStep` predicate.
* This is the local flow predicate that's used as a building block in both
* local and global data flow. It may have less flow than the `localFlowStep`
* predicate.
*/
cached
predicate simpleLocalFlowStep(Node nodeFrom, Node nodeTo) {
// Post update node -> Node flow
Ssa::postUpdateFlow(nodeFrom, nodeTo)
or
// Def-use/Use-use flow
Ssa::ssaFlow(nodeFrom, nodeTo)
or
// Operand -> Instruction flow
simpleInstructionLocalFlowStep(nodeFrom.asOperand(), nodeTo.asInstruction())
or
// Instruction -> Operand flow
exists(Instruction iFrom, Operand opTo |
iFrom = nodeFrom.asInstruction() and opTo = nodeTo.asOperand()
|
simpleOperandLocalFlowStep(iFrom, opTo) and
// Omit when the instruction node also represents the operand.
not iFrom = Ssa::getIRRepresentationOfOperand(opTo)
)
or
// Phi node -> Node flow
Ssa::fromPhiNode(nodeFrom, nodeTo)
or
// Indirect operand -> (indirect) instruction flow
indirectionOperandFlow(nodeFrom, nodeTo)
or
// Indirect instruction -> indirect operand flow
indirectionInstructionFlow(nodeFrom, nodeTo)
predicate simpleLocalFlowStep(Node nodeFrom, Node nodeTo, string model) {
(
// Post update node -> Node flow
Ssa::postUpdateFlow(nodeFrom, nodeTo)
or
// Def-use/Use-use flow
Ssa::ssaFlow(nodeFrom, nodeTo)
or
IteratorFlow::localFlowStep(nodeFrom, nodeTo)
or
// Operand -> Instruction flow
simpleInstructionLocalFlowStep(nodeFrom.asOperand(), nodeTo.asInstruction())
or
// Instruction -> Operand flow
exists(Instruction iFrom, Operand opTo |
iFrom = nodeFrom.asInstruction() and opTo = nodeTo.asOperand()
|
simpleOperandLocalFlowStep(iFrom, opTo) and
// Omit when the instruction node also represents the operand.
not iFrom = Ssa::getIRRepresentationOfOperand(opTo)
)
or
// Phi node -> Node flow
Ssa::fromPhiNode(nodeFrom, nodeTo)
or
// Indirect operand -> (indirect) instruction flow
indirectionOperandFlow(nodeFrom, nodeTo)
or
// Indirect instruction -> indirect operand flow
indirectionInstructionFlow(nodeFrom, nodeTo)
) and
model = ""
or
// Flow through modeled functions
modelFlow(nodeFrom, nodeTo)
modelFlow(nodeFrom, nodeTo, model)
or
// Reverse flow: data that flows from the definition node back into the indirection returned
// by a function. This allows data to flow 'in' through references returned by a modeled
// function such as `operator[]`.
reverseFlow(nodeFrom, nodeTo)
reverseFlow(nodeFrom, nodeTo) and
model = ""
or
// models-as-data summarized flow
FlowSummaryImpl::Private::Steps::summaryLocalStep(nodeFrom.(FlowSummaryNode).getSummaryNode(),
nodeTo.(FlowSummaryNode).getSummaryNode(), true, model)
}
private predicate simpleInstructionLocalFlowStep(Operand opFrom, Instruction iTo) {
@@ -2000,12 +2227,13 @@ private module Cached {
opTo.getDef() = iFrom
}
private predicate modelFlow(Node nodeFrom, Node nodeTo) {
private predicate modelFlow(Node nodeFrom, Node nodeTo, string model) {
exists(
CallInstruction call, DataFlowFunction func, FunctionInput modelIn, FunctionOutput modelOut
|
call.getStaticCallTarget() = func and
func.hasDataFlow(modelIn, modelOut)
func.hasDataFlow(modelIn, modelOut) and
model = "DataFlowFunction"
|
nodeFrom = callInput(call, modelIn) and
nodeTo = callOutput(call, modelOut)
@@ -2226,6 +2454,8 @@ private Field getAFieldWithSize(Union u, int bytes) {
cached
private newtype TContent =
TFieldContent(Field f, int indirectionIndex) {
// the indirection index for field content starts at 1 (because `TFieldContent` is thought of as
// the address of the field, `FieldAddress` in the IR).
indirectionIndex = [1 .. Ssa::getMaxIndirectionsForType(f.getUnspecifiedType())] and
// Reads and writes of union fields are tracked using `UnionContent`.
not f.getDeclaringType() instanceof Union
@@ -2235,7 +2465,8 @@ private newtype TContent =
f = u.getAField() and
bytes = getFieldSize(f) and
// We key `UnionContent` by the union instead of its fields since a write to one
// field can be read by any read of the union's fields.
// field can be read by any read of the union's fields. Again, the indirection index
// is 1-based (because 0 is considered the address).
indirectionIndex =
[1 .. max(Ssa::getMaxIndirectionsForType(getAFieldWithSize(u, bytes).getUnspecifiedType()))]
)
@@ -2269,16 +2500,14 @@ class Content extends TContent {
abstract predicate impliesClearOf(Content c);
}
/**
* Gets a string consisting of `n` star characters ("*"), where n >= 0. This is
* used to represent indirection.
*/
bindingset[n]
string repeatStars(int n) { result = concat(int i | i in [1 .. n] | "*") }
private module ContentStars {
private int maxNumberOfIndirections() { result = max(any(Content c).getIndirectionIndex()) }
private string repeatStars(int n) {
n = 0 and result = ""
or
n = [1 .. maxNumberOfIndirections()] and
result = "*" + repeatStars(n - 1)
}
/**
* Gets the number of stars (i.e., `*`s) needed to produce the `toString`
* output for `c`.
@@ -2290,8 +2519,8 @@ private import ContentStars
/** A reference through a non-union instance field. */
class FieldContent extends Content, TFieldContent {
Field f;
int indirectionIndex;
private Field f;
private int indirectionIndex;
FieldContent() { this = TFieldContent(f, indirectionIndex) }
@@ -2318,9 +2547,9 @@ class FieldContent extends Content, TFieldContent {
/** A reference through an instance field of a union. */
class UnionContent extends Content, TUnionContent {
Union u;
int indirectionIndex;
int bytes;
private Union u;
private int indirectionIndex;
private int bytes;
UnionContent() { this = TUnionContent(u, bytes, indirectionIndex) }
@@ -2358,6 +2587,12 @@ class UnionContent extends Content, TUnionContent {
* stored into (`getAStoreContent`) or read from (`getAReadContent`).
*/
class ContentSet instanceof Content {
/**
* Holds if this content set is the singleton `{c}`. At present, this is
* the only kind of content set supported in C/C++.
*/
predicate isSingleton(Content c) { this = c }
/** Gets a content that may be stored into when storing into this set. */
Content getAStoreContent() { result = this }
@@ -2575,5 +2810,5 @@ class AdditionalCallTarget extends Unit {
/**
* Gets a viable target for `call`.
*/
abstract DataFlowCallable viableTarget(Call call);
abstract Declaration viableTarget(Call call);
}

View File

@@ -3,12 +3,26 @@
* `toString` for `Instruction` and `Operand` dataflow nodes.
*/
private import cpp
private import semmle.code.cpp.ir.IR
private import codeql.util.Unit
private import Node0ToString
private import DataFlowUtil
private import DataFlowPrivate
/**
* Gets the string representation of the unconverted expression `loc` if
* `loc` is an `Expression`.
*
* Otherwise, this gets the string representation of `loc`.
*/
private string unconvertedAstToString(Locatable loc) {
result = loc.(Expr).getUnconverted().toString()
or
not loc instanceof Expr and
result = loc.toString()
}
private class NormalNode0ToString extends Node0ToString {
NormalNode0ToString() {
// Silence warning about `this` not being bound.
@@ -18,14 +32,10 @@ private class NormalNode0ToString extends Node0ToString {
override string instructionToString(Instruction i) {
if i.(InitializeParameterInstruction).getIRVariable() instanceof IRThisVariable
then result = "this"
else result = i.getAst().toString()
else result = unconvertedAstToString(i.getAst())
}
override string operandToString(Operand op) {
if op.getDef().(InitializeParameterInstruction).getIRVariable() instanceof IRThisVariable
then result = "this"
else result = op.getDef().getAst().toString()
}
override string operandToString(Operand op) { result = this.instructionToString(op.getDef()) }
override string toExprString(Node n) {
result = n.asExpr(0).toString()

View File

@@ -10,7 +10,7 @@ private import PrintIRUtilities
*/
private string getFromFlow(Node node2, int order1, int order2) {
exists(Node node1 |
simpleLocalFlowStep(node1, node2) and
simpleLocalFlowStep(node1, node2, _) and
result = nodeId(node1, order1, order2)
)
}
@@ -20,7 +20,7 @@ private string getFromFlow(Node node2, int order1, int order2) {
*/
private string getToFlow(Node node1, int order1, int order2) {
exists(Node node2 |
simpleLocalFlowStep(node1, node2) and
simpleLocalFlowStep(node1, node2, _) and
result = nodeId(node2, order1, order2)
)
}

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