Compare commits

...

2726 Commits

Author SHA1 Message Date
Sam Partington
44377d2ae3 Make java/string-concatenation-in-loop high precision 2024-06-26 15:18:47 +01:00
Owen Mansel-Chan
272132a09a Merge pull request #16799 from owen-mc/go/mad/match-all-package-versions
Go: Make models-as-data package column match any version without "$ANYVERSION"
2024-06-26 13:46:49 +01:00
Anders Schack-Mulligen
9d8ee99c1c Merge pull request #16806 from aschackmull/dataflow/debug-stages
Dataflow: Add path-problem view of intermediate stages for debug purposes.
2024-06-26 12:53:12 +02:00
Michael Nebel
e1f65d1f8b Merge pull request #16836 from michaelnebel/csharp/bestlocation
C#: Be more consistent when picking between locations.
2024-06-26 12:46:50 +02:00
Cornelius Riemenschneider
c4cc30fb7a Merge pull request #16839 from github/criemen/bazel-721
Bump to bazel 7.2.1.
2024-06-26 11:26:19 +02:00
Paolo Tranquilli
53a7d823ec Merge pull request #16841 from github/redsun82/kotlin
Kotlin: exclude `KotlinExtractorDbScheme.kt` generated by hand
2024-06-26 11:18:44 +02:00
Tamás Vajk
81f4786643 Merge pull request #16832 from tamasvajk/feature/update-dependencies
C#: Update (some) nuget dependencies
2024-06-26 11:12:26 +02:00
Michael Nebel
e258d9fa74 C#: Use the first best location from the list of locations. 2024-06-26 11:04:38 +02:00
Paolo Tranquilli
a52a412c24 Kotlin: exclude KotlinExtractorDbScheme.kt generated by hand 2024-06-26 09:05:09 +02:00
Owen Mansel-Chan
a30b34c4bd Used "fixed-version:" prefix in a test 2024-06-26 05:01:09 +01:00
Owen Mansel-Chan
418a56d385 Replace "$THISVERSION" suffix with "fixed-version:" prefix 2024-06-26 05:01:09 +01:00
Owen Mansel-Chan
081f32141c Accept review suggestion fixing a comment
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2024-06-26 05:01:09 +01:00
Owen Mansel-Chan
d4e8e4c943 Add QLDoc for majorVersionSuffixRegex 2024-06-26 05:01:09 +01:00
Owen Mansel-Chan
46d0c6ff9c Use lookahead in regex to not match e.g. "/v2foo" 2024-06-26 05:01:09 +01:00
Owen Mansel-Chan
c8a3bedf44 Move major version suffix regex into one place 2024-06-26 05:01:09 +01:00
Owen Mansel-Chan
cb2ccef5fa Refactor suffix check 2024-06-26 05:01:09 +01:00
Owen Mansel-Chan
c045e77d61 Fix QLDoc for interpretPackage 2024-06-26 05:01:09 +01:00
Owen Mansel-Chan
7d11fc2c7d Fix bug in regex
I accidentally included a `$` at the end, so it only matched a major
version suffix at the end of the package path.
2024-06-26 05:01:09 +01:00
Owen Mansel-Chan
a9afbfa993 Document version matching and "$THISVERSION" 2024-06-26 05:01:09 +01:00
Owen Mansel-Chan
3e2bbd38d4 Remove "$ANYVERSION" from models 2024-06-26 05:01:09 +01:00
Owen Mansel-Chan
47d946fb1c Make MaD package match any version without $ANYVERSION
Note that if the package column contains major version suffix (like
"/v2") or if it ends with "$THISVERSION" (which is removed) then we
don't do any version matching.
2024-06-26 05:01:09 +01:00
Owen Mansel-Chan
ea0db4d55e Add predicate for package path without "/v2" etc 2024-06-26 05:01:09 +01:00
Ian Lynagh
f9ae44ca5c Merge pull request #16736 from igfoo/igfoo/debugLoC
Java/Kotlin: Tag the LoC queries 'debug'
2024-06-25 22:57:36 +01:00
Cornelius Riemenschneider
37da3e1bb3 Bump to bazel 7.2.1. 2024-06-25 21:21:39 +02:00
Chris Smowton
2413332553 Merge pull request #16802 from github/smowton/admin/note-java-system-requirements
Java: document extraction system requirements
2024-06-25 15:53:09 +01:00
Ian Lynagh
c12adbeeaa Java/Kotlin: Tag the LoC queries 'debug'
This brings them into line with LinesOfCode.ql
2024-06-25 15:46:10 +01:00
Michael Nebel
d18915a1e4 C#: Update expected test output. 2024-06-25 16:02:58 +02:00
Michael Nebel
e15a47d58c C#: Update the extractor to use the BestOrDefault extension method to choose between multiple locations. 2024-06-25 16:02:54 +02:00
Michael Nebel
dd65d960be C#: Introduce a Location extension method to help pick a unique location. 2024-06-25 16:02:49 +02:00
Michael Nebel
8dc95ce9b0 Merge pull request #16722 from michaelnebel/csharp/modelgensourcesink
C#/Java: Respect manual neutrals, sources and sinks in model generation.
2024-06-25 15:55:06 +02:00
yoff
58b6b3f601 Merge pull request #16789 from yoff/python/document-models-as-data
python: Document MaD format
2024-06-25 15:46:28 +02:00
Tamas Vajk
5058727980 C#: Update (some) nuget dependencies 2024-06-25 15:24:08 +02:00
Anders Schack-Mulligen
1cc49af454 Dataflow: Address review comments. 2024-06-25 15:19:55 +02:00
Asger F
6a3bb4dd28 Merge pull request #16834 from asgerf/shared/capture-this-location
Shared: add location for 'this' CaptureContainer
2024-06-25 13:18:41 +02:00
Mathias Vorreiter Pedersen
17edfdf801 Merge pull request #16833 from MathiasVP/simplify-incorrect-allocation-error-handling
C++: Simplify `cpp/incorrect-allocation-error-handling`
2024-06-25 12:16:21 +01:00
Rasmus Lerchedahl Petersen
6524b8e25d Python: consistent double quotes in examples 2024-06-25 12:11:52 +02:00
Rasmus Lerchedahl Petersen
09905ee228 Python: double back-tics 2024-06-25 12:05:38 +02:00
Rasmus Lerchedahl Petersen
6d4e993dea Python: remove named parameter filename 2024-06-25 12:00:53 +02:00
Rasmus Lerchedahl Petersen
aa4fd1992e Python: compact types in type models 2024-06-25 11:59:55 +02:00
Rasmus Lerchedahl Petersen
b902dd5680 Python: add change note 2024-06-25 11:54:30 +02:00
Jeroen Ketema
e0e5bdec8a Merge pull request #16818 from jketema/predef
C++: Update expected test results
2024-06-25 11:06:53 +02:00
Mathias Vorreiter Pedersen
921afb71e2 Update cpp/ql/src/Security/CWE/CWE-570/IncorrectAllocationErrorHandling.ql
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2024-06-25 10:03:53 +01:00
Owen Mansel-Chan
890da5377e Merge pull request #16819 from owen-mc/go/remove-dataflowtype-optimizer-bug-workaround
Go: Make DataFlowType a singleton (remove workaround)
2024-06-25 10:03:08 +01:00
Asger F
551743e000 Shared: add location for 'this' CaptureContainer
Only has an effect for debugging purposes
2024-06-25 10:34:28 +02:00
Mathias Vorreiter Pedersen
982f845be7 C++: Accept test changes. 2024-06-25 09:31:00 +01:00
Mathias Vorreiter Pedersen
bb8b0d0bf5 C++: Use the unary version of 'comparesEq' to handle both disjuncts. 2024-06-25 09:30:53 +01:00
Jeroen Ketema
285ed3630b C++: Update expected test results 2024-06-25 09:16:05 +02:00
Dave Bartolomeo
1e46e431e8 Merge pull request #16823 from smowton/smowton/admin/maven-transfer-failure-test-expectations
Java: Adjust and tolerate variability in test expectations
2024-06-24 13:54:25 -04:00
Paolo Tranquilli
d2a00fa773 Merge pull request #16822 from github/redsun82/nodejs-mirror
Bazel: add `nodejs` mirror
2024-06-24 17:59:08 +02:00
Chris Smowton
351b908f62 Adjust and tolerate variability in test expectations 2024-06-24 16:38:18 +01:00
Paolo Tranquilli
0669186713 Bazel: remove unneeded upstream rules_nodejs patch 2024-06-24 17:09:40 +02:00
Paolo Tranquilli
a02cf07833 Bazel: add nodejs mirror
This patches `rules_nodejs` with the contents of
https://github.com/bazelbuild/rules_nodejs/pull/3763
in order to allow specifying a mirror for nodejs, as nodejs.org has
hit us with intermittent downtimes.
2024-06-24 16:59:25 +02:00
Mathias Vorreiter Pedersen
5b1b60cc92 Merge pull request #16797 from MathiasVP/yml-for-allocation-and-deallocation
C++: Add extensible predicates to `Allocation` and `Deallocation`
2024-06-24 15:34:27 +01:00
Anders Schack-Mulligen
25d520a7f1 Merge pull request #16785 from aschackmull/dataflow/stage3-notypes
Dataflow: Replace stage 3 type pruning with flow-insensitive type pruning.
2024-06-24 15:21:37 +02:00
Mathias Vorreiter Pedersen
36d59cef7e C++: Add 'bsl::free' as a deallocation function model. 2024-06-24 13:56:44 +01:00
Mathias Vorreiter Pedersen
82ed1ee671 Update cpp/ql/lib/change-notes/2024-06-20-extensible-allocation-deallocation.md
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2024-06-24 13:50:24 +01:00
Owen Mansel-Chan
d8df38c683 Make DataFlowType a singleton (remove workaround) 2024-06-24 13:43:10 +01:00
Mathias Vorreiter Pedersen
19b6d24bc2 Merge pull request #16816 from MathiasVP/fix-valuenumber-imports
C++: Fix value numbering imports
2024-06-24 13:37:38 +01:00
Anders Schack-Mulligen
fdf6e30888 Dataflow: Handle non-trivial type systems with stores into a top type. 2024-06-24 13:35:50 +02:00
Anders Schack-Mulligen
a26132e818 Dataflow: Replace stage 3 type pruning with flow-insensitive type pruning. 2024-06-24 13:35:50 +02:00
Anders Schack-Mulligen
3ede3af6f2 C#: Fix join-order. 2024-06-24 13:35:49 +02:00
Anders Schack-Mulligen
8c23e21073 Dataflow: Cache compatibleTypes. 2024-06-24 13:35:48 +02:00
Anders Schack-Mulligen
06a7e3f3ee Dataflow: Cache typeStrongerThan. 2024-06-24 13:35:48 +02:00
Anders Schack-Mulligen
bd99f32a4b Dataflow: Check types on ParamReturnNode. 2024-06-24 13:35:47 +02:00
Michael Nebel
24685a07c0 Java: Update model generator test expected output. 2024-06-24 13:07:42 +02:00
Michael Nebel
c687dcb094 Java: Sync files and make language specific implementation. 2024-06-24 13:07:39 +02:00
Michael Nebel
30249e4f2b Java: Add some spurious source and sink examples. 2024-06-24 13:07:34 +02:00
Michael Nebel
854674a71c C#: Update expected test output. 2024-06-24 13:07:30 +02:00
Michael Nebel
b27a9d948a C#: Exclude APIs with a manual source neutral from source model generation and allow source generation for all source kinds. 2024-06-24 13:07:14 +02:00
Michael Nebel
2657e7f56d C#: Add some source and sink modelling examples where a neutral exist. 2024-06-24 13:05:35 +02:00
Mathias Vorreiter Pedersen
00d772f980 C++: Fix value numbering imports. 2024-06-24 11:53:24 +01:00
Michael Nebel
abc7cc39d4 Merge pull request #16775 from michaelnebel/modelgen/refactorprinting
C#/Java: Parameterized module for model printing.
2024-06-24 12:51:07 +02:00
Michael Nebel
9cd16fd9d6 Java: Base the model printing on the shared implementation. 2024-06-24 11:52:50 +02:00
Michael Nebel
8630583856 C#/Java: Exclude the model printing implementation form sync files. 2024-06-24 11:50:57 +02:00
Michael Nebel
b7bc540325 C#: Adjust implementation to use the shared model printer. 2024-06-24 11:50:46 +02:00
Michael Nebel
65e150b416 Add parameterized module for MaD model printing. 2024-06-24 11:48:33 +02:00
Owen Mansel-Chan
f04a85e121 Merge pull request #16753 from owen-mc/go/misc-clean-up
Go: a few small clean ups
2024-06-24 10:47:21 +01:00
Michael Nebel
94d12edfdb Merge pull request #16759 from michaelnebel/modelgen/sourcesinkmodelgen
C#/Java: Introduce source and sink model generation sanitisers.
2024-06-24 11:47:11 +02:00
Rasmus Lerchedahl Petersen
4626e134fa Python: update doc to use operations module 2024-06-24 10:56:34 +02:00
Rasmus Lerchedahl Petersen
00fbada41d Python: recognize fabric.operations 2024-06-24 10:54:59 +02:00
Rasmus Lerchedahl Petersen
21a0f8af07 Python: address reviewer comments
- fix wording on `builtins`
- add named argument/parameter access path components
2024-06-24 10:48:53 +02:00
yoff
d603b48884 Apply suggestions from code review
Co-authored-by: Taus <tausbn@github.com>
2024-06-24 10:29:33 +02:00
Mathias Vorreiter Pedersen
a1743aa12e Merge pull request #16805 from MathiasVP/tc-in-temp-materialization
C++: Fix missing `asExpr` for temporary materializations with conversions
2024-06-23 13:38:01 +01:00
Owen Mansel-Chan
513ec16691 Merge pull request #16796 from owen-mc/go/fix/package-vendor
Go: Fix bug removing "vendor/" from package paths
2024-06-22 07:54:18 +01:00
Mathias Vorreiter Pedersen
1bb762bea9 C++: Accept test changes. 2024-06-21 13:35:10 +01:00
Mathias Vorreiter Pedersen
7d41e8ef73 C++: Perform a TC to skip conversions when special-casing materialization of temporaries. 2024-06-21 13:35:09 +01:00
Mathias Vorreiter Pedersen
3b585b4196 C++: Add test with missing flow. 2024-06-21 13:35:08 +01:00
Taus
4a448f445e Merge pull request #15715 from am0o0/am0o0-python-codeExec
Python: New command execution sinks
2024-06-21 14:26:33 +02:00
Anders Schack-Mulligen
accc73d1d0 Dataflow: Add debug graph for pruning stages. 2024-06-21 14:25:32 +02:00
Erik Krogh Kristensen
49f74bacf2 Merge pull request #16729 from mbaluda/main
JS: Extract SAP XSJS file types as Javascript
2024-06-21 14:23:55 +02:00
Anders Schack-Mulligen
bbdae5188d Dataflow: Add ArgNodeEx column to fwdFlowIsEntered. 2024-06-21 14:10:37 +02:00
Anders Schack-Mulligen
fa13861e53 Dataflow: Add Debug module with stage references. 2024-06-21 14:02:07 +02:00
Mauro Baluda
b75514c990 Merge branch 'github:main' into main 2024-06-21 13:36:38 +02:00
Chris Smowton
cfb48ace73 Java: document extraction system requirements
Note that a `java` binary is at least highly recommended for Java extraction, and in many circumstances a hard requirement. The same goes for `mvn` and `gradle`.
2024-06-21 11:53:36 +01:00
Kasper Svendsen
988d0671bb Merge pull request #16734 from kaspersv/kaspersv/doc-intern-sets-builtin
Document builtin InternSets module
2024-06-21 12:06:40 +02:00
Tom Hvitved
dff3ce2a9f Merge pull request #16794 from hvitved/ruby/sinatra-flow
Ruby: Rework `Sinatra.FilterJumpStep`
2024-06-21 11:38:10 +02:00
Mathias Vorreiter Pedersen
c357cc9f08 C++: Add change note. 2024-06-21 08:54:12 +01:00
Mathias Vorreiter Pedersen
69490c62cd C++: Add qlpack dependency. 2024-06-21 08:54:10 +01:00
Mathias Vorreiter Pedersen
6bf22bda58 C++: Replace allocation models with models from extensible predicates. 2024-06-21 08:54:09 +01:00
Tom Hvitved
8ea4f85de3 Ruby: Rework Sinatra.FilterJumpStep 2024-06-21 08:57:59 +02:00
Tom Hvitved
95c764eff6 Fix Sinatra test to properly output pathgraph 2024-06-21 08:57:19 +02:00
Erik Krogh Kristensen
db768960f4 Merge pull request #15060 from am0o0/amammad-js-envinjection
JS: Env Injection query
2024-06-20 21:27:21 +02:00
Erik Krogh Kristensen
555d7e5958 Merge pull request #14293 from am0o0/amammad-js-CodeInjection_dynamic_import
JS: Dynamic import as code injection sink
2024-06-20 21:19:57 +02:00
Erik Krogh Kristensen
60ed51781e Merge pull request #16790 from github/max-schaefer-patch-1
JavaScript: Fix CodeQL alert in extractor
2024-06-20 20:20:00 +02:00
Erik Krogh Kristensen
e84028d01e Merge pull request #14088 from am0o0/amammad-js-JWT
JS: decoding JWT without signature verification
2024-06-20 20:13:40 +02:00
Mathias Vorreiter Pedersen
d308178781 C++: Add extensible predicate for allocation. 2024-06-20 16:26:52 +01:00
Mathias Vorreiter Pedersen
ce5ab4c4b7 C++: Add qlpack dependency. 2024-06-20 16:26:50 +01:00
Mathias Vorreiter Pedersen
3457551264 C++: Replace deallocation models with models from extensible predicates. 2024-06-20 16:26:49 +01:00
Jeroen Ketema
0e04a59c08 Merge pull request #16795 from jketema/test-cleanup
C++: Remove unneeded options from tests
2024-06-20 16:24:07 +02:00
Mathias Vorreiter Pedersen
e5c20b13cf C++: Add extensible predicate for deallocation. 2024-06-20 14:51:09 +01:00
Jeroen Ketema
4c4c15b425 C++: Remove unneeded options from tests 2024-06-20 14:21:34 +02:00
Owen Mansel-Chan
aa35bd771b Fix bug removing "vendor/" from package paths 2024-06-20 13:18:21 +01:00
Asger F
a36e39359f Merge pull request #16739 from RasmusWL/js-array-steps
JS: Allow many Array steps to be used in type-tracking
2024-06-20 11:39:46 +02:00
Rasmus Lerchedahl Petersen
a7386b6670 Python: include new documentation 2024-06-20 11:25:25 +02:00
Rasmus Lerchedahl Petersen
f0e68887d4 Python: autoformat 2024-06-20 10:59:39 +02:00
yoff
b4fdf3c342 Apply suggestions from code review
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
2024-06-20 10:57:54 +02:00
Rasmus Wriedt Larsen
596102d3fb Update javascript/ql/lib/change-notes/2024-06-14-type-tracking-array-steps.md
Co-authored-by: Asger F <asgerf@github.com>
2024-06-20 10:07:49 +02:00
Owen Mansel-Chan
754fd8e84c Drop leading . from getQualifiedName for built-in functions
So it will be "panic" instead of ".panic".
2024-06-19 22:04:21 +01:00
Owen Mansel-Chan
68a661f3c7 Write out whole function names 2024-06-19 21:58:31 +01:00
Owen Mansel-Chan
b79711b17e Move deprecated notice to top of comment 2024-06-19 21:58:28 +01:00
Max Schaefer
2be171746b JavaScript: Fix CodeQL alert in extractor
This doesn't make a difference in practice because we only run the method on arrays of even length, but we might as well fix it.
2024-06-19 17:13:01 +01:00
Rasmus Lerchedahl Petersen
5cb37f5c4c python: Document MaD format
- add a few tests reflecting the documentation
- make the mentioned sink-kinds have an effect on relevant queries
2024-06-19 17:00:15 +02:00
Michael Nebel
aa962f9b03 Java: Update expected output of model generation. 2024-06-19 14:10:59 +02:00
Michael Nebel
1185e28ea2 Java: Add some spurious source and sink model generation examples. 2024-06-19 14:10:56 +02:00
Michael Nebel
ed3f1e40db Java: Sync changes and make dummy language specific implementation. 2024-06-19 14:10:54 +02:00
Michael Nebel
99907471b2 C#: Update model generator expected output. 2024-06-19 14:10:52 +02:00
Michael Nebel
40204911bc C#: Only allow source propgatation upwards in the call stack if the call path consists of unique call targets (to avoid unwanted virtual dispatch). This severely tightens the generation of extrapolated sources. 2024-06-19 14:10:49 +02:00
Tom Hvitved
6dbdc9e17f Merge pull request #16784 from github/redsun82/fix-warnings-in-ql-tests
C++/Java: Accept new warning format in ql tests
2024-06-19 13:05:50 +02:00
Paolo Tranquilli
b7a2ea8981 CI: accept other diagnostic format related test changes 2024-06-19 11:33:50 +02:00
Paolo Tranquilli
59f8f8a394 Merge branch 'main' into redsun82/fix-warnings-in-ql-tests 2024-06-19 11:21:36 +02:00
Tamás Vajk
45ece48b6f Merge pull request #16776 from tamasvajk/fix/source-generator-folder
C#: Make sure no file is added twice to the compilation
2024-06-19 10:09:50 +02:00
Paolo Tranquilli
919ddccfdb C++/Java: Accept new warning format in ql tests 2024-06-19 09:13:18 +02:00
Edward Minnix III
7adfa6bbed Merge pull request #16709 from egregius313/egregius313/go/df/threat-models/refactor-queries
Go: Refactor queries to use `ThreatModelFlowSource` instead of `RemoteFlowSource`
2024-06-18 13:56:00 -04:00
am0o0
eb1999f8b3 revert .vscode/settings.json :(( 2024-06-18 18:43:20 +02:00
am0o0
ccb923a436 fix formatting 2024-06-18 18:31:29 +02:00
Ed Minnix
5bbd003dfc Reword change note 2024-06-18 12:27:21 -04:00
Ed Minnix
b53712cae0 Change note 2024-06-18 12:27:19 -04:00
Ed Minnix
6a0be6ad09 ExternalAPIs 2024-06-18 12:27:18 -04:00
Ed Minnix
46e16b88bb Refactor experimental queries to use ThreadModelFlowSource 2024-06-18 12:27:17 -04:00
Ed Minnix
cfd5f53eb0 Refactor Customizations libraries to use ThreatModelFlowSource 2024-06-18 12:27:15 -04:00
Edward Minnix III
8997f2cdf2 Merge pull request #16697 from egregius313/egregius313/go/dataflow/threat-modeling
Go: Introduce Threat Modeling
2024-06-18 12:25:33 -04:00
am0o0
1f99559e9f Revert "update id of the query file"
This reverts commit 1f112467ce.
2024-06-18 17:33:07 +02:00
am0o0
cb39ae7dd3 revert .vscode/settings.json 2024-06-18 17:27:15 +02:00
am0o0
8a7fdfa6fe fix conflict 2024-06-18 17:18:59 +02:00
Taus
59a77a873c Merge pull request #16754 from github/tausbn/python-disregard-unused-imports-in-pytest-tests
Python: Disregard unused imports in `pytest` tests
2024-06-18 15:10:31 +02:00
Owen Mansel-Chan
9403bf25d8 Merge pull request #16667 from smowton/smowton/fix/global-variable-side-effect
Add support for flow through content of global variables
2024-06-18 13:41:57 +01:00
Tamas Vajk
6c8e391a63 C#: Make sure no file is added twice to the compilation 2024-06-18 13:45:09 +02:00
Tamas Vajk
5170585515 C#: Add integration test with file added multiple times in the same compilation 2024-06-18 13:45:06 +02:00
Michael Nebel
1c3ceacf04 C#: Some renaming and re-factoring. 2024-06-18 13:05:21 +02:00
Michael Nebel
dfaa40a1d2 C#: Update expected test output from model generation. 2024-06-18 13:05:17 +02:00
Michael Nebel
b5d6a6db7e C#: Use the same types as sanitizers for source and sink model as we use for summary model generation. 2024-06-18 13:05:12 +02:00
Michael Nebel
031e44b157 C#: Add some source/sink model generator test examples. 2024-06-18 13:05:07 +02:00
Max Schaefer
2c4a95bb5e Merge pull request #16777 from github/max-schaefer-patch-1
Swift: Add missing bracket in example
2024-06-18 11:39:42 +01:00
Alex Ford
6c3d90e8a0 Merge pull request #16650 from alexrford/rb/routing-improvements
Ruby: ActionDispatch - support `path => target` route format
2024-06-18 11:17:05 +01:00
Max Schaefer
9ca74de3e9 Swift: Add missing bracket in example 2024-06-18 11:00:59 +01:00
Joe Farebrother
33704779ea Merge pull request #16503 from joefarebrother/ruby-sensitive-sources
Ruby: Use additional sensitive data heuristics for CleartextSources
2024-06-18 10:57:55 +01:00
Michael Nebel
cd9d58fdc8 Merge pull request #16772 from michaelnebel/java/taintedpermissionthreatmodel
Java: Opt-in `java/tainted-permissions-check` to threat models.
2024-06-18 10:54:28 +02:00
Joe Farebrother
eee7f5a896 Use a combined regex for performance 2024-06-17 22:21:33 +01:00
Cornelius Riemenschneider
0f98d9e815 Merge pull request #16774 from github/criemen/cleanup
Remove unused bzl files.
2024-06-17 20:04:25 +02:00
Chris Smowton
4da5d6660a Add change note 2024-06-17 16:49:09 +01:00
Chris Smowton
38ee085782 Adjust test expectation 2024-06-17 16:46:49 +01:00
Chris Smowton
822f6eebfb Add support for flow through content of global variables 2024-06-17 16:42:23 +01:00
Ed Minnix
b4ecc81145 Fix provenance numbers in tests 2024-06-17 11:33:19 -04:00
Ed Minnix
fa2c50616b Remove getSourceType definitions 2024-06-17 10:57:11 -04:00
Ed Minnix
b6adff6377 Fix jsoniter test 2024-06-17 10:51:13 -04:00
Ed Minnix
53dd269f9f Go: Threat model tests 2024-06-17 10:51:11 -04:00
Ed Minnix
7f19f449eb Change note 2024-06-17 10:51:10 -04:00
Ed Minnix
49fb372eb9 Add getSourceType declarations to existing remote flow sources 2024-06-17 10:51:09 -04:00
Ed Minnix
df6449cfc7 Go: Add the SourceNode and ThreatModelFlowSource classes 2024-06-17 10:51:07 -04:00
Ed Minnix
b697068e9a Go: Add threat modeling shared library 2024-06-17 10:51:06 -04:00
Michael Nebel
5686efd25c Update java/ql/src/change-notes/2024-06-17-tainted-permissions-check.md
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2024-06-17 16:47:22 +02:00
Cornelius Riemenschneider
f41bd41bd0 Remove unused bzl files. 2024-06-17 15:15:08 +02:00
Michael Nebel
197cdab43d Merge pull request #16752 from michaelnebel/shared/sourcesinkcallables
C#/Java: Add some (shared) helper classes for Neutrals, Sources and Sink
2024-06-17 14:58:27 +02:00
Anders Schack-Mulligen
0e8af39b77 Merge pull request #16719 from aschackmull/shared/fix-qldoc
Shared: Fix file-module qldoc.
2024-06-17 13:26:57 +02:00
Anders Schack-Mulligen
96b6ddefe0 Merge pull request #16751 from aschackmull/java/sndlevelscope-fix
Java: Calculate 2nd level scopes for implicit instance accesses.
2024-06-17 13:10:46 +02:00
Michael Nebel
57925373c6 Address review comment. 2024-06-17 13:02:25 +02:00
Michael Nebel
833b4f90bf Java: Make source and sink callable adapters. 2024-06-17 12:53:08 +02:00
Michael Nebel
0fabca94db C#: Use the new shared classes for Source and Sink callables. 2024-06-17 12:53:06 +02:00
Michael Nebel
3d53ddf919 DataFlow: Add some shared classes for Neutrals, Source and Sink callables. 2024-06-17 12:53:03 +02:00
Michael Nebel
e1317ddcb6 Merge pull request #16768 from github/workflow/coverage/update
Update CSV framework coverage reports
2024-06-17 11:51:35 +02:00
Anders Schack-Mulligen
b8b95fd81d Java: Add change note. 2024-06-17 11:46:54 +02:00
Michael Nebel
c3862660e4 Java: Add change note. 2024-06-17 11:07:29 +02:00
Michael Nebel
327dab69d0 Java: Opt-in the tainted permissions check query to threat models. 2024-06-17 11:02:08 +02:00
Jeroen Ketema
1d1a84962b Merge pull request #16765 from jketema/attrib-dup
C++: Add more tests that show we do not properly deduplicate attributes
2024-06-17 07:07:55 +02:00
github-actions[bot]
abe2deb6a6 Add changed framework coverage reports 2024-06-17 00:18:39 +00:00
Andrew Eisenberg
3d3a315456 Merge pull request #16766 from github/aeisenberg/requirements
Add powershell to list of requirements on windows
2024-06-14 15:15:28 -07:00
Andrew Eisenberg
d238b9198d Clarify that this applies to both autobuild and regular builds 2024-06-14 14:41:29 -07:00
Owen Mansel-Chan
b0afba49a2 Merge pull request #16761 from owen-mc/java/reverse-dns-get-loopback-address
Java: Exclude loopback address from reverse DNS source
2024-06-14 22:39:55 +01:00
Andrew Eisenberg
39a8af6519 Add powershell to list of requirements on windows 2024-06-14 14:30:47 -07:00
Jeroen Ketema
14b5114aa6 C++: Add more tests that show we do not properly deduplicate attributes 2024-06-14 17:44:05 +02:00
Jeroen Ketema
c0df22950b Merge pull request #16763 from jketema/attrib-dup
C++: Add test that show that routine attributes are not fully de-duplicated
2024-06-14 17:15:27 +02:00
Taus
b7b0f84e8b Python: Handle @pytest.fixture decorations with arguments as well
Not the prettiest of solutions, but it seems to work well enough.
2024-06-14 15:11:25 +00:00
Taus
c75e66c433 Merge pull request #16762 from github/redsun82/python-disregard-unused-imports-in-pytest-tests
Python: failing unused import test case
2024-06-14 16:57:53 +02:00
Owen Mansel-Chan
9aa0c9f1f3 Fix test expectations 2024-06-14 15:55:30 +01:00
Paolo Tranquilli
1046d03486 Python: update unused import test case for pytest 2024-06-14 16:55:05 +02:00
Jeroen Ketema
7d97463e4d C++: Add test that show that routine attributes are not fully de-duplicated 2024-06-14 16:43:29 +02:00
Ian Lynagh
079717bbc0 Merge pull request #16694 from igfoo/igfoo/PopulationSpecFile
Kotlin: Remove unused PopulationSpecFile
2024-06-14 15:06:39 +01:00
Rasmus Wriedt Larsen
3fc8401370 JS: Add change-note 2024-06-14 15:37:25 +02:00
Rasmus Wriedt Larsen
3f2befc3e5 JS: Support spread arguments in array.splice 2024-06-14 15:33:17 +02:00
Rasmus Wriedt Larsen
269f8ca2cd JS: Add splice(...arr) test 2024-06-14 15:19:56 +02:00
Rasmus Wriedt Larsen
68ccec3d43 JS: Prepare for new test 2024-06-14 15:18:47 +02:00
Taus
2f00a0d323 Python: Also test pytest fixture factories 2024-06-14 13:11:00 +00:00
Owen Mansel-Chan
6cfd9458b0 Add change note 2024-06-14 14:05:25 +01:00
Owen Mansel-Chan
7a13c31021 Exclude loopback address from reverse DNS source 2024-06-14 14:05:01 +01:00
Owen Mansel-Chan
5973f3fadc Add test for reverse DNS from loopback address 2024-06-14 14:04:47 +01:00
Owen Mansel-Chan
098b732937 Fix formatting of inline expectation test comment 2024-06-14 14:04:42 +01:00
Rasmus Wriedt Larsen
194ef607f7 JS: Updated .expected 2024-06-14 14:49:34 +02:00
Taus
78729180ad Python: Fix pytest fixture unused import FPs 2024-06-14 12:05:55 +00:00
Taus
f3a9c9a9dc Python: Add tests for pytest fixture unused import FPs 2024-06-14 12:03:43 +00:00
am0o0
4e1f7a930d fix invalid js file sample in qlhelp 2024-06-14 13:47:01 +02:00
Paolo Tranquilli
e2a47e7c18 Merge pull request #16720 from github/redsun82/kotlin
Kotlin: cleanup after internal changes
2024-06-14 13:28:22 +02:00
Cornelius Riemenschneider
c808953b1d Merge pull request #16723 from github/criemen/codeql-pack-group
`pkg.bzl`: Significantly restructure `codeql_pack` rule.
2024-06-14 13:19:00 +02:00
Michael Nebel
3525967143 Merge pull request #16701 from michaelnebel/csharp/modelgentaintmembers
C#/Java: Improve Sink and Summary model generation.
2024-06-14 12:30:50 +02:00
Tom Hvitved
c7b4f51077 Merge pull request #16758 from hvitved/ruby/shared-ci-trigger
Ruby: Trigger `ruby-build.yml` on changes to shared extractor
2024-06-14 12:00:18 +02:00
Michael B. Gale
039537f7ba Merge pull request #16727 from github/mbg/go/fix/too-many-go-mod-files-initialised 2024-06-14 10:14:57 +01:00
Tom Hvitved
be66ea2178 Ruby: Trigger ruby-build.yml on changes to shared extractor 2024-06-14 11:09:03 +02:00
Michael Nebel
a29446a566 C#/Java: Address review comments. 2024-06-14 10:46:19 +02:00
Cornelius Riemenschneider
58f69c9385 Make CodeQLPackInfo provider public. 2024-06-13 21:57:46 +02:00
Cornelius Riemenschneider
02100e58d9 Address review. 2024-06-13 21:55:56 +02:00
Cornelius Riemenschneider
ede0b5bdf4 Merge remote-tracking branch 'origin/main' into criemen/codeql-pack-group 2024-06-13 21:53:31 +02:00
Paolo Tranquilli
f9db7864e1 Change note: reword 2024-06-13 18:04:23 +02:00
Paolo Tranquilli
0198806658 Merge branch 'main' into redsun82/kotlin 2024-06-13 16:29:13 +02:00
am0o0
bb03a9faba format the query file 2024-06-13 14:54:29 +02:00
am0o0
f0a467e80b update tests 2024-06-13 14:52:22 +02:00
am0o0
84b9d4d1ac fix qlhelp errors 2024-06-13 14:32:41 +02:00
Mathias Vorreiter Pedersen
3d037e73f0 Merge pull request #16749 from MathiasVP/fix-fps-on-double-free
C++: Fix `ArrayExpr` FPs in `cpp/double-free`
2024-06-13 12:58:41 +01:00
Paolo Tranquilli
b8de2ea03b Merge pull request #16731 from github/redsun82/kotlin-fix-version-picker
Kotlin: expose kotlin version picker for internal packaging
2024-06-13 13:57:38 +02:00
Anders Schack-Mulligen
b47831af14 Java: Calculate 2nd level scopes for implicit instance accesses. 2024-06-13 13:57:18 +02:00
Michael B. Gale
1834a399d2 Merge pull request #16738 from github/mbg/go/remove-go-work
Go: Remove `go.work` file
2024-06-13 12:20:12 +01:00
Mathias Vorreiter Pedersen
4bbeda08d6 C++: Fix change note naming. 2024-06-13 11:10:00 +01:00
Mathias Vorreiter Pedersen
83108e3e25 C++: Add change note. 2024-06-13 11:03:52 +01:00
Mathias Vorreiter Pedersen
bcabc88649 C++: Accept test changes. 2024-06-13 10:59:46 +01:00
Mathias Vorreiter Pedersen
4079de125f C++: Fix FP by also excluding indirections of array expressions. 2024-06-13 10:59:39 +01:00
Mathias Vorreiter Pedersen
eec259279a C++: Add another FP test. We already have tests for this, but it doesn't hurt to have another one, I guess. 2024-06-13 10:57:49 +01:00
Mathias Vorreiter Pedersen
e244eef3b5 Merge pull request #16748 from MathiasVP/rc-3.14-mergeback-2
Mergeback from `rc/3.14`
2024-06-13 10:44:46 +01:00
Michael Nebel
7f7c5d7c94 Java: Update model generator expected test output. 2024-06-13 10:57:15 +02:00
Michael Nebel
e247d5b316 Java: Sync files and make dummy language specific implementation. 2024-06-13 10:55:17 +02:00
Michael Nebel
e56c185f32 Java: Add some model generator sink examples. 2024-06-13 10:49:57 +02:00
Mathias Vorreiter Pedersen
0150269503 Merge branch 'rc/3.14' into rc-3.14-mergeback-2 2024-06-13 09:14:40 +01:00
Mathias Vorreiter Pedersen
9384f6189e Merge pull request #16740 from MathiasVP/fix-join-in-ssa
SSA: Fix bad join in `lastRefRedefExt`
2024-06-13 09:06:20 +01:00
Paolo Tranquilli
11c37734c3 Kotlin: add change note for having fixed kotlin QL tests in release 2024-06-13 09:49:39 +02:00
Michael Nebel
854c6fa813 C#: Update expected test output after .NET 8 models update. 2024-06-13 09:24:13 +02:00
Michael Nebel
9ea2b463f0 C#: Update .NET 8 Runtime models. 2024-06-13 08:36:23 +02:00
Michael Nebel
78d23ee044 C#/Java: Allow the model generator to use 32GB of ram. 2024-06-13 08:35:52 +02:00
Rasmus Wriedt Larsen
ec18786488 JS: Provide better model for Array.splice 2024-06-12 16:29:21 +02:00
Mathias Vorreiter Pedersen
5b3403c4b1 C++: Fix bad join in 'lastRefRedefExt'. 2024-06-12 15:24:58 +01:00
Michael B. Gale
e10e2899bd Go: Update comment in gen.py 2024-06-12 15:24:33 +01:00
Rasmus Wriedt Larsen
54a0e6dc45 JS: Add new test for Array.splice 2024-06-12 16:24:33 +02:00
Michael B. Gale
8629e00686 Go: Remove workspace from vendor/modules.txt 2024-06-12 15:22:56 +01:00
Rasmus Wriedt Larsen
9ed6da1072 JS: prepare to extend Array tests
Oh how I have enjoyed working with InlineExpectationTests for these sort
of things, not worrying about all the .expected files changing because
you add a few lines in the middle of your tests :D
2024-06-12 16:22:55 +02:00
Michael B. Gale
a90968d277 Go: Replace go work vendor with go mod vendor 2024-06-12 15:19:14 +01:00
Rasmus Wriedt Larsen
1027ca266d JS: Allow many Array steps to be used in type-tracking 2024-06-12 16:14:13 +02:00
Joe Farebrother
90d6f2ece3 Factor out nameIndicatesRelevantSensitiveData 2024-06-12 15:11:47 +01:00
Tom Hvitved
605fe54a06 Ruby: Remove two Cartesian products 2024-06-12 15:11:43 +01:00
Joe Farebrother
5f08371f19 Add change note 2024-06-12 15:11:39 +01:00
Joe Farebrother
07f03be8cc Add unit tests 2024-06-12 15:11:35 +01:00
Joe Farebrother
b0c03f6d68 Allow implicit read steps on sinks 2024-06-12 15:11:32 +01:00
Joe Farebrother
8b51ee8fe8 Use additional sensitive data heuristics in CleartextSources 2024-06-12 15:11:27 +01:00
Michael B. Gale
a04f08f026 Go: Remove go.work file 2024-06-12 15:10:28 +01:00
Tamás Vajk
a756f86847 Merge pull request #16732 from tamasvajk/refactor/extraction-states
C#: Refactor extractor state classes and simplify extraction code
2024-06-12 15:20:11 +02:00
Tamas Vajk
0df6a1c4b1 Fix quality issues 2024-06-12 14:48:16 +02:00
Michael Nebel
48739da565 C#: Update expected test output. 2024-06-12 14:16:31 +02:00
Michael Nebel
91ebeee429 C#: Perceive field and property reads as additional flow steps in sink extrapolation. 2024-06-12 14:16:26 +02:00
Michael Nebel
5aee35256d C#: Add member flow example. 2024-06-12 14:16:22 +02:00
Michael Nebel
4b62cb64ed C#: Update expected test output. 2024-06-12 14:16:17 +02:00
Michael Nebel
0bbf131fdb C#: Add some compound sink examples. 2024-06-12 14:16:12 +02:00
Kasper Svendsen
7c2ee80bc3 Document builtin InternSets module 2024-06-12 13:56:48 +02:00
Tamas Vajk
e3cbf1479a Fix quality issue 2024-06-12 13:25:34 +02:00
Arthur Baars
4ee80653e2 Merge pull request #16471 from Sim4n6/ruby-UBV
Ruby: Add some method calls as a Source
2024-06-12 12:42:08 +02:00
Tamas Vajk
3551386a1a Simplify standalone extractor 2024-06-12 12:30:08 +02:00
Owen Mansel-Chan
6af1ed9d75 Merge pull request #16730 from github/workflow/coverage/update
Update CSV framework coverage reports
2024-06-12 11:22:29 +01:00
Tamas Vajk
cdca607828 Rename Extractor to ExtractionContext 2024-06-12 11:43:19 +02:00
Tamas Vajk
af2a78ea4d Reduce references to Extract class 2024-06-12 11:13:05 +02:00
Paolo Tranquilli
183a825841 Kotlin: expose kotlin version picker for internal packaging 2024-06-12 09:29:57 +02:00
github-actions[bot]
bbeebfae73 Add changed framework coverage reports 2024-06-12 00:17:31 +00:00
Joe Farebrother
f441c68f7e Merge pull request #16657 from joefarebrother/python-partial-ssrf-fp
Python: Add additional sanitizers to SSRF
2024-06-11 23:20:50 +01:00
Mauro Baluda
1db5e32e86 Extract SAP XSJS file types as Javascript 2024-06-11 23:53:41 +02:00
Mauro Baluda
45a48f360f Extract SAP XSJS file types as Javascript 2024-06-11 23:51:44 +02:00
Michael B. Gale
e9bd85e0ba Merge pull request #16704 from github/mbg/go/fix/build-scripts-running-more-than-once 2024-06-11 22:23:15 +01:00
Michael B. Gale
202d77d94f Merge pull request #16726 from github/mbg/go/log-one-line-for-stray-sources
Go: Only log one line for stray .go files
2024-06-11 22:16:21 +01:00
Owen Mansel-Chan
24c9062b35 Merge pull request #16671 from owen-mc/go/mad-builtin-taint-models-try-2
Go: Convert old-style models for built-ins to MaD
2024-06-11 19:45:34 +01:00
Michael B. Gale
d8d1ae632c Merge branch 'mbg/go/fix/build-scripts-running-more-than-once' into mbg/go/fix/too-many-go-mod-files-initialised 2024-06-11 18:31:03 +01:00
Michael B. Gale
0f56e408f8 Merge branch 'main' into mbg/go/fix/build-scripts-running-more-than-once 2024-06-11 18:29:41 +01:00
Michael B. Gale
864d629a13 Go: Prevent go.mod files from being added to every directory with stray source files 2024-06-11 18:24:11 +01:00
Michael B. Gale
20b7def543 Go: Only log one line for stray .go files 2024-06-11 18:06:08 +01:00
Geoffrey White
cf4736c8f6 Merge pull request #16545 from geoffw0/salvage
Swift: Salvage
2024-06-11 17:51:17 +01:00
Mathias Vorreiter Pedersen
67b327a0f7 Merge pull request #16725 from MathiasVP/rc-3.14-mergeback
Mergeback from `rc/3.14`
2024-06-11 17:37:40 +01:00
Tony Torralba
a299afaf51 Merge pull request #16712 from mbaluda/main
Java: Add `FileUtils` sinks to path injection
2024-06-11 17:50:08 +02:00
Paolo Tranquilli
3d3652c63f Merge branch 'main' into redsun82/kotlin 2024-06-11 17:25:10 +02:00
Cornelius Riemenschneider
92957a63ad Add prefix feature to codeql_pack_group.
Turns out we need this for our production targets.
2024-06-11 17:22:35 +02:00
Mathias Vorreiter Pedersen
3351b9547d Merge branch 'rc/3.14' into rc-3.14-mergeback 2024-06-11 16:21:08 +01:00
Owen Mansel-Chan
2ae7fa4897 Tests: accept expected changes 2024-06-11 16:20:06 +01:00
Owen Mansel-Chan
6fd2ab7cef Tests: Accept model renumbering in edge provenance 2024-06-11 16:18:18 +01:00
Mathias Vorreiter Pedersen
b88a1b2d1e Merge pull request #16724 from MathiasVP/cache-asexpr
C++: Cache `asExpr` (and `asIndirectExpr`) implementation predicates
2024-06-11 16:17:29 +01:00
Owen Mansel-Chan
700604a1c2 Convert old-style models for built-ins to MaD
These models are to cover the special cases where `append` can be used
with a second argument which is a string followed by `...`, and `copy`
can be used with a second argument which is a string. In this case the
taint is carried by the whole string, rather than in array elements.
2024-06-11 16:16:45 +01:00
Joe Farebrother
93f10fcf14 Add sanitizers for compiled regexes 2024-06-11 15:44:16 +01:00
Mathias Vorreiter Pedersen
6a6978398a C++: Add file QLDoc. 2024-06-11 15:39:45 +01:00
Mathias Vorreiter Pedersen
333df03f64 C++: Cache more things. 2024-06-11 15:39:43 +01:00
Mauro Baluda
a464a8e48e @mbaluda
Update provenance in test expectations
2024-06-11 15:15:50 +02:00
Tamas Vajk
11faf08ed0 Remove specific standalone/tracing extractor state classes 2024-06-11 14:16:35 +02:00
Geoffrey White
214db5c20d Swift: Make CI more happy. 2024-06-11 12:49:58 +01:00
Cornelius Riemenschneider
3cf719cb39 pkg.bzl: Significantly restructure codeql_pack rule.
This PR introduces a `codeql_pack_rule` that does the heavy lifting
of extracting arch- and common zip files for production dist building.
It also factors out the installer targets for individual packs,
as well as pack groups.

This changes the contract between the internal build system and the pack
definition significantly, which is why an accompanying internal PR is required.
No backwards compatibility layer is provided, as the PR as complex enough as-is.

The individual `codeql_pack` rules are now much simpler,
as they mostly stuff their inputs into a new `_CodeQLPackInfo` provider,
and let the installer and `codeql_pack_group` rules do the heavy lifting.
For working in the external repo with self-contained packs,
the per-pack installer targets are still available.
Internally, we'll only use the new `codeql_pack_group` targets
going forward, both for defining intree-dists and for building
the production zip files.
2024-06-11 13:15:05 +02:00
Cornelius Riemenschneider
3574b9fd4f Merge pull request #16716 from github/criemen/rust-bzlmod-new
Rust: Move to bzlmod.
2024-06-11 13:13:16 +02:00
Mauro Baluda
29e3816412 Apply suggestions from code review
Address reviewiew comments

Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2024-06-11 12:05:14 +02:00
Paolo Tranquilli
01416838a1 Merge branch 'main' into redsun82/kotlin 2024-06-11 11:57:19 +02:00
Cornelius Riemenschneider
4226270ef9 Merge branch 'main' into criemen/rust-bzlmod-new 2024-06-11 11:40:40 +02:00
Anders Schack-Mulligen
73caa48302 Merge pull request #16721 from aschackmull/dataflow/remove-unused-import
Dataflow: Remove unused import.
2024-06-11 09:54:05 +02:00
Chris Smowton
3172054073 Merge pull request #16717 from github/post-release-prep/codeql-cli-2.17.5
Post-release preparation for codeql-cli-2.17.5
2024-06-11 07:56:55 +01:00
Anders Schack-Mulligen
939ae4a561 Dataflow: Remove unused import. 2024-06-11 08:55:44 +02:00
Paolo Tranquilli
90db894d01 Kotlin: remove obsolete scripts and reword comments 2024-06-11 08:52:26 +02:00
Anders Schack-Mulligen
87316784ad Shared: Fix file-module qldoc. 2024-06-11 08:49:15 +02:00
Mauro Baluda
bb5ef3ccd9 Update provenance in test expectations 2024-06-10 19:57:37 +02:00
Mauro Baluda
e9dba59f11 Merge branch 'main' into main 2024-06-10 19:57:00 +02:00
Geoffrey White
ae0bf037ac Swift: Make CI happy. 2024-06-10 18:54:16 +01:00
Geoffrey White
2f33b9422b Merge branch 'main' into salvage 2024-06-10 18:31:46 +01:00
Geoffrey White
83860acdde Swift: Test BuiltinLiteralExpr. 2024-06-10 18:20:25 +01:00
Geoffrey White
f2b1e09650 Swift: Add some conversion test cases. 2024-06-10 17:25:25 +01:00
Michael B. Gale
317790eac3 Merge pull request #16703 from github/mbg/go/improve-version-selection-v2
Go: Use toolchain directives for version selection if available, and add tests (v2)
2024-06-10 16:03:00 +00:00
Mathias Vorreiter Pedersen
ec34007a88 Merge pull request #16714 from MathiasVP/handle-unlikely-in-guards-2
C++: Support `__builtin_expect` in `IRGuards`
2024-06-10 16:54:01 +01:00
github-actions[bot]
8a25081a0e Post-release preparation for codeql-cli-2.17.5 2024-06-10 15:33:08 +00:00
Tony Torralba
7336dd1ae5 Merge pull request #16482 from grakshith/rakshith/tune-java-crypto
Java: Add RSA/ECB/OEAP ciphers to the list of secure algorithms
2024-06-10 17:27:35 +02:00
Cornelius Riemenschneider
496fff4273 C#: Remove empty glob pattern. 2024-06-10 17:04:00 +02:00
Cornelius Riemenschneider
00319c5010 Upgrade bazel to 7.2.0.
This also bumps a bunch of external dependencies.
2024-06-10 17:03:59 +02:00
Cornelius Riemenschneider
092bc6445d Rust/bazel: Port to bzlmod.
This gets rid of our last workspace dependency.
In particular, this change also gets rid of the checked-in extra
lock files that took forever to generate.
2024-06-10 17:03:58 +02:00
Michael B. Gale
d4adc373c6 Replace if with else if in RequiredGoVersion 2024-06-10 15:48:29 +01:00
Chris Smowton
a160b891c8 Merge pull request #16715 from github/release-prep/2.17.5
Release preparation for version 2.17.5
2024-06-10 14:46:30 +01:00
github-actions[bot]
877bfa2468 Release preparation for version 2.17.5 2024-06-10 13:40:39 +00:00
Mathias Vorreiter Pedersen
c3bba38950 C++: Fix QLDoc. 2024-06-10 13:39:34 +01:00
Cornelius Riemenschneider
7ecf1f9010 Merge pull request #16713 from github/criemen/csharp-version-fallback
C#: Add fallback for branch detection.
2024-06-10 14:24:37 +02:00
Mathias Vorreiter Pedersen
1aea120e89 C++: Add change note. 2024-06-10 13:01:01 +01:00
Mathias Vorreiter Pedersen
b0c4fcec57 C++: Cleanup. 2024-06-10 12:53:07 +01:00
Mathias Vorreiter Pedersen
9e088f3e4a C++: Accept test changes. 2024-06-10 12:53:06 +01:00
Mathias Vorreiter Pedersen
84c1341b62 C++: Support builtin expect in IRGuards. 2024-06-10 12:53:04 +01:00
Mathias Vorreiter Pedersen
d76700497b C++: Add testcases using the builtin expect operation. 2024-06-10 12:47:45 +01:00
Mathias Vorreiter Pedersen
9c98652116 C++: Handle 'unlikely' in IRGuards. 2024-06-10 12:47:44 +01:00
Jeroen Ketema
000a81fd29 Merge pull request #16690 from MathiasVP/better-guards
C++: Fix missing results for `comparesEq` in `IRGuardCondition`
2024-06-10 13:32:10 +02:00
Sim4n6
7c0ce6486b Rerun the test learn 2024-06-10 12:21:10 +01:00
Cornelius Riemenschneider
027c7d0d43 C#: Add fallback for branch detection.
Apparently, when building a release build, we're getting `no-git`
as first part o the version string for the submodule.
If we do, fall back to the internal repo's branch name.
For releases, that's the same anyways.
Luckily, the commit SHA is correct.
2024-06-10 12:14:03 +02:00
Mauro Baluda
1d44f45be2 Update org.apache.commons.io.model.yml 2024-06-10 12:03:57 +02:00
Mathias Vorreiter Pedersen
7819cc1c36 C++: Add more QLDoc. 2024-06-10 10:58:52 +01:00
Mauro Baluda
71505f4003 Added more org.apache.commons.io.FileUtils-related sinks to the path injection query. 2024-06-10 11:29:51 +02:00
Tamás Vajk
06aa2664bf Merge pull request #16705 from tamasvajk/build/fix-attributes
C#: Add assembly attributes to assemblies built with Bazel
2024-06-10 09:26:31 +02:00
am0o0
9db334d02f update select statement, update test cases 2024-06-07 21:26:20 +02:00
am0o0
2c9340331d update test cases expected results 2024-06-07 21:16:31 +02:00
am0o0
5e0a78c4c7 make predicate for env key and value nodes, use propertyRead/Write instead of API nodes to find env key and value assignments, fix a bug thanks to @erik-krogh 2024-06-07 21:15:30 +02:00
Michael B. Gale
e7a60b72f1 Go: Check dependencies per workspace 2024-06-07 16:22:41 +00:00
Michael B. Gale
b9586a81ef Go: Add functions for constructing go list commands 2024-06-07 16:22:40 +00:00
Michael B. Gale
6c0c3365cf Go: Fix vendor issues and go.sum files in separate loop 2024-06-07 16:22:39 +00:00
Michael B. Gale
d344f720aa Go: Add methods to GoModule for the tidy and vendor commands
These ensure that the module path is used automatically
2024-06-07 16:22:37 +00:00
Tamas Vajk
5f98f2aec9 Add assembly attributes to bazel build script 2024-06-07 15:42:12 +02:00
Cornelius Riemenschneider
6731bccc92 C#: Provide skeleton to generate an assemblyInfo file.
Each unit gets a unique assemblyInfo file, on top
of the ones for entrypoints that also gets the git info embedded.
2024-06-07 15:24:53 +02:00
Tamas Vajk
16f8be4ba4 C#: Add product name to assemblies 2024-06-07 15:24:21 +02:00
Tamas Vajk
beffc2a49d C#: Remove unneeded source folder from Bazel build scripts 2024-06-07 15:23:45 +02:00
Anders Schack-Mulligen
32260e2823 Merge pull request #16210 from aschackmull/dataflow/provenance-for-tests
Dataflow: Add support for pretty-printed alert provenance in tests
2024-06-07 14:53:56 +02:00
Michael B. Gale
881b2586e1 Go: Add tests for RequiredGoVersion 2024-06-07 12:20:44 +00:00
Michael B. Gale
504a233299 Go: Use Toolchain directives in go.mod files, if available 2024-06-07 12:20:43 +00:00
Michael B. Gale
1d6f09c750 Go: Refactor go.mod version retrieval into its own method 2024-06-07 12:20:42 +00:00
Michael B. Gale
44a16cef6c Go: Use Toolchain directives in go.work files, if available 2024-06-07 12:20:41 +00:00
Michael B. Gale
ea3a3db847 Merge pull request #16460 from github/mbg/go/semver-type
Go: Use new type for all semantic versions
2024-06-07 12:19:12 +00:00
Michael B. Gale
9d1c2c6ba1 Merge branch 'main' into mbg/go/semver-type 2024-06-07 12:09:10 +00:00
Anders Schack-Mulligen
9b1e4d7895 Go: Fix test failure. 2024-06-07 13:16:20 +02:00
Pierre
0ab67d1790 Merge pull request #16684 from github/sitedocs/2.17.4
Add changelog for 2.17.4
2024-06-07 02:50:38 -07:00
Anders Schack-Mulligen
7e980d9524 Add a bit more qldoc. 2024-06-07 11:47:50 +02:00
Anders Schack-Mulligen
0c47203580 Javascript: Add support for pretty-printed provenace in tests. 2024-06-07 11:47:49 +02:00
Anders Schack-Mulligen
68ddae2918 Python: Add support for pretty-printed provenace in tests. 2024-06-07 11:47:48 +02:00
Anders Schack-Mulligen
5d51b5b97b Ruby: Add support for pretty-printed provenace in tests. Convert one test. 2024-06-07 11:47:48 +02:00
Anders Schack-Mulligen
a26c01d7c7 Go: Add support for pretty-printed provenace in tests. Convert one test. 2024-06-07 11:47:45 +02:00
Anders Schack-Mulligen
0e8d72c126 C#: Add support for pretty-printed provenace in tests. Convert one test. 2024-06-07 11:45:16 +02:00
Anders Schack-Mulligen
4ec4da4c8c Dataflow/Java: Add support for pretty-printed provenace in tests. Convert one test. 2024-06-07 11:45:13 +02:00
Tamás Vajk
68a78fa3ed Merge pull request #16700 from tamasvajk/buildless/tsp-warning-config
C#: Add TSP warning if `buildless` option is used instead of `build-mode`
2024-06-07 11:07:16 +02:00
Michael Nebel
d5af71a6c9 Merge pull request #16647 from michaelnebel/csharp/idempotentsummarygeneration
C#: Make summary generation idempotent.
2024-06-07 10:38:25 +02:00
Tamas Vajk
9366eb8288 C#: Add TSP warning if buildless option is used instead of build-mode 2024-06-07 10:33:13 +02:00
Mathias Vorreiter Pedersen
7f62085be5 C++: Delete unused predicate. 2024-06-07 09:13:29 +01:00
Jeroen Ketema
456c046b09 Merge pull request #16693 from jketema/func-fix
C++: Correctly identify orphaned variables as static
2024-06-07 07:54:11 +02:00
am0o0
1033bf9c4c remove unused imports from javascript test cases 2024-06-07 06:04:12 +02:00
am0o0
b9e3b3310e update the remote flow based query thanks to @erik-krogh, update tests and separate the local and remote query tests 2024-06-07 06:01:49 +02:00
Ian Lynagh
97cb0c89c8 Kotlin: Remove unused PopulationSpecFile 2024-06-06 21:14:28 +01:00
Mathias Vorreiter Pedersen
ed525fce70 C++: Accept test changes. 2024-06-06 20:38:31 +01:00
Mathias Vorreiter Pedersen
b5a3575130 C++: Make proper use of barrier guards in test. 2024-06-06 20:38:17 +01:00
Jeroen Ketema
4488518838 C++: Update expected test results 2024-06-06 21:12:34 +02:00
Jeroen Ketema
5ae8fe502a C++: Correctly identify orphaned variables as static 2024-06-06 20:35:26 +02:00
Jeroen Ketema
798357ffc6 C++: Add test case that shows that __func__ is not considered static 2024-06-06 20:31:45 +02:00
Mathias Vorreiter Pedersen
7b92554cf2 Merge branch 'main' into better-guards 2024-06-06 19:22:10 +01:00
Mathias Vorreiter Pedersen
9f4c1380e5 Merge pull request #16677 from MathiasVP/phi-input-nodes
C++: Extend barrier guards to handle phi inputs
2024-06-06 19:21:30 +01:00
Michael B. Gale
2662808629 Go: Output setup-go compatible pre-release identifiers 2024-06-06 17:14:45 +00:00
Mathias Vorreiter Pedersen
9564ae1ca4 C++: Accept more test changes. 2024-06-06 17:04:48 +01:00
Tom Hvitved
eae6406629 Merge pull request #16687 from hvitved/ruby/bump-ts-grammar
Ruby: Bump tree-sitter grammar
2024-06-06 17:44:18 +02:00
Mathias Vorreiter Pedersen
528afba919 C++: Accept test changes. 2024-06-06 16:32:29 +01:00
Mathias Vorreiter Pedersen
36aac3ffd8 C++: Get rid of 'relevantUnaryComparison' since it was excluding too much. The performance is most likely fine with that restriction. 2024-06-06 16:32:16 +01:00
Mathias Vorreiter Pedersen
703832f5a1 C++: Remove a column from a few predicates. 2024-06-06 16:30:32 +01:00
Mathias Vorreiter Pedersen
0298755975 C++: Add a test. 2024-06-06 16:22:23 +01:00
Mathias Vorreiter Pedersen
8aaa2a1079 C++: Improve comment. 2024-06-06 15:58:52 +01:00
Mathias Vorreiter Pedersen
f7b2d98c6e C++: Add tests to demonstrate that it's not barrier guard that's buggy. Rather, it's the GuardCondition library. 2024-06-06 15:35:16 +01:00
Mathias Vorreiter Pedersen
fa09d21c32 C++: Simplify. No need for the 'PhiInputNodeExt' class. 2024-06-06 15:33:38 +01:00
Asger F
6e0f3df573 Merge pull request #14120 from asgerf/dynamic/typemodel-istypeused
Dynamic: add TypeModel.isTypeUsed
2024-06-06 15:31:16 +02:00
Mathias Vorreiter Pedersen
5deb9002bf Merge pull request #16665 from geoffw0/yml
C++: Support for extension models (.yml)
2024-06-06 14:21:42 +01:00
Geoffrey White
8acb11924d C++: Remove redundant import. 2024-06-06 13:39:10 +01:00
Mathias Vorreiter Pedersen
314eb5db72 Merge pull request #16688 from MathiasVP/flow-through-builtin-bit-cast
C++: Fix IR generation for builtins and add flow through `__builtin_bit_cast`
2024-06-06 13:28:41 +01:00
Geoffrey White
38acfcf42e C++: Doc tweaks addressing review comments. 2024-06-06 13:11:57 +01:00
am0o0
12df7dee17 Merge branch 'amammad-js-JWT' of https://github.com/amammad/codeql into amammad-js-JWT 2024-06-06 14:04:46 +02:00
Am
af016f9416 Merge branch 'github:main' into amammad-js-JWT 2024-06-06 15:33:26 +03:30
am0o0
8258e377dd use PascalCase for URLConstructorLabel 2024-06-06 14:00:56 +02:00
am0o0
d27a378008 change query-id to avoid duplicate ids 2024-06-06 13:59:58 +02:00
Geoffrey White
7aec488d8a C++: Permit ':' in models-as-data namespaces. 2024-06-06 12:53:42 +01:00
Geoffrey White
894497218d Shared: Recognize 'remote-sink' in ModelValidation.qll. 2024-06-06 12:49:13 +01:00
Geoffrey White
f9ef72eca6 C++: Fix typos. 2024-06-06 12:31:44 +01:00
Tom Hvitved
331f676832 Merge pull request #16523 from microsoft/jb1/chanely-insecure-sql-connection
Adding case to InsecureSQLConnection.ql when Encrypt set in initializer
2024-06-06 12:58:14 +02:00
Mathias Vorreiter Pedersen
31bc4263e7 C++: Fix QLDoc. 2024-06-06 10:52:37 +01:00
Paolo Tranquilli
ac6cc38b20 Merge pull request #16681 from github/redsun82/ripunzip
Ripunzip: provide installer
2024-06-06 11:52:04 +02:00
Paolo Tranquilli
2d42ea0f2f Merge pull request #16668 from github/criemen/pkg-js-fixup
JS: Use `resources/tools` from external repo, not internal.
2024-06-06 11:50:54 +02:00
Mathias Vorreiter Pedersen
bd9ece0bd3 C++: Add dataflow through '__builtin_bit_cast'. 2024-06-06 10:00:18 +01:00
Mathias Vorreiter Pedersen
48f2fd0460 C++: Accept IR changes. 2024-06-06 09:52:35 +01:00
Mathias Vorreiter Pedersen
d6352b47a1 C++: Fix IR generation for builtin operations. 2024-06-06 09:52:20 +01:00
Mathias Vorreiter Pedersen
f58757ff9d C++: Skip children we cannot translate when translating builtin operations. 2024-06-06 09:48:41 +01:00
Mathias Vorreiter Pedersen
af4d2f1ed3 C++: Add an IR test. 2024-06-06 09:48:03 +01:00
Tom Hvitved
523139259a Ruby: Update cargo-bazel-lock.json 2024-06-06 10:46:01 +02:00
Tom Hvitved
7122db0c45 Ruby: Bump tree-sitter grammar 2024-06-06 10:31:16 +02:00
Tom Hvitved
421c68a263 Merge pull request #16663 from hvitved/ruby/extraction-error-consistency
Ruby: Add consistency query for extraction errors
2024-06-06 10:29:56 +02:00
Tamás Vajk
0f09198bcd Merge pull request #16673 from tamasvajk/fix/logger-disposal
C#: Fix erroneous logger disposal
2024-06-06 09:13:27 +02:00
Sim4n6
dabc33bf66 simplify UnicodeBypassValidationQuery code 2024-06-05 22:45:49 +01:00
Erik Krogh Kristensen
2e5d9c34bf Merge pull request #16675 from mbaluda/main
Extract .xsaccess files as JSON
2024-06-05 20:19:40 +02:00
Chanel
7b5297b882 Merge branch 'main' into jb1/chanely-insecure-sql-connection 2024-06-05 09:02:13 -07:00
Chanel Young
716e2737d1 formatting 2024-06-05 09:01:10 -07:00
Owen Mansel-Chan
ef2f01613c Merge pull request #16676 from owen-mc/qldoc-external-flow
C/C#/Java/Swift: Cover all params in QLDoc of `modelCoverage`
2024-06-05 16:53:27 +01:00
Ian Lynagh
ac91a5167a Merge pull request #16682 from igfoo/igfoo/integ
Java integration tests: accept new output
2024-06-05 16:48:18 +01:00
Chris Smowton
e704bf353b Merge pull request #16685 from smowton/smowton/admin/ecj-change-note
Java: Add change note documenting ECJ improvements
2024-06-05 16:39:20 +01:00
Owen Mansel-Chan
3b51f1f722 Merge pull request #16683 from owen-mc/go/refactor-extractor
Go: Refactor findMethodWithGivenReceiver
2024-06-05 16:31:44 +01:00
Chris Smowton
79ae522349 Add change note documenting ECJ improvements 2024-06-05 15:12:33 +01:00
Michael B. Gale
c0142c1a91 Go: Add comment explaining why NewSemVer does not Canonicalise the result 2024-06-05 14:08:45 +00:00
Pierre
366fba8b33 Add changelog for 2.17.4 2024-06-05 16:03:50 +02:00
Michael B. Gale
f830dc6852 Merge branch 'main' into mbg/go/semver-type 2024-06-05 13:59:20 +00:00
Owen Mansel-Chan
fcf06c59aa Refactor findMethodWithGivenReceiver 2024-06-05 14:52:31 +01:00
Chris Smowton
e267031f59 Merge pull request #16680 from smowton/smowton/admin/add-ecj-tests
Java: add basic ECJ integration tests
2024-06-05 14:33:36 +01:00
Ian Lynagh
13dd87f04c Java integration tests: accept new output
This means the expected output is in the order that the new test driver
creates it in, which means future diffs will be smaller.
2024-06-05 14:14:44 +01:00
Paolo Tranquilli
61847bc58b Ripunzip: provide installer 2024-06-05 14:46:59 +02:00
Michael B. Gale
5dd7e136e5 Merge branch 'main' into mbg/go/semver-type 2024-06-05 12:22:16 +00:00
Sim4n6
7dcbbbac91 Refactor UnicodeBypassValidationQuery to remove unnecessary code 2024-06-05 13:05:34 +01:00
Chris Smowton
54347c2642 Java: add basic ECJ integration tests 2024-06-05 12:49:25 +01:00
Owen Mansel-Chan
44a56c420f Merge pull request #16558 from owen-mc/go/sync-external-flow
Go: sync ExternalFlow.qll
2024-06-05 11:31:34 +01:00
Jeroen Ketema
ff46e2c627 Merge pull request #16662 from jketema/gets
C++: Ignore `gets`'es with incorrect parameter counts
2024-06-05 11:50:04 +02:00
Mathias Vorreiter Pedersen
97f0c759c0 C++: Accept test changes. 2024-06-05 09:58:47 +01:00
Mathias Vorreiter Pedersen
44cc19cd6b C++: Handle phi inputs in barrier guards logic. 2024-06-05 09:58:45 +01:00
Mathias Vorreiter Pedersen
05d46a6793 C++: Also ignore phi input edges in 'AllocaInLoop.ql'. 2024-06-05 09:58:44 +01:00
Mathias Vorreiter Pedersen
0149fb640d C++: Simplify. 2024-06-05 09:58:43 +01:00
Mathias Vorreiter Pedersen
25179074c1 C++: Better toString on phi nodes. 2024-06-05 09:58:41 +01:00
Mathias Vorreiter Pedersen
85d0efcbed C++: Make the last use of a node before entering the phi node map to a phi input dataflow node. 2024-06-05 09:58:40 +01:00
Jeroen Ketema
6f8449cf75 C++: Add change note 2024-06-05 10:05:13 +02:00
Owen Mansel-Chan
6b2e86afea Accept review suggestion 2024-06-05 07:34:46 +01:00
Owen Mansel-Chan
63bec5ae3e Merge pull request #16678 from github/workflow/coverage/update
Update CSV framework coverage reports
2024-06-05 07:31:57 +01:00
github-actions[bot]
c2bd050e08 Add changed framework coverage reports 2024-06-05 00:17:01 +00:00
Mauro Baluda
cc0271715b Merge branch 'main' into main 2024-06-04 23:27:10 +02:00
Mauro Baluda
0b9bafc9c3 Update AutoBuildTests.java 2024-06-04 21:07:57 +02:00
Mauro Baluda
168cba86c1 Add .xsaccess test data 2024-06-04 20:55:07 +02:00
Rakshith Gopalakrishna
798a736d16 fix: update changelog
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2024-06-04 11:20:05 -07:00
Rakshith Gopalakrishna
65af2556ed fix: remove rsa/ecb/* from getASecureAlgorithmName
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2024-06-04 11:20:05 -07:00
Rakshith Gopala krishna
97f9a882c6 fix: address PR comments 2024-06-04 11:20:05 -07:00
Rakshith Gopala krishna
0f63f0dda2 docs: add changenote 2024-06-04 11:20:05 -07:00
Rakshith Gopala krishna
80bf7cdb52 fix: remove the pkcs1 scheme 2024-06-04 11:20:05 -07:00
Rakshith Gopala krishna
dd223ed704 feat: add rsa/ecb/... variants to the list of secure algorithms 2024-06-04 11:20:05 -07:00
Paolo Tranquilli
ad2eacfd2f Merge pull request #16117 from github/redsun82/kotlin
Kotlin: build extractor with bazel
2024-06-04 20:13:00 +02:00
Mathias Vorreiter Pedersen
d020f93005 C++: This is never a definition. 2024-06-04 17:19:49 +01:00
Mathias Vorreiter Pedersen
3e53f3bd13 C++: Flow out of phi inputs to the phi node. 2024-06-04 17:19:47 +01:00
Mathias Vorreiter Pedersen
e04c75df24 C++: Introduce a new phi input dataflow node. 2024-06-04 17:19:46 +01:00
Mathias Vorreiter Pedersen
888a831a5c C++: Use 'ssaDefReachesReadExt' instead of 'ssaDefReachesRead'. 2024-06-04 17:19:45 +01:00
Mathias Vorreiter Pedersen
556dc282d2 C++: Use 'phiHasInputFromBlockExt' instead of 'phiHasInputFromBlock'. 2024-06-04 17:19:43 +01:00
Mathias Vorreiter Pedersen
ceccc9294c C++: Add a testcase that failed during development. 2024-06-04 17:19:41 +01:00
Mathias Vorreiter Pedersen
a9af28ede0 C++: Drive-by fix. This is not needed anymore after #16345 2024-06-04 17:19:40 +01:00
Mathias Vorreiter Pedersen
43c7ac36d9 C++: Add a test with spurious flow. 2024-06-04 17:19:36 +01:00
Owen Mansel-Chan
3fb5ad2a0d Cover all params in QLDoc of modelCoverage 2024-06-04 17:06:00 +01:00
Paolo Tranquilli
b7e16ca55d Kotlin: fix custom_plugin test 2024-06-04 17:59:13 +02:00
Paolo Tranquilli
e4653a80d4 Kotlin: remove kapt wrapper, probably unneeded 2024-06-04 17:55:19 +02:00
Mauro Baluda
8791e67789 Add .xsaccess test data 2024-06-04 17:50:08 +02:00
Mauro Baluda
576ee7892d Add .xsaccess test data 2024-06-04 17:36:05 +02:00
Mauro Baluda
7b3e9b4ec1 Extract .xsaccess files as JSON 2024-06-04 16:28:08 +02:00
Mauro Baluda
73b18129d9 Extract .xsaccess files as JSON 2024-06-04 16:23:05 +02:00
Paolo Tranquilli
10584b3a7a Kotlin: improve posix dev wrappers 2024-06-04 15:36:35 +02:00
Paolo Tranquilli
a48d71b42f Merge branch 'main' into redsun82/kotlin 2024-06-04 15:32:59 +02:00
Tamas Vajk
b8bc014297 Fix erroneous logger disposal 2024-06-04 15:12:44 +02:00
Paolo Tranquilli
8205f86365 Kotlin: use tools/bazel in integration test 2024-06-04 15:12:23 +02:00
Paolo Tranquilli
be5c82cb88 Kotlin: add other tools to dev wrapper 2024-06-04 15:11:59 +02:00
Tom Hvitved
e42de3de6f Ruby: Fix extraction errors 2024-06-04 14:54:02 +02:00
Paolo Tranquilli
c6039b345b Kotlin: update default kotlinc version 2024-06-04 14:39:16 +02:00
Paolo Tranquilli
e693c2719d Kotlin: remove unneeded patch 2024-06-04 14:39:02 +02:00
Paolo Tranquilli
e7cec01a81 Kotlin: make current_kotlin_version.py executable 2024-06-04 14:31:59 +02:00
Paolo Tranquilli
4c91bdce48 Kotlin: tgt -> target 2024-06-04 14:27:33 +02:00
Paolo Tranquilli
2fe0718e49 Explain .lfsconfig choice in the comment 2024-06-04 14:27:08 +02:00
Am
e3e59e02e5 Merge branch 'github:main' into amammad-js-CodeInjection_dynamic_import 2024-06-04 16:22:06 +04:00
Paolo Tranquilli
6a9cb90a57 Kotlin: rework header comment 2024-06-04 14:21:58 +02:00
Paolo Tranquilli
fcd326eb11 CI: reword comment 2024-06-04 14:14:23 +02:00
Owen Mansel-Chan
60970ff015 Merge pull request #16571 from owen-mc/go/remove-step-duplication-in-config
Go: remove flow step duplication in configs
2024-06-04 12:57:26 +01:00
Cornelius Riemenschneider
e8c1e50276 JS: Use resources/tools from external repo, not internal.
This was missing in https://github.com/github/codeql/pull/16656, so we couldn't actually
delete the resources in the internal repo.
2024-06-04 13:54:41 +02:00
Cornelius Riemenschneider
c8202341bb Merge pull request #16666 from tamasvajk/buildless/fix/quote-nuget-path
C#: Quote `nuget.exe` path
2024-06-04 13:29:05 +02:00
Tom Hvitved
ad99158838 Ruby: Fix/accept extraction errors 2024-06-04 12:55:44 +02:00
Tom Hvitved
858c7cead2 Ruby: Add consistency query for extraction errors 2024-06-04 12:55:42 +02:00
Tamas Vajk
c608675212 C#: Quote nuget.exe path 2024-06-04 12:49:32 +02:00
Owen Mansel-Chan
cbbdd01d5a Reinstate more descriptive QLDoc 2024-06-04 11:46:05 +01:00
Owen Mansel-Chan
7356e747e4 Add change note 2024-06-04 11:46:04 +01:00
Owen Mansel-Chan
6e67e724b4 Update documentation for receiver instead of -1 2024-06-04 11:46:02 +01:00
Owen Mansel-Chan
5c5949ba5e Add tests for neutral models 2024-06-04 11:46:01 +01:00
Owen Mansel-Chan
c964fc2dca Update expected results (only empty predicate names added) 2024-06-04 11:46:00 +01:00
Owen Mansel-Chan
18fa454d33 Replace Argument[-1] with Argument[receiver] 2024-06-04 11:45:59 +01:00
Owen Mansel-Chan
0870946e05 Add model validation to more tests 2024-06-04 11:45:58 +01:00
Owen Mansel-Chan
a8112ec62e Add neutralModel to empty.model.yml so it is defined somewhere 2024-06-04 11:45:57 +01:00
Owen Mansel-Chan
adfaae02e7 Cache interpretElement 2024-06-04 11:45:55 +01:00
Owen Mansel-Chan
479ea9f82c Remove unused predicate hasExternalSpecification 2024-06-04 11:45:54 +01:00
Owen Mansel-Chan
174712a472 Delete unused predicate paramsString
This is needed for other languages, but in Go you cannot have two
functions which are distinguished only by their parameter types.
2024-06-04 11:45:52 +01:00
Owen Mansel-Chan
40127583fb Make manual neutral summary models block generated summary models 2024-06-04 11:45:51 +01:00
Owen Mansel-Chan
5b04a71169 Non-trivial implementation of NeutralCallableAdapter 2024-06-04 11:45:49 +01:00
Owen Mansel-Chan
df8e04fcf9 Add predicate neutralElement matching summaryElement 2024-06-04 11:45:48 +01:00
Owen Mansel-Chan
209fe731a6 Change type of c to be more portable 2024-06-04 11:45:47 +01:00
Owen Mansel-Chan
e2008e14e2 Move summaryElement to FlowSummyImpl.qll 2024-06-04 11:45:45 +01:00
Owen Mansel-Chan
7f0f2d3438 Rename interpretSummary to summaryElement 2024-06-04 11:45:44 +01:00
Owen Mansel-Chan
961b09d63c Use methods of AccessPathToken more 2024-06-04 11:45:42 +01:00
Owen Mansel-Chan
9f7c47509a Expect "receiver" instead of "-1" 2024-06-04 11:45:41 +01:00
Owen Mansel-Chan
557adaf6f2 Update invalid model predicates 2024-06-04 11:45:40 +01:00
Owen Mansel-Chan
8e2e32742c Use neutralModel in various places 2024-06-04 11:45:38 +01:00
Owen Mansel-Chan
83672f545f Add neutralModel extensible predicate 2024-06-04 11:45:36 +01:00
Owen Mansel-Chan
a71e678bb9 Change imports 2024-06-04 11:45:33 +01:00
Owen Mansel-Chan
c3e1592815 Use AccessPath and AccessPathToken more 2024-06-04 11:45:27 +01:00
Owen Mansel-Chan
54a0c03e5d Rename canonicalPackageHasASubpackage to canonicalPkgLink 2024-06-04 11:45:25 +01:00
Owen Mansel-Chan
e81a98925a Remove QLDoc 2024-06-04 11:45:20 +01:00
Owen Mansel-Chan
797e5d0c8a Rename packageHasASubpackage to packageLink 2024-06-04 11:45:17 +01:00
Owen Mansel-Chan
7c94120eb7 Rename packageHasMaDCoverage to relevantPackage 2024-06-04 11:45:13 +01:00
Owen Mansel-Chan
89e7bab0b3 QLDoc 2024-06-04 11:45:06 +01:00
Tony Torralba
78552b8bca Merge pull request #16600 from atorralba/atorralba/java/more-file-sinks
Java: Add more File-related sinks to the path-injection query
2024-06-04 11:59:05 +02:00
Cornelius Riemenschneider
63116d2779 Merge pull request #16656 from github/criemen/pkg-javascript
Javascript: use `codeql_pack` for javascript extractor
2024-06-04 11:58:45 +02:00
Tamás Vajk
a1415e2b6d Merge pull request #16661 from tamasvajk/buildless/nuget-path-space
C#: Quote packages.config paths
2024-06-04 11:53:55 +02:00
Geoffrey White
38c47a4b11 C++: Add change notes. 2024-06-04 10:47:25 +01:00
Tamás Vajk
c06df5552b Merge pull request #16660 from tamasvajk/buildless/nuget-exe
C#: Prefer downloading nuget.exe over local instances
2024-06-04 11:25:03 +02:00
Geoffrey White
9c2b4c9446 C++: Update the doc examples for C/C++. 2024-06-04 10:21:06 +01:00
Geoffrey White
79e9198b20 C++: An empty models-as-data namespace / type is not 'dubious' in CPP. 2024-06-04 10:21:06 +01:00
Geoffrey White
f479649727 C++: Add Boost::Asio models. 2024-06-04 10:21:05 +01:00
Geoffrey White
7e5b7346c0 C++: Add flow test cases for Boost::Asio. 2024-06-04 10:21:05 +01:00
Geoffrey White
8a5b5d220a C++: Add source/sink test cases for Boost::Asio. 2024-06-04 10:21:05 +01:00
Geoffrey White
af6a08893a C++: Update the doc text for C/C++. 2024-06-04 10:20:59 +01:00
Jeroen Ketema
66077dc38d C++: Ignore gets'es with incorrect parameter counts 2024-06-04 11:15:07 +02:00
Joe Farebrother
6ff7fb2a70 Add change note 2024-06-04 09:52:57 +01:00
Michael Nebel
a83d50062e Merge pull request #16658 from github/workflow/coverage/update
Update CSV framework coverage reports
2024-06-04 10:52:03 +02:00
Tamas Vajk
9af6cb8e4b Quote packages.config paths 2024-06-04 10:47:00 +02:00
Joe Farebrother
9331c2c33a Add tests 2024-06-04 09:39:37 +01:00
Tony Torralba
292395b80e Update test expectations 2024-06-04 10:35:16 +02:00
Tony Torralba
f16dd8c010 Apply code review suggestions. 2024-06-04 10:35:11 +02:00
Tony Torralba
f84c2a842d Java: Add more File-related sinks for path-injection 2024-06-04 10:35:07 +02:00
Tamas Vajk
2a62bfd0c2 C#: Add integration test with space in packages.config path 2024-06-04 10:33:03 +02:00
Rasmus Wriedt Larsen
839171e557 Merge pull request #16646 from RasmusWL/url-redirect-qhelp
Python: Update url-redirect qhelp with `https:/example.com` handling
2024-06-04 10:17:37 +02:00
Rasmus Wriedt Larsen
dd8b65130e Merge pull request #16598 from jorgectf/jorgectf/opml-models
Python: Add models for `opml`
2024-06-04 10:16:26 +02:00
Tamas Vajk
f4d3756894 C#: Prefer downloading nuget.exe over local instances 2024-06-04 09:58:04 +02:00
Tom Hvitved
16e9cede3c Merge pull request #16637 from hvitved/csharp/xml-validation-perf
C#: Improve performance of `MissingXMLValidation` query
2024-06-04 09:28:37 +02:00
Paolo Tranquilli
99f70a64e9 Kotlin: address review comments 2024-06-04 09:00:35 +02:00
Paolo Tranquilli
d1a2c0fbe4 Merge branch 'main' into redsun82/kotlin 2024-06-04 08:48:52 +02:00
Tom Hvitved
48455ec3c9 C#: Improve performance of MissingXMLValidation query 2024-06-04 08:35:53 +02:00
Tom Hvitved
e6dc36b2c4 Merge pull request #16636 from hvitved/tree-sitter/verbosity-fix
Tree-sitter: Verbosity fixes
2024-06-04 08:33:28 +02:00
Owen Mansel-Chan
133983678c Merge pull request #16619 from owen-mc/go/fix/response-writer-variadic
Go: Fix bug in ResponseWriter for variadic MaD
2024-06-04 05:36:58 +01:00
github-actions[bot]
922489c8e8 Add changed framework coverage reports 2024-06-04 00:17:08 +00:00
Joe Farebrother
6ac46b8436 Add additional sanitizers to SSRF for methods that restrict the contents of a string. 2024-06-03 23:23:25 +01:00
Paolo Tranquilli
7b8c11379d Javascript: use codeql_pack for javascript extractor 2024-06-03 23:14:44 +02:00
yoff
fe8f13e8dd Merge pull request #16654 from sidshank/sidshank/fix-incorrect-deprecation-comment
Python: Fixes an error in the deprecation notice for a taint tracking configuration
2024-06-03 21:46:35 +02:00
Cornelius Riemenschneider
5b6f38f821 Merge pull request #16623 from github/criemen/new-pkg
Bazel: Use new packaging rules
2024-06-03 20:15:56 +02:00
Sid Shankar
859e8db5f2 Fixes typo in deprecation notice 2024-06-03 16:31:29 +00:00
Cornelius Riemenschneider
8783dfbaac Merge branch 'main' into criemen/new-pkg 2024-06-03 18:15:45 +02:00
Ian Lynagh
b0865c2218 Merge pull request #16554 from igfoo/igfoo/k2rel
Kotlin: Accept Kotlin 2 test output, and use 2.0.0 on CI
2024-06-03 17:14:21 +01:00
Cornelius Riemenschneider
1bd7aef1b2 Fix search paths.
It turns out we still need to supply this option, so `codeql` goes looking
for the extractor paths specified in the `codeql-workspace.yml` file.
2024-06-03 16:33:17 +02:00
Ian Lynagh
986babb912 Kotlin: Accept 2.0 output for integration tests, and run some in 1.9 mode 2024-06-03 15:26:53 +01:00
Ian Lynagh
2bcf292dd6 Kotlin: Fix custom_plugin test with Kotlin 2.0.0 2024-06-03 15:26:53 +01:00
Ian Lynagh
acdf7df6a4 Kotlin: Fix typo 2024-06-03 15:26:53 +01:00
Ian Lynagh
839258897a Kotlin: Add test for generated throw statements 2024-06-03 15:26:52 +01:00
Ian Lynagh
f458ca9568 Kotlin: Bump supported version limit to 2.0.0x 2024-06-03 15:26:52 +01:00
Ian Lynagh
2d760c7cc7 Kotlin: Tweak comments test
The top comment now gets owned by the Compilation Unit. We could
explicitly stop this from happening instead, but I think it's
reasonable.
2024-06-03 15:26:52 +01:00
Ian Lynagh
6224670884 Kotlin: Accept 2.0.0's Kotlin 2 test output 2024-06-03 15:26:51 +01:00
Ian Lynagh
918bee07dd Kotlin: Accept Kotlin 1 test changes 1.9.0 -> 2.0.0 2024-06-03 15:26:51 +01:00
Ian Lynagh
2550e113a0 Kotlin: Set CI to use 2.0.0 release 2024-06-03 15:26:51 +01:00
Cornelius Riemenschneider
c30cc0f665 Fix formatting. 2024-06-03 16:10:41 +02:00
Cornelius Riemenschneider
b67309299f C#: Unified handling of in-tree extractor packs. 2024-06-03 16:07:13 +02:00
Cornelius Riemenschneider
dd267e126c Ql-for-ql: Unified handling of in-tree extractor packs. 2024-06-03 16:06:58 +02:00
Cornelius Riemenschneider
57f7602126 Go: Unified handling of in-tree extractor packs. 2024-06-03 16:06:44 +02:00
Cornelius Riemenschneider
5c77b8708c Ruby: Unified handling of in-tree extractor packs. 2024-06-03 16:06:24 +02:00
Cornelius Riemenschneider
7b72018e56 Swift: Unified handling of in-tree extractor packs. 2024-06-03 16:06:08 +02:00
Cornelius Riemenschneider
04f5f30489 Unified handling of in-tree extractor packs. 2024-06-03 16:05:46 +02:00
Cornelius Riemenschneider
b9da01a384 Merge remote-tracking branch 'origin/main' into criemen/new-pkg 2024-06-03 15:47:15 +02:00
Cornelius Riemenschneider
5875ec272d Merge pull request #16627 from github/criemen/pkg-fix-install
`pkg.bzl`: Fix install targets.
2024-06-03 15:31:43 +02:00
Geoffrey White
e87593af75 C++: Add the doc (copy from csharp). 2024-06-03 13:49:38 +01:00
Geoffrey White
94413c8c2e C++: Implement YML extension models. 2024-06-03 13:49:38 +01:00
Geoffrey White
34130d50d3 C++: Add library tests for YML extension models. 2024-06-03 13:49:26 +01:00
Paolo Tranquilli
51b000a424 Merge pull request #16649 from github/redsun82/bazel-lfs
Bazel: ignore non-default SSH endpoints in `git_lfs_probe.py`
2024-06-03 13:31:43 +02:00
Paolo Tranquilli
8479673419 Bazel: ignore non-default SSH endpoints in git_lfs_probe.py 2024-06-03 12:26:37 +02:00
Cornelius Riemenschneider
a42bdd9bb0 Update misc/bazel/pkg.bzl
Co-authored-by: Paolo Tranquilli <redsun82@github.com>
2024-06-03 10:53:08 +02:00
Cornelius Riemenschneider
0173cf56f5 Merge pull request #16645 from github/criemen/cmake
Cmake generator: Remove space in argument.
2024-06-03 10:46:42 +02:00
Michael Nebel
546b260330 C#: Update expected test output and remove spurious result. 2024-06-03 10:40:13 +02:00
Michael Nebel
46f5b13854 C#: Only dispatch to summarized callables with generated summaries in case there are no source dispatch possibilities. 2024-06-03 10:40:10 +02:00
Michael Nebel
eb0925be60 C#: There should at least be one manual summary for a non-source summarized callable. 2024-06-03 10:40:06 +02:00
Michael Nebel
213e3918df C#: Add some more external flow testcases (one with a spurious result). 2024-06-03 10:40:02 +02:00
Michael Nebel
b08a0a303f C#: Re-factor external models tests to use compiled code instead of emulating it. 2024-06-03 10:39:59 +02:00
Michael Nebel
88b978f0ec Merge pull request #16574 from michaelnebel/csharp/updatenetruntimemodels
C#: Re-generate .NET 8 Runtime models.
2024-06-03 10:33:10 +02:00
Rasmus Wriedt Larsen
121ca129bc Update qhelp with https:/example.com handling 2024-06-03 10:17:10 +02:00
Cornelius Riemenschneider
cff78cca5e Cmake generator: Remove space in argument.
This space breaks when upgrading bazelisk on Windows.
Somehow, a space inside the argument messes up some argument-parsin
somewhere. Porbably due to Windows argument parsing
being not well-defined in how it splits a string into argv.
Removing the space works around the problem.

If the space is included, cmake suddenly can't find the bazelisk
binary anymore, despite happily executing `info output_base` earlier.
2024-06-02 23:56:31 +02:00
Tom Hvitved
58ce3e805e Merge pull request #16633 from hvitved/dataflow/inline-pred
Data flow: Inline `isUnreachableInCall1`
2024-05-31 20:12:14 +02:00
Tom Hvitved
beeae69845 Tree-sitter: Verbosity fixes 2024-05-31 20:10:19 +02:00
Chuan-kai Lin
8d5bb21643 Merge pull request #16642 from github/post-release-prep/codeql-cli-2.17.4
Post-release preparation for codeql-cli-2.17.4
2024-05-31 09:08:03 -07:00
Alex Ford
1100b75a3c Ruby: handle routes with path/action pairs 2024-05-31 15:54:57 +01:00
github-actions[bot]
a19149032f Post-release preparation for codeql-cli-2.17.4 2024-05-31 14:49:11 +00:00
Paolo Tranquilli
58fb0270fb Merge pull request #16641 from github/redsun82/legacy-integration-test-marker
Mark all integration tests as legacy
2024-05-31 16:18:00 +02:00
Alex Ford
0473655752 Ruby: actiondispatch add hash arg testcase 2024-05-31 15:08:35 +01:00
Alex Ford
22858249f9 Ruby: actiondispatch test whitespace changes 2024-05-31 15:07:39 +01:00
Paolo Tranquilli
096a31dbef Mark all integration tests as legacy
This is in preparation for the new integration test framework. Tests
marked thus will be run by the current framework and ignored by the new
one.
2024-05-31 16:04:50 +02:00
Alex Ford
4644f08195 Ruby: Routing.qll - rename call as methodCall 2024-05-31 14:45:32 +01:00
Alex Ford
25f9449f53 Ruby: Routing.qll - rename method as httpMethod 2024-05-31 14:45:26 +01:00
Alex Ford
af9ed21c36 Ruby: Routing.qll - rename method as methodCall 2024-05-31 14:45:20 +01:00
Chuan-kai Lin
a7bbcf3eb8 Merge pull request #16640 from github/release-prep/2.17.4
Release preparation for version 2.17.4
2024-05-31 06:43:37 -07:00
github-actions[bot]
a22e70373a Release preparation for version 2.17.4 2024-05-31 13:40:51 +00:00
Anders Schack-Mulligen
06ce40c687 Merge pull request #16561 from aschackmull/java/typeflow-effectively-private
Java: Improve dispatch through TypeFlow of effectively private calls.
2024-05-31 15:11:18 +02:00
Michael Nebel
e2758f2abb C#: Update expected test output. 2024-05-31 15:06:16 +02:00
Owen Mansel-Chan
ca2faa7ef0 Merge pull request #16624 from owen-mc/go/append-taint-models
Go: Add back taint models for `append` and `copy`
2024-05-31 13:35:14 +01:00
Paolo Tranquilli
01c1acd43f Merge pull request #16632 from github/redsun82/bazel-fix
Bazel: fix non-swift macOS builds
2024-05-31 14:33:55 +02:00
Michael Nebel
d38894a5e5 C#: Update .NET 8 runtime models. 2024-05-31 14:19:48 +02:00
Paolo Tranquilli
25ab1a934d Merge branch 'main' into redsun82/bazel-fix 2024-05-31 14:03:20 +02:00
Paolo Tranquilli
67e2ea195f Merge pull request #16634 from github/redsun82/swift-integration-tests
Swift: remove integration test running in CI
2024-05-31 13:55:14 +02:00
Cornelius Riemenschneider
f27d48d03d Merge pull request #16622 from github/criemen/pkg-lib-nolang
`pkg.bzl`: Add features to support the nolang dist.
2024-05-31 13:15:23 +02:00
Paolo Tranquilli
959aa3515c Swift: remove integration test running in CI
They are being triggered by QLucie now, so there's no need to also
trigger them in the `codeql` specific CI.
2024-05-31 12:59:38 +02:00
Michael Nebel
8b75bb2ba9 C#: The model generator should consider System.Type and System.DateTime as sanitizers. 2024-05-31 12:50:18 +02:00
Michael Nebel
02f9aec517 C#: Add some spurious summary generation examples. 2024-05-31 12:50:14 +02:00
Michael Nebel
b628c2e121 C#: Update flow summaries expected output. 2024-05-31 12:50:10 +02:00
Michael Nebel
5e1801f7be C#: Update models based on review comments. 2024-05-31 12:50:06 +02:00
Michael Nebel
121378a262 C#: Add change-note. 2024-05-31 12:50:02 +02:00
Michael Nebel
0985a3a5f6 C#: Update expected test output. 2024-05-31 12:49:58 +02:00
Michael Nebel
9bb7575018 C#: Promote IDataRecord and IDbCommand to manual summaries such that they are used in conjunction with source code. 2024-05-31 12:49:53 +02:00
Michael Nebel
90538d4b4c C#: Update expected test output. 2024-05-31 12:49:48 +02:00
Michael Nebel
cd5168b570 C#: Limit the defintion of database flow source and use summaries for better paths and reduced result multiplicity. 2024-05-31 12:49:44 +02:00
Michael Nebel
38d246a3bd C#: Update flowsummaries expected output. 2024-05-31 12:49:40 +02:00
Michael Nebel
db0131d931 C#: Update .NET8 models. 2024-05-31 12:49:35 +02:00
Tom Hvitved
be4fce26c0 Merge pull request #16631 from hvitved/tree-sitter/multi-file-lists
Tree-sitter: Allow for multiple file lists in simple extractor
2024-05-31 12:47:11 +02:00
Paolo Tranquilli
bfc37fddff Bazel: move --build_tests_only from swift action to .bazelrc 2024-05-31 12:35:52 +02:00
Cornelius Riemenschneider
14988002fa Address review. 2024-05-31 12:35:03 +02:00
Tom Hvitved
42d87f6d19 Data flow: Inline isUnreachableInCall1 2024-05-31 12:25:11 +02:00
Paolo Tranquilli
3f19974bb6 Bazel: fix transition on non-macOS 2024-05-31 12:14:13 +02:00
Paolo Tranquilli
b3e29bd8b5 Bazel: add --build_tests_only in swift CI 2024-05-31 12:13:26 +02:00
Paolo Tranquilli
07f4288e1f Fix zipmerge build and test 2024-05-31 12:12:58 +02:00
Paolo Tranquilli
8e26f64f89 Bazel: fix non-swift macOS builds
This is meant to be cleaned up in a later PR with respect to the TODOs.
2024-05-31 11:49:36 +02:00
Tom Hvitved
d6a3765597 Tree-sitter: Allow for multiple file lists in simple extractor 2024-05-31 11:15:21 +02:00
Tony Torralba
2d3d49f957 Merge pull request #16628 from mbaluda/main
Disable csrf for ServerHttpSecurity
2024-05-31 10:31:28 +02:00
Mauro Baluda
48fc44baff Add release notes 2024-05-30 23:21:12 +02:00
Mauro Baluda
bbe888c2b3 Update SpringCsrfProtection.qll 2024-05-30 23:13:08 +02:00
Mauro Baluda
e2479a7ce2 Disable csrf for ServerHttpSecurity 2024-05-30 23:08:57 +02:00
Owen Mansel-Chan
d112073a13 Edit change note 2024-05-30 21:04:05 +01:00
Owen Mansel-Chan
ffc25add70 Accept test changes 2024-05-30 21:01:06 +01:00
Owen Mansel-Chan
a5c392ed4b Add back taint models for append and copy
This is needed when they are used with string arguments.
2024-05-30 21:01:03 +01:00
Cornelius Riemenschneider
e2cb5631d9 pkg.bzl: Fix install targets.
First, the labels used in this file need to be wrapped in `Label`,
so that we can use the installer target from the internal repo.
Second, when unpacking zips, the path passed to `ripunzip` included a trailing
`\n`, which caused `ripunzip` to fail.
2024-05-30 21:06:46 +02:00
Chuan-kai Lin
0369f8f5df Merge pull request #16625 from github/revert-16605-release-prep/2.17.4
Revert "Release preparation for version 2.17.4"
2024-05-30 10:08:31 -07:00
Chuan-kai Lin
b41835a7d9 Revert "Release preparation for version 2.17.4" 2024-05-30 09:25:15 -07:00
Cornelius Riemenschneider
e43b773d7c Fix comment to indicate the correct order in the zip dict. 2024-05-30 17:58:22 +02:00
Cornelius Riemenschneider
60cb8e7e8e Ruby: Move to new packaging rules. 2024-05-30 14:25:20 +02:00
Cornelius Riemenschneider
1158e92f12 Python: Move to the new packaging rules. 2024-05-30 14:25:18 +02:00
Cornelius Riemenschneider
dcd44859f5 Go: Move to new packaging rules. 2024-05-30 14:25:17 +02:00
Cornelius Riemenschneider
d66d7d8a3a C#: Move to new packaging rules. 2024-05-30 14:25:16 +02:00
Cornelius Riemenschneider
60b5317c5f C++: Move to new packaging rules. 2024-05-30 14:25:15 +02:00
Cornelius Riemenschneider
9f3310d3d2 pkg.bzl: Add features to support the nolang dist.
In order to build the language-independent parts of our dist with `pkg.bzl`,
we need two override features:
* A way to set the prefix in the zip files to the empty string, so that our top-level files
  stay top-level.
* A way to put `codeql.exe` into the arch-specific zip, despite it not being under `CODEQL_PLATFORM`.
This PR implements both.
2024-05-30 13:03:57 +02:00
Owen Mansel-Chan
61593aed7d Merge pull request #16617 from owen-mc/go/side-effects-on-global-variables
Go: Add tests (mostly failing) for writes to global variables
2024-05-30 08:02:45 +01:00
Cornelius Riemenschneider
2c4a216dd9 Merge pull request #16616 from github/redsun82/fix-pkg
Reinstate bazel packaging library with a backward compatibility fix
2024-05-29 23:02:30 +02:00
Owen Mansel-Chan
1d9a98614a Fix bug in ResponseWriter for variadic MaD
`getSummaryInputOrOutputNode` was giving the summary component stack for
arguments corresponding to variadic parameters. This will be a problem
when the models for variadic functions are converted to models-as-data.
2024-05-29 21:15:49 +01:00
Owen Mansel-Chan
7ff1eabfc3 Add tests (mostly failing) for writes to global variables
This was based on the equivalent for java:
https://github.com/github/codeql/pull/16500
2024-05-29 16:07:16 +01:00
am0o0
1f112467ce update id of the query file 2024-05-29 16:48:35 +02:00
am0o0
b9edcb7943 rename secondary to remote :), complete the previous commit changes 2024-05-29 16:47:37 +02:00
am0o0
52a809145e SecondaryCommandInjection to RemoteCommandExecution, change RemoteCommandExecution to module like SystemCommandExecution module 2024-05-29 16:18:55 +02:00
Paolo Tranquilli
655f079329 Swift: fix legacy extractor-pack-arch target 2024-05-29 16:17:59 +02:00
am0o0
fd9e6f48d7 fix the docs of secondary server cmd injection 2024-05-29 16:01:43 +02:00
am0o0
171486641e Ssh2.qll: fix a typo 2024-05-29 16:00:52 +02:00
am0o0
5299c4a845 fix the qhelp of secondary server cmd injectino 2024-05-29 16:00:06 +02:00
Paolo Tranquilli
2606d3f6d1 Reapply "Bazel: add codeql specific packaging library"
This reverts commit 31d6b9be4d.
2024-05-29 15:46:29 +02:00
am0o0
66cba89fdb Torch.qll: use better alternative instead of exists 2024-05-29 15:43:41 +02:00
am0o0
8c3994bc9c Paramiko.qll: improve docs 2024-05-29 15:42:29 +02:00
am0o0
b1242e464e Pandas.qll: remove unnecessary exists, fix class naming 2024-05-29 15:41:45 +02:00
Paolo Tranquilli
8509bcae58 Merge pull request #16615 from github/revert-16432-redsun82/pkg
Revert "Bazel: add codeql specific packaging library"
2024-05-29 15:39:23 +02:00
am0o0
fcd2bd6776 fabic.qll: remove test predicate and apply review changes 2024-05-29 15:37:11 +02:00
Paolo Tranquilli
31d6b9be4d Revert "Bazel: add codeql specific packaging library" 2024-05-29 15:27:10 +02:00
Paolo Tranquilli
3b246b2422 Merge pull request #16432 from github/redsun82/pkg
Bazel: add codeql specific packaging library
2024-05-29 12:58:47 +02:00
Paolo Tranquilli
1e6820b6ed Merge branch 'main' into redsun82/pkg 2024-05-29 12:02:31 +02:00
Paolo Tranquilli
336ec089cc Bazel: use extend(...) instead of += list(...) 2024-05-29 12:02:02 +02:00
Paolo Tranquilli
e8061ecd38 Bazel: fix _zipmerge rule 2024-05-29 11:59:18 +02:00
Tom Hvitved
775625968a Merge pull request #16602 from hvitved/dataflow/fix-bad-join
Data flow: Fix bad join
2024-05-29 09:53:56 +02:00
Paolo Tranquilli
5672ddf8f3 Fix bazel formatting 2024-05-29 09:53:31 +02:00
Anders Schack-Mulligen
2f95851537 Merge pull request #16603 from aschackmull/dataflow/location
Dataflow/Go: Add getLocation to DataFlowCall and DataFlowCallable for easier debugging.
2024-05-29 08:58:22 +02:00
Paolo Tranquilli
491e3a44be Merge branch 'main' into redsun82/pkg 2024-05-29 08:55:48 +02:00
Paolo Tranquilli
fbe1b56f2d Zipmerge: link test statically 2024-05-29 08:55:06 +02:00
Chuan-kai Lin
06fd16bbf5 Merge pull request #16607 from github/post-release-prep/codeql-cli-2.17.4
Post-release preparation for codeql-cli-2.17.4
2024-05-28 14:56:43 -07:00
github-actions[bot]
906b65d09c Post-release preparation for codeql-cli-2.17.4 2024-05-28 18:02:25 +00:00
Tom Hvitved
059ce1ba15 Data flow: Fix bad join
Before
```
Evaluated relational algebra for predicate _DataFlowImpl::Impl<ExceptionInformationExposure::ExceptionInformationExposure::C>::AccessPathApprox__#count_range@9acc2d7t with tuple counts:
              875   ~0%    {3} r1 = SCAN `num#DataFlowImpl::Impl<ExceptionInformationExposure::ExceptionInformationExposure::C>::TCons1#055add5f` OUTPUT _, In.0, In.1
              875   ~0%    {3}    | REWRITE WITH Tmp.0 := 1, Out.0 := (InOut.2 - Tmp.0)
        113896125   ~1%    {3}    | JOIN WITH `DataFlowImpl::Impl<ExceptionInformationExposure::ExceptionInformationExposure::C>::AccessPathApprox.len/0#dispred#e932df4d_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2
        113896125   ~7%    {4}    | JOIN WITH `DataFlowImpl::Impl<ExceptionInformationExposure::ExceptionInformationExposure::C>::AccessPathApprox.getFront/0#dispred#5d402e21` ON FIRST 1 OUTPUT Lhs.1, Lhs.0, Lhs.2, Rhs.1
             2404   ~9%    {5}    | JOIN WITH `DataFlowImpl::Impl<ExceptionInformationExposure::ExceptionInformationExposure::C>::Stage5::consCand/3#cd06ec82_021#join_rhs` ON FIRST 2 OUTPUT Lhs.2, Lhs.0, Rhs.2, Lhs.3, _
             2404  ~14%    {5}    | REWRITE WITH Out.4 := 1
                           return r1

Evaluated relational algebra for predicate DataFlowImpl::Impl<ExceptionInformationExposure::ExceptionInformationExposure::C>::count1to2unfold/1#9ad56f09@c47f87cq with tuple counts:
        365  ~0%    {2} r1 = JOIN `num#DataFlowImpl::Impl<ExceptionInformationExposure::ExceptionInformationExposure::C>::TCons1#055add5f_102#join_rhs` WITH `__DataFlowImpl::Impl<ExceptionInformationExposure::ExceptionInformationExposure::C>::AccessPathAppro__#join_rhs` ON FIRST 2 OUTPUT Lhs.2, Rhs.2
                    return r1
```

After
```
Evaluated relational algebra for predicate DataFlowImpl::Impl<ExceptionInformationExposure::ExceptionInformationExposure::C>::stage5ConsCand/4#ce755854@46e7620j with tuple counts:
        848899   ~5%    {3} r1 = SCAN `DataFlowImpl::Impl<ExceptionInformationExposure::ExceptionInformationExposure::C>::AccessPathApprox.len/0#dispred#e932df4d` OUTPUT In.0, _, In.1
        848899   ~0%    {2}    | REWRITE WITH Tmp.1 := 1, Out.1 := (Tmp.1 + In.2) KEEPING 2
        848899   ~0%    {3}    | JOIN WITH `DataFlowImpl::Impl<ExceptionInformationExposure::ExceptionInformationExposure::C>::AccessPathApprox.getFront/0#dispred#5d402e21` ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Rhs.1
         12961  ~14%    {4}    | JOIN WITH `DataFlowImpl::Impl<ExceptionInformationExposure::ExceptionInformationExposure::C>::Stage5::consCand/3#cd06ec82_201#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Rhs.2, Lhs.2, Lhs.1
                        return r1

Evaluated relational algebra for predicate DataFlowImpl::Impl<ExceptionInformationExposure::ExceptionInformationExposure::C>::stage5ConsCand/4#ce755854_0312_1#count_range@a0e570ci with tuple counts:
        11548  ~1%    {5} r1 = SCAN `DataFlowImpl::Impl<ExceptionInformationExposure::ExceptionInformationExposure::C>::stage5ConsCand/4#ce755854` OUTPUT In.0, In.3, In.1, In.2, _
        11548  ~3%    {5}    | REWRITE WITH Out.4 := 1
                      return r1

Evaluated relational algebra for predicate DataFlowImpl::Impl<ExceptionInformationExposure::ExceptionInformationExposure::C>::count1to2unfold/1#9ad56f09@e0e6143p with tuple counts:
        3981  ~0%    {3} r1 = AGGREGATE `DataFlowImpl::Impl<ExceptionInformationExposure::ExceptionInformationExposure::C>::stage5ConsCand/4#ce755854_0312_1#count_range`, `DataFlowImpl::Impl<ExceptionInformationExposure::ExceptionInformationExposure::C>::stage5ConsCand/4#ce755854_0312_1#count_range` ON  WITH COUNT OUTPUT In.0, In.1, Agg.0
         365  ~0%    {2}    | JOIN WITH `num#DataFlowImpl::Impl<ExceptionInformationExposure::ExceptionInformationExposure::C>::TCons1#055add5f` ON FIRST 2 OUTPUT Rhs.2, Lhs.2
                     return r1
```
2024-05-28 19:59:30 +02:00
Chuan-kai Lin
dc0db9a6c6 Merge pull request #16605 from github/release-prep/2.17.4
Release preparation for version 2.17.4
2024-05-28 08:57:38 -07:00
github-actions[bot]
33b4ae8bbb Release preparation for version 2.17.4 2024-05-28 15:44:32 +00:00
Paolo Tranquilli
332d178298 Zipmerge: allow test to be run from internal repo 2024-05-28 17:37:34 +02:00
Paolo Tranquilli
4094db40b8 Merge branch 'main' into redsun82/pkg 2024-05-28 17:28:24 +02:00
Paolo Tranquilli
45f1fdfaff Bazel: extract pack filtering logic out of _zipmerge 2024-05-28 17:24:20 +02:00
Pierre
06d6671c55 Merge pull request #16569 from github/sitedocs/2.17.3
Add changelogs for 2.17.2 and 2.17.3
2024-05-28 08:15:04 -07:00
Paolo Tranquilli
de484773f0 Zipmerge: print test outputs on CI 2024-05-28 16:29:41 +02:00
Paolo Tranquilli
2a62455822 Merge branch 'main' into redsun82/pkg 2024-05-28 16:15:48 +02:00
Paolo Tranquilli
5eb12b8503 Zipmerge: substitute stripped down slf4j jars with dummy ones 2024-05-28 16:15:20 +02:00
Michael Nebel
195ccb0018 Merge pull request #16484 from michaelnebel/csharp/superimplmodelgen
C#: Lift models.
2024-05-28 15:49:35 +02:00
Paolo Tranquilli
c3ccf4d5a3 Zipmerge: substitute CPython archives with dummy ones 2024-05-28 15:47:24 +02:00
Paolo Tranquilli
67d622fa9d Bazel: actually run the zipmerge tests 2024-05-28 15:44:53 +02:00
Paolo Tranquilli
9c1efb9f0e Bazel: expose compression_level in codeql_pack 2024-05-28 15:09:15 +02:00
Paolo Tranquilli
00ed00e1e5 Bazel: avoid unneeded operations if no imported zips are present 2024-05-28 15:01:35 +02:00
Paolo Tranquilli
e2206e62d6 Bazel: restrict codeql_pack zips to .zip files 2024-05-28 14:39:20 +02:00
Paolo Tranquilli
6b971617e7 Bazel: rename _process_path to _expand_path, and make its use clearer 2024-05-28 14:17:05 +02:00
Paolo Tranquilli
76fbb522d2 Bazel: use pack name for zip file name 2024-05-28 14:10:31 +02:00
Anders Schack-Mulligen
3b12f69dd9 Dataflow/Go: Add getLocation to calls and callables for easier debugging. 2024-05-28 13:47:08 +02:00
Michael Nebel
5a25967019 C#: Address review comments. 2024-05-28 13:38:23 +02:00
Paolo Tranquilli
6d798410ce Bazel: add --no-cleanup to installer script 2024-05-28 12:51:52 +02:00
Paolo Tranquilli
a8543d4a88 Zipmerge: port tests from internal repo 2024-05-28 12:01:57 +02:00
Paolo Tranquilli
afadc1f1eb Merge branch 'main' into redsun82/pkg 2024-05-28 11:21:19 +02:00
Paolo Tranquilli
f7bfe435c8 Swift: fix windows build again 2024-05-28 11:20:32 +02:00
Joe Farebrother
4c97b0c785 Merge pull request #16529 from joefarebrother/python-flask-session-interface
Python: Model Flask SessionInterface request parameter
2024-05-28 10:03:13 +01:00
Paolo Tranquilli
fe9a153f44 Merge branch 'main' into redsun82/pkg 2024-05-28 10:07:28 +02:00
Jeroen Ketema
174f212d4e Merge pull request #16589 from rvermeulen/rvermeulen/update-nospaceforzeroterminator-qlhelp
Rewrite recommendations for the query `cpp/no-space-for-terminator`
2024-05-28 09:52:20 +02:00
Paolo Tranquilli
fbf3b9ae7a Merge branch 'main' into redsun82/pkg 2024-05-27 18:16:39 +02:00
Paolo Tranquilli
392ef09d19 Zipmerge: make lib public for internal testing 2024-05-27 17:28:33 +02:00
Paolo Tranquilli
cde71a915b Bazel: address review comments 2024-05-27 17:00:39 +02:00
Paolo Tranquilli
2f95944244 Bazel: add documentation to install.py 2024-05-27 16:58:58 +02:00
Paolo Tranquilli
2f53c0e640 Bazel: fix codeql_pack installation on Windows 2024-05-27 16:09:42 +02:00
Paolo Tranquilli
6bbad22672 Codegen: make codegen work on windows 2024-05-27 16:05:38 +02:00
Jeroen Ketema
c936f964d3 Merge pull request #16599 from jketema/padding
C++: Make the padding test independent of the `predefined_macros` file
2024-05-27 15:36:06 +02:00
Tom Hvitved
69fb2bb97c Merge pull request #16597 from hvitved/tree-sitter/empty-location
Tree-sitter: Emit `empty_location` relation to avoid scan
2024-05-27 15:19:15 +02:00
Jeroen Ketema
c57c027f70 C++: Make the padding test independent of the predefined_macros file
The padding test is the only test that currently depends on the contents
of the `predefined_macros` flile that we ship with CodeQL for use with the
CodeQL tests. Explicitly specifying `__x86_64` makes the test independent of
the contents of the file.
2024-05-27 14:21:10 +02:00
Anders Schack-Mulligen
d88c498d49 Merge pull request #16456 from aschackmull/dataflow/callcontext-grouping
Dataflow: Implement call context grouping to improve performance
2024-05-27 14:11:11 +02:00
Paolo Tranquilli
821bd1f27b Merge branch 'main' into redsun82/kotlin 2024-05-27 13:17:06 +02:00
Paolo Tranquilli
2bec696114 Merge branch 'main' into redsun82/pkg 2024-05-27 13:13:12 +02:00
Cornelius Riemenschneider
bd6e233b66 Merge pull request #16519 from github/criemen/bazel-csharp
Bazel-build for C# language pack
2024-05-27 12:08:21 +02:00
Paolo Tranquilli
1e7b3d0f6f Merge pull request #16588 from github/redsun82/ripunzip
Add ripunzip build workflow
2024-05-27 12:05:34 +02:00
Cornelius Riemenschneider
735bea624a Place the C++ autobuilder in the correct path. 2024-05-27 11:55:14 +02:00
Jorge
b786ea7e5f Add change note 2024-05-27 09:48:56 +00:00
Jorge
34230369bc Add OPML module to frameworks imports 2024-05-27 09:48:49 +00:00
Jorge
e992d86d38 Add OPML models 2024-05-27 09:48:10 +00:00
Anders Schack-Mulligen
51c48c767e Dataflow: Address review comments (take 2). 2024-05-27 11:01:52 +02:00
Anders Schack-Mulligen
4ff37cc7b6 Dataflow: Address review comments. 2024-05-27 11:01:52 +02:00
Anders Schack-Mulligen
8085460e4a C++/Shared: Fix join order issues. 2024-05-27 11:01:52 +02:00
Anders Schack-Mulligen
5c635e982e C++/C#/Java: Update expected output. 2024-05-27 11:01:52 +02:00
Anders Schack-Mulligen
1432519cc2 Dataflow: Add totalorder predicates to all languages. 2024-05-27 11:01:52 +02:00
Anders Schack-Mulligen
5a259843bb Dataflow: Switch call context to a set representation. 2024-05-27 11:01:52 +02:00
Anders Schack-Mulligen
972b81bbd1 Util: Allow best-effort total orders with a reasonable fallback. 2024-05-27 11:01:52 +02:00
Anders Schack-Mulligen
b83416f3a1 Dataflow: Make two predicates private. 2024-05-27 11:01:52 +02:00
Anders Schack-Mulligen
52a232e91c Dataflow: Make CallContext type private to DataFlowImplCommon. 2024-05-27 11:01:52 +02:00
Anders Schack-Mulligen
947c2bf722 Dataflow: Move two declarations. 2024-05-27 11:01:52 +02:00
Anders Schack-Mulligen
1dd1f12919 Dataflow: Move Level1CallContext to DataFlowImplCommon 2024-05-27 11:01:52 +02:00
Anders Schack-Mulligen
e1e6cd9b3d Dataflow: Simplify: remove Level1CallContextInput module 2024-05-27 11:01:52 +02:00
Anders Schack-Mulligen
f6eb82ee15 Dataflow: Simplify. 2024-05-27 11:01:52 +02:00
Anders Schack-Mulligen
5ac96d009a Dataflow: Move viableImplNotCallContextReducedReverse to DataFlowImplCommon::CallContextSensitivity. 2024-05-27 11:01:52 +02:00
Anders Schack-Mulligen
740bb84423 Dataflow: Rename prunedViableImplInCallContextReverse to viableImplCallContextReducedReverse. 2024-05-27 11:01:52 +02:00
Anders Schack-Mulligen
0561c65b61 Dataflow: Rename noPrunedViableImplInCallContext to viableImplNotCallContextReduced. 2024-05-27 11:01:52 +02:00
Anders Schack-Mulligen
aa87243e3a Dataflow: Rename prunedViableImplInCallContext to viableImplCallContextReduced 2024-05-27 11:01:52 +02:00
Anders Schack-Mulligen
ace369faa8 Dataflow: Share getCallContextCall in DataFlowImplCommon::CallContextSensitivity. 2024-05-27 11:01:52 +02:00
Anders Schack-Mulligen
b2e3d784f6 Dataflow: Share getCallContextReturn in DataFlowImplCommon::CallContextSensitivity. 2024-05-27 11:01:52 +02:00
Anders Schack-Mulligen
79b1cd7d3d Dataflow: Refactor getLocalCc to avoid reference to NodeEx. 2024-05-27 11:01:51 +02:00
Anders Schack-Mulligen
eb0b92350a Dataflow: Switch column order in viableImplCallContextReducedReverse. 2024-05-27 11:01:51 +02:00
Anders Schack-Mulligen
86e6d0b1e1 Dataflow: Switch local call contexts to use canonical representative. 2024-05-27 11:01:51 +02:00
Anders Schack-Mulligen
012e1b498d Dataflow: Remove duplicate definitions 2024-05-27 11:01:51 +02:00
Anders Schack-Mulligen
bc8ca1af86 Dataflow: Introduce NodeRegions for use in isUnreachableInCall. 2024-05-27 11:01:51 +02:00
Anders Schack-Mulligen
486eaad566 Shared: Add MakeSets module. 2024-05-27 11:01:51 +02:00
Paolo Tranquilli
f9674d1b3a Update .github/workflows/build-ripunzip.yml
Co-authored-by: Cornelius Riemenschneider <cornelius@github.com>
2024-05-27 11:01:05 +02:00
Paolo Tranquilli
546d644765 Swift: do not use codeql_pkg_files needlessly 2024-05-27 10:46:50 +02:00
Tom Hvitved
686879a2a3 Ruby: Add up/downgrade scripts 2024-05-27 10:39:22 +02:00
Tom Hvitved
94d2e9591d Tree-sitter: Emit empty_location relation to avoid scan 2024-05-27 10:39:21 +02:00
Cornelius Riemenschneider
44f666c90a Merge pull request #16585 from github/criemen/ruby-codeql-extractor-hack
Ruby: Change how we pull in `shared/tree-sitter-extractor` dependency
2024-05-27 10:32:16 +02:00
Paolo Tranquilli
0b7a4257d7 Bazel: use {CODEQL_PLATFORM} as discriminant between arch and generic contents 2024-05-27 10:31:19 +02:00
am0o0
2b929c4d2d remove old expected test file 2024-05-25 20:45:34 +02:00
am0o0
1fc481ce81 v2: it is basically the first stable version :)) 2024-05-25 20:43:36 +02:00
am0o0
ea05b297a3 update expected test files 2024-05-25 19:40:37 +02:00
am0o0
14daf58767 update tests, add test cases for query with local sources 2024-05-25 18:17:56 +02:00
am0o0
8fde8c2db4 change test dir name 2024-05-25 13:54:31 +02:00
am0o0
b397f57357 change queries id according to new naming 2024-05-25 13:53:33 +02:00
am0o0
300c82a8ff use Verification instead of validation in files name 2024-05-25 13:52:32 +02:00
am0o0
76beffb04a change dir name 2024-05-25 13:49:34 +02:00
am0o0
f1533f40b6 change query files name 2024-05-25 13:49:01 +02:00
am0o0
d2d945c66d merge all JWT pkgs into one 2024-05-25 13:47:43 +02:00
am0o0
4af4040bd6 change duplicate query IDs 2024-05-25 13:29:16 +02:00
am0o0
f905ac10c4 add jsonWebToken library file to remove duplicate predicate declrations 2024-05-25 13:28:13 +02:00
Remco Vermeulen
6df4c8964b Rewrite recommendations
- Replace segmentation fault with crash that is platform agnostic (I think segmentation fault is not really a thing on Windows).
- Replace security vulnerability with malicious code execution. This provides a range of issues, because a crash (previously segmentation fault) could also be considered a security vulnerability. Namely a DOS.
- Removed the additional note on stack allocated arrays which seem confusing because we are always talking about buffers allocated on the heap.
2024-05-24 16:10:42 -07:00
Cornelius Riemenschneider
d30ed54bfd Merge branch 'main' into criemen/bazel-csharp 2024-05-24 18:02:20 +02:00
Paolo Tranquilli
5d4b61c365 Bazel: replace prebuilt ripunzip from workflow 2024-05-24 17:44:39 +02:00
Paolo Tranquilli
8d5fa9583e Add ripunzip build workflow 2024-05-24 17:37:59 +02:00
Cornelius Riemenschneider
b09f3c1c0d Don't build with cross any longer.
We've removed cross from the internal build when converting to bazel,
mirror that here.
2024-05-24 16:17:37 +02:00
Paolo Tranquilli
b9064c5446 Bazel: fail install on ripunzip failing 2024-05-24 15:50:16 +02:00
Cornelius Riemenschneider
8c46b61e85 Ruby: Change how we pull in shared/tree-sitter-extractor dependency
Previously, we pulled in the shared tree-sitter extractor via a `git`
dependency in `Cargo.toml` to address a `rules_rust` limitation (no `path`
dependencies outside of the cargo workspace)). This was a problem,
as that means we're cloning `github/codeql` _again_ for the build, which is
quite slow.

I found another way that is faster, and still produces correct builds
for both `cargo`` and `rules_rust`:
* Cargo depends on a fake crate that has the same dependencies as the real crate (thanks to `sync-files.py`). Therefore, cargo pulls in the right dependencies into the lockfile, which bazel targets
* For local builds, we override the path to that dependency in a cargo config, so we're pulling in the correct code
* rules_rust only uses `path` dependencies for collecting transitive dependencies, it never pulls in the code from there. So far that, we manually provide a `BUILD.bazel` file for the shared extractor, and depend on that.
2024-05-24 15:37:35 +02:00
Cornelius Riemenschneider
5fa1b57aaa Merge pull request #16586 from hvitved/rust-bump
Python: Use Rust 1.74
2024-05-24 15:30:15 +02:00
Paolo Tranquilli
f35f077c76 Swift: cleanup tools scripts in pack 2024-05-24 15:24:15 +02:00
Paolo Tranquilli
e990d75a8f Bazel: use codeql platform as arch zip filename 2024-05-24 15:23:51 +02:00
Paolo Tranquilli
ea01ae6534 Swift: fix integration test log upload 2024-05-24 14:29:22 +02:00
Paolo Tranquilli
fa2c626e49 Bazel: add fat macOS ripunzip binary 2024-05-24 14:29:02 +02:00
Paolo Tranquilli
dcbf42d29c Bazel: reorganize LFS files and add licensing information 2024-05-24 14:26:22 +02:00
Tom Hvitved
386bc1eb03 Bazel: repin 2024-05-24 13:53:55 +02:00
Tom Hvitved
7490472772 Update Python to use Rust 1.74 2024-05-24 13:05:39 +02:00
Michael Nebel
c59c7cf02a C#: Use manual sink callables as exclusion for extrapolated sinks. 2024-05-24 12:50:48 +02:00
Michael Nebel
d272d6a9ca C#: Assume that models should apply when a method is overridable except for the implicit methods on Object and ValueType. 2024-05-24 12:50:48 +02:00
Michael Nebel
ad55744877 C#: Add model generator test case for property. 2024-05-24 12:50:48 +02:00
Michael Nebel
057a420833 C#: Update expected test output. 2024-05-24 12:50:48 +02:00
Michael Nebel
a8feda2e2b C#: Introduce lifting of callables in the model generator. 2024-05-24 12:50:48 +02:00
Michael Nebel
0d397cea9f C#: Add some model generator tests related to lifting. 2024-05-24 12:50:48 +02:00
Michael Nebel
3ad29d843d C#: Re-factor model generator specific to align with Java. 2024-05-24 12:50:48 +02:00
Michael Nebel
95473c06fc Merge pull request #16520 from michaelnebel/csharp/fixsummarizedcallabledataflow
C#: Make the flow summary filtering in the adapter.
2024-05-24 12:48:03 +02:00
Paolo Tranquilli
e694968012 Fix change to .gitattributes done by mistake 2024-05-24 12:41:32 +02:00
Paolo Tranquilli
175f0dbb00 Swift: remove broken obsolete alias 2024-05-24 12:40:29 +02:00
Paolo Tranquilli
94d6feffed Swift: fix module 2024-05-24 12:35:41 +02:00
Paolo Tranquilli
8e132e90cc Bazel: add executable attribute to lfs_files 2024-05-24 12:35:17 +02:00
Paolo Tranquilli
1529b58089 Swift: add resource dir updater 2024-05-24 12:19:06 +02:00
Paolo Tranquilli
e8b857b79e Bazel/Swift: add zip imports to packs 2024-05-24 12:18:42 +02:00
Tom Hvitved
0dbce3d077 Merge pull request #16451 from hvitved/treesitter/codeql-verbosity
Tree-sitter: Respect verbosity defined in `CODEQL_VERBOSITY`
2024-05-24 11:24:01 +02:00
Paolo Tranquilli
4d93e8a732 Bazel: move codeql packaging rules away from some macros 2024-05-24 10:27:45 +02:00
Paolo Tranquilli
60cf77be7e Bazel: add codeql specific packaging library
This encapsulate arch specific logic, local installation and separation
of zip files into generic and arch-specific parts as required by the
internal build.
2024-05-24 10:27:44 +02:00
Tamás Vajk
8ae607cdce Merge pull request #16577 from tamasvajk/fix/adjust-compiler-arg-test
C#: Adjust compiler argument integration test
2024-05-24 09:24:21 +02:00
Erik Krogh Kristensen
c743abad54 Merge pull request #14294 from am0o0/amammad-js-CodeInjection_execa
JS: provide command execution sinks for execa package
2024-05-24 09:20:19 +02:00
Anders Schack-Mulligen
5a7174dcbb Merge pull request #16500 from aschackmull/java/static-field-side-effect
Java: Add support for flow through side-effects on static fields.
2024-05-24 09:19:31 +02:00
Michael Nebel
78d4745722 Merge pull request #16578 from michaelnebel/java/dontliftneutral
Java: Do not lift neutrals in Model generation.
2024-05-24 09:19:20 +02:00
Tamas Vajk
9aee2dc002 C#: Adjust compiler argument integration test 2024-05-24 08:39:08 +02:00
Michael Nebel
f5c654b669 Merge pull request #16579 from tamasvajk/fix/integration-test-2
C#: Fix integration test expected file
2024-05-24 08:16:37 +02:00
Dave Bartolomeo
6f67f9e887 Merge pull request #16564 from github/dbartol/v1
Update all pack versions to `1.0.0`
2024-05-23 17:32:27 -04:00
Dave Bartolomeo
f498e05099 Merge branch 'main' into dbartol/v1 2024-05-23 14:37:28 -04:00
Dave Bartolomeo
613ccaac1d Add change note to all v1.0.0 packs 2024-05-23 13:01:22 -04:00
Arthur Baars
b2c64eabd4 Merge pull request #16572 from github/aibaars-patch-2
Java: include link to `remote source` in TrustBoundaryViolation.ql
2024-05-23 18:16:11 +02:00
Philip Ginsbach
4fbbda508b Merge pull request #16580 from github/ginsbach/MonotonicAggregateModules
`monotonicAggregates` can apply to modules (see language spec)
2024-05-23 16:40:29 +01:00
Philip Ginsbach
1129df9cb7 'monotonicAggregates' can apply to modules (see language spec) 2024-05-23 16:20:54 +01:00
Tamas Vajk
5928ede324 C#: Fix integration test expected file 2024-05-23 16:47:35 +02:00
Michael Nebel
9cf0995720 Java: Update test expected output. 2024-05-23 16:33:04 +02:00
Michael Nebel
6f5bdfba65 Java: Do not lift neutrals and only generate for public endpoints. 2024-05-23 16:32:45 +02:00
Arthur Baars
b5b5fef642 Switch source and sink in TrustBoundaryViolation.ql 2024-05-23 15:53:12 +02:00
Arthur Baars
5c4eb3c943 Java: add change note 2024-05-23 13:06:01 +00:00
Michael Nebel
1e54422662 Java: Add neutral implementations. 2024-05-23 15:00:23 +02:00
Tamás Vajk
c0d623c056 Merge pull request #16567 from tamasvajk/refactor/static-extraction-state
C#: Refactor static compilation state
2024-05-23 14:49:33 +02:00
Anders Schack-Mulligen
4905612905 Merge pull request #16573 from aschackmull/java/dispatch-joinorder
Java: Fix join-order in viableImplInCallContext.
2024-05-23 14:48:25 +02:00
Arthur Baars
d540675b9e Update TrustBoundaryViolation.ql 2024-05-23 12:04:47 +00:00
Tom Hvitved
e4cd9d86f6 Tree-sitter: Respect verbosity defined in CODEQL_VERBOSITY 2024-05-23 13:38:35 +02:00
Anders Schack-Mulligen
1bc3f6b0e7 Java: Add change note. 2024-05-23 13:03:06 +02:00
Tom Hvitved
a523be4d0a Tree-sitter: Add set_tracing_level to shared extractor module 2024-05-23 12:58:53 +02:00
Anders Schack-Mulligen
bf3dbc24de Java: Add support for flow through side-effects on static fields. 2024-05-23 12:57:57 +02:00
Anders Schack-Mulligen
619913b553 Merge pull request #16552 from aschackmull/java/no-source-dispatch-for-exact-mad
Java: Remove source dispatch when there's an exact match from a manual model.
2024-05-23 12:56:58 +02:00
Paolo Tranquilli
7da7416bcd Merge pull request #16568 from github/redsun82/m1-opts
Swift: add flags and instructions for building on macOS ARM
2024-05-23 12:53:29 +02:00
Anders Schack-Mulligen
4b3e35ed52 Java: Fix join-order in viableImplInCallContext. 2024-05-23 12:49:57 +02:00
Owen Mansel-Chan
b2deea4606 Avoid duplicate additional flow steps in configs
`localTaintStep` includes a lot of steps which are already part of value
flow. Instead use `defaultAdditionalTaintStep`, which is just the extra
steps that are added for taint tracking.
2024-05-23 11:13:35 +01:00
Owen Mansel-Chan
7e5891b443 Remove unnecessary additional flow step
TaintTracking already adds taint steps for field reads
2024-05-23 11:08:29 +01:00
Owen Mansel-Chan
cf997fddf6 Trivial: improve parameter names
These names make more sense and match everywhere
else that this function signature is used.
2024-05-23 11:04:09 +01:00
Pierre
52a834dfa3 Add changelogs for 2.17.2 and 2.17.3 2024-05-23 11:26:16 +02:00
Anders Schack-Mulligen
70d3be0a3a Java: Fix test. 2024-05-23 11:24:11 +02:00
Anders Schack-Mulligen
b519f13600 Java: Add change note. 2024-05-23 10:50:16 +02:00
Anders Schack-Mulligen
527dafa346 Java: Improve dispatch through TypeFlow of effectively private calls. 2024-05-23 10:50:16 +02:00
Anders Schack-Mulligen
f353065d26 Java: Allow overloading for exact model matches. 2024-05-23 10:50:01 +02:00
Anders Schack-Mulligen
0f864081cb Java: Remove source dispatch when there's an exact match from a manual model. 2024-05-23 10:50:00 +02:00
Paolo Tranquilli
90a152a2bc Swift: add flags and instructions for building on macOS ARM 2024-05-23 10:44:06 +02:00
Tamás Vajk
5cf7112d4c Merge pull request #16541 from tamasvajk/buildless/use-nuget-config-fallback
C#: Use nuget feeds from nuget.config in fallback restore
2024-05-23 10:43:03 +02:00
Owen Mansel-Chan
4567b17a58 Merge pull request #16566 from github/workflow/coverage/update
Update CSV framework coverage reports
2024-05-23 09:42:51 +01:00
Cornelius Riemenschneider
303dc200c1 Add standalone dependency to autobuilder, following upstream changes. 2024-05-23 10:24:44 +02:00
Cornelius Riemenschneider
576ea325e8 Merge remote-tracking branch 'origin/main' into criemen/bazel-csharp 2024-05-23 10:21:19 +02:00
Tamas Vajk
7042f3222a Code quality improvements 2024-05-23 09:49:09 +02:00
Tamas Vajk
c58971e632 C#: Refactor static compilation state 2024-05-23 09:47:49 +02:00
Tom Hvitved
11da42b049 Merge pull request #16134 from hvitved/csharp/autobuild-buildless-process-indirection
C#: Avoid process creation indirection in auto-builder
2024-05-23 09:25:58 +02:00
Tom Hvitved
f517c00658 Merge pull request #16559 from hvitved/csharp/callable-always-returns-true
C#: Simplify logic in `JsonWebTokenHandlerLib.qll`
2024-05-23 09:25:19 +02:00
Owen Mansel-Chan
0cc868c742 Merge branch 'main' into workflow/coverage/update 2024-05-23 07:49:02 +01:00
Tony Torralba
d202355b07 Merge pull request #16553 from atorralba/atorralba/java/xxe-qhelp-reword
Java: Reword recommendation section of XXE query
2024-05-23 08:48:29 +02:00
erik-krogh
c80f48b23a Merge branch 'main' into amammad-js-CodeInjection_execa 2024-05-23 08:02:22 +02:00
github-actions[bot]
0f2d0c098f Add changed framework coverage reports 2024-05-23 00:16:44 +00:00
Joe Farebrother
2db1fbc713 Merge branch 'main' into python-flask-session-interface 2024-05-22 21:48:01 +01:00
Tom Hvitved
621de2b977 C#: Avoid process creation indirection in auto-builder 2024-05-22 20:05:16 +02:00
Dave Bartolomeo
ffe4c8c87b Update all pack versions to 1.0.0 2024-05-22 13:39:08 -04:00
Mathias Vorreiter Pedersen
3f66b635a4 Merge pull request #16562 from aschackmull/dataflow/update-qltest-expected
Dataflow: Fix qltests following https://github.com/github/codeql/pull/16511
2024-05-22 16:16:04 +01:00
Mathias Vorreiter Pedersen
1978922d9e Merge pull request #16563 from MathiasVP/avoid-cp
C++: Avoid a CP in `cpp/alloca-in-loop`
2024-05-22 15:58:46 +01:00
Mathias Vorreiter Pedersen
769d9317c7 C++: Avoid a CP between 'getExpr(node)' and 'this' in 'LoopWithAlloca'. 2024-05-22 15:15:40 +01:00
Mathias Vorreiter Pedersen
1a0d66b339 Merge pull request #16557 from MathiasVP/fix-unique-pointer-query-fp
C++: Fix `cpp/use-of-unique-pointer-after-lifetime-ends` FP
2024-05-22 15:09:54 +01:00
Anders Schack-Mulligen
987d5712b8 Python: Accept qltest .expected file changes. 2024-05-22 15:43:49 +02:00
Anders Schack-Mulligen
15a7c3faeb Java: Accept qltest .expected file changes. 2024-05-22 15:42:40 +02:00
Anders Schack-Mulligen
a650499a9c Java: Accept qltest .expected file changes (interesting). 2024-05-22 15:42:12 +02:00
Anders Schack-Mulligen
f931c8d836 Go: Accept qltest .expected file changes. 2024-05-22 15:39:47 +02:00
Anders Schack-Mulligen
8db9187698 Go: Accept qltest .expected file changes (interesting). 2024-05-22 15:38:01 +02:00
Anders Schack-Mulligen
e7f24318cd C++: Accept qltest .expected file changes. 2024-05-22 15:36:30 +02:00
Anders Schack-Mulligen
f977a4206a C++: Accept qltest .expected file changes (interesting). 2024-05-22 15:35:28 +02:00
Joe Farebrother
8ff0cb614b Apply review suggestion - Update change note
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2024-05-22 14:26:41 +01:00
Michael Nebel
2449074f3d C#: Remove the DataFlowSummarizedCallable as this narrowing is now handled in the adapter. 2024-05-22 15:11:41 +02:00
Mathias Vorreiter Pedersen
9907f0f827 C++: Exclude a cast to any integral type. 2024-05-22 13:42:07 +01:00
Tom Hvitved
39019b3b62 C#: Simplify logic in JsonWebTokenHandlerLib.qll 2024-05-22 14:24:32 +02:00
Anders Schack-Mulligen
bbebdfea8d Merge pull request #16511 from aschackmull/dataflow/configuration-provenance
Dataflow: Add provenance for configuration-specific steps.
2024-05-22 14:07:10 +02:00
Anders Schack-Mulligen
de5c69d0a1 Merge pull request #16551 from aschackmull/java/model-fixes
Java: Revise some jdk time-related models
2024-05-22 14:05:23 +02:00
Mathias Vorreiter Pedersen
09357e15b4 Merge pull request #16533 from MathiasVP/better-negation-guards-in-c
C++: Make `IRGuardCondition` handle `p` in `if(p)` and `if(!p)` better in C programs
2024-05-22 13:02:06 +01:00
Tom Hvitved
a992b67d97 Merge pull request #16556 from hvitved/dataflow/simplify
Data flow: Remove two redundant conjuncts
2024-05-22 13:58:04 +02:00
Tamás Vajk
c9f468578d Merge pull request #16521 from tamasvajk/impr/refactor-common-csproj-prop
C#: Refactor common msbuild properties
2024-05-22 13:38:31 +02:00
Mathias Vorreiter Pedersen
00a940fd58 Merge pull request #16524 from catenacyber/deref-null-result
Adds another rule for null deref
2024-05-22 12:37:39 +01:00
Mathias Vorreiter Pedersen
4b02f88089 C++: Add change note. 2024-05-22 12:37:08 +01:00
Mathias Vorreiter Pedersen
af81698fa8 C++: Fix FP and accept test changes. 2024-05-22 12:34:09 +01:00
Mathias Vorreiter Pedersen
91f860ba4f C++: Add 'cpp/use-of-unique-pointer-after-lifetime-ends' FP. 2024-05-22 12:33:34 +01:00
Paolo Tranquilli
eab940c45d Merge branch 'main' into redsun82/kotlin 2024-05-22 13:30:23 +02:00
Alex Ford
8119a27540 Merge pull request #16185 from alexrford/rb/conditions-arr0
Ruby: ActiveRecord - refine `conditions` argument as an SQLi sink
2024-05-22 12:19:10 +01:00
Michael Nebel
e4319db18d C#: Filter out unwanted summaries at the root. 2024-05-22 12:53:55 +02:00
Tom Hvitved
a006c29a00 Merge pull request #16481 from hvitved/treesitter/bump2
Tree-sitter: Bump to 0.22.6
2024-05-22 12:53:14 +02:00
Tom Hvitved
70cf16597b Data flow: Remove two redundant conjuncts 2024-05-22 12:45:11 +02:00
Anders Schack-Mulligen
a078dcf1f2 Merge pull request #16550 from aschackmull/java/zipslip-number-sanitizer
Java: Improve sanitizer for java/zipslip
2024-05-22 12:43:44 +02:00
Mathias Vorreiter Pedersen
eda815789b Update cpp/ql/src/experimental/Likely Bugs/DerefNullResult.ql 2024-05-22 11:21:04 +01:00
Cornelius Riemenschneider
24a14badbb Bazel: Remove some kwargs.pop invocations. 2024-05-22 12:09:18 +02:00
Cornelius Riemenschneider
09f60e3e45 C#: Address C# code comments. 2024-05-22 12:09:12 +02:00
Tony Torralba
5ec3335b07 Java: Reword recommendation section of XXE query 2024-05-22 11:34:19 +02:00
Anders Schack-Mulligen
a74cf6501a Java: update qltest expected files. 2024-05-22 11:13:06 +02:00
Michael Nebel
84e412fe36 Merge pull request #16477 from michaelnebel/csharp/madinlinetest
C#: Inline expectation for model generator test.
2024-05-22 11:05:23 +02:00
Anders Schack-Mulligen
ba97c3623a Java: Change most java.time.* df-generated taint models to neutrals. 2024-05-22 10:29:54 +02:00
Anders Schack-Mulligen
54f2316d00 Java: Add a neutral model. 2024-05-22 10:29:49 +02:00
Anders Schack-Mulligen
7828cb8f5a Java: Add change note. 2024-05-22 10:27:33 +02:00
Anders Schack-Mulligen
d82acf5866 Java: Add simple type sanitization to java/zipslip. 2024-05-22 10:23:30 +02:00
Tamás Vajk
855fe12c6c Merge pull request #16549 from tamasvajk/fix/tsp-diag
C#: Fix TSP diagnostic message
2024-05-22 10:10:26 +02:00
Anders Schack-Mulligen
012b861ffb Ruby: Accept qltest .expected file changes. 2024-05-22 10:08:59 +02:00
Anders Schack-Mulligen
c4ae18649e Ruby: Accept qltest .expected file changes (interesting). 2024-05-22 10:08:59 +02:00
Anders Schack-Mulligen
c2ec1bf561 Swift: Accept qltest .expected file changes. 2024-05-22 10:08:56 +02:00
Anders Schack-Mulligen
73b8314308 C#: Accept qltest .expected file changes. 2024-05-22 10:05:42 +02:00
Anders Schack-Mulligen
22c1d52381 Dataflow: Add provenance for configuration-specific steps. 2024-05-22 10:05:42 +02:00
Tamas Vajk
91aa182d53 C#: Fix TSP diagnostic message 2024-05-22 08:49:55 +02:00
Paolo Tranquilli
b744f9fab9 Merge pull request #16544 from github/redsun82/bazel-csharp-2
Bazel/C#: avoid zipmerge
2024-05-22 08:18:30 +02:00
Erik Krogh Kristensen
92df0a3d46 Merge pull request #16546 from erik-krogh/ts-big-file-fix
JS: fix that very large TypeScript files would crash the extractor
2024-05-22 07:41:58 +02:00
am0o0
0895f7d971 update qlref files 2024-05-21 22:48:17 +02:00
am0o0
c470c078dc move to experimental 2024-05-21 22:42:16 +02:00
erik-krogh
a30bac14e9 add change-note 2024-05-21 22:14:39 +02:00
Philippe Antoine
ab4b823c2e fixup unique assignment 2024-05-21 22:10:00 +02:00
Tom Hvitved
22aea47604 Repin 2024-05-21 20:59:54 +02:00
Tom Hvitved
a87ceed361 Merge pull request #16394 from hvitved/dataflow/synth-param-ret-node
Data flow: Synthesize parameter return nodes
2024-05-21 20:55:14 +02:00
Tom Hvitved
bc1283c715 Ruby: Reference official Tree-sitter grammar in Cargo.toml 2024-05-21 20:51:50 +02:00
erik-krogh
61c72361cd move the "isFileTooLarge" earlier in the pipeline, so we're only doing it once 2024-05-21 20:01:24 +02:00
erik-krogh
241f977488 fix that very large TypeScript files would crash the extractor 2024-05-21 19:52:43 +02:00
Paolo Tranquilli
3c52e3b7c5 Bazel/C#: adjust DefaultInfo in codeql_pkg_files_overlay 2024-05-21 16:32:24 +01:00
Geoffrey White
8dad622de2 Swift: Fix some inconsistencies. 2024-05-21 16:32:00 +01:00
Cornelius Riemenschneider
730d5425b3 C#: Add comment justifing turning off strict deps. 2024-05-21 17:30:27 +02:00
Cornelius Riemenschneider
767d427c1b C#: Re-implement the git version logic using an attribute. 2024-05-21 17:28:31 +02:00
Chuan-kai Lin
8a22e2283c Merge pull request #16424 from github/cklin/ruby-entities-reorder
Ruby: Use entities in reorder directives
2024-05-21 07:32:28 -07:00
Paolo Tranquilli
b19bf2f37a Bazel/C#: avoid zipmerge 2024-05-21 15:29:54 +01:00
Tom Hvitved
bebcd679a4 Address review comments 2024-05-21 14:51:52 +02:00
Tom Hvitved
18f138e754 Add change note 2024-05-21 14:47:42 +02:00
Rasmus Wriedt Larsen
2451a6d3f6 Accept .expected changes 2024-05-21 14:47:42 +02:00
Tom Hvitved
454687d583 Data flow: Synthesize parameter return nodes 2024-05-21 14:47:42 +02:00
Asger F
0b78d1d953 Python: add qldoc 2024-05-21 14:40:35 +02:00
Asger F
3b211089d6 JS: Remove redundant import 2024-05-21 14:40:17 +02:00
Asger F
13d01f1ec4 Ruby/Python: add recursion guard 2024-05-21 14:40:15 +02:00
Asger F
14c71a351e Sync shared files 2024-05-21 14:38:55 +02:00
Asger F
6f19fc2fcd JS: Add isTypeUsed to avoid overpruning 2024-05-21 14:38:52 +02:00
Asger F
632cce2c16 JS: Add failing test due to overpruning 2024-05-21 14:20:13 +02:00
Asger F
43abc72780 JS: Add TypeModel.isTypeUsed
f
2024-05-21 14:19:56 +02:00
Tamas Vajk
182325dc5e Fix expected test files 2024-05-21 14:03:04 +02:00
Tamas Vajk
12494a0c5a C#: Use nuget feeds from nuget.config in fallback restore 2024-05-21 12:47:38 +02:00
yoff
358c7410c8 Merge pull request #16490 from yoff/python/rich-type-column-MaD
Python: Rich `type` column in MaD
2024-05-21 11:55:41 +02:00
Tom Hvitved
158dafa7d0 Python: Dummy change to trigger CI 2024-05-21 11:25:21 +02:00
Tom Hvitved
80364e9570 Ruby: Repin in Cargo.toml 2024-05-21 11:25:21 +02:00
Jeroen Ketema
bddc69e409 Merge pull request #16537 from jketema/memcmp
C++: Fix typo in `cpp/network-to-host-function-as-array-bound`
2024-05-21 11:14:48 +02:00
Tom Hvitved
bf2ae9890f Tree-sitter: Bump to 0.22.6 2024-05-21 11:14:06 +02:00
Jeroen Ketema
c8fec336ce C++: Fix typo in cpp/network-to-host-function-as-array-bound 2024-05-21 10:29:17 +02:00
Jeroen Ketema
1a60c01723 C++: Add memcmp test for cpp/network-to-host-function-as-array-bound 2024-05-21 10:27:38 +02:00
Joe Farebrother
01a6c5e82f Merge pull request #16446 from joefarebrother/shared-sensitive-heuristics
Ruby/Python/JS/Swift: Add category of Private information to shared sensitive data heuristics
2024-05-21 09:07:13 +01:00
Tom Hvitved
60ee7fb0d3 Merge pull request #16473 from hvitved/csharp/entity-framework-perf
C#: Fix performance issue in EntityFramework modelling
2024-05-21 10:03:21 +02:00
Tamás Vajk
1a20a624d6 Merge pull request #16498 from tamasvajk/buildless/use-nuget-from-path
C#: Use nuget.exe from the executing machine instead of always downlo…
2024-05-21 09:38:47 +02:00
Tamas Vajk
c9b4e83e73 Add empty Directory.Build.props to ql subdirectory 2024-05-21 09:30:25 +02:00
Cornelius Riemenschneider
731b9412df Fix integration test expectations. 2024-05-21 09:14:15 +02:00
Cornelius Riemenschneider
36922f2625 Remove GitInfo dependency.
GitInfo doesn't work with the bazel-based build.
Instead, we pull in the information from bazel,
which correctly works with the bazel cache.
2024-05-21 09:14:14 +02:00
Cornelius Riemenschneider
71372bc74c C#: Add Bazel-based build system.
This commits a bazel-based build system for C#
using `rules_dotnet`. External dependencies are managed
via `paket`, and updates to the generated bazel files
are done via `./update-deps.sh`.
We're providing our own (minimal) test runner for `xunit`
tests.
2024-05-21 09:14:13 +02:00
Paolo Tranquilli
9d21e2cda3 Merge pull request #16522 from github/redsun82/lfs
Bazel: allow LFS rules to use cached downloads without internet
2024-05-21 08:56:47 +02:00
Tamas Vajk
cecaa0de3a C#: Clear possibly inherited Directory.Build.props and Directory.Build.targets in stub generator 2024-05-21 08:55:19 +02:00
Tamas Vajk
6da0592ab6 C#: Refactor common msbuild properties 2024-05-21 08:55:12 +02:00
Tom Hvitved
d9019f9676 C#: Fix performance issue in EntityFramework modelling 2024-05-21 08:53:51 +02:00
erik-krogh
c166cb406a Merge branch 'main' into amammad-js-CodeInjection_execa 2024-05-21 08:48:12 +02:00
Mathias Vorreiter Pedersen
5893e38567 C++: Accept test changes. 2024-05-20 22:28:17 +01:00
Mathias Vorreiter Pedersen
0a550bb919 C++: Support 'if(!p)' for C programs in IRGuards. 2024-05-20 22:28:17 +01:00
Philippe Antoine
8ace9da14a fixup dataflow path and formatting 2024-05-20 21:31:47 +02:00
Mathias Vorreiter Pedersen
398b90a15d C++: Rename a few predicates. 2024-05-20 17:15:20 +01:00
Joe Farebrother
553500d9f2 Fix change note 2024-05-20 15:47:07 +01:00
Geoffrey White
13a7d9acb6 Merge pull request #16528 from geoffw0/docfix2
C++: Update an instance of the name 'Semmle' in a doc page.
2024-05-20 15:07:42 +01:00
Joe Farebrother
be573329d8 Add change note 2024-05-20 10:54:13 +01:00
Mathias Vorreiter Pedersen
c483a4bf04 Merge pull request #16527 from codeqlhelper/main
C++: Static variables are initialized to zero or null by compiler
2024-05-20 10:13:23 +01:00
Geoffrey White
0ba3cd96f5 C++: Update an instance of the name 'Semmle' in a doc page. 2024-05-20 10:02:50 +01:00
Joe Farebrother
7727e465f4 Model Flask SessionInterface request parameter 2024-05-20 09:46:54 +01:00
Mathias Vorreiter Pedersen
2f7766a557 C++: Autoformat. 2024-05-20 09:04:24 +01:00
Mathias Vorreiter Pedersen
df24e5982a C++: Add tests and accept test changes. 2024-05-20 09:01:42 +01:00
Mathias Vorreiter Pedersen
e8b9d7e6fa C++: Modify change note to be more aligned with existing change notes. 2024-05-20 08:52:18 +01:00
codeqlhelper
15667dcf1e Create 2024-05-19-avoid-reporting-static-variable.md 2024-05-19 21:55:35 +08:00
codeqlhelper
1d8d45b3aa Static variables are initialized to zero or null by compiler
Static variables are initialized to zero or null by compiler, no need to get an initializer of them
2024-05-19 21:48:43 +08:00
Erik Krogh Kristensen
bfc95c6f13 Merge pull request #16510 from erik-krogh/go-command
Go: Update the QHelp for `go/command-injection`.
2024-05-17 17:45:10 +02:00
Paolo Tranquilli
d01d657f89 Bazel: accept new SSH keys in git_lfs_probe.py 2024-05-17 16:39:18 +01:00
Philippe Antoine
73d306c8c8 Adds another rule for null deref 2024-05-17 17:35:07 +02:00
Paolo Tranquilli
170e2231d4 Bazel: allow LFS rules to use cached downloads without internet
If the cache is prefilled, LFS rules were still trying to query LFS
urls.

Now the strategy is to first try to fetch the files from the repository
cache (which is possible by providing an empty url list and `allow_fail`
to `repository_ctx.download`), and only run the LFS protocol if that
fails. Technically this is possible by enhancing `git_lfs_probe.py` with
a `--hash-only` flag.

This is also an optimization where no uneeded access is done (including
the slightly slow SSH call) if the repository cache is warm.
2024-05-17 16:24:38 +01:00
yoff
0ecefd6a24 Update python/ql/lib/change-notes/2024-05-17-maD-rich-type-column.md
Co-authored-by: Taus <tausbn@github.com>
2024-05-17 16:58:59 +02:00
Rasmus Lerchedahl Petersen
9534e56d1b Python: address review comments 2024-05-17 16:25:22 +02:00
Cornelius Riemenschneider
b639f60fa6 Merge pull request #16517 from github/criemen/paket-rewrite
C#: Reformat project files with `paket`.
2024-05-17 16:20:25 +02:00
Chuan-kai Lin
1a4c07a1ac Merge pull request #16425 from github/cklin/swift-entities-reorder
Swift: Use entities in reorder directives
2024-05-17 06:43:18 -07:00
Chuan-kai Lin
f1047606ad Merge pull request #16418 from github/cklin/cpp-entities-reorder
C++: Use entities in reorder directives
2024-05-17 06:43:07 -07:00
yoff
a7a12f17b5 Merge pull request #16512 from yoff/python/allow-provenance-in-additional-taint-steps
Python: Allow provenance in additional taint steps
2024-05-17 15:07:12 +02:00
Felicity Chapman
daf19a2468 Merge pull request #16496 from github/felicitymay/sphinx-config
Stop building the CodeQL for VS Code docs now they've been migrated
2024-05-17 13:37:36 +01:00
Paolo Tranquilli
ad1188be1f Merge pull request #16518 from github/redsun82/bazel-update
Bazel: update bazel to version 7.1.2
2024-05-17 12:14:48 +01:00
Cornelius Riemenschneider
a6ce24dc39 C#: Reformat project files with paket.
When running `dotnet paket update` or `dotnet paket install`, `paket`
forcefully reformats the project files. This is unfortunate.
One option is to accept these changes, as they're not harmful.
They do mean that each project includes the Paket restore targets individually,
instead of doing so via `Directory.Build.targets`.
Another option would be to not merge this PR, and then I'll document that
the changes to the csproj files should be ignored when running `paket` instead.
I don't really mind either way.
2024-05-17 12:19:53 +02:00
Paolo Tranquilli
cc4f8e038d Bazel: update bazel to version 7.1.2 2024-05-17 10:52:29 +01:00
Erik Krogh Kristensen
03cf9b702c Merge pull request #14291 from am0o0/amammad-js-CodeInjection_Shelljs
JS: Shelljs improvement
2024-05-17 11:14:11 +02:00
Rasmus Lerchedahl Petersen
a568873a8e Python: update test expectations 2024-05-17 10:59:49 +02:00
Rasmus Lerchedahl Petersen
92a5b6f6d6 python: add change note 2024-05-17 10:02:38 +02:00
Rasmus Lerchedahl Petersen
e66cce7fe1 python: add qldoc and refactor
The logic of which steps an `AdditionalTaintStep` has defined
is now pushed into the defitnion of `AdditionalTaintStep`.
2024-05-17 09:49:31 +02:00
Michael Nebel
e198d0105f C#: Re-factor the model generator tests. 2024-05-17 09:44:58 +02:00
Michael Nebel
adeff8c602 C#: Convert neutral capture test to inline expectation. 2024-05-17 09:44:58 +02:00
Michael Nebel
e3b6ee1aaf C#: Convert type based summary capture test to inline expectation. 2024-05-17 09:44:58 +02:00
Michael Nebel
a5fd433c20 C#: Convert sink capture test to inline expectation. 2024-05-17 09:44:58 +02:00
Michael Nebel
26f9297d62 C#: Convert source capture test to inline expectation. 2024-05-17 09:44:58 +02:00
Michael Nebel
404b39b6e6 C#: Convert summary capture test to inline expectation. 2024-05-17 09:44:57 +02:00
Michael Nebel
2cda1a207e C#: Add language specific part of the models as data inline expectation. 2024-05-17 09:44:57 +02:00
Michael Nebel
78b8a9259a Share the Models as Data inline expect predicates. 2024-05-17 09:44:57 +02:00
Michael Nebel
e483948c19 Merge pull request #16513 from michaelnebel/csharp/flowsummariestest
C#: Change the printed information in the Flow summaries tests.
2024-05-17 09:43:28 +02:00
erik-krogh
384649b336 changes based on review, and improve the new command-injection test 2024-05-17 08:38:54 +02:00
Chanel Young
5ee7004a62 fp case if encrypt set in initializer 2024-05-16 17:59:17 -07:00
Rasmus Lerchedahl Petersen
d4d6b48f98 python: add test for subclass instance method 2024-05-17 00:03:01 +02:00
Rasmus Lerchedahl Petersen
3d0c42f44d python: rewrite text models to use rich paths 2024-05-17 00:03:01 +02:00
Rasmus Lerchedahl Petersen
a88c007c05 python: Allow dotted paths in type column 2024-05-17 00:03:00 +02:00
Tamas Vajk
a79105e2ae C#: Use nuget.exe from the executing machine instead of always downloading it 2024-05-16 23:15:04 +02:00
erik-krogh
2848ccf0e2 fix frontend errors that Go complained about 2024-05-16 20:06:26 +02:00
erik-krogh
08c0d8ec60 autoformat go files 2024-05-16 19:59:40 +02:00
erik-krogh
9aeebc6f39 update the QHelp to add a "--" example 2024-05-16 19:49:22 +02:00
Owen Mansel-Chan
a8201a19ae Merge pull request #16506 from github/smowton/admin/gradle-version-detection-change-note
Java: Add change note for Gradle JDK version detection
2024-05-16 17:11:03 +01:00
Cornelius Riemenschneider
3a224871ee Merge pull request #16476 from github/criemen/update-deps
C#: Update non-Roslyn thirdparty dependencies
2024-05-16 17:58:10 +02:00
Alex Ford
19e2af8a1d Merge pull request #13556 from am0o0/amammad-ruby-bombs
Ruby: Decompression Bombs
2024-05-16 16:23:02 +01:00
Paolo Tranquilli
75709bf1ec Merge branch 'main' into redsun82/kotlin 2024-05-16 15:55:08 +01:00
Paolo Tranquilli
92699d18ac Merge pull request #16508 from github/redsun82/updated-prebuilt
Swift: update prebuilt package
2024-05-16 14:58:17 +01:00
am0o0
dcadda23cd update expected file 2024-05-16 15:15:27 +02:00
am0o0
f06c3fddd9 fix qhelp, fix duplicate query id 2024-05-16 15:12:31 +02:00
Michael Nebel
18fc92247b C#: Update flowsummaries expected output. 2024-05-16 15:09:04 +02:00
Michael Nebel
763d53afed C#: Remove the override and ext column from the summaries printing test. 2024-05-16 15:08:45 +02:00
Alex Ford
78dc6502f5 Merge branch 'main' into amammad-ruby-bombs 2024-05-16 13:53:31 +01:00
Michael Nebel
b1329fd806 Merge pull request #16362 from michaelnebel/java/removelocalqueries
Java: Remove local query variants.
2024-05-16 14:34:04 +02:00
am0o0
42a9962519 make shellJSMember predicate private, improve predicate document 2024-05-16 14:05:06 +02:00
Rasmus Lerchedahl Petersen
4378924785 Python: Example use of provenance for additional taint steps 2024-05-16 14:04:35 +02:00
Rasmus Lerchedahl Petersen
20ea9255a1 Python: Allow provenance in additional taint steps 2024-05-16 14:04:10 +02:00
yoff
ea3cc51286 Merge pull request #16194 from yoff/python/test-constructor-MaD-path
Python: test the MaD path for constructor calls
2024-05-16 13:52:30 +02:00
Cornelius Riemenschneider
47f679dc34 C#: Remove version constraints on most dependencies.
This means that `dotnet paket update` will pull in the
latest matching versions of all dependencies, except
the pinned roslyn versions.
GitInfo also remains pinned, as we're removing that
dependency when converting the build to bazel anyways.

This removes a whole bunch of transitive dependencies
we no longer need, resulting in a smaller distribution,
and hopefully a smaller build.
2024-05-16 13:51:36 +02:00
Cornelius Riemenschneider
8dc9c95be4 Merge pull request #16376 from github/criemen/dotnet-paket
C#/C++: Convert C# code to use `paket` package manager
2024-05-16 13:45:25 +02:00
Owen Mansel-Chan
2dd42f7aa5 Merge pull request #16509 from owen-mc/go/fix-missing-underlying-types
Go: make two barriers recognise named types whose underlying types are integer types
2024-05-16 12:41:42 +01:00
Owen Mansel-Chan
2b7394cd42 Merge pull request #16305 from github/go/value-flow-instead-of-taint-flow
Go: Use value flow instead of taint flow for `go/incorrect-integer-conversion`
2024-05-16 12:40:53 +01:00
Asger F
499c4df79b Merge pull request #13554 from am0o0/amammad-js-bombs
JS: Decompression Bombs
2024-05-16 13:25:41 +02:00
Erik Krogh Kristensen
a2994c073a Merge pull request #16507 from erik-krogh/up-insecure-randomness
JS: Update the insecure-randomness QHelp
2024-05-16 12:52:09 +02:00
Owen Mansel-Chan
8cc118f781 Add change note 2024-05-16 11:16:54 +01:00
Owen Mansel-Chan
b008f98782 Fix missing getUnderlyingType() calls
In both cases we also care about named types whose underlying type is
an integer type.
2024-05-16 11:10:15 +01:00
Paolo Tranquilli
451f601a65 Swift: update prebuilt package 2024-05-16 11:07:07 +01:00
Max Schaefer
98d2c848bb Merge pull request #16497 from github/max-schaefer/comparison-with-wider-type
Java: Add tests for `comparison-with-wider-type`.
2024-05-16 10:59:59 +01:00
Cornelius Riemenschneider
74e446ea3b Paket/C#: Only pull in the tool restore targt via InitialTargets. 2024-05-16 11:42:20 +02:00
erik-krogh
56dff8540f add an example of how to get a floating point value between 0 and 1 2024-05-16 11:15:07 +02:00
erik-krogh
066f3b61a2 RandomSource is deprecated, it's crypto now 2024-05-16 11:14:50 +02:00
Owen Mansel-Chan
410543f26b Add change note 2024-05-16 10:10:22 +01:00
Owen Mansel-Chan
e71cf0ff1d Use value flow instead of taint flow 2024-05-16 10:10:18 +01:00
Owen Mansel-Chan
5dbb91f508 Merge pull request #16504 from owen-mc/go/allow-array-reads-from-named-types
Go: allow read and store steps from named types
2024-05-16 09:47:54 +01:00
Tamás Vajk
c4d33fbede Merge pull request #16505 from tamasvajk/fix/pin-sdk-version-in-test
C#: Pin dotnet SDK version in integration test relying on razor sourc…
2024-05-16 10:18:17 +02:00
Chris Smowton
e8d064e291 Java: Add change note for Gradle JDK version detection 2024-05-16 09:15:47 +01:00
erik-krogh
ea2b73bda2 add a sanitizer that checks that the string does not start with "--" 2024-05-16 09:25:19 +02:00
Tamas Vajk
62faab320b C#: Pin dotnet SDK version in integration test relying on razor source generator 2024-05-16 09:00:53 +02:00
yoff
5076b1a214 Merge pull request #16135 from sylwia-budzynska/gradio-model
Python: Add Gradio models
2024-05-16 09:00:50 +02:00
erik-krogh
b9a7f6a8f7 add regexp check as a sanitizer for command-injection 2024-05-16 08:55:03 +02:00
erik-krogh
761f9cac97 make a new go/command-injection qhelp 2024-05-16 08:54:55 +02:00
erik-krogh
e2a4c2aa1b move the code samples for the Go command-injection queries to an examples/ folder 2024-05-16 08:54:54 +02:00
Owen Mansel-Chan
6ffa821aa3 Add change note 2024-05-16 00:41:28 +01:00
Owen Mansel-Chan
21ff705b73 Fix bug with read/store steps and named types 2024-05-16 00:35:45 +01:00
Owen Mansel-Chan
1af3374322 Add tests for data flow through ranged for loops
Including the case where the type of the domain is a named type rather
than an array type or map type or whatever.
2024-05-16 00:32:30 +01:00
Cornelius Riemenschneider
1b22e0879a Paket/C#: Automatically restore tools for CSharp.sln.
This is not a general fix, as we not always build the
solution file, but this should improve the DX for
local developers that use the solution file.
2024-05-15 21:51:33 +02:00
Chris Smowton
4617c055e2 Merge pull request #16336 from smowton/smowton/admin/android-8-test
Java: Add Android Gradle Plugin 8 and Spring Boot 3 tests
2024-05-15 16:23:21 +01:00
Chris Smowton
a50584c665 Comment on Java version selection testing strategy 2024-05-15 14:52:09 +01:00
Chris Smowton
44edff7661 AGP 8 test: ignore and remove the .gradle directory 2024-05-15 14:52:09 +01:00
Chris Smowton
9c823d708d Expose toolchains to some Android tests, which would otherwise now try to upgrade to JDK17 2024-05-15 14:52:09 +01:00
Chris Smowton
c328957bf3 Add Spring Boot 3 test 2024-05-15 14:52:09 +01:00
Chris Smowton
7e13c88f1d Add Android 8 integration test 2024-05-15 14:52:09 +01:00
Sylwia Budzynska
72493a6bd1 Change classes to private
Co-authored-by: yoff <lerchedahl@gmail.com>
2024-05-15 15:08:27 +02:00
Cornelius Riemenschneider
950e8c85e7 Paket: Prevent recursion into ql/csharp/ql directory. 2024-05-15 14:17:04 +02:00
Cornelius Riemenschneider
a158e40cc2 MSBuild: Move paket restore target inclusion to global file. 2024-05-15 14:17:02 +02:00
Cornelius Riemenschneider
90bb0ba33f Paket: Mark lockfile as generated. 2024-05-15 14:17:01 +02:00
Cornelius Riemenschneider
8f207e7a06 Add dotnet tool restore to local CI. 2024-05-15 14:16:47 +02:00
Max Schaefer
3c47c1137d Simplify query. 2024-05-15 12:49:45 +01:00
Max Schaefer
d406646414 Java: Add tests for comparison-with-wider-type. 2024-05-15 12:45:19 +01:00
Felicity Chapman
b32fb1d961 Fix another couple of links 2024-05-15 12:43:40 +01:00
Cornelius Riemenschneider
3f020a96e4 Remove unused dependency. 2024-05-15 13:37:05 +02:00
Cornelius Riemenschneider
25b7214064 C++: Move Windows autobuilder to paket dependencies. 2024-05-15 13:36:51 +02:00
Cornelius Riemenschneider
723850394d Add paket files to .gitignore. 2024-05-15 13:28:03 +02:00
Cornelius Riemenschneider
f1616d3c26 Add auto-generated paket restore targets. 2024-05-15 13:28:01 +02:00
Cornelius Riemenschneider
45167cf9f1 C#: Switch over dependencies in msbuild files to paket. 2024-05-15 13:28:00 +02:00
Cornelius Riemenschneider
04c26056a1 C#: Commit paket-based dependency tree. 2024-05-15 13:27:58 +02:00
Cornelius Riemenschneider
4a85cc98e5 C#: Add tool file for paket. 2024-05-15 13:27:56 +02:00
Michael B. Gale
81297aad8c Go: Use standard semver format in outputEnvironmentJson 2024-05-15 12:21:23 +01:00
Felicity Chapman
24da489bab Replace a few more old references 2024-05-15 12:14:10 +01:00
Felicity Chapman
c6ee25497e Replace old references to VS Code articles 2024-05-15 12:07:53 +01:00
Michael B. Gale
fabd7a9c51 Go: Better preserve original versions 2024-05-15 12:01:03 +01:00
Cornelius Riemenschneider
eb9c734120 Merge pull request #16487 from github/criemen/move-win-autobuilder
C++/C#: Move the Windows autobuilder into a subfolder in `ql/csharp`.
2024-05-15 12:55:10 +02:00
Owen Mansel-Chan
332a3dbc61 Merge pull request #16493 from github/workflow/coverage/update
Update CSV framework coverage reports
2024-05-15 11:49:06 +01:00
Michael B. Gale
e0543d1d59 Go: Support all permutations of version prefixes and suffixes 2024-05-15 10:43:02 +01:00
Owen Mansel-Chan
253965096b Merge branch 'main' into workflow/coverage/update 2024-05-15 10:10:44 +01:00
Michael B. Gale
6652685f5a Go: Restore toolchain.IsInstalled check 2024-05-15 10:07:44 +01:00
Michael B. Gale
898383ccff Go: Fix comment in NewSemVer for empty string 2024-05-15 10:07:44 +01:00
Michael B. Gale
054efa648c Go: Move version constants to shared location 2024-05-15 10:03:35 +01:00
Michael B. Gale
9e618b6961 Go: Use SemVer type in autobuilder package 2024-05-15 10:03:35 +01:00
Michael B. Gale
a6d2aa3913 Go: Use SemVer type in project package 2024-05-15 10:03:32 +01:00
Michael B. Gale
010df54657 Go: Use SemVer type in toolchain package 2024-05-15 10:03:01 +01:00
Michael B. Gale
d171750678 Go: Add SemVer type to track valid semantic versions 2024-05-15 10:02:10 +01:00
Michael B. Gale
964b3f2339 Merge pull request #16480 from github/mbg/go/improve-script-fail-message
Go: Improve log messages in `buildWithoutCustomCommands`
2024-05-15 10:00:30 +01:00
Michael B. Gale
586e90043a Merge pull request #16462 from github/mbg/go/add-resolve-env-tests
Go: Add tests for `resolve build-environment`
2024-05-15 09:59:52 +01:00
Cornelius Riemenschneider
ab7d30a464 Merge branch 'main' into criemen/move-win-autobuilder 2024-05-15 10:58:01 +02:00
Michael B. Gale
38e1065b24 Go: Document return values for Autobuild 2024-05-15 09:38:31 +01:00
Mathias Vorreiter Pedersen
64b8f97d39 Merge pull request #16495 from MathiasVP/delete-duplicated-conjunction 2024-05-15 09:37:46 +01:00
Michael B. Gale
28c8611f93 Go: Add build-environment.expected for linux-only tests 2024-05-15 09:34:28 +01:00
Michael B. Gale
b44ad2d39f Go: Add missing diagnostics.expected file 2024-05-15 09:33:44 +01:00
Cornelius Riemenschneider
8ea1d1376f Update CODEOWNERS
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2024-05-15 10:18:31 +02:00
Michael B. Gale
7e10f212cd Go: Move resolve build-environment test into subdirectory 2024-05-15 08:54:24 +01:00
Mathias Vorreiter Pedersen
a1cb419902 C++: Delete duplicated case in IR generation. 2024-05-15 08:52:56 +01:00
Michael B. Gale
7cf61ffb18 Go: Add integration test for resolve build-environment 2024-05-15 08:51:54 +01:00
Michael B. Gale
eb2e587637 Go: Add build-environment.expected files 2024-05-15 08:41:31 +01:00
github-actions[bot]
c3caafcca1 Add changed framework coverage reports 2024-05-15 00:16:53 +00:00
Dave Bartolomeo
b49a61705c Merge pull request #16491 from github/post-release-prep/codeql-cli-2.17.3
Post-release preparation for codeql-cli-2.17.3
2024-05-14 19:33:20 -04:00
github-actions[bot]
32e8b5c667 Post-release preparation for codeql-cli-2.17.3 2024-05-14 21:14:08 +00:00
Owen Mansel-Chan
145873f562 Merge pull request #16413 from owen-mc/go/fix-builtin-models
Go: fix models for built-in functions
2024-05-14 21:03:05 +01:00
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
yoff
538d556465 Merge branch 'main' into python/test-constructor-MaD-path 2024-05-14 21:30:58 +02:00
yoff
04c0475251 Merge pull request #16483 from yoff/python/MaD-instance-follow-subclass
Python: The MaD token `Instance` now follows subclasses
2024-05-14 21:30:43 +02: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
Michael B. Gale
58ef9f4e3e Go: Run resolve build-environment in integration tests 2024-05-14 15:46:03 +01:00
Chris Smowton
8814e6e2bd Replace deprecated ssl.wrap_socket method 2024-05-14 15:14:27 +01:00
Owen Mansel-Chan
827d15aaa0 Test changes due to model renumbering 2024-05-14 14:40:57 +01:00
Owen Mansel-Chan
ab5e1f8a69 Fix models for min and max and improve tests
Although the documentation makes them look variadic (and generic), they
are actually special-cased in the compiler. Like all built-in functions
they don't have a signature type, but the type of `min(a, b, c)` is
`func(int, int, int) int` and not `func(int, ...int) int`.

Go doesn't allow open-ended ranges for argument indices in
models-as-data specifications (though Ruby and Python do), so I've used
`1..1000`.
2024-05-14 14:40:56 +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
Rasmus Lerchedahl Petersen
49ffa8bf07 Merge branch 'main' of https://github.com/github/codeql into python/test-constructor-MaD-path 2024-05-14 14:30:18 +02: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
Sylwia Budzynska
34c447939e Update test results 2024-05-14 14:23:36 +02:00
Cornelius Riemenschneider
869bf8afc6 C++/C#: Move the Windows autobuilder into a subfolder in ql/csharp.
This is a necessary preparation for moving the C# dependency management to `paket`,
which in turn is a necessary preparation for moving the C# build to bazel.

As we discovered in https://github.com/github/codeql/pull/16376,
`paket` tries to restore all projects recursively from the root folder.
If we support building C# code under both `ql/csharp` and `ql/cpp`, we need
to have a single lockfile under `ql`, as both codebases share the same set of dependencies
(and utilities from `ql/csharp/extractor`).
Then, `paket` will also try to restore things that look like "C# projects" in other languages'
folders, which is not what we want.
Therefore, we address this by moving all C# code into a common root directory, `ql/csharp`.

This needs an internal PR to adjust the buildsystem to look for the autobuilder in the new location.
2024-05-14 13:45:49 +02: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
Sylwia Budzynska
f72afdc7cb Merge branch 'main' into gradio-model 2024-05-14 12:41:00 +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
am0o0
c7adb32bc4 simply replace duplicate class references with classRef() in Fabric.qll 2024-05-14 09:51:47 +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
Rasmus Lerchedahl Petersen
52717f8500 python: The MaD token Instance now follows subclasses 2024-05-14 08:40:19 +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
Felicity Chapman
34f91f8129 Stop building the CodeQL for VS Code docs 2024-05-13 16:23:06 +01:00
Michael B. Gale
65c654e946 Go: Do not use a named return variable in buildWithoutCustomCommands 2024-05-13 15:33:52 +01:00
am0o0
37d33186e5 revert classRef deletion, fix secondaryserverCmdInjection expected test results 2024-05-13 15:02:04 +02:00
am0o0
fb3d34ce11 format Torch.qll 2024-05-13 14:43:43 +02:00
Chris Smowton
10e1bfcee5 Add test case for a custom Java trust store 2024-05-13 12:43:06 +01:00
Michael B. Gale
4d5f05a8dd Go: Adjust log messages depending on whether build scripts were found or not 2024-05-13 12:42:00 +01:00
Michael B. Gale
1b9e8ae86f Go: Modify Autobuild to return an array of scripts that were run 2024-05-13 12:38:51 +01:00
Michael B. Gale
bbc359ebde Go: Improve messages in buildWithoutCustomCommands 2024-05-13 12:31:04 +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
Sim4n6
7f153ed07b Add some method calls as a Source 2024-05-12 09:46:36 +01: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
Owen Mansel-Chan
f7e6bf7ef5 Two tests have different paths but same results 2024-05-10 23:41:00 +01:00
Owen Mansel-Chan
f8e17fe8cc Accept expected test changes 2024-05-10 23:40:59 +01:00
Owen Mansel-Chan
76946184de Accept MaD renumbering for edge provenance 2024-05-10 23:40:58 +01:00
Owen Mansel-Chan
e1c85e3581 Fix elementWrite to include flow summaries 2024-05-10 23:40:58 +01:00
Owen Mansel-Chan
8cc9838628 Add change note 2024-05-10 23:40:57 +01:00
Owen Mansel-Chan
d5aa08dbf3 Local flow steps for flow summaries for built-in functions 2024-05-10 23:40:57 +01:00
Owen Mansel-Chan
86e2b845f3 Add tests for copy (taint passes, value fails) 2024-05-10 23:40:56 +01:00
Owen Mansel-Chan
eab1569342 Update ExternalValueFlow to use value flow 2024-05-10 23:40:56 +01:00
Owen Mansel-Chan
c816412795 Create copy of ExternalTaintFlow called ExternalValueFlow 2024-05-10 23:40:55 +01:00
Owen Mansel-Chan
84b7319688 Rename test folder ExternalFlow to ExternalTaintFlow 2024-05-10 23:40:54 +01:00
Owen Mansel-Chan
f95ccd242f Remove old-style models of built-in functions 2024-05-10 23:40:54 +01:00
Owen Mansel-Chan
fcdac0aeb0 Add models for min and max built-in functions 2024-05-10 23:40:53 +01:00
Owen Mansel-Chan
1322ce35d6 Add model for built-in function copy 2024-05-10 23:40:53 +01:00
Owen Mansel-Chan
e857eedd4a Fix model for append - it is variadic 2024-05-10 23:40:52 +01: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
Sylwia Budzynska
d6acea1d0c Fix tests 2024-05-10 12:41:47 +02:00
Sylwia Budzynska
52ceb7fb89 Apply suggestions from code review
Co-authored-by: yoff <lerchedahl@gmail.com>
2024-05-10 12:07:32 +02:00
am0o0
90da07159e fix tests, chore on Find.ql 2024-05-10 08:51:23 +02:00
am0o0
a87d27b53e revert vscode settings.json file 2024-05-10 08:35:50 +02:00
am0o0
9435a62a86 revert vscode settings.json file 2024-05-10 08:34:08 +02:00
am0o0
0e80e867af fix actions reviews 2024-05-10 08:32:45 +02:00
am0o0
f93d4a0dd5 fix Fabric query library 2024-05-10 01:27:31 +02:00
am0o0
3a52cd186e Merge branch 'am0o0-python-codeExec' of https://github.com/amammad/codeql into am0o0-python-codeExec 2024-05-09 23:16:11 +02:00
Am
0043d93fc1 Merge branch 'github:main' into am0o0-python-codeExec 2024-05-09 23:15:56 +02:00
am0o0
9b4ea8877b Merge branch 'am0o0-python-codeExec' of https://github.com/amammad/codeql into am0o0-python-codeExec 2024-05-09 23:14:11 +02: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
Joe Farebrother
da93a08639 Add change notes
No change note is needed for Swift, as the new heuristics are unused and thus should not affect any queries.
2024-05-09 10:03:20 +01:00
Joe Farebrother
f1ab3f40f3 Add unit tests 2024-05-09 09:47:44 +01:00
Joe Farebrother
9aff22c664 Fix typos in sensitive data regex 2024-05-09 09:39:03 +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
Sylwia Budzynska
944f8842b7 Change getASuccessor() to getASubscript() 2024-05-08 14:44:06 +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
Sylwia Budzynska
8bb4193704 Put GradioInterface models into GradioInput 2024-05-08 14:36:42 +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
Sylwia Budzynska
eaba798e34 Apply suggestions from code review
Co-authored-by: yoff <lerchedahl@gmail.com>
2024-05-08 14:26:34 +02: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
Joe Farebrother
23fbfcee27 Exclude new private heuristics from swift sensitive credential 2024-05-08 10:02:00 +01:00
Joe Farebrother
5f4bc4197b Add private category to sensitive data heuristics 2024-05-08 10:02:00 +01: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
e546560d7c Kotlin: restore kotlin-compiler-embeddable-1.7.0.jar to the maven central version 2024-05-06 17:37:16 +02:00
Paolo Tranquilli
514e24ce62 Kotlin: bring back lazy LFS dependencies
This reverts commit d7ecaae245.

Problems with lazy LFS rules were solved by
https://github.com/github/codeql/pull/16393 and
https://github.com/github/codeql/pull/16434.
2024-05-06 17:31:50 +02:00
Paolo Tranquilli
239b6d8c8e Merge branch 'main' into redsun82/kotlin 2024-05-06 17:24:53 +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
am0o0
4a2ab49efb better structure for pandas DataFrame, it is now much better readable and also we can find much more DataFrame objects 2024-05-06 14:36:10 +02:00
am0o0
8b93e815b9 minor test cases change: remove unused dict 2024-05-06 14:36:10 +02:00
amammad
6b9cc1a278 update Twisted document link 2024-05-06 14:36:10 +02:00
amammad
c4a38d0a2f add twisted SSH client as secondary server command injection sinks, add proper test cases 2024-05-06 14:36:10 +02:00
amammad
0a765cc94a add jsonpickle and pexpect libs in case of unsafe decoding and secondary command execution, add proper test cases 2024-05-06 14:36:10 +02:00
amammad
7e93102097 finalize Secondary server command injection queries and tests. 2024-05-06 14:36:10 +02:00
amammad
ead247469d add ssh client libraries, add SecondaryServerCmdInjectionCustomizations 2024-05-06 14:36:10 +02:00
amammad
4df73f9975 continue to convert paramiko query to a more general query,
the proxy command is not a secondary command execution
so we can add proxy command to SystemCommandExecution::Range, update QLDocs,
add a proper Paramiko test case
fix a typo
2024-05-06 14:36:10 +02:00
amammad
5fea71e5d6 convert paramiko query to SecondaryServerCmdInjection query, Add inline tests 2024-05-06 14:36:10 +02:00
amammad
6520e2fdfb update Fabric models, add new sink to Fabric, add proper test cases 2024-05-06 14:36:10 +02:00
amammad
2708e57e4b add pyTorch :) code execution sinks, add proper tests 2024-05-06 14:36:10 +02:00
amammad
cffdc5b452 add panas code execution sinks, add proper tests 2024-05-06 14:36:10 +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
e68165fcb7 Swift: Use entities in reorder directives 2024-05-03 11:18:42 -07:00
Chuan-kai Lin
cbc0261567 Ruby: Use entities in reorder directives 2024-05-03 11:18:15 -07: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
Chuan-kai Lin
ca9567debc C++: Use entities in reorder directives 2024-05-03 11:14:41 -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
Michael Nebel
8b0f3af5b1 Java: Update change-note. 2024-05-02 14:05:44 +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
Michael Nebel
42653b5fec Java: Add change note about local query removal. 2024-05-01 13:07:22 +02:00
Michael Nebel
58bbfe694f Java: Deprecate the content of ExecTaintedLocalQuery as this is unused. 2024-05-01 13:07:21 +02:00
Michael Nebel
d9c7401ea2 Java: Deprecate the local content of UrlRedirectLocalQuery and remove the local query variant. 2024-05-01 13:07:21 +02:00
Michael Nebel
ed7538d0b9 Java: Deprecate the local content of TaintedPathQuery and remove the local query variant. 2024-05-01 13:07:21 +02:00
Michael Nebel
5b89bd23c7 Java: Deprecate the content of SqlTaintedLocalQuery and remove the local query variant. 2024-05-01 13:07:21 +02:00
Michael Nebel
b68abab12a Java: Deprecate the content of ResponseSplittingLocalQuery and remove local query variant. 2024-05-01 13:07:21 +02:00
Michael Nebel
d05c5e3d94 Java: Deprecate the content of NumericCastTaintedLocalQuery, remove the local query variant and update the non-local query variant. 2024-05-01 13:07:21 +02:00
Michael Nebel
301a6cc191 Java: Deprecate the content of ImproperValidationOrArray and remove local query variants. 2024-05-01 13:07:21 +02:00
Michael Nebel
acd0fa4b7b Java: Deprecate the content of ExternallyControlledFormatStringLocalQuery and remove the externally controlled format string local query variant. 2024-05-01 13:07:21 +02:00
Michael Nebel
85a4dd0325 Java: Deprecate the local content of CommandLineQuery and remove the exec tainted local query variant. 2024-05-01 13:07:20 +02: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
Michael Nebel
072f19008a Java: Deprecate the content of ArithmeticTaintedLocalQuery and remove the arithmetic tainted local query variant. 2024-05-01 08:59:51 +02:00
Michael Nebel
93988e5834 Java: Deprecate the content of XxeLocalQuery and remove the Xxe local query variant. 2024-05-01 08:59:50 +02:00
Michael Nebel
e0c2a43780 Java: Deprecate the content of XssLocalQuery and remove the Xss local query variant. 2024-05-01 08:59:50 +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
Paolo Tranquilli
52a015fb11 Bazel: remove further unneeded files 2024-04-30 09:07:11 +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
Paolo Tranquilli
d4e0a5629d Kotlin: update wrapper location 2024-04-29 17:33:40 +02:00
Paolo Tranquilli
b83417301f Merge branch 'main' into redsun82/kotlin 2024-04-29 17:26:59 +02:00
Paolo Tranquilli
450f6518e2 Bazel: remove generic lazy lfs files 2024-04-29 17:26:48 +02:00
Paolo Tranquilli
d7ecaae245 Kotlin: back off from lazy LFS rules
Those have shown to cause problems with too many concurrent downloads.

This changes kotlinc dependencies fetching to:
* use `resource/kotlinc-dependencies` if available (which is the case
  for the internal repo)
* otherwise, download them from maven.

This means sha256 hashes need to be written down for bazel.
2024-04-29 17:26:25 +02: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
Rasmus Lerchedahl Petersen
862942f3d8 python: extra test
suggested by @RasmusWL
2024-04-26 14:19:10 +02:00
Rasmus Lerchedahl Petersen
adc82b553b Python: more realistic summaries 2024-04-26 14:19:10 +02:00
Rasmus Lerchedahl Petersen
c2252e12ac python: sync files 2024-04-26 14:19:09 +02:00
Rasmus Lerchedahl Petersen
bab6ecf3bb Python: test the MaD path for constructor calls 2024-04-26 14:19:09 +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
Paolo Tranquilli
a841a2b0a2 Merge branch 'main' into redsun82/kotlin 2024-04-26 10:38:28 +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
8e1d77bcb2 Bazel: format file 2024-04-25 11:05:57 +02:00
Paolo Tranquilli
1e622e168c Merge branch 'main' into redsun82/kotlin 2024-04-25 11:05:19 +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
Alex Ford
98a6d0fa26 Ruby: add another SQLi AR conditions test case 2024-04-24 14:46:53 +01:00
Alex Ford
6b0e7961fa Ruby: prepare test case whitespace 2024-04-24 14:39:06 +01: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
Paolo Tranquilli
a23327c399 Merge branch 'main' into HEAD 2024-04-24 13:39:44 +02:00
Paolo Tranquilli
4aa0a8ebae Kotlin: make wrapper more robust for windows 2024-04-24 13:39:32 +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
Paolo Tranquilli
c014cd84f4 Bazel: fix kotlin wrapper version dependency 2024-04-23 15:15:38 +02:00
Paolo Tranquilli
5b143cee96 Kotlin: make wrapper install quietly unless --select is explicit
This allows `kotlinc -version` to always produce something parseable.
2024-04-23 15:15:38 +02:00
Paolo Tranquilli
072e2edd34 Merge branch 'main' into redsun82/kotlin 2024-04-23 14:29:33 +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
Paolo Tranquilli
aaa29d8982 Remove unneeded slash in kotlinc.bat 2024-04-22 18:13:55 +02:00
Joe Farebrother
f85ee38e04 Add instance taint steps for requests 2024-04-22 16:03:39 +01:00
Paolo Tranquilli
f685843a52 Merge branch 'main' into redsun82/kotlin 2024-04-22 16:47:56 +02: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
Paolo Tranquilli
7952f0e237 Merge branch 'main' into redsun82/kotlin 2024-04-22 08:30:22 +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
Paolo Tranquilli
3678e51f0b Merge branch 'main' into redsun82/kotlin 2024-04-17 15:09:27 +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
Paolo Tranquilli
c5f6c65ff1 Merge branch 'main' into redsun82/kotlin 2024-04-16 18:23:33 +02: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
Paolo Tranquilli
a7411700ef Merge branch 'main' into redsun82/kotlin 2024-04-16 16:13:31 +02: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
Paolo Tranquilli
306f0f172d Kotlin: accept --select default in kotlinc wrapper to select the default version 2024-04-16 13:55:20 +02:00
Paolo Tranquilli
27ab4875fd Kotlin: simplify kotlinc wrapper 2024-04-16 13:37:06 +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
Paolo Tranquilli
aee3c0d249 Add license and notice information to patched registry 2024-04-16 12:33:00 +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
Paolo Tranquilli
735b3410aa Merge branch 'main' into redsun82/kotlin 2024-04-16 11:49:21 +02: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
Geoffrey White
fc7fef3dd8 Swift: Add dataflow tests for dictionaries. 2024-04-15 18:50:41 +01:00
github-actions[bot]
9bfe4ea90a Release preparation for version 2.17.1 2024-04-15 17:34:47 +00:00
Geoffrey White
0c88d05a65 Swift: QLDoc BuiltinLiteralExpr subclasses and add BuiltinLiteral.getValueString. 2024-04-15 18:23:32 +01: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
Paolo Tranquilli
8c705adbe9 Kotlin/Bazel: fix java release to 8 for java code 2024-04-15 15:38:06 +02:00
Paolo Tranquilli
bd631c5e00 Merge branch 'main' into redsun82/kotlin 2024-04-15 15:37:33 +02: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
Paolo Tranquilli
5bb2cba66c Merge branch 'main' into redsun82/kotlin 2024-04-15 14:08:13 +02:00
Paolo Tranquilli
6a83bf9de5 Merge pull request #16208 from github/redsun82/kotlin-wrapper
Kotlin/Bazel: provide wrapper for managing versions of `kotlinc`
2024-04-15 13:33:10 +02:00
Paolo Tranquilli
1b5675eb21 Kotlin/Bazel: tweak wrapper 2024-04-15 13:31:29 +02:00
Paolo Tranquilli
e53ef4acd2 Kotlin/Bazel: fix wrapper on Windows 2024-04-15 13:13:31 +02: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
Paolo Tranquilli
b07fa70133 Kotlin/Bazel: provide wrapper for managing versions of kotlinc
By adding `java/kotlinc-extractor/deps/dev` to `PATH`, one gets a
`kotlinc` wrapper that takes care of downloading and extracting the
desired version of `kotlinc` on demand. The desired version can be
selected with `kotlinc --select x.y.z`, or left to the current default
of `1.9.0`.

Moreover, this default version is integrated with the Bazel build, so
that when using this wrapper, changes in the selected version will be
picked up to define the default single version kotlin extractor build,
without needing to do anything else (like `bazel fetch --force` or
similar).

Selected and installed version data is stored in `.gitignore`d files
in the same directory, and can be cleared with `kotlinc --clear`.
2024-04-15 10:48:57 +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
Paolo Tranquilli
9d1901c049 Merge branch 'main' into redsun82/kotlin 2024-04-15 08:27:34 +02:00
Paolo Tranquilli
bdc8a7f59d Revert "Use fetchexclude=* in .lfsconfig rather than fetchinclude"
This reverts commit a834101d7e.

Using `fetchinclude` allows for easier local customization of what to
fetch, because fetchexlude has precedence over fetchinclude.
2024-04-15 08:26:19 +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
Alex Ford
91bca4a2c3 Ruby: limit ActiveRecord conditions sink to first array element 2024-04-12 15:32:16 +01:00
Alex Ford
2950890180 Ruby: add more ActiveRecord conditions arg test cases 2024-04-12 15:31:28 +01:00
Alex Ford
f98479dca3 Ruby: prepare test case whitespace 2024-04-12 15:30:42 +01:00
Paolo Tranquilli
b36cabb396 Anchor .gitattributes entries at root where it makes sense 2024-04-12 16:04:15 +02:00
Paolo Tranquilli
92a5f3da75 Merge branch 'main' into redsun82/kotlin 2024-04-12 16:02:39 +02: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
Paolo Tranquilli
a78124b2d5 Bazel/Kotlin: use a wrapper to get the current kotlin version 2024-04-12 14:47:21 +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
Paolo Tranquilli
5c2d9fe9a1 Merge branch 'main' into redsun82/kotlin 2024-04-12 14:01:04 +02:00
Paolo Tranquilli
24c7ad5d28 Bazel/Kotlin: use plain kotlinc instead of result of repository_ctx.which 2024-04-12 14:00:46 +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
Paolo Tranquilli
0ad8ed3822 Kotlin/Bazel: use kotlinc.bat instead of kotlinc.exe on Windows 2024-04-12 12:15:26 +02:00
Paolo Tranquilli
65df2bb16d Bazel/Kotlin: add .exe to kotlinc on windows 2024-04-12 11:56:33 +02:00
Paolo Tranquilli
b8010f27e7 Merge branch 'main' into redsun82/kotlin 2024-04-12 11:56:16 +02: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
Paolo Tranquilli
9114131128 Bazel: add settings required by internal repo 2024-04-12 11:19:43 +02:00
Paolo Tranquilli
2d16192bab CI: fix typo in kotlin-build.yml 2024-04-12 11:19:43 +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
Paolo Tranquilli
9c3a615794 CI: add non-blocking kotlin extractor build check
This is to check that the build from `codeql` works. The "official"
build will still be checked from the internal repo with QLucie, once
we integrate the bazel build there.
2024-04-12 10:59:17 +02:00
Paolo Tranquilli
bc89742979 Kotlin: fix space indentation in OdasaOutput.java 2024-04-12 10:50:02 +02:00
Paolo Tranquilli
c64d02d6df Undo .gitattributes formatting, move LFS entry 2024-04-12 10:44:18 +02:00
Paolo Tranquilli
a834101d7e Use fetchexclude=* in .lfsconfig rather than fetchinclude 2024-04-12 10:41:46 +02:00
Paolo Tranquilli
4822de3313 Kotlin/Bazel: add fail printouts to _default_version 2024-04-12 10:19:10 +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
Paolo Tranquilli
b8c063ed2a Merge branch 'main' into redsun82/kotlin 2024-04-12 08:19:14 +02:00
Paolo Tranquilli
fc62ed5af0 Kotlin/Bazel: port custom_plugin test to use bazel 2024-04-12 08:18:53 +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
Paolo Tranquilli
3d1465439a Bazel/Kotlin: tentatively fix version detection on Windows 2024-04-11 17:39:09 +02:00
Paolo Tranquilli
59fdbdbb20 Kotlin/Bazel: move defaults to separate bazel package
This makes calling specific targets in `java/kotlin-extractor` not
depend on `@kotlin_extractor_defaults`, avoiding its overhead.
2024-04-11 17:31:37 +02:00
Paolo Tranquilli
7f495b1851 Bazel/kotlin: make version detection more robust 2024-04-11 17:17:57 +02:00
Paolo Tranquilli
c18b556f3d Kotlin/Bazel: remove 2.0.255-SNAPSHOT version 2024-04-11 16:50:09 +02: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
Paolo Tranquilli
3b75d63c18 Merge branch 'main' into redsun82/kotlin 2024-04-11 16:40:57 +02:00
Paolo Tranquilli
54156650d7 Bazel/Kotlin: make _embeddable_source more robust 2024-04-11 16:40:37 +02:00
Paolo Tranquilli
f0fc8110a0 Bazel/Kotlin: add 2.0.0-RC1, remove 2.0.0-Beta4 2024-04-11 16:39:23 +02: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
Paolo Tranquilli
02257eead0 Bazel: use triple slash in --registry
`file://%workspace%` works on POSIX systems, but not on Windows.
`file:///` works on both.
2024-04-11 16:28:49 +02: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
Paolo Tranquilli
fe35902222 Merge branch 'main' into redsun82/kotlin 2024-04-11 15:07:39 +02: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
Paolo Tranquilli
24ef424d04 Merge branch 'main' into redsun82/kotlin 2024-04-10 16:57:30 +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
Paolo Tranquilli
5df1abcd26 Bazel/Kotlin: use "all" for extension metadata direct dependencies 2024-04-10 15:41:27 +02:00
Paolo Tranquilli
1a7f25af35 Merge pull request #16167 from github/redsun82/kotlin-patched-registry
Bazel: move patching of `rules_kotlin` to a registry override
2024-04-10 15:30:40 +02:00
Paolo Tranquilli
35a2ed87b6 Bazel/Kotlin: patch jdep emission 2024-04-10 15:29:44 +02: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
Paolo Tranquilli
a15681a181 Bazel: ease update of local registry 2024-04-10 13:22:18 +02:00
Paolo Tranquilli
5bdd724221 Bazel: move patching of rules_kotlin to a registry override 2024-04-10 13:22:18 +02: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
Paolo Tranquilli
c9565b3657 Bazel/Kotlin: fix version comparison logic, add default version printing 2024-04-10 11:29:58 +02:00
Joe Farebrother
976ca48317 Review suggestions - rename sink class and add barrier out 2024-04-10 10:17:19 +01:00
Paolo Tranquilli
aca8d047ca Bazel: fix .bazelrc 2024-04-10 10:24:15 +02:00
Paolo Tranquilli
3bdab70451 Bazel: rename exported.bazelrc to .bazelrc.exported
This makes the `.bazelrc` files be near each other in the directory
listing.
2024-04-10 10:18:10 +02: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
Paolo Tranquilli
e7c680e963 Kotlin: reuse generated dbscheme in embeddable, and tweak comments 2024-04-09 16:33:17 +02: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
Paolo Tranquilli
662fd5c04a Add explanatory comment to .lfsconfig 2024-04-09 15:48:23 +02:00
Paolo Tranquilli
9c73a9a1db Bazel: move shared bazelrc settings to a exported.bazelrc file
This will be `importe`d by the `semmle-code` `.bazelrc` file.
2024-04-09 15:48:23 +02: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
Paolo Tranquilli
4b205ff96d Apply suggestions from code review
Co-authored-by: Cornelius Riemenschneider <cornelius@github.com>
2024-04-09 14:44:44 +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
Paolo Tranquilli
11729aaf6e Kotlin: add licensing links about kotlin dependencies 2024-04-09 13:55:30 +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
4a4bd16eab Java/Kotlin: prepare for internal bazel packaging 2024-04-09 13:27:27 +02: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
Sylwia Budzynska
5d946586b8 Add tests 2024-04-08 15:39:54 +02:00
Paolo Tranquilli
b71ffc658b Bazel: properly fix lfs smudge script 2024-04-08 15:22:54 +02:00
Paolo Tranquilli
60febcdf1e Revert "Bazel: fix lfs to do checkout rather than smudging"
This reverts commit fd77f1a7cb.
2024-04-08 14:54:15 +02: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
Paolo Tranquilli
a970c2d11c Kotlin: move empty zip from git to internal bazel repo rule 2024-04-08 14:37:53 +02: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
Paolo Tranquilli
e963b84a5a Kotlin: fix error in building extractor from internal repo 2024-04-08 14:03:15 +02: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
Paolo Tranquilli
fd77f1a7cb Bazel: fix lfs to do checkout rather than smudging
On Windows `git lfs smudge` was not working as expected.
2024-04-08 10:57:24 +02: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
Paolo Tranquilli
38a7bc0580 Bazel: optimize LFS to use symlinks when the file is not an LFS pointer 2024-04-08 09:26:19 +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
Sylwia Budzynska
112992585a Add change note 2024-04-05 14:56:06 +02:00
Sylwia Budzynska
84d69566c9 Fix decorator QLdoc 2024-04-05 14:51:30 +02:00
Sylwia Budzynska
ca7789d73c Fix QLdoc 2024-04-05 14:40:17 +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
Sylwia Budzynska
bed0d5678d Add Gradio models 2024-04-05 14:14:21 +02: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
Paolo Tranquilli
7aefd22e34 Kotlin: tweak BUILD.bazel file, add documentation 2024-04-04 17:32:23 +02:00
Paolo Tranquilli
44f3c0289a Kotlin: revert accidental modification of kotlin_plugin_versions.py 2024-04-04 17:31:40 +02: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
Paolo Tranquilli
cbdb1ebb5a Merge branch 'main' into redsun82/kotlin 2024-04-04 16:56:07 +02: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
Paolo Tranquilli
3a0a219ce7 Kotlin: remove obsolete 1.4.32 version 2024-04-04 15:49:37 +02: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
Paolo Tranquilli
5d6baea174 Kotlin: add aliases for default versions 2024-04-04 15:34:48 +02: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
Paolo Tranquilli
55ff7109fa Kotlin: support embeddable build in bazel 2024-04-04 12:53:14 +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
Paolo Tranquilli
5313288b8e LFS: do non-matching fetchinclude rather than explicit fetchexclude 2024-04-04 11:02:29 +02: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
Paolo Tranquilli
47ff1c1ee6 Kotlin: working standalone extractor built with bazel 2024-04-04 10:23:26 +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
Paolo Tranquilli
c242466d31 Kotlin: first support for Kotlin extractor build 2024-04-03 16:30:57 +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
Paolo Tranquilli
341816c280 Kotlin: add dependencies as lazy LFS files 2024-04-03 08:35:34 +02:00
Paolo Tranquilli
0da4130bb9 Bazel: add LFS rules 2024-04-03 08:35:19 +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
erik-krogh
572d3ba542 fix language specifier typo in qhelp for rb/multi-char-san 2024-04-02 19:40:46 +02: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
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
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
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
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
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
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
Geoffrey White
a55f07ac68 C++: QLDoc FlowSummaryNode. 2024-03-28 10:17:39 +00: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
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
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
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
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
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
Geoffrey White
8fbbc2b6d8 C++: Improve QLDoc. 2024-03-26 11:21:25 +00: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
Geoffrey White
ce52cbb428 C++: Disambiguate *n1..n2 doc. 2024-03-25 18:22:28 +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
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
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
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
Tamas Vajk
78912d5eea C#: Reword public mentions of C# buildless 2024-03-25 14:33:51 +01:00
Geoffrey White
88ea9197d9 C++: Add more tests for uncommon cases. 2024-03-25 11:40:15 +00: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
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
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
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
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
Joe Farebrother
592acb94d2 Add missing .s to qldoc 2024-03-22 15:28:34 +00:00
Joe Farebrother
a6ee19ca2d Fix query id 2024-03-22 14:36:47 +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
Tom Hvitved
9d124197e8 C#: Remove support for legacy LGTM options in autobuilder 2024-03-22 10:09:24 +01: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
erik-krogh
db3bf0e482 use the sanitizers from ReflectedXSS in unsafe-html-construction 2024-03-20 10:11:07 +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
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
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
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
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
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
Geoffrey White
92d57ab504 C++: Correct some existing cases that are in fact indirect. 2024-03-13 15:26:21 +00:00
Geoffrey White
9aad43f649 C++: Add indirect test models. 2024-03-13 11:34:36 +00:00
Harry Maclean
806f42ef72 Ruby: Update change note 2024-03-13 09:54:17 +00:00
intrigus-lgtm
f70a39e72f [cpp-docs] Fix 404 link in guards library doc. 2024-03-12 19:59:26 +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
Geoffrey White
900c8b71d8 C++: Complete the SummaryCall class. 2024-03-12 14:23:00 +00:00
Geoffrey White
a27949cffa C++: Set certain = true in storeStepImpl. 2024-03-12 14:08:20 +00:00
Owen Mansel-Chan
33c17313b4 Add test for not extracting values for intermediate string concatenations 2024-03-12 11:59:10 +00: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
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
Geoffrey White
026a13b4db C++: Change Node/Node0.getEnclosingCallable back to returning Declaration. 2024-03-11 12:22:55 +00: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
Geoffrey White
4bc272da73 C++: Doc correction and TODOs for interpretOutput, interpretInput. 2024-03-11 10:16:46 +00:00
Geoffrey White
e8d0f1fa3e C++: Comments. 2024-03-08 18:25:01 +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
8c0f02ac4b C++: Add summary jumpStep, readStep, storeStep. 2024-03-06 14:51:48 +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
Harry Maclean
87f3b43576 Ruby: remove deprecated private class 2024-03-05 08:28:16 +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
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
Mathias Vorreiter Pedersen
2fd57f6ee7 Shared: Remove cached annotation. 2024-02-28 16:24:21 +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
am0o0
b20b733172 better structure for pandas DataFrame, it is now much better readable and also we can find much more DataFrame objects 2024-02-27 09:38:43 +04: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
Harry Maclean
dd092fd18f Ruby: Fix CSRF test 2024-02-26 11:02:54 +00:00
am0o0
a636c47c84 minor test cases change: remove unused dict 2024-02-25 23:57:58 +04:00
amammad
4321c5c2da update Twisted document link 2024-02-25 17:53:19 +04:00
amammad
7dd1389b9e add twisted SSH client as secondary server command injection sinks, add proper test cases 2024-02-25 17:52:24 +04:00
amammad
ab219902a9 add jsonpickle and pexpect libs in case of unsafe decoding and secondary command execution, add proper test cases 2024-02-25 17:15:35 +04:00
amammad
3e6b4a161b finalize Secondary server command injection queries and tests. 2024-02-25 14:24:42 +04:00
amammad
95c9a3fc9a add ssh client libraries, add SecondaryServerCmdInjectionCustomizations 2024-02-25 12:50:12 +04:00
amammad
385c3ba7ff continue to convert paramiko query to a more general query,
the proxy command is not a secondary command execution
so we can add proxy command to SystemCommandExecution::Range, update QLDocs,
add a proper Paramiko test case
fix a typo
2024-02-25 01:18:34 +04:00
amammad
70282f9ebe convert paramiko query to SecondaryServerCmdInjection query, Add inline tests 2024-02-24 18:10:13 +04:00
amammad
d234a53c50 update Fabric models, add new sink to Fabric, add proper test cases 2024-02-24 17:43:51 +04:00
amammad
076faa3a4e add pyTorch :) code execution sinks, add proper tests 2024-02-24 15:55:33 +04:00
amammad
3d7db0e46b add panas code execution sinks, add proper tests 2024-02-24 14:44:06 +04:00
Harry Maclean
f5be407989 Ruby: deprecate old ProtectFromForgeryCall class 2024-02-23 12:02:26 +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
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
Geoffrey White
6e13b877bb C++: Add FlowSummaryNode and test it. 2024-02-16 18:06:57 +00:00
Geoffrey White
e187a4a7d6 C++: Add flow summaries to simpleLocalFlowStep. 2024-02-16 12:31:17 +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
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
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
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
Geoffrey White
7514037464 C++: Add test cases for MAD sources, sinks and summaries in namespaces. 2024-02-06 12:12:28 +00: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
GitHub Security Lab
df10a7e7f0 Merge branch 'main' into amammad-js-bombs 2024-01-25 11:23:38 +01: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
Chad Bentz
b12f4d97f8 Merge branch 'main' into patch-1 2024-01-17 09:25:28 -05:00
Chad Bentz
ee3085e15e Update generate-code-scanning-query-list.py 2023-12-14 14:09:14 -05:00
amammad
102f09aa23 extend tests 2023-12-10 20:33:00 +01:00
amammad
18d0b28024 v1 2023-12-10 20:27:21 +01:00
amammad
1547cd0546 added inline tests, move to experimental dir 2023-12-05 18:59:46 +01:00
amammad
2c4d2d3069 Merge branch 'main' into amammad-js-CodeInjection_execa 2023-12-05 18:38:09 +01:00
amammad
67fb802f29 fix conflict 2023-12-05 18:37:50 +01:00
amammad
48a9b107b9 add query to detect strapi CVe too 2023-11-24 10:47:17 +01:00
amammad
2097a001b9 apply code review suggestions, fix qldoc, add experimental additional taint steps that can improve performance 2023-11-22 10:01:51 +01:00
amammad
5cc4206e00 add a temporary Query file to demonstrate unsuccessful usage of two DataFlow configs 2023-11-22 08:30:59 +01:00
amammad
0652afced3 update tests, updated qldoc and examples, upgrade all libraries to path-problem, update jsonwebtoken source and sinks 2023-11-07 08:25:25 +01:00
amammad
a9c8bc082f delete CWE-321 2023-11-02 16:27:31 +01:00
amammad
faa483a282 move to CWE-347, update comments of tests 2023-11-02 16:24:58 +01:00
amammad
9da815a5c0 move to new CWE-321 directory, make saparate query files for each JWT pkg, create a path query for jsonwebtoken package which is not work correctly 2023-11-02 14:13:52 +01:00
Chad Bentz
53e96e5adf Merge branch 'main' into patch-1 2023-10-25 10:00:16 -04:00
amammad
ee4d87bd96 remove hardcoded JWT secret-key query 2023-10-19 11:57:53 +02:00
amammad
2e4e5ef480 fix a comment 2023-10-17 10:42:40 +02:00
amammad
7891e64d3e add sanitizers to hardcoded query 2023-10-17 10:37:27 +02:00
amammad
3899f2cdf3 upgrade execa scripts 2023-10-12 10:44:57 +02:00
amammad
261cabde67 better comments 2023-10-11 17:44:12 +02:00
amammad
b24c6fd579 for demonstration 2023-10-11 17:34:33 +02:00
amammad
de2ee4d289 stash I can't especify the argument and command differences with new API 2023-10-11 14:36:56 +02:00
amammad
4cd3618dcd Merge branch 'main' into amammad-js-CodeInjection_execa 2023-10-11 13:27:26 +02:00
amammad
8768eb64e6 Merge branch 'amammad-ruby-bombs' of https://github.com/amammad/codeql into amammad-ruby-bombs 2023-10-11 12:40:03 +02:00
amammad
609bb762fe fix a bug,modularize 2023-10-11 12:04:11 +02:00
amammad
90017712a6 Merge remote-tracking branch 'origin/main' into amammad-ruby-bombs 2023-10-11 10:45:16 +02:00
amammad
32859eb057 move to experimental 2023-10-10 22:46:44 +02:00
amammad
4198f61c16 fix a qldoc isuse 2023-10-10 22:21:43 +02:00
amammad
6f73e9c3ba revert for in additional steps 2023-10-10 22:12:37 +02:00
amammad
9053ceb3b7 revert a unexpected test file 2023-10-10 21:37:59 +02:00
amammad
e13050b64e revert a unexpected test file 2023-10-10 21:35:52 +02:00
amammad
3f41a42c38 remove unused classes 2023-10-08 11:08:05 +02:00
amammad
15671682c5 remove unused flowLable, update path query alert message 2023-10-08 11:06:13 +02:00
amammad
00b6e1f0b0 fix tests 2023-10-08 11:03:19 +02:00
amammad
41e7b91d78 fix flowLabels 2023-10-08 11:00:07 +02:00
amammad
6789273ab1 remove a test predicate 2023-10-07 12:05:44 +02:00
amammad
aff6f00450 comments improvement,separate module file, fix tests 2023-10-07 12:02:39 +02:00
amammad
5a49f6bb9b fix tests 2023-10-06 22:10:57 +02:00
amammad
f5efddc011 comments improvement 2023-10-06 21:12:59 +02:00
amammad
e45268cd4d improve and fix bugs and add Form Flow Sources test files 2023-10-06 21:01:42 +02:00
amammad
5bc21a6178 delete old tests 2023-10-06 16:09:05 +02:00
amammad
7d961e1af2 do review improvements 2023-10-06 16:07:10 +02:00
amammad
eef8137166 add Dice package, add global taint steps by SharedTaintStep, use getASuccessor 2023-10-06 10:58:26 +02:00
amammad
faaddd4dfe updates for FormParsers and ReadableStream modules, add separate module for Readable Streams, BusBoy RemoteFlowSources is covering more sources now!, modularize 2023-10-05 21:46:58 +02:00
amammad
e81a4fc330 remove CLI sources Library file and local sources for lower FPs 2023-10-01 05:44:13 +10:00
amammad
f41bc1f631 revert nodeJSLib 2023-09-28 20:37:21 +10:00
amammad
75f0fc4a98 fix a mistake 2023-09-28 20:34:58 +10:00
amammad
921198ed30 add separate query for sinks that accepts data: URL 2023-09-28 20:33:38 +10:00
amammad
f6737b3d90 fix FP 2023-09-25 21:09:19 +10:00
amammad
2c74dc23c9 add second order command execution sinks to tests 2023-09-22 20:00:36 +10:00
amammad
344869f0d7 change commandExecution sink to CodeInjection sink 2023-09-22 19:37:17 +10:00
amammad
a20ca78599 V1 2023-09-22 19:23:34 +10:00
amammad
f1a7f0a7e8 V1 2023-09-22 19:21:41 +10:00
amammad
06114d91d8 V1 2023-09-22 19:19:52 +10:00
amammad
d44c9d3e74 stash 2023-09-08 05:51:21 +10:00
amammad
905fa10c88 Merge branch 'github:main' into amammad-ruby-bombs 2023-09-07 20:41:45 +10:00
amammad
4191b07b1f Merge branch 'github:main' into amammad-ruby-bombs 2023-09-06 20:17:49 +10:00
amammad
77dcd68a86 v2 2023-08-31 21:26:25 +10:00
amammad
7a577ddd98 change Source to ConstantString, it seems that we have some duplicate results now, ConstantString is suggested as a better alternative for finding constant sources 2023-08-30 20:47:43 +10:00
amammad
d06444e639 upgrade additional steps 2023-08-30 05:03:19 +10:00
amammad
369bc50709 fix comments 2023-08-30 04:53:58 +10:00
amammad
3f64cc82eb fix qhelps 2023-08-29 22:42:21 +10:00
amammad
4f04dc8f6e add test cases 2023-08-29 21:34:02 +10:00
amammad
65b97745c2 V1 2023-08-29 21:23:02 +10:00
Chad Bentz
6f60eb9e1a Merge branch 'main' into patch-1 2023-08-09 14:31:26 -04:00
Chad Bentz
845f384df6 Merge branch 'main' into patch-1 2023-08-04 17:57:53 -04:00
amammad
516fdf627a update stream pipe 2023-06-28 00:09:39 +10:00
amammad
c7a7594821 merge all ql files into one 2023-06-27 01:56:23 +10:00
amammad
37af588492 update CVE instance in qhelp 2023-06-26 21:16:16 +10:00
amammad
9540c58c4a make one ql file 2023-06-26 20:55:11 +10:00
amammad
8a80a734d8 fix an accident :) 2023-06-26 20:20:00 +10:00
amammad
9e33b47cbd added more additional steps 2023-06-26 17:46:22 +10:00
amammad
e2fe0e11f0 fix formatting error/warnings 2023-06-26 17:14:46 +10:00
amammad
3bd45a8536 fix query identifier 2023-06-26 03:01:19 +10:00
amammad
effb8024a4 fix yargs bug 2023-06-25 23:30:24 +10:00
amammad
c16a2827d7 fix format warnings/errors 2023-06-25 23:24:12 +10:00
amammad
796075f9dc V1 Bombs 2023-06-25 00:59:21 +10:00
amammad
307187f6c1 V1 2023-06-23 06:06:37 +10:00
Chad Bentz
39c52c9ecf add security-severity to code scanning query list 2023-03-16 11:27:23 -04:00
4641 changed files with 171877 additions and 360444 deletions

View File

@@ -10,8 +10,19 @@ common --override_module=semmle_code=%workspace%/misc/bazel/semmle_code_stub
build --repo_env=CC=clang --repo_env=CXX=clang++
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
# we use transitions that break builds of `...`, so for `test` to work with that we need the following
test --build_tests_only
# this requires developer mode, but is required to have pack installer functioning
startup --windows_enable_symlinks
common --enable_runfiles
# with the above, we can avoid building python zips which is the default on windows as that's expensive
build --nobuild_python_zip
common --registry=file:///%workspace%/misc/bazel/registry
common --registry=https://bcr.bazel.build
common --@rules_dotnet//dotnet/settings:strict_deps=false
try-import %workspace%/local.bazelrc

10
.bazelrc.internal Normal file
View File

@@ -0,0 +1,10 @@
# 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
# See bazelbuild/rules_dotnet#413: strict_deps in C# also appliy to 3rd-party deps, and when we pull
# in (for example) the xunit package, there's no code in this at all, it just depends transitively on
# its implementation packages without providing any code itself.
# We either can depend on internal implementation details, or turn of strict deps.
common --@rules_dotnet//dotnet/settings:strict_deps=false

View File

@@ -1 +1 @@
7.1.0
7.2.1

39
.gitattributes vendored
View File

@@ -50,31 +50,40 @@
*.dll -text
*.pdb -text
java/ql/test/stubs/**/*.java linguist-generated=true
java/ql/test/experimental/stubs/**/*.java linguist-generated=true
/java/ql/test/stubs/**/*.java linguist-generated=true
/java/ql/test/experimental/stubs/**/*.java linguist-generated=true
/java/kotlin-extractor/deps/*.jar filter=lfs diff=lfs merge=lfs -text
# Force git not to modify line endings for go or html files under the go/ql directory
go/ql/**/*.go -text
go/ql/**/*.html -text
/go/ql/**/*.go -text
/go/ql/**/*.html -text
# Force git not to modify line endings for go dbschemes
go/*.dbscheme -text
/go/*.dbscheme -text
# Preserve unusual line ending from codeql-go merge
go/extractor/opencsv/CSVReader.java -text
/go/extractor/opencsv/CSVReader.java -text
# For some languages, upgrade script testing references really old dbscheme
# files from legacy upgrades that have CRLF line endings. Since upgrade
# resolution relies on object hashes, we must suppress line ending conversion
# 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
/*/ql/lib/upgrades/initial/*.dbscheme -text
# Auto-generated modeling for Python
python/ql/lib/semmle/python/frameworks/data/internal/subclass-capture/*.yml linguist-generated=true
/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
/ruby/extractor/cargo-bazel-lock.json linguist-generated=true
/ruby/extractor/cargo-bazel-lock.json -merge
# auto-generated files for the C# build
/csharp/paket.lock linguist-generated=true
# needs eol=crlf, as `paket` touches this file and saves it as crlf
/csharp/.paket/Paket.Restore.targets linguist-generated=true eol=crlf
/csharp/paket.main.bzl linguist-generated=true
/csharp/paket.main_extension.bzl linguist-generated=true
# ripunzip tool
/misc/ripunzip/ripunzip-* filter=lfs diff=lfs merge=lfs -text
# swift prebuilt resources
/swift/third_party/resource-dir/*.zip filter=lfs diff=lfs merge=lfs -text

5
.github/labeler.yml vendored
View File

@@ -15,7 +15,7 @@ Java:
- change-notes/**/*java.*
JS:
- any: [ 'javascript/**/*', '!javascript/ql/experimental/adaptivethreatmodeling/**/*' ]
- any: [ 'javascript/**/*' ]
- change-notes/**/*javascript*
Kotlin:
@@ -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/**/*

74
.github/workflows/build-ripunzip.yml vendored Normal file
View File

@@ -0,0 +1,74 @@
name: Build runzip
on:
workflow_dispatch:
inputs:
ripunzip-version:
description: "what reference to checktout from google/runzip"
required: false
default: v1.2.1
openssl-version:
description: "what reference to checkout from openssl/openssl for Linux"
required: false
default: openssl-3.3.0
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-12, windows-2019]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
repository: google/ripunzip
ref: ${{ inputs.ripunzip-version }}
# we need to avoid ripunzip dynamically linking into libssl
# see https://github.com/sfackler/rust-openssl/issues/183
- if: runner.os == 'Linux'
name: checkout openssl
uses: actions/checkout@v4
with:
repository: openssl/openssl
path: openssl
ref: ${{ inputs.openssl-version }}
- if: runner.os == 'Linux'
name: build and install openssl with fPIC
shell: bash
working-directory: openssl
run: |
./config -fPIC --prefix=$HOME/.local --openssldir=$HOME/.local/ssl
make -j $(nproc)
make install_sw -j $(nproc)
- if: runner.os == 'Linux'
name: build (linux)
shell: bash
run: |
env OPENSSL_LIB_DIR=$HOME/.local/lib64 OPENSSL_INCLUDE_DIR=$HOME/.local/include OPENSSL_STATIC=yes cargo build --release
mv target/release/ripunzip ripunzip-linux
- if: runner.os == 'Windows'
name: build (windows)
shell: bash
run: |
cargo build --release
mv target/release/ripunzip ripunzip-windows
- name: build (macOS)
if: runner.os == 'macOS'
shell: bash
run: |
rustup target install x86_64-apple-darwin
rustup target install aarch64-apple-darwin
cargo build --target x86_64-apple-darwin --release
cargo build --target aarch64-apple-darwin --release
lipo -create -output ripunzip-macos \
-arch x86_64 target/x86_64-apple-darwin/release/ripunzip \
-arch arm64 target/aarch64-apple-darwin/release/ripunzip
- uses: actions/upload-artifact@v4
with:
name: ripunzip-${{ runner.os }}
path: ripunzip-*
- name: Check built binary
shell: bash
run: |
./ripunzip-* --version

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

@@ -56,7 +56,9 @@ jobs:
# uses a compiled language
- run: |
dotnet build csharp
cd csharp
dotnet tool restore
dotnet build .
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@main

View File

@@ -65,7 +65,7 @@ jobs:
key: csharp-qltest-${{ matrix.slice }}
- name: Run QL tests
run: |
codeql test run --threads=0 --ram 50000 --slice ${{ matrix.slice }} --search-path extractor-pack --check-databases --check-undefined-labels --check-repeated-labels --check-redefined-labels --consistency-queries ql/consistency-queries ql/test --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
codeql test run --threads=0 --ram 50000 --slice ${{ matrix.slice }} --search-path "${{ github.workspace }}" --check-databases --check-undefined-labels --check-repeated-labels --check-redefined-labels --consistency-queries ql/consistency-queries ql/test --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
env:
GITHUB_TOKEN: ${{ github.token }}
unit-tests:
@@ -81,10 +81,11 @@ jobs:
dotnet-version: 8.0.101
- name: Extractor unit tests
run: |
dotnet tool restore
dotnet test -p:RuntimeFrameworkVersion=8.0.1 extractor/Semmle.Util.Tests
dotnet test -p:RuntimeFrameworkVersion=8.0.1 extractor/Semmle.Extraction.Tests
dotnet test -p:RuntimeFrameworkVersion=8.0.1 autobuilder/Semmle.Autobuild.CSharp.Tests
dotnet test -p:RuntimeFrameworkVersion=8.0.1 "${{ github.workspace }}/cpp/autobuilder/Semmle.Autobuild.Cpp.Tests"
dotnet test -p:RuntimeFrameworkVersion=8.0.1 autobuilder/Semmle.Autobuild.Cpp.Tests
shell: bash
stubgentest:
runs-on: ubuntu-latest
@@ -100,6 +101,6 @@ jobs:
# Update existing stubs in the repo with the freshly generated ones
mv "$STUBS_PATH/output/stubs/_frameworks" ql/test/resources/stubs/
git status
codeql test run --threads=0 --search-path extractor-pack --check-databases --check-undefined-labels --check-repeated-labels --check-redefined-labels --consistency-queries ql/consistency-queries -- ql/test/library-tests/dataflow/flowsources/aspremote
codeql test run --threads=0 --search-path "${{ github.workspace }}" --check-databases --check-undefined-labels --check-repeated-labels --check-redefined-labels --consistency-queries ql/consistency-queries -- ql/test/library-tests/dataflow/flowsources/aspremote
env:
GITHUB_TOKEN: ${{ github.token }}

View File

@@ -7,8 +7,9 @@ on:
- .github/workflows/go-tests-other-os.yml
- .github/actions/**
- codeql-workspace.yml
env:
GO_VERSION: '~1.22.0'
- MODULE.bazel
- .bazelrc
- misc/bazel/**
permissions:
contents: read
@@ -18,72 +19,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

@@ -15,9 +15,9 @@ on:
- .github/workflows/go-tests.yml
- .github/actions/**
- codeql-workspace.yml
env:
GO_VERSION: '~1.22.0'
- MODULE.bazel
- .bazelrc
- misc/bazel/**
permissions:
contents: read
@@ -28,51 +28,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

28
.github/workflows/kotlin-build.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: "Kotlin Build"
on:
pull_request:
paths:
- "java/kotlin-extractor/**"
- "misc/bazel/**"
- "misc/codegen/**"
- "*.bazel*"
- .github/workflows/kotlin-build.yml
branches:
- main
- rc/*
- codeql-cli-*
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
bazel query //java/kotlin-extractor/...
# only build the default version as a quick check that we can build from `codeql`
# the full official build will be checked by QLucie
bazel build //java/kotlin-extractor

View File

@@ -49,20 +49,20 @@ jobs:
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-rust-cargo-${{ hashFiles('ql/**/Cargo.lock') }}
- name: Release build
if: steps.cache-extractor.outputs.cache-hit != 'true'
run: cd ql; ./scripts/create-extractor-pack.sh
run: cd ql; ./scripts/create-extractor-pack.sh
env:
GH_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ github.token }}
- name: Cache compilation cache
id: query-cache
uses: ./.github/actions/cache-query-compilation
with:
with:
key: run-ql-for-ql
- name: Make database and analyze
run: |
./ql/target/release/buramu | tee deprecated.blame # Add a blame file for the extractor to parse.
${CODEQL} database create -l=ql --search-path ql/extractor-pack ${DB}
${CODEQL} database create -l=ql ${DB} --search-path "${{ github.workspace }}"
${CODEQL} database analyze -j0 --format=sarif-latest --output=ql-for-ql.sarif ${DB} ql/ql/src/codeql-suites/ql-code-scanning.qls --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
env:
env:
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
DB: ${{ runner.temp }}/DB
LGTM_INDEX_FILTERS: |

View File

@@ -53,8 +53,8 @@ jobs:
- name: Create database
run: |
"${CODEQL}" database create \
--search-path "ql/extractor-pack" \
--threads 4 \
--search-path "${{ github.workspace }}"
--threads 4 \
--language ql --source-root "${{ github.workspace }}/repo" \
"${{ runner.temp }}/database"
env:

View File

@@ -49,15 +49,15 @@ jobs:
- name: Cache compilation cache
id: query-cache
uses: ./.github/actions/cache-query-compilation
with:
with:
key: ql-for-ql-tests
- name: Run QL tests
run: |
"${CODEQL}" test run --check-databases --check-unused-labels --check-repeated-labels --check-redefined-labels --check-use-before-definition --search-path "${{ github.workspace }}/ql/extractor-pack" --consistency-queries ql/ql/consistency-queries --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}" ql/ql/test
"${CODEQL}" test run --check-databases --check-unused-labels --check-repeated-labels --check-redefined-labels --check-use-before-definition --search-path "${{ github.workspace }}" --consistency-queries ql/ql/consistency-queries --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}" ql/ql/test
env:
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
other-os:
other-os:
strategy:
matrix:
os: [macos-latest, windows-latest]
@@ -65,7 +65,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install GNU tar
- name: Install GNU tar
if: runner.os == 'macOS'
run: |
brew install gnu-tar
@@ -100,7 +100,7 @@ jobs:
- name: Run a single QL tests - Unix
if: runner.os != 'Windows'
run: |
"${CODEQL}" test run --check-databases --search-path "${{ github.workspace }}/ql/extractor-pack" ql/ql/test/queries/style/DeadCode/DeadCode.qlref
"${CODEQL}" test run --check-databases --search-path "${{ github.workspace }}" ql/ql/test/queries/style/DeadCode/DeadCode.qlref
env:
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
- name: Run a single QL tests - Windows
@@ -108,5 +108,4 @@ jobs:
shell: pwsh
run: |
$Env:PATH += ";$(dirname ${{ steps.find-codeql.outputs.codeql-path }})"
codeql test run --check-databases --search-path "${{ github.workspace }}/ql/extractor-pack" ql/ql/test/queries/style/DeadCode/DeadCode.qlref
codeql test run --check-databases --search-path "${{ github.workspace }}" ql/ql/test/queries/style/DeadCode/DeadCode.qlref

View File

@@ -7,6 +7,7 @@ on:
- .github/workflows/ruby-build.yml
- .github/actions/fetch-codeql/action.yml
- codeql-workspace.yml
- "shared/tree-sitter-extractor/**"
branches:
- main
- "rc/*"
@@ -16,6 +17,7 @@ on:
- .github/workflows/ruby-build.yml
- .github/actions/fetch-codeql/action.yml
- codeql-workspace.yml
- "shared/tree-sitter-extractor/**"
branches:
- main
- "rc/*"

View File

@@ -44,7 +44,7 @@ jobs:
- name: Create database
run: |
codeql database create \
--search-path "${{ github.workspace }}/ruby/extractor-pack" \
--search-path "${{ github.workspace }}" \
--threads 4 \
--language ruby --source-root "${{ github.workspace }}/repo" \
"${{ runner.temp }}/database"

View File

@@ -64,10 +64,10 @@ jobs:
- name: Cache compilation cache
id: query-cache
uses: ./.github/actions/cache-query-compilation
with:
with:
key: ruby-qltest
- name: Run QL tests
run: |
codeql test run --threads=0 --ram 50000 --search-path "${{ github.workspace }}/ruby/extractor-pack" --check-databases --check-undefined-labels --check-unused-labels --check-repeated-labels --check-redefined-labels --check-use-before-definition --consistency-queries ql/consistency-queries ql/test --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
codeql test run --threads=0 --ram 50000 --search-path "${{ github.workspace }}" --check-databases --check-undefined-labels --check-unused-labels --check-repeated-labels --check-redefined-labels --check-use-before-definition --consistency-queries ql/consistency-queries ql/test --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
env:
GITHUB_TOKEN: ${{ github.token }}

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:
@@ -65,21 +68,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./swift/actions/run-ql-tests
integration-tests-linux:
if: github.repository_owner == 'github'
needs: build-and-test-linux
runs-on: ubuntu-latest-xl
steps:
- uses: actions/checkout@v4
- uses: ./swift/actions/run-integration-tests
integration-tests-macos:
if: ${{ github.repository_owner == 'github' && github.event_name == 'pull_request' }}
needs: build-and-test-macos
runs-on: macos-12-xl
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: ./swift/actions/run-integration-tests
clang-format:
if : ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest

23
.github/workflows/zipmerge-test.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: "Test zipmerge code"
on:
pull_request:
paths:
- "misc/bazel/internal/zipmerge/**"
- "MODULE.bazel"
- ".bazelrc*"
branches:
- main
- "rc/*"
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
bazel test //misc/bazel/internal/zipmerge:test --test_output=all

3
.gitignore vendored
View File

@@ -62,3 +62,6 @@ node_modules/
# Temporary folders for working with generated models
.model-temp
# bazel-built in-tree extractor packs
/*/extractor-pack

7
.lfsconfig Normal file
View File

@@ -0,0 +1,7 @@
[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.
# we go for `fetchinclude` to something not exsiting rather than `fetchexclude = *` because the
# former is easier to override (with `git -c` or a local git config) to fetch something specific
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

@@ -0,0 +1 @@
exports_files(["LICENSE"])

View File

@@ -1,6 +1,7 @@
/cpp/ @github/codeql-c-analysis
/cpp/autobuilder/ @github/codeql-c-extractor
/csharp/ @github/codeql-csharp
/csharp/autobuilder/Semmle.Autobuild.Cpp @github/codeql-c-extractor
/csharp/autobuilder/Semmle.Autobuild.Cpp.Tests @github/codeql-c-extractor
/go/ @github/codeql-go
/java/ @github/codeql-java
/javascript/ @github/codeql-javascript
@@ -12,9 +13,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
@@ -37,9 +35,7 @@ MODULE.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

View File

@@ -13,14 +13,53 @@ local_path_override(
# see https://registry.bazel.build/ for a list of available packages
bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "rules_pkg", version = "0.9.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 = "platforms", version = "0.0.10")
bazel_dep(name = "rules_go", version = "0.48.0")
bazel_dep(name = "rules_pkg", version = "0.10.1")
bazel_dep(name = "rules_nodejs", version = "6.2.0-codeql.1")
bazel_dep(name = "rules_python", version = "0.32.2")
bazel_dep(name = "bazel_skylib", version = "1.6.1")
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 = "rules_kotlin", version = "1.9.4-codeql.1")
bazel_dep(name = "gazelle", version = "0.37.0")
bazel_dep(name = "rules_dotnet", version = "0.15.1")
bazel_dep(name = "googletest", version = "1.14.0.bcr.1")
bazel_dep(name = "rules_rust", version = "0.46.0")
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
crate = use_extension(
"@rules_rust//crate_universe:extension.bzl",
"crate",
)
crate.from_cargo(
name = "py_deps",
cargo_lockfile = "//python/extractor/tsg-python:Cargo.lock",
manifests = [
"//python/extractor/tsg-python:Cargo.toml",
"//python/extractor/tsg-python/tsp:Cargo.toml",
],
)
crate.from_cargo(
name = "ruby_deps",
cargo_lockfile = "//ruby/extractor:Cargo.lock",
manifests = [
"//ruby/extractor:Cargo.toml",
"//ruby/extractor/codeql-extractor-fake-crate:Cargo.toml",
],
)
use_repo(crate, "py_deps", "ruby_deps")
dotnet = use_extension("@rules_dotnet//dotnet:extensions.bzl", "dotnet")
dotnet.toolchain(dotnet_version = "8.0.101")
use_repo(dotnet, "dotnet_toolchains")
register_toolchains("@dotnet_toolchains//:all")
csharp_main_extension = use_extension("//csharp:paket.main_extension.bzl", "main_extension")
use_repo(csharp_main_extension, "paket.main")
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
@@ -31,6 +70,8 @@ pip.parse(
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",
@@ -44,10 +85,92 @@ use_repo(
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(
name = "nodejs",
node_urls = [
"https://nodejs.org/dist/v{version}/{filename}",
"https://mirrors.dotsrc.org/nodejs/release/v{version}/{filename}",
],
node_version = "18.15.0",
)
use_repo(node, "nodejs", "nodejs_toolchains")
kotlin_extractor_deps = use_extension("//java/kotlin-extractor:deps.bzl", "kotlin_extractor_deps")
# following list can be kept in sync by running `bazel mod tidy` in `codeql`
use_repo(
kotlin_extractor_deps,
"codeql_kotlin_defaults",
"codeql_kotlin_embeddable",
"kotlin-compiler-1.5.0",
"kotlin-compiler-1.5.10",
"kotlin-compiler-1.5.20",
"kotlin-compiler-1.5.30",
"kotlin-compiler-1.6.0",
"kotlin-compiler-1.6.20",
"kotlin-compiler-1.7.0",
"kotlin-compiler-1.7.20",
"kotlin-compiler-1.8.0",
"kotlin-compiler-1.9.0-Beta",
"kotlin-compiler-1.9.20-Beta",
"kotlin-compiler-2.0.0-RC1",
"kotlin-compiler-embeddable-1.5.0",
"kotlin-compiler-embeddable-1.5.10",
"kotlin-compiler-embeddable-1.5.20",
"kotlin-compiler-embeddable-1.5.30",
"kotlin-compiler-embeddable-1.6.0",
"kotlin-compiler-embeddable-1.6.20",
"kotlin-compiler-embeddable-1.7.0",
"kotlin-compiler-embeddable-1.7.20",
"kotlin-compiler-embeddable-1.8.0",
"kotlin-compiler-embeddable-1.9.0-Beta",
"kotlin-compiler-embeddable-1.9.20-Beta",
"kotlin-compiler-embeddable-2.0.0-RC1",
"kotlin-stdlib-1.5.0",
"kotlin-stdlib-1.5.10",
"kotlin-stdlib-1.5.20",
"kotlin-stdlib-1.5.30",
"kotlin-stdlib-1.6.0",
"kotlin-stdlib-1.6.20",
"kotlin-stdlib-1.7.0",
"kotlin-stdlib-1.7.20",
"kotlin-stdlib-1.8.0",
"kotlin-stdlib-1.9.0-Beta",
"kotlin-stdlib-1.9.20-Beta",
"kotlin-stdlib-2.0.0-RC1",
)
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.22.2")
lfs_files = use_repo_rule("//misc/bazel:lfs.bzl", "lfs_files")
lfs_files(
name = "ripunzip-linux",
srcs = ["//misc/ripunzip:ripunzip-linux"],
executable = True,
)
lfs_files(
name = "ripunzip-windows",
srcs = ["//misc/ripunzip:ripunzip-windows.exe"],
executable = True,
)
lfs_files(
name = "ripunzip-macos",
srcs = ["//misc/ripunzip:ripunzip-macos"],
executable = True,
)
lfs_files(
name = "swift-resource-dir-linux",
srcs = ["//swift/third_party/resource-dir:resource-dir-linux.zip"],
)
lfs_files(
name = "swift-resource-dir-macos",
srcs = ["//swift/third_party/resource-dir:resource-dir-macos.zip"],
)
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

@@ -6,29 +6,16 @@ provide:
- "*/ql/consistency-queries/qlpack.yml"
- "*/ql/automodel/src/qlpack.yml"
- "*/ql/automodel/test/qlpack.yml"
- "*/extractor-pack/codeql-extractor.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"
- "misc/legacy-support/*/qlpack.yml"
- "misc/suite-helpers/qlpack.yml"
- "ruby/extractor-pack/codeql-extractor.yml"
- "swift/extractor-pack/codeql-extractor.yml"
- "ql/extractor-pack/codeql-extractor.yml"
- ".github/codeql/extensions/**/codeql-pack.yml"
versionPolicies:

View File

@@ -28,6 +28,7 @@
"/*- Yaml dbscheme -*/",
"/*- Blame dbscheme -*/",
"/*- JSON dbscheme -*/",
"/*- Python dbscheme -*/"
"/*- Python dbscheme -*/",
"/*- Empty location -*/"
]
}

View File

@@ -61,10 +61,6 @@
"java/ql/src/utils/modelgenerator/internal/CaptureModels.qll",
"csharp/ql/src/utils/modelgenerator/internal/CaptureModels.qll"
],
"Model as Data Generation Java/C# - CaptureModelsPrinting": [
"java/ql/src/utils/modelgenerator/internal/CaptureModelsPrinting.qll",
"csharp/ql/src/utils/modelgenerator/internal/CaptureModelsPrinting.qll"
],
"Sign Java/C#": [
"java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/Sign.qll",
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/Sign.qll"
@@ -185,11 +181,6 @@
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/AliasAnalysisImports.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/AliasAnalysisImports.qll"
],
"C++ IR ValueNumberingImports": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/gvn/internal/ValueNumberingImports.qll",
"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 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"
@@ -251,12 +242,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",
"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",
@@ -368,7 +353,11 @@
"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"
],
"shared tree-sitter extractor cargo.toml": [
"shared/tree-sitter-extractor/Cargo.toml",
"ruby/extractor/codeql-extractor-fake-crate/Cargo.toml"
]
}
}

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

@@ -1,13 +0,0 @@
obj/
TestResults/
*.manifest
*.pdb
*.suo
*.mdb
*.vsmdi
csharp.log
**/bin/Debug
**/bin/Release
*.tlog
.vs
*.user

View File

@@ -0,0 +1 @@
The Windows autobuilder that used to live in this directory moved to `csharp/autobuilder/Semmle.Autobuild.Cpp`.

View File

@@ -1,26 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Semmle.Autobuild.Cpp\Semmle.Autobuild.Cpp.csproj" />
<ProjectReference Include="..\..\..\csharp\autobuilder\Semmle.Autobuild.Shared\Semmle.Autobuild.Shared.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,32 +0,0 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Semmle.Autobuild.Cpp")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("GitHub")]
[assembly: AssemblyProduct("CodeQL autobuilder for C++")]
[assembly: AssemblyCopyright("Copyright © GitHub 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,28 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>Semmle.Autobuild.Cpp</AssemblyName>
<RootNamespace>Semmle.Autobuild.Cpp</RootNamespace>
<ApplicationIcon />
<OutputType>Exe</OutputType>
<StartupObject />
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build" Version="17.8.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\csharp\extractor\Semmle.Util\Semmle.Util.csproj" />
<ProjectReference Include="..\..\..\csharp\autobuilder\Semmle.Autobuild.Shared\Semmle.Autobuild.Shared.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,4 +1,4 @@
description: Revert support for repeated initializers, which are allowed in C with designated initializers.
compatibility: full
aggregate_field_init.rel: reorder aggregate_field_init.rel (int aggregate, int initializer, int field, int position) aggregate initializer field
aggregate_array_init.rel: reorder aggregate_array_init.rel (int aggregate, int initializer, int element_index, int position) aggregate initializer element_index
aggregate_field_init.rel: reorder aggregate_field_init.rel (@aggregateliteral aggregate, @expr initializer, @membervariable field, int position) aggregate initializer field
aggregate_array_init.rel: reorder aggregate_array_init.rel (@aggregateliteral aggregate, @expr initializer, int element_index, int position) aggregate initializer element_index

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",
@@ -6,7 +6,7 @@ pkg_files(
["**"],
exclude = ["BUILD.bazel"],
),
prefix = "cpp/downgrades",
prefix = "downgrades",
strip_prefix = strip_prefix.from_pkg(),
visibility = ["//cpp:__pkg__"],
)

View File

@@ -1,15 +1,13 @@
load("@rules_pkg//:mappings.bzl", "pkg_files")
load("@rules_pkg//pkg:mappings.bzl", "pkg_files")
package(default_visibility = ["//cpp:__pkg__"])
pkg_files(
name = "dbscheme",
srcs = ["semmlecode.cpp.dbscheme"],
prefix = "cpp",
)
pkg_files(
name = "dbscheme-stats",
srcs = ["semmlecode.cpp.dbscheme.stats"],
prefix = "cpp",
)

View File

@@ -1,3 +1,44 @@
## 1.1.0
### New Features
* Data models can now be added with data extensions. In this way source, sink and summary models can be added in extension `.model.yml` files, rather than by writing classes in QL code. New models should be added in the `lib/ext` folder.
### Minor Analysis Improvements
* A partial model for the `Boost.Asio` network library has been added. This includes sources, sinks and summaries for certain functions in `Boost.Asio`, such as `read_until` and `write`.
## 1.0.0
### Breaking Changes
* CodeQL package management is now generally available, and all GitHub-produced CodeQL packages have had their version numbers increased to 1.0.0.
## 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

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* The "Guards" library (`semmle.code.cpp.controlflow.Guards`) now also infers guards from calls to the builtin operation `__builtin_expect`. As a result, some queries may produce fewer false positives.

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* The queries "Potential double free" (`cpp/double-free`) and "Potential use after free" (`cpp/use-after-free`) now produce fewer false positives.

View File

@@ -0,0 +1,4 @@
---
category: feature
---
* It is now possible to extend the classes `AllocationFunction` and `DeallocationFunction` via data extensions. Extensions of these classes should be added to the `lib/ext/allocation` and `lib/ext/deallocation` directories respectively.

View File

@@ -0,0 +1,3 @@
## 0.12.11
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

@@ -0,0 +1,5 @@
## 1.0.0
### Breaking Changes
* CodeQL package management is now generally available, and all GitHub-produced CodeQL packages have had their version numbers increased to 1.0.0.

View File

@@ -0,0 +1,9 @@
## 1.1.0
### New Features
* Data models can now be added with data extensions. In this way source, sink and summary models can be added in extension `.model.yml` files, rather than by writing classes in QL code. New models should be added in the `lib/ext` folder.
### Minor Analysis Improvements
* A partial model for the `Boost.Asio` network library has been added. This includes sources, sinks and summaries for certain functions in `Boost.Asio`, such as `read_until` and `write`.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 0.12.10
lastReleaseVersion: 1.1.0

View File

@@ -0,0 +1,26 @@
extensions:
# partial model of the Boost::Asio network library
extensions:
- addsTo:
pack: codeql/cpp-all
extensible: sourceModel
data: # namespace, type, subtypes, name, signature, ext, output, kind, provenance
- ["boost::asio", "", False, "read", "", "", "Argument[*1]", "remote", "manual"]
- ["boost::asio", "", False, "read_at", "", "", "Argument[*2]", "remote", "manual"]
- ["boost::asio", "", False, "read_until", "", "", "Argument[*1]", "remote", "manual"]
- ["boost::asio", "", False, "async_read", "", "", "Argument[*1]", "remote", "manual"]
- ["boost::asio", "", False, "async_read_at", "", "", "Argument[*2]", "remote", "manual"]
- ["boost::asio", "", False, "async_read_until", "", "", "Argument[*1]", "remote", "manual"]
- addsTo:
pack: codeql/cpp-all
extensible: sinkModel
data: # namespace, type, subtypes, name, signature, ext, input, kind, provenance
- ["boost::asio", "", False, "write", "", "", "Argument[*1]", "remote-sink", "manual"]
- ["boost::asio", "", False, "write_at", "", "", "Argument[*2]", "remote-sink", "manual"]
- ["boost::asio", "", False, "async_write", "", "", "Argument[*1]", "remote-sink", "manual"]
- ["boost::asio", "", False, "async_write_at", "", "", "Argument[*2]", "remote-sink", "manual"]
- addsTo:
pack: codeql/cpp-all
extensible: summaryModel
data: # namespace, type, subtypes, name, signature, ext, input, output, kind, provenance
- ["boost::asio", "", False, "buffer", "", "", "Argument[*0]", "ReturnValue", "taint", "manual"]

View File

@@ -0,0 +1,7 @@
extensions:
- addsTo:
pack: codeql/cpp-all
extensible: allocationFunctionModel
data:
- ["", "", False, "kmem_alloc", "0", "", "", True]
- ["", "", False, "kmem_zalloc", "0", "", "", True]

View File

@@ -0,0 +1,7 @@
extensions:
- addsTo:
pack: codeql/cpp-all
extensible: allocationFunctionModel
data:
- ["", "", False, "g_malloc", "0", "", "", True]
- ["", "", False, "g_try_malloc", "0", "", "", True]

View File

@@ -0,0 +1,10 @@
extensions:
- addsTo:
pack: codeql/cpp-all
extensible: allocationFunctionModel
data:
- ["", "", False, "CRYPTO_malloc", "0", "", "", True]
- ["", "", False, "CRYPTO_zalloc", "0", "", "", True]
- ["", "", False, "CRYPTO_secure_malloc", "0", "", "", True]
- ["", "", False, "CRYPTO_secure_zalloc", "0", "", "", True]

View File

@@ -0,0 +1,15 @@
extensions:
- addsTo:
pack: codeql/cpp-all
extensible: allocationFunctionModel
data:
- ["", "", False, "malloc", "0", "", "", True]
- ["std", "", False, "malloc", "0", "", "", True]
- ["bsl", "", False, "malloc", "0", "", "", True]
- ["", "", False, "alloca", "0", "", "", False]
- ["", "", False, "__builtin_alloca", "0", "", "", False]
- ["", "", False, "_alloca", "0", "", "", False]
- ["", "", False, "_malloca", "0", "", "", False]
- ["", "", False, "calloc", "1", "0", "", True]
- ["std", "", False, "calloc", "1", "0", "", True]
- ["bsl", "", False, "calloc", "1", "0", "", True]

View File

@@ -0,0 +1,29 @@
extensions:
- addsTo:
pack: codeql/cpp-all
extensible: allocationFunctionModel
data:
- ["", "", False, "MmAllocateContiguousMemory", "0", "", "", True]
- ["", "", False, "MmAllocateContiguousNodeMemory", "0", "", "", True]
- ["", "", False, "MmAllocateContiguousMemorySpecifyCache", "0", "", "", True]
- ["", "", False, "MmAllocateContiguousMemorySpecifyCacheNode", "0", "", "", True]
- ["", "", False, "MmAllocateNonCachedMemory", "0", "", "", True]
- ["", "", False, "MmAllocateMappingAddress", "0", "", "", True]
- ["", "", False, "CoTaskMemAlloc", "0", "", "", True]
- ["", "", False, "ExAllocatePool", "1", "", "", True]
- ["", "", False, "ExAllocatePool2", "1", "", "", True]
- ["", "", False, "ExAllocatePool3", "1", "", "", True]
- ["", "", False, "ExAllocatePoolWithTag", "1", "", "", True]
- ["", "", False, "ExAllocatePoolWithTagPriority", "1", "", "", True]
- ["", "", False, "ExAllocatePoolWithQuota", "1", "", "", True]
- ["", "", False, "ExAllocatePoolWithQuotaTag", "1", "", "", True]
- ["", "", False, "ExAllocatePoolZero", "1", "", "", True]
- ["", "", False, "IoAllocateMdl", "1", "", "", True]
- ["", "", False, "IoAllocateErrorLogEntry", "1", "", "", True]
- ["", "", False, "LocalAlloc", "1", "", "", True]
- ["", "", False, "GlobalAlloc", "1", "", "", True]
- ["", "", False, "VirtualAlloc", "1", "", "", True]
- ["", "", False, "HeapAlloc", "2", "", "", True]
- ["", "", False, "MmAllocatePagesForMdl", "3", "", "", True]
- ["", "", False, "MmAllocatePagesForMdlEx", "3", "", "", True]
- ["", "", False, "MmAllocateNodePagesForMdlEx", "3", "", "", True]

View File

@@ -0,0 +1,5 @@
extensions:
- addsTo:
pack: codeql/cpp-all
extensible: allocationFunctionModel
data: []

View File

@@ -0,0 +1,8 @@
extensions:
- addsTo:
pack: codeql/cpp-all
extensible: deallocationFunctionModel
data:
- ["", "", False, "pool_put", "1"]
- ["", "", False, "pool_cache_put", "1"]
- ["", "", False, "kmem_free", "0"]

View File

@@ -0,0 +1,42 @@
extensions:
- addsTo:
pack: codeql/cpp-all
extensible: deallocationFunctionModel
data:
- ["", "", False, "free", "0"]
- ["std", "", False, "free", "0"]
- ["bsl", "", False, "free", "0"]
- ["", "", False, "realloc", "0"]
- ["std", "", False, "realloc", "0"]
- ["bsl", "", False, "realloc", "0"]
- ["", "", False, "CRYPTO_free", "0"]
- ["", "", False, "CRYPTO_secure_free", "0"]
- ["", "", False, "g_free", "0"]
- ["", "", False, "ExFreePool", "0"]
- ["", "", False, "ExFreePoolWithTag", "0"]
- ["", "", False, "ExDeleteTimer", "0"]
- ["", "", False, "IoFreeIrp", "0"]
- ["", "", False, "IoFreeMdl", "0"]
- ["", "", False, "IoFreeErrorLogEntry", "0"]
- ["", "", False, "IoFreeWorkItem", "0"]
- ["", "", False, "MmFreeContiguousMemory", "0"]
- ["", "", False, "MmFreeContiguousMemorySpecifyCache", "0"]
- ["", "", False, "MmFreeNonCachedMemory", "0"]
- ["", "", False, "MmFreeMappingAddress", "0"]
- ["", "", False, "MmFreePagesFromMdl", "0"]
- ["", "", False, "MmUnmapReservedMapping", "0"]
- ["", "", False, "MmUnmapLockedPages", "0"]
- ["", "", False, "NdisFreeGenericObject", "0"]
- ["", "", False, "NdisFreeMemory", "0"]
- ["", "", False, "NdisFreeMemoryWithTag", "0"]
- ["", "", False, "NdisFreeMdl", "0"]
- ["", "", False, "NdisFreeNetBufferListPool", "0"]
- ["", "", False, "NdisFreeNetBufferPool", "0"]
- ["", "", False, "LocalFree", "0"]
- ["", "", False, "GlobalFree", "0"]
- ["", "", False, "LocalReAlloc", "0"]
- ["", "", False, "GlobalReAlloc", "0"]
- ["", "", False, "VirtualFree", "0"]
- ["", "", False, "CoTaskMemFree", "0"]
- ["", "", False, "CoTaskMemRealloc", "0"]
- ["", "", False, "SysFreeString", "0"]

View File

@@ -0,0 +1,41 @@
extensions:
- addsTo:
pack: codeql/cpp-all
extensible: deallocationFunctionModel
data:
- ["", "", False, "ExFreePool", "0"]
- ["", "", False, "ExFreePoolWithTag", "0"]
- ["", "", False, "ExDeleteTimer", "0"]
- ["", "", False, "IoFreeIrp", "0"]
- ["", "", False, "IoFreeMdl", "0"]
- ["", "", False, "IoFreeErrorLogEntry", "0"]
- ["", "", False, "IoFreeWorkItem", "0"]
- ["", "", False, "MmFreeContiguousMemory", "0"]
- ["", "", False, "MmFreeContiguousMemorySpecifyCache", "0"]
- ["", "", False, "MmFreeNonCachedMemory", "0"]
- ["", "", False, "MmFreeMappingAddress", "0"]
- ["", "", False, "MmFreePagesFromMdl", "0"]
- ["", "", False, "MmUnmapReservedMapping", "0"]
- ["", "", False, "MmUnmapLockedPages", "0"]
- ["", "", False, "NdisFreeGenericObject", "0"]
- ["", "", False, "NdisFreeMemory", "0"]
- ["", "", False, "NdisFreeMemoryWithTag", "0"]
- ["", "", False, "NdisFreeMdl", "0"]
- ["", "", False, "NdisFreeNetBufferListPool", "0"]
- ["", "", False, "NdisFreeNetBufferPool", "0"]
- ["", "", False, "LocalFree", "0"]
- ["", "", False, "GlobalFree", "0"]
- ["", "", False, "LocalReAlloc", "0"]
- ["", "", False, "GlobalReAlloc", "0"]
- ["", "", False, "VirtualFree", "0"]
- ["", "", False, "CoTaskMemFree", "0"]
- ["", "", False, "CoTaskMemRealloc", "0"]
- ["", "", False, "SysFreeString", "0"]
- ["", "", False, "ExFreeToLookasideListEx", "1"]
- ["", "", False, "ExFreeToPagedLookasideList", "1"]
- ["", "", False, "ExFreeToNPagedLookasideList", "1"]
- ["", "", False, "NdisFreeMemoryWithTagPriority", "1"]
- ["", "", False, "StorPortFreeMdl", "1"]
- ["", "", False, "StorPortFreePool", "1"]
- ["", "", False, "HeapFree", "2"]
- ["", "", False, "HeapReAlloc", "2"]

View File

@@ -0,0 +1,5 @@
extensions:
- addsTo:
pack: codeql/cpp-all
extensible: deallocationFunctionModel
data: []

View File

@@ -0,0 +1,15 @@
extensions:
# Make sure that the extensible model predicates have at least one definition
# to avoid errors about undefined extensionals.
- addsTo:
pack: codeql/cpp-all
extensible: sourceModel
data: []
- addsTo:
pack: codeql/cpp-all
extensible: sinkModel
data: []
- addsTo:
pack: codeql/cpp-all
extensible: summaryModel
data: []

View File

@@ -1,5 +1,5 @@
name: codeql/cpp-all
version: 0.12.10
version: 1.1.1-dev
groups: cpp
dbscheme: semmlecode.cpp.dbscheme
extractor: cpp
@@ -7,8 +7,15 @@ 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}
dataExtensions:
- ext/*.model.yml
- ext/deallocation/*.model.yml
- ext/allocation/*.model.yml
warnOnImplicitThis: true

View File

@@ -364,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)
}
}
@@ -461,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`.
*/
@@ -672,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
@@ -862,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

@@ -410,6 +410,10 @@ class LocalVariable extends LocalScopeVariable, @localvariable {
or
orphaned_variables(underlyingElement(this), unresolveElement(result))
}
override predicate isStatic() {
super.isStatic() or orphaned_variables(underlyingElement(this), _)
}
}
/**

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>

View File

@@ -375,6 +375,33 @@ cached
class IRGuardCondition extends Instruction {
Instruction branch;
/*
* An `IRGuardCondition` supports reasoning about four different kinds of
* relations:
* 1. A unary equality relation of the form `e == k`
* 2. A binary equality relation of the form `e1 == e2 + k`
* 3. A unary inequality relation of the form `e < k`
* 4. A binary inequality relation of the form `e1 < e2 + k`
*
* where `k` is a constant.
*
* Furthermore, the unary relations (i.e., case 1 and case 3) are also
* inferred from `switch` statement guards: equality relations are inferred
* from the unique `case` statement, if any, and inequality relations are
* inferred from the [case range](https://gcc.gnu.org/onlinedocs/gcc/Case-Ranges.html)
* gcc extension.
*
* The implementation of all four follows the same structure: Each relation
* has a cached user-facing predicate that. For example,
* `GuardCondition::comparesEq` calls `compares_eq`. This predicate has
* several cases that recursively decompose the relation to bring it to a
* canonical form (i.e., a relation of the form `e1 == e2 + k`). The base
* case for this relation (i.e., `simple_comparison_eq`) handles
* `CompareEQInstruction`s and `CompareNEInstruction`, and recursive
* predicates (e.g., `complex_eq`) rewrites larger expressions such as
* `e1 + k1 == e2 + k2` into canonical the form `e1 == e2 + (k2 - k1)`.
*/
cached
IRGuardCondition() { branch = getBranchForCondition(this) }
@@ -565,7 +592,7 @@ class IRGuardCondition extends Instruction {
/** Holds if (determined by this guard) `op == k` evaluates to `areEqual` if this expression evaluates to `value`. */
cached
predicate comparesEq(Operand op, int k, boolean areEqual, AbstractValue value) {
compares_eq(this, op, k, areEqual, value)
unary_compares_eq(this, op, k, areEqual, false, value)
}
/**
@@ -586,7 +613,7 @@ class IRGuardCondition extends Instruction {
cached
predicate ensuresEq(Operand op, int k, IRBlock block, boolean areEqual) {
exists(AbstractValue value |
compares_eq(this, op, k, areEqual, value) and this.valueControls(block, value)
unary_compares_eq(this, op, k, areEqual, false, value) and this.valueControls(block, value)
)
}
@@ -611,7 +638,7 @@ class IRGuardCondition extends Instruction {
cached
predicate ensuresEqEdge(Operand op, int k, IRBlock pred, IRBlock succ, boolean areEqual) {
exists(AbstractValue value |
compares_eq(this, op, k, areEqual, value) and
unary_compares_eq(this, op, k, areEqual, false, value) and
this.valueControlsEdge(pred, succ, value)
)
}
@@ -735,33 +762,80 @@ private predicate compares_eq(
exists(AbstractValue dual | value = dual.getDualValue() |
compares_eq(test.(LogicalNotInstruction).getUnary(), left, right, k, areEqual, dual)
)
or
compares_eq(test.(BuiltinExpectCallInstruction).getCondition(), left, right, k, areEqual, value)
}
/** Holds if `op == k` is `areEqual` given that `test` is equal to `value`. */
private predicate compares_eq(
Instruction test, Operand op, int k, boolean areEqual, AbstractValue value
/**
* Holds if `op == k` is `areEqual` given that `test` is equal to `value`.
*
* Many internal predicates in this file have a `inNonZeroCase` column.
* Ideally, the `k` column would be a type such as `Option<int>::Option`, to
* represent whether we have a concrete value `k` such that `op == k`, or whether
* we only know that `op != 0`.
* However, cannot instantiate `Option` with an infinite type. Thus the boolean
* `inNonZeroCase` is used to distinquish the `Some` (where we have a concrete
* value `k`) and `None` cases (where we only know that `op != 0`).
*
* Thus, if `inNonZeroCase = true` then `op != 0` and the value of `k` is
* meaningless.
*
* To see why `inNonZeroCase` is needed consider the following C program:
* ```c
* char* p = ...;
* if(p) {
* use(p);
* }
* ```
* in C++ there would be an int-to-bool conversion on `p`. However, since C
* does not have booleans there is no conversion. We want to be able to
* conclude that `p` is non-zero in the true branch, so we need to give `k`
* some value. However, simply setting `k = 1` would make the rest of the
* analysis think that `k == 1` holds inside the branch. So we distinquish
* between the above case and
* ```c
* if(p == 1) {
* use(p)
* }
* ```
* by setting `inNonZeroCase` to `true` in the former case, but not in the
* latter.
*/
private predicate unary_compares_eq(
Instruction test, Operand op, int k, boolean areEqual, boolean inNonZeroCase, AbstractValue value
) {
/* The simple case where the test *is* the comparison so areEqual = testIsTrue xor eq. */
exists(AbstractValue v | simple_comparison_eq(test, op, k, v) |
exists(AbstractValue v |
unary_simple_comparison_eq(test, k, inNonZeroCase, v) and op.getDef() = test
|
areEqual = true and value = v
or
areEqual = false and value = v.getDualValue()
)
or
complex_eq(test, op, k, areEqual, value)
unary_complex_eq(test, op, k, areEqual, inNonZeroCase, value)
or
/* (x is true => (op == k)) => (!x is false => (op == k)) */
exists(AbstractValue dual | value = dual.getDualValue() |
compares_eq(test.(LogicalNotInstruction).getUnary(), op, k, areEqual, dual)
exists(AbstractValue dual, boolean inNonZeroCase0 |
value = dual.getDualValue() and
unary_compares_eq(test.(LogicalNotInstruction).getUnary(), op, k, inNonZeroCase0, areEqual, dual)
|
k = 0 and inNonZeroCase = inNonZeroCase0
or
k != 0 and inNonZeroCase = true
)
or
// ((test is `areEqual` => op == const + k2) and const == `k1`) =>
// test is `areEqual` => op == k1 + k2
inNonZeroCase = false and
exists(int k1, int k2, ConstantInstruction const |
compares_eq(test, op, const.getAUse(), k2, areEqual, value) and
int_value(const) = k1 and
k = k1 + k2
)
or
unary_compares_eq(test.(BuiltinExpectCallInstruction).getCondition(), op, k, areEqual,
inNonZeroCase, value)
}
/** Rearrange various simple comparisons into `left == right + k` form. */
@@ -781,14 +855,96 @@ private predicate simple_comparison_eq(
value.(BooleanValue).getValue() = false
}
/** Rearrange various simple comparisons into `op == k` form. */
private predicate simple_comparison_eq(Instruction test, Operand op, int k, AbstractValue value) {
/**
* Rearrange various simple comparisons into `op == k` form.
*/
private predicate unary_simple_comparison_eq(
Instruction test, int k, boolean inNonZeroCase, AbstractValue value
) {
exists(SwitchInstruction switch, CaseEdge case |
test = switch.getExpression() and
op.getDef() = test and
case = value.(MatchValue).getCase() and
exists(switch.getSuccessor(case)) and
case.getValue().toInt() = k
case.getValue().toInt() = k and
inNonZeroCase = false
)
or
// Any instruction with an integral type could potentially be part of a
// check for nullness when used in a guard. So we include all integral
// typed instructions here. However, since some of these instructions are
// already included as guards in other cases, we exclude those here.
// These are instructions that compute a binary equality or inequality
// relation. For example, the following:
// ```cpp
// if(a == b + 42) { ... }
// ```
// generates the following IR:
// ```
// r1(glval<int>) = VariableAddress[a] :
// r2(int) = Load[a] : &:r1, m1
// r3(glval<int>) = VariableAddress[b] :
// r4(int) = Load[b] : &:r3, m2
// r5(int) = Constant[42] :
// r6(int) = Add : r4, r5
// r7(bool) = CompareEQ : r2, r6
// v1(void) = ConditionalBranch : r7
// ```
// and since `r7` is an integral typed instruction this predicate could
// include a case for when `r7` evaluates to true (in which case we would
// infer that `r6` was non-zero, and a case for when `r7` evaluates to false
// (in which case we would infer that `r6` was zero).
// However, since `a == b + 42` is already supported when reasoning about
// binary equalities we exclude those cases here.
not test.isGLValue() and
not simple_comparison_eq(test, _, _, _, _) and
not simple_comparison_lt(test, _, _, _) and
not test = any(SwitchInstruction switch).getExpression() and
(
test.getResultIRType() instanceof IRAddressType or
test.getResultIRType() instanceof IRIntegerType or
test.getResultIRType() instanceof IRBooleanType
) and
(
k = 1 and
value.(BooleanValue).getValue() = true and
inNonZeroCase = true
or
k = 0 and
value.(BooleanValue).getValue() = false and
inNonZeroCase = false
)
}
/** A call to the builtin operation `__builtin_expect`. */
private class BuiltinExpectCallInstruction extends CallInstruction {
BuiltinExpectCallInstruction() { this.getStaticCallTarget().hasName("__builtin_expect") }
/** Gets the condition of this call. */
Instruction getCondition() {
// The first parameter of `__builtin_expect` has type `long`. So we skip
// the conversion when inferring guards.
result = this.getArgument(0).(ConvertInstruction).getUnary()
}
}
/**
* Holds if `left == right + k` is `areEqual` if `cmp` evaluates to `value`,
* and `cmp` is an instruction that compares the value of
* `__builtin_expect(left == right + k, _)` to `0`.
*/
private predicate builtin_expect_eq(
CompareInstruction cmp, Operand left, Operand right, int k, boolean areEqual, AbstractValue value
) {
exists(BuiltinExpectCallInstruction call, Instruction const, AbstractValue innerValue |
int_value(const) = 0 and
cmp.hasOperands(call.getAUse(), const.getAUse()) and
compares_eq(call.getCondition(), left, right, k, areEqual, innerValue)
|
cmp instanceof CompareNEInstruction and
value = innerValue
or
cmp instanceof CompareEQInstruction and
value.getDualValue() = innerValue
)
}
@@ -798,14 +954,39 @@ private predicate complex_eq(
sub_eq(cmp, left, right, k, areEqual, value)
or
add_eq(cmp, left, right, k, areEqual, value)
or
builtin_expect_eq(cmp, left, right, k, areEqual, value)
}
private predicate complex_eq(
Instruction test, Operand op, int k, boolean areEqual, AbstractValue value
/**
* Holds if `op == k` is `areEqual` if `cmp` evaluates to `value`, and `cmp` is
* an instruction that compares the value of `__builtin_expect(op == k, _)` to `0`.
*/
private predicate unary_builtin_expect_eq(
CompareInstruction cmp, Operand op, int k, boolean areEqual, boolean inNonZeroCase,
AbstractValue value
) {
sub_eq(test, op, k, areEqual, value)
exists(BuiltinExpectCallInstruction call, Instruction const, AbstractValue innerValue |
int_value(const) = 0 and
cmp.hasOperands(call.getAUse(), const.getAUse()) and
unary_compares_eq(call.getCondition(), op, k, areEqual, inNonZeroCase, innerValue)
|
cmp instanceof CompareNEInstruction and
value = innerValue
or
cmp instanceof CompareEQInstruction and
value.getDualValue() = innerValue
)
}
private predicate unary_complex_eq(
Instruction test, Operand op, int k, boolean areEqual, boolean inNonZeroCase, AbstractValue value
) {
unary_sub_eq(test, op, k, areEqual, inNonZeroCase, value)
or
add_eq(test, op, k, areEqual, value)
unary_add_eq(test, op, k, areEqual, inNonZeroCase, value)
or
unary_builtin_expect_eq(test, op, k, areEqual, inNonZeroCase, value)
}
/*
@@ -834,7 +1015,8 @@ private predicate compares_lt(
/** Holds if `op < k` evaluates to `isLt` given that `test` evaluates to `value`. */
private predicate compares_lt(Instruction test, Operand op, int k, boolean isLt, AbstractValue value) {
simple_comparison_lt(test, op, k, isLt, value)
unary_simple_comparison_lt(test, k, isLt, value) and
op.getDef() = test
or
complex_lt(test, op, k, isLt, value)
or
@@ -881,12 +1063,11 @@ private predicate simple_comparison_lt(CompareInstruction cmp, Operand left, Ope
}
/** Rearrange various simple comparisons into `op < k` form. */
private predicate simple_comparison_lt(
Instruction test, Operand op, int k, boolean isLt, AbstractValue value
private predicate unary_simple_comparison_lt(
Instruction test, int k, boolean isLt, AbstractValue value
) {
exists(SwitchInstruction switch, CaseEdge case |
test = switch.getExpression() and
op.getDef() = test and
case = value.(MatchValue).getCase() and
exists(switch.getSuccessor(case)) and
case.getMaxValue() > case.getMinValue()
@@ -1069,16 +1250,20 @@ private predicate sub_eq(
}
// op - x == c => op == (c+x)
private predicate sub_eq(Instruction test, Operand op, int k, boolean areEqual, AbstractValue value) {
private predicate unary_sub_eq(
Instruction test, Operand op, int k, boolean areEqual, boolean inNonZeroCase, AbstractValue value
) {
inNonZeroCase = false and
exists(SubInstruction sub, int c, int x |
compares_eq(test, sub.getAUse(), c, areEqual, value) and
unary_compares_eq(test, sub.getAUse(), c, areEqual, inNonZeroCase, value) and
op = sub.getLeftOperand() and
x = int_value(sub.getRight()) and
k = c + x
)
or
inNonZeroCase = false and
exists(PointerSubInstruction sub, int c, int x |
compares_eq(test, sub.getAUse(), c, areEqual, value) and
unary_compares_eq(test, sub.getAUse(), c, areEqual, inNonZeroCase, value) and
op = sub.getLeftOperand() and
x = int_value(sub.getRight()) and
k = c + x
@@ -1132,11 +1317,13 @@ private predicate add_eq(
}
// left + x == right + c => left == right + (c-x)
private predicate add_eq(
Instruction test, Operand left, int k, boolean areEqual, AbstractValue value
private predicate unary_add_eq(
Instruction test, Operand left, int k, boolean areEqual, boolean inNonZeroCase,
AbstractValue value
) {
inNonZeroCase = false and
exists(AddInstruction lhs, int c, int x |
compares_eq(test, lhs.getAUse(), c, areEqual, value) and
unary_compares_eq(test, lhs.getAUse(), c, areEqual, inNonZeroCase, value) and
(
left = lhs.getLeftOperand() and x = int_value(lhs.getRight())
or
@@ -1145,8 +1332,9 @@ private predicate add_eq(
k = c - x
)
or
inNonZeroCase = false and
exists(PointerAddInstruction lhs, int c, int x |
compares_eq(test, lhs.getAUse(), c, areEqual, value) and
unary_compares_eq(test, lhs.getAUse(), c, areEqual, inNonZeroCase, value) and
(
left = lhs.getLeftOperand() and x = int_value(lhs.getRight())
or
@@ -1156,5 +1344,14 @@ private predicate add_eq(
)
}
private class IntegerOrPointerConstantInstruction extends ConstantInstruction {
IntegerOrPointerConstantInstruction() {
this instanceof IntegerConstantInstruction or
this instanceof PointerConstantInstruction
}
}
/** The int value of integer constant expression. */
private int int_value(Instruction i) { result = i.(IntegerConstantInstruction).getValue().toInt() }
private int int_value(Instruction i) {
result = i.(IntegerOrPointerConstantInstruction).getValue().toInt()
}

View File

@@ -0,0 +1,567 @@
/**
* 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 internal.ExternalFlowExtensions as Extensions
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"
or
Extensions::sourceModel(namespace, type, subtypes, name, signature, ext, output, kind, provenance,
_)
}
/** 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"
or
Extensions::sinkModel(namespace, type, subtypes, name, signature, ext, input, kind, provenance, _)
}
/** 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"
or
Extensions::summaryModel(namespace, type, subtypes, name, signature, ext, input, output, kind,
provenance, _)
}
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 MaD framework coverage of `namespace` is `n` api endpoints of the
* kind `(kind, part)`, and `namespaces` is the number of subnamespaces of
* `namespace` which have MaD framework coverage (including `namespace`
* itself).
*/
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

@@ -9,7 +9,7 @@ private import DataFlowUtil
/**
* Gets a function that might be called by `call`.
*/
Function viableCallable(DataFlowCall call) {
DataFlowCallable viableCallable(DataFlowCall call) {
result = call.(Call).getTarget()
or
// If the target of the call does not have a body in the snapshot, it might

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) {

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) {

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) {

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) {

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) {

View File

@@ -216,7 +216,7 @@ predicate localMustFlowStep(Node node1, Node node2) { none() }
/** Gets the type of `n` used for type pruning. */
Type getNodeType(Node n) {
suppressUnusedNode(n) and
exists(n) and
result instanceof VoidType // stub implementation
}
@@ -227,13 +227,10 @@ string ppReprType(Type t) { none() } // stub implementation
* Holds if `t1` and `t2` are compatible, that is, whether data can flow from
* a node of type `t1` to a node of type `t2`.
*/
pragma[inline]
predicate compatibleTypes(Type t1, Type t2) {
any() // stub implementation
t1 instanceof VoidType and t2 instanceof VoidType // stub implementation
}
private predicate suppressUnusedNode(Node n) { any() }
//////////////////////////////////////////////////////////////////////////////
// Java QL library compatibility wrappers
//////////////////////////////////////////////////////////////////////////////
@@ -242,7 +239,17 @@ class CastNode extends Node {
CastNode() { none() } // stub implementation
}
class DataFlowCallable = Function;
class DataFlowCallable extends Function {
/** Gets a best-effort total ordering. */
int totalorder() {
this =
rank[result](DataFlowCallable c, string file, int startline, int startcolumn |
c.getLocation().hasLocationInfo(file, startline, startcolumn, _, _)
|
c order by file, startline, startcolumn
)
}
}
class DataFlowExpr = Expr;
@@ -261,10 +268,28 @@ class DataFlowCall extends Expr instanceof Call {
ExprNode getNode() { result.getExpr() = this }
/** Gets the enclosing callable of this call. */
Function getEnclosingCallable() { result = this.getEnclosingFunction() }
DataFlowCallable getEnclosingCallable() { result = this.getEnclosingFunction() }
/** Gets a best-effort total ordering. */
int totalorder() {
this =
rank[result](DataFlowCall c, int startline, int startcolumn |
c.getLocation().hasLocationInfo(_, startline, startcolumn, _, _)
|
c order by startline, startcolumn
)
}
}
predicate isUnreachableInCall(Node n, DataFlowCall call) { none() } // stub implementation
class NodeRegion instanceof Unit {
string toString() { result = "NodeRegion" }
predicate contains(Node n) { none() }
int totalOrder() { result = 1 }
}
predicate isUnreachableInCall(NodeRegion nr, DataFlowCall call) { none() } // stub implementation
/**
* Holds if access paths with `c` at their head always should be tracked at high
@@ -286,6 +311,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

@@ -516,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
@@ -530,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,27 @@
/**
* This module provides extensible predicates for defining MaD models.
*/
/**
* Holds if an external source model exists for the given parameters.
*/
extensible predicate sourceModel(
string namespace, string type, boolean subtypes, string name, string signature, string ext,
string output, string kind, string provenance, QlBuiltins::ExtensionId madId
);
/**
* Holds if an external sink model exists for the given parameters.
*/
extensible predicate sinkModel(
string namespace, string type, boolean subtypes, string name, string signature, string ext,
string input, string kind, string provenance, QlBuiltins::ExtensionId madId
);
/**
* Holds if an external summary model exists for the given parameters.
*/
extensible predicate summaryModel(
string namespace, string type, boolean subtypes, string name, string signature, string ext,
string input, string output, string kind, string provenance, QlBuiltins::ExtensionId madId
);

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

@@ -32,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

@@ -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

@@ -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,6 +1370,24 @@ 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) }
}
/**

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,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

@@ -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) {

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) {

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) {

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) {

View File

@@ -22,9 +22,13 @@ module CppDataFlow implements InputSig<Location> {
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

@@ -0,0 +1,518 @@
/**
* Provides the classes `ExprNode` and `IndirectExprNode` for converting between `Expr` and `Node`.
*/
private import cpp
private import semmle.code.cpp.ir.IR
private import DataFlowUtil
private import DataFlowPrivate
private import semmle.code.cpp.ir.implementation.raw.internal.TranslatedExpr
private import semmle.code.cpp.ir.implementation.raw.internal.InstructionTag
cached
private module Cached {
private Operand getAnInitializeDynamicAllocationInstructionAddress() {
result = any(InitializeDynamicAllocationInstruction init).getAllocationAddressOperand()
}
/**
* Gets the expression that should be returned as the result expression from `instr`.
*
* Note that this predicate may return multiple results in cases where a conversion belongs to a
* different AST element than its operand.
*/
private Expr getConvertedResultExpression(Instruction instr, int n) {
// Only fully converted instructions have a result for `asConvertedExpr`
not conversionFlow(unique(Operand op |
// The address operand of a `InitializeDynamicAllocationInstruction` is
// special: we need to handle it during dataflow (since it's
// effectively a store to an indirection), but it doesn't appear in
// source syntax, so dataflow node <-> expression conversion shouldn't
// care about it.
op = getAUse(instr) and not op = getAnInitializeDynamicAllocationInstructionAddress()
|
op
), _, false, false) and
result = getConvertedResultExpressionImpl(instr) and
n = 0
or
// If the conversion also has a result then we return multiple results
exists(Operand operand | conversionFlow(operand, instr, false, false) |
n = 1 and
result = getConvertedResultExpressionImpl(operand.getDef())
or
result = getConvertedResultExpression(operand.getDef(), n - 1)
)
}
private Expr getConvertedResultExpressionImpl0(Instruction instr) {
// IR construction inserts an additional cast to a `size_t` on the extent
// of a `new[]` expression. The resulting `ConvertInstruction` doesn't have
// a result for `getConvertedResultExpression`. We remap this here so that
// this `ConvertInstruction` maps to the result of the expression that
// represents the extent.
exists(TranslatedNonConstantAllocationSize tas |
result = tas.getExtent().getExpr() and
instr = tas.getInstruction(AllocationExtentConvertTag())
)
or
// There's no instruction that returns `ParenthesisExpr`, but some queries
// expect this
exists(TranslatedTransparentConversion ttc |
result = ttc.getExpr().(ParenthesisExpr) and
instr = ttc.getResult()
)
or
// Certain expressions generate `CopyValueInstruction`s only when they
// are needed. Examples of this include crement operations and compound
// assignment operations. For example:
// ```cpp
// int x = ...
// int y = x++;
// ```
// this generate IR like:
// ```
// r1(glval<int>) = VariableAddress[x] :
// r2(int) = Constant[0] :
// m3(int) = Store[x] : &:r1, r2
// r4(glval<int>) = VariableAddress[y] :
// r5(glval<int>) = VariableAddress[x] :
// r6(int) = Load[x] : &:r5, m3
// r7(int) = Constant[1] :
// r8(int) = Add : r6, r7
// m9(int) = Store[x] : &:r5, r8
// r11(int) = CopyValue : r6
// m12(int) = Store[y] : &:r4, r11
// ```
// When the `CopyValueInstruction` is not generated there is no instruction
// whose `getConvertedResultExpression` maps back to the expression. When
// such an instruction doesn't exist it means that the old value is not
// needed, and in that case the only value that will propagate forward in
// the program is the value that's been updated. So in those cases we just
// use the result of `node.asDefinition()` as the result of `node.asExpr()`.
exists(TranslatedCoreExpr tco |
tco.getInstruction(_) = instr and
tco.producesExprResult() and
result = asDefinitionImpl0(instr)
)
}
private Expr getConvertedResultExpressionImpl(Instruction instr) {
result = getConvertedResultExpressionImpl0(instr)
or
not exists(getConvertedResultExpressionImpl0(instr)) and
result = instr.getConvertedResultExpression()
}
/**
* Gets the result for `node.asDefinition()` (when `node` is the instruction
* node that wraps `store`) in the cases where `store.getAst()` should not be
* used to define the result of `node.asDefinition()`.
*/
private Expr asDefinitionImpl0(StoreInstruction store) {
// For an expression such as `i += 2` we pretend that the generated
// `StoreInstruction` contains the result of the expression even though
// this isn't totally aligned with the C/C++ standard.
exists(TranslatedAssignOperation tao |
store = tao.getInstruction(AssignmentStoreTag()) and
result = tao.getExpr()
)
or
// Similarly for `i++` and `++i` we pretend that the generated
// `StoreInstruction` is contains the result of the expression even though
// this isn't totally aligned with the C/C++ standard.
exists(TranslatedCrementOperation tco |
store = tco.getInstruction(CrementStoreTag()) and
result = tco.getExpr()
)
}
/**
* Holds if the expression returned by `store.getAst()` should not be
* returned as the result of `node.asDefinition()` when `node` is the
* instruction node that wraps `store`.
*/
private predicate excludeAsDefinitionResult(StoreInstruction store) {
// Exclude the store to the temporary generated by a ternary expression.
exists(TranslatedConditionalExpr tce |
store = tce.getInstruction(ConditionValueFalseStoreTag())
or
store = tce.getInstruction(ConditionValueTrueStoreTag())
)
}
/**
* Gets the expression that represents the result of `StoreInstruction` for
* dataflow purposes.
*
* For example, consider the following example
* ```cpp
* int x = 42; // 1
* x = 34; // 2
* ++x; // 3
* x++; // 4
* x += 1; // 5
* int y = x += 2; // 6
* ```
* For (1) the result is `42`.
* For (2) the result is `x = 34`.
* For (3) the result is `++x`.
* For (4) the result is `x++`.
* For (5) the result is `x += 1`.
* For (6) there are two results:
* - For the `StoreInstruction` generated by `x += 2` the result
* is `x += 2`
* - For the `StoreInstruction` generated by `int y = ...` the result
* is also `x += 2`
*/
cached
Expr asDefinitionImpl(StoreInstruction store) {
not exists(asDefinitionImpl0(store)) and
not excludeAsDefinitionResult(store) and
result = store.getAst().(Expr).getUnconverted()
or
result = asDefinitionImpl0(store)
}
/** Holds if `node` is an `OperandNode` that should map `node.asExpr()` to `e`. */
private 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)
)
}
/** Holds if `node` should be an `IndirectOperand` that maps `node.asIndirectExpr()` to `e`. */
private predicate indirectExprNodeShouldBeIndirectOperand(
IndirectOperand node, Expr e, int n, int indirectionIndex
) {
exists(Instruction def |
node.hasOperandAndIndirectionIndex(unique( | | getAUse(def)), indirectionIndex) and
e = getConvertedResultExpression(def, n)
)
}
/** Holds if `operand`'s definition is a `VariableAddressInstruction` whose variable is a temporary */
private predicate isIRTempVariable(Operand operand) {
operand.getDef().(VariableAddressInstruction).getIRVariable() instanceof IRTempVariable
}
/**
* Holds if `node` is an indirect operand whose operand is an argument, and
* the `n`'th expression associated with the operand is `e`.
*/
private predicate isIndirectOperandOfArgument(
IndirectOperand node, ArgumentOperand operand, Expr e, int n
) {
node.hasOperandAndIndirectionIndex(operand, 1) and
e = getConvertedResultExpression(operand.getDef(), n)
}
/**
* Holds if `opFrom` is an operand to a conversion, and `opTo` is the unique
* use of the conversion.
*/
private predicate isConversionStep(Operand opFrom, Operand opTo) {
exists(Instruction mid |
conversionFlow(opFrom, mid, false, false) and
opTo = unique( | | getAUse(mid))
)
}
/**
* Holds if an operand that satisfies `isIRTempVariable` flows to `op`
* through a (possibly empty) sequence of conversions.
*/
private predicate irTempOperandConversionFlows(Operand op) {
isIRTempVariable(op)
or
exists(Operand mid |
irTempOperandConversionFlows(mid) and
isConversionStep(mid, op)
)
}
/** 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.
isIndirectOperandOfArgument(node, operand, e, n) and
irTempOperandConversionFlows(operand)
)
}
private predicate exprNodeShouldBeIndirectOutNode(IndirectArgumentOutNode node, Expr e, int n) {
exists(CallInstruction call |
call.getStaticCallTarget() instanceof Constructor and
e = getConvertedResultExpression(call, n) and
call.getThisArgumentOperand() = node.getAddressOperand()
)
}
/** Holds if `node` should be an instruction node that maps `node.asExpr()` to `e`. */
private 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)
}
/** Holds if `node` should be an `IndirectInstruction` that maps `node.asIndirectExpr()` to `e`. */
private predicate indirectExprNodeShouldBeIndirectInstruction(
IndirectInstruction node, Expr e, int n, int indirectionIndex
) {
not indirectExprNodeShouldBeIndirectOperand(_, e, n, indirectionIndex) and
exists(Instruction instr |
node.hasInstructionAndIndirectionIndex(instr, indirectionIndex) and
e = getConvertedResultExpression(instr, n)
)
}
abstract private class ExprNodeBase extends Node {
/**
* Gets the expression corresponding to this node, if any. The returned
* expression may be a `Conversion`.
*/
abstract Expr getConvertedExpr(int n);
/** Gets the non-conversion expression corresponding to this node, if any. */
final Expr getExpr(int n) { result = this.getConvertedExpr(n).getUnconverted() }
}
/**
* Holds if there exists a dataflow node whose `asExpr(n)` should evaluate
* to `e`.
*/
private predicate exprNodeShouldBe(Expr e, int n) {
exprNodeShouldBeInstruction(_, e, n) or
exprNodeShouldBeOperand(_, e, n) or
exprNodeShouldBeIndirectOutNode(_, e, n) or
exprNodeShouldBeIndirectOperand(_, e, n)
}
private class InstructionExprNode extends ExprNodeBase, InstructionNode {
InstructionExprNode() {
exists(Expr e, int n |
exprNodeShouldBeInstruction(this, e, n) and
not exists(Expr conv |
exprNodeShouldBe(conv, n + 1) and
conv.getUnconverted() = e.getUnconverted()
)
)
}
final override Expr getConvertedExpr(int n) { exprNodeShouldBeInstruction(this, result, n) }
}
private class OperandExprNode extends ExprNodeBase, OperandNode {
OperandExprNode() {
exists(Expr e, int n |
exprNodeShouldBeOperand(this, e, n) and
not exists(Expr conv |
exprNodeShouldBe(conv, n + 1) and
conv.getUnconverted() = e.getUnconverted()
)
)
}
final override Expr getConvertedExpr(int n) { exprNodeShouldBeOperand(this, result, n) }
}
abstract private class IndirectExprNodeBase extends Node {
/**
* Gets the expression corresponding to this node, if any. The returned
* expression may be a `Conversion`.
*/
abstract Expr getConvertedExpr(int n, int indirectionIndex);
/** Gets the non-conversion expression corresponding to this node, if any. */
final Expr getExpr(int n, int indirectionIndex) {
result = this.getConvertedExpr(n, indirectionIndex).getUnconverted()
}
}
/** A signature for converting an indirect node to an expression. */
private signature module IndirectNodeToIndirectExprSig {
/** The indirect node class to be converted to an expression */
class IndirectNode;
/**
* Holds if the indirect expression at indirection index `indirectionIndex`
* of `node` is `e`. The integer `n` specifies how many conversions has been
* applied to `node`.
*/
predicate indirectNodeHasIndirectExpr(IndirectNode node, Expr e, int n, int indirectionIndex);
}
/**
* A module that implements the logic for deciding whether an indirect node
* should be an `IndirectExprNode`.
*/
private module IndirectNodeToIndirectExpr<IndirectNodeToIndirectExprSig Sig> {
import Sig
/**
* This predicate shifts the indirection index by one when `conv` is a
* `ReferenceDereferenceExpr`.
*
* This is necessary because `ReferenceDereferenceExpr` is a conversion
* in the AST, but appears as a `LoadInstruction` in the IR.
*/
bindingset[e, indirectionIndex]
private predicate adjustForReference(
Expr e, int indirectionIndex, Expr conv, int adjustedIndirectionIndex
) {
conv.(ReferenceDereferenceExpr).getExpr() = e and
adjustedIndirectionIndex = indirectionIndex - 1
or
not conv instanceof ReferenceDereferenceExpr and
conv = e and
adjustedIndirectionIndex = indirectionIndex
}
/** Holds if `node` should be an `IndirectExprNode`. */
predicate charpred(IndirectNode node) {
exists(Expr e, int n, int indirectionIndex |
indirectNodeHasIndirectExpr(node, e, n, indirectionIndex) and
not exists(Expr conv, int adjustedIndirectionIndex |
adjustForReference(e, indirectionIndex, conv, adjustedIndirectionIndex) and
indirectExprNodeShouldBe(conv, n + 1, adjustedIndirectionIndex)
)
)
}
}
private predicate indirectExprNodeShouldBe(Expr e, int n, int indirectionIndex) {
indirectExprNodeShouldBeIndirectOperand(_, e, n, indirectionIndex) or
indirectExprNodeShouldBeIndirectInstruction(_, e, n, indirectionIndex)
}
private module IndirectOperandIndirectExprNodeImpl implements IndirectNodeToIndirectExprSig {
class IndirectNode = IndirectOperand;
predicate indirectNodeHasIndirectExpr = indirectExprNodeShouldBeIndirectOperand/4;
}
module IndirectOperandToIndirectExpr =
IndirectNodeToIndirectExpr<IndirectOperandIndirectExprNodeImpl>;
private class IndirectOperandIndirectExprNode extends IndirectExprNodeBase instanceof IndirectOperand
{
IndirectOperandIndirectExprNode() { IndirectOperandToIndirectExpr::charpred(this) }
final override Expr getConvertedExpr(int n, int index) {
IndirectOperandToIndirectExpr::indirectNodeHasIndirectExpr(this, result, n, index)
}
}
private module IndirectInstructionIndirectExprNodeImpl implements IndirectNodeToIndirectExprSig {
class IndirectNode = IndirectInstruction;
predicate indirectNodeHasIndirectExpr = indirectExprNodeShouldBeIndirectInstruction/4;
}
module IndirectInstructionToIndirectExpr =
IndirectNodeToIndirectExpr<IndirectInstructionIndirectExprNodeImpl>;
private class IndirectInstructionIndirectExprNode extends IndirectExprNodeBase instanceof IndirectInstruction
{
IndirectInstructionIndirectExprNode() { IndirectInstructionToIndirectExpr::charpred(this) }
final override Expr getConvertedExpr(int n, int index) {
IndirectInstructionToIndirectExpr::indirectNodeHasIndirectExpr(this, result, n, index)
}
}
private class IndirectArgumentOutExprNode extends ExprNodeBase, IndirectArgumentOutNode {
IndirectArgumentOutExprNode() { exprNodeShouldBeIndirectOutNode(this, _, _) }
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.
*/
cached
class ExprNode extends Node instanceof ExprNodeBase {
/**
* INTERNAL: Do not use.
*/
cached
Expr getExpr(int n) { result = super.getExpr(n) }
/**
* Gets the non-conversion expression corresponding to this node, if any. If
* this node strictly (in the sense of `getConvertedExpr`) corresponds to a
* `Conversion`, then the result is that `Conversion`'s non-`Conversion` base
* expression.
*/
cached
final Expr getExpr() { result = this.getExpr(_) }
/**
* INTERNAL: Do not use.
*/
cached
Expr getConvertedExpr(int n) { result = super.getConvertedExpr(n) }
/**
* Gets the expression corresponding to this node, if any. The returned
* expression may be a `Conversion`.
*/
cached
final Expr getConvertedExpr() { result = this.getConvertedExpr(_) }
}
/**
* An indirect expression, viewed as a node in a data flow graph.
*/
cached
class IndirectExprNode extends Node instanceof IndirectExprNodeBase {
/**
* Gets the non-conversion expression corresponding to this node, if any. If
* this node strictly (in the sense of `getConvertedExpr`) corresponds to a
* `Conversion`, then the result is that `Conversion`'s non-`Conversion` base
* expression.
*/
cached
final Expr getExpr(int indirectionIndex) { result = this.getExpr(_, indirectionIndex) }
/**
* INTERNAL: Do not use.
*/
cached
Expr getExpr(int n, int indirectionIndex) { result = super.getExpr(n, indirectionIndex) }
/**
* INTERNAL: Do not use.
*/
cached
Expr getConvertedExpr(int n, int indirectionIndex) {
result = super.getConvertedExpr(n, indirectionIndex)
}
/**
* Gets the expression corresponding to this node, if any. The returned
* expression may be a `Conversion`.
*/
cached
Expr getConvertedExpr(int indirectionIndex) {
result = this.getConvertedExpr(_, indirectionIndex)
}
}
}
import Cached

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)
)
}

View File

@@ -546,7 +546,7 @@ module ProductFlow {
Flow1::PathGraph::edges(pred1, succ1, _, _) and
exists(ReturnKindExt returnKind |
succ1.getNode() = returnKind.getAnOutNode(call) and
pred1.getNode().(ReturnNodeExt).getKind() = returnKind
paramReturnNode(_, pred1.asParameterReturnNode(), _, returnKind)
)
}
@@ -574,7 +574,7 @@ module ProductFlow {
Flow2::PathGraph::edges(pred2, succ2, _, _) and
exists(ReturnKindExt returnKind |
succ2.getNode() = returnKind.getAnOutNode(call) and
pred2.getNode().(ReturnNodeExt).getKind() = returnKind
paramReturnNode(_, pred2.asParameterReturnNode(), _, returnKind)
)
}

View File

@@ -6,6 +6,7 @@ private import DataFlowImplCommon as DataFlowImplCommon
private import DataFlowUtil
private import semmle.code.cpp.models.interfaces.PointerWrapper
private import DataFlowPrivate
private import TypeFlow
private import semmle.code.cpp.ir.ValueNumbering
/**
@@ -245,14 +246,6 @@ private module IteratorIndirections {
baseType = super.getValueType()
}
override predicate isAdditionalDereference(Instruction deref, Operand address) {
exists(CallInstruction call |
operandForFullyConvertedCall(getAUse(deref), call) and
this = call.getStaticCallTarget().getClassAndName("operator*") and
address = call.getThisArgumentOperand()
)
}
override predicate isAdditionalWrite(Node0Impl value, Operand address, boolean certain) {
exists(CallInstruction call | call.getArgumentOperand(0) = value.asOperand() |
this = call.getStaticCallTarget().getClassAndName("operator=") and
@@ -261,16 +254,6 @@ private module IteratorIndirections {
)
}
override predicate isAdditionalTaintStep(Node node1, Node node2) {
exists(CallInstruction call |
// Taint through `operator+=` and `operator-=` on iterators.
call.getStaticCallTarget() instanceof Iterator::IteratorAssignArithmeticOperator and
node2.(IndirectArgumentOutNode).getPreUpdateNode() = node1 and
node1.(IndirectOperand).hasOperandAndIndirectionIndex(call.getArgumentOperand(0), _) and
node1.getType().getUnspecifiedType() = this
)
}
override predicate isAdditionalConversionFlow(Operand opFrom, Instruction instrTo) {
// This is a bit annoying: Consider the following snippet:
// ```
@@ -588,230 +571,6 @@ private class BaseCallInstruction extends BaseSourceVariableInstruction, CallIns
cached
private module Cached {
private import semmle.code.cpp.models.interfaces.Iterator as Interfaces
private import semmle.code.cpp.models.implementations.Iterator as Iterator
private import semmle.code.cpp.models.interfaces.FunctionInputsAndOutputs as IO
/**
* Holds if `next` is a instruction with a memory result that potentially
* updates the memory produced by `prev`.
*/
private predicate memorySucc(Instruction prev, Instruction next) {
prev = next.(ChiInstruction).getTotal()
or
// Phi inputs can be inexact.
prev = next.(PhiInstruction).getAnInputOperand().getAnyDef()
or
prev = next.(CopyInstruction).getSourceValue()
or
exists(ReadSideEffectInstruction read |
next = read.getPrimaryInstruction() and
isAdditionalConversionFlow(_, next) and
prev = read.getSideEffectOperand().getAnyDef()
)
}
/**
* Holds if `iteratorDerefAddress` is an address of an iterator dereference (i.e., `*it`)
* that is used for a write operation that writes the value `value`. The `memory` instruction
* represents the memory that the IR's SSA analysis determined was read by the call to `operator*`.
*
* The `numberOfLoads` integer represents the number of dereferences this write corresponds to
* on the underlying container that produced the iterator.
*/
private predicate isChiAfterIteratorDef(
Instruction memory, Operand iteratorDerefAddress, Node0Impl value, int numberOfLoads
) {
exists(
BaseSourceVariableInstruction iteratorBase, ReadSideEffectInstruction read,
Operand iteratorAddress
|
numberOfLoads >= 0 and
isDef(_, value, iteratorDerefAddress, iteratorBase, numberOfLoads + 2, 0) and
isUse(_, iteratorAddress, iteratorBase, numberOfLoads + 1, 0) and
iteratorBase.getResultType() instanceof Interfaces::Iterator and
isDereference(iteratorAddress.getDef(), read.getArgumentDef().getAUse(), _) and
memory = read.getSideEffectOperand().getAnyDef()
)
}
private predicate isSource(Instruction instr, Operand iteratorAddress, int numberOfLoads) {
getAUse(instr) = iteratorAddress and
exists(BaseSourceVariableInstruction iteratorBase |
iteratorBase.getResultType() instanceof Interfaces::Iterator and
not iteratorBase.getResultType() instanceof Cpp::PointerType and
isUse(_, iteratorAddress, iteratorBase, numberOfLoads - 1, 0)
)
}
private predicate isSink(Instruction instr, CallInstruction call) {
getAUse(instr).(ArgumentOperand).getCall() = call and
// Only include operations that may modify the object that the iterator points to.
// The following is a non-exhaustive list of things that may modify the value of the
// iterator, but never the value of what the iterator points to.
// The more things we can exclude here, the faster the small dataflow-like analysis
// done by `convertsIntoArgument` will converge.
not exists(Function f | f = call.getStaticCallTarget() |
f instanceof Iterator::IteratorCrementOperator or
f instanceof Iterator::IteratorBinaryArithmeticOperator or
f instanceof Iterator::IteratorAssignArithmeticOperator or
f instanceof Iterator::IteratorCrementMemberOperator or
f instanceof Iterator::IteratorBinaryArithmeticMemberOperator or
f instanceof Iterator::IteratorAssignArithmeticMemberOperator or
f instanceof Iterator::IteratorAssignmentMemberOperator
)
}
private predicate convertsIntoArgumentFwd(Instruction instr) {
isSource(instr, _, _)
or
exists(Instruction prev | convertsIntoArgumentFwd(prev) |
conversionFlow(unique( | | getAUse(prev)), instr, false, _)
)
}
private predicate convertsIntoArgumentRev(Instruction instr) {
convertsIntoArgumentFwd(instr) and
(
isSink(instr, _)
or
exists(Instruction next | convertsIntoArgumentRev(next) |
conversionFlow(unique( | | getAUse(instr)), next, false, _)
)
)
}
private predicate convertsIntoArgument(
Operand iteratorAddress, CallInstruction call, int numberOfLoads
) {
exists(Instruction iteratorAddressDef |
isSource(iteratorAddressDef, iteratorAddress, numberOfLoads) and
isSink(iteratorAddressDef, call) and
convertsIntoArgumentRev(pragma[only_bind_into](iteratorAddressDef))
)
}
private predicate isChiAfterIteratorArgument(
Instruction memory, Operand iteratorAddress, int numberOfLoads
) {
// Ideally, `iteratorAddress` would be an `ArgumentOperand`, but there might be
// various conversions applied to it before it becomes an argument.
// So we do a small amount of flow to find the call that the iterator is passed to.
exists(CallInstruction call | convertsIntoArgument(iteratorAddress, call, numberOfLoads) |
exists(ReadSideEffectInstruction read |
read.getPrimaryInstruction() = call and
read.getSideEffectOperand().getAnyDef() = memory
)
or
exists(LoadInstruction load |
iteratorAddress.getDef() = load and
memory = load.getSourceValueOperand().getAnyDef()
)
)
}
/**
* Holds if `iterator` is a `StoreInstruction` that stores the result of some function
* returning an iterator into an address computed started at `containerBase`.
*
* For example, given a declaration like `std::vector<int>::iterator it = v.begin()`,
* the `iterator` will be the `StoreInstruction` generated by the write to `it`, and
* `containerBase` will be the address of `v`.
*/
private predicate isChiAfterBegin(
BaseSourceVariableInstruction containerBase, StoreInstruction iterator
) {
exists(
CallInstruction getIterator, Iterator::GetIteratorFunction getIteratorFunction,
IO::FunctionInput input, int i
|
getIterator = iterator.getSourceValue() and
getIteratorFunction = getIterator.getStaticCallTarget() and
getIteratorFunction.getsIterator(input, _) and
isDef(_, any(Node0Impl n | n.asInstruction() = iterator), _, _, 1, 0) and
input.isParameterDerefOrQualifierObject(i) and
isUse(_, getIterator.getArgumentOperand(i), containerBase, 0, 0)
)
}
/**
* Holds if `iteratorAddress` is an address of an iterator that is used for
* a read operation. The `memory` instruction represents the memory that
* the IR's SSA analysis determined was read by the call to `operator*`.
*
* Finally, the `numberOfLoads` integer represents the number of dereferences
* this read corresponds to on the underlying container that produced the iterator.
*/
private predicate isChiBeforeIteratorUse(
Operand iteratorAddress, Instruction memory, int numberOfLoads
) {
exists(
BaseSourceVariableInstruction iteratorBase, LoadInstruction load,
ReadSideEffectInstruction read, Operand iteratorDerefAddress
|
numberOfLoads >= 0 and
isUse(_, iteratorAddress, iteratorBase, numberOfLoads + 1, 0) and
isUse(_, iteratorDerefAddress, iteratorBase, numberOfLoads + 2, 0) and
iteratorBase.getResultType() instanceof Interfaces::Iterator and
load.getSourceAddressOperand() = iteratorDerefAddress and
read.getPrimaryInstruction() = load.getSourceAddress() and
memory = read.getSideEffectOperand().getAnyDef()
)
}
/**
* Holds if `iteratorDerefAddress` is an address of an iterator dereference (i.e., `*it`)
* that is used for a write operation that writes the value `value` to a container that
* created the iterator. `container` represents the base of the address of the container
* that was used to create the iterator.
*/
cached
predicate isIteratorDef(
BaseSourceVariableInstruction container, Operand iteratorDerefAddress, Node0Impl value,
int numberOfLoads, int indirectionIndex
) {
exists(Instruction memory, Instruction begin, int upper, int ind |
isChiAfterIteratorDef(memory, iteratorDerefAddress, value, numberOfLoads) and
memorySucc*(begin, memory) and
isChiAfterBegin(container, begin) and
upper = countIndirectionsForCppType(getResultLanguageType(container)) and
ind = numberOfLoads + [1 .. upper] and
indirectionIndex = ind - (numberOfLoads + 1)
)
}
/**
* Holds if `iteratorAddress` is an address of an iterator that is used for a
* read operation to read a value from a container that created the iterator.
* `container` represents the base of the address of the container that was used
* to create the iterator.
*/
cached
predicate isIteratorUse(
BaseSourceVariableInstruction container, Operand iteratorAddress, int numberOfLoads,
int indirectionIndex
) {
// Direct use
exists(Instruction begin, Instruction memory, int upper, int ind |
isChiBeforeIteratorUse(iteratorAddress, memory, numberOfLoads) and
memorySucc*(begin, memory) and
isChiAfterBegin(container, begin) and
upper = countIndirectionsForCppType(getResultLanguageType(container)) and
ind = numberOfLoads + [1 .. upper] and
indirectionIndex = ind - (numberOfLoads + 1)
)
or
// Use through function output
exists(Instruction memory, Instruction begin, int upper, int ind |
isChiAfterIteratorArgument(memory, iteratorAddress, numberOfLoads) and
memorySucc*(begin, memory) and
isChiAfterBegin(container, begin) and
upper = countIndirectionsForCppType(getResultLanguageType(container)) and
ind = numberOfLoads + [1 .. upper] and
indirectionIndex = ind - (numberOfLoads - 1)
)
}
/** Holds if `op` is the only use of its defining instruction, and that op is used in a conversation */
private predicate isConversion(Operand op) {
exists(Instruction def, Operand use |
@@ -955,11 +714,7 @@ private module Cached {
* Holds if the address computed by `operand` is guaranteed to write
* to a specific address.
*/
private predicate isCertainAddress(Operand operand) {
valueNumberOfOperand(operand).getAnInstruction() instanceof VariableAddressInstruction
or
operand.getType() instanceof Cpp::ReferenceType
}
private predicate isCertainAddress(Operand operand) { isPointerToSingleObject(operand.getDef()) }
/**
* Holds if `address` is a use of an SSA variable rooted at `base`, and the

View File

@@ -6,16 +6,26 @@ private import semmle.code.cpp.models.interfaces.SideEffect
private import DataFlowUtil
private import DataFlowPrivate
private import SsaInternals as Ssa
private import semmle.code.cpp.dataflow.internal.FlowSummaryImpl as FlowSummaryImpl
private import semmle.code.cpp.ir.dataflow.FlowSteps
/**
* Holds if taint propagates from `nodeFrom` to `nodeTo` in exactly one local
* (intra-procedural) step.
* (intra-procedural) step. This relation is only used for local taint flow
* (for example `TaintTracking::localTaint(source, sink)`) so it may contain
* special cases that should only apply to local taint flow.
*/
predicate localTaintStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) {
// dataflow step
DataFlow::localFlowStep(nodeFrom, nodeTo)
or
localAdditionalTaintStep(nodeFrom, nodeTo)
// taint flow step
localAdditionalTaintStep(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::summaryThroughStepTaint(nodeFrom, nodeTo, _)
}
/**
@@ -24,10 +34,11 @@ predicate localTaintStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) {
* different objects.
*/
cached
predicate localAdditionalTaintStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) {
operandToInstructionTaintStep(nodeFrom.asOperand(), nodeTo.asInstruction())
predicate localAdditionalTaintStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo, string model) {
operandToInstructionTaintStep(nodeFrom.asOperand(), nodeTo.asInstruction()) and
model = ""
or
modeledTaintStep(nodeFrom, nodeTo)
modeledTaintStep(nodeFrom, nodeTo, model)
or
// Flow from (the indirection of) an operand of a pointer arithmetic instruction to the
// indirection of the pointer arithmetic instruction. This provides flow from `source`
@@ -35,15 +46,22 @@ predicate localAdditionalTaintStep(DataFlow::Node nodeFrom, DataFlow::Node nodeT
exists(PointerArithmeticInstruction pai, int indirectionIndex |
nodeHasOperand(nodeFrom, pai.getAnOperand(), pragma[only_bind_into](indirectionIndex)) and
hasInstructionAndIndex(nodeTo, pai, indirectionIndex + 1)
)
) and
model = ""
or
any(Ssa::Indirection ind).isAdditionalTaintStep(nodeFrom, nodeTo)
any(Ssa::Indirection ind).isAdditionalTaintStep(nodeFrom, nodeTo) and
model = ""
or
// models-as-data summarized flow
FlowSummaryImpl::Private::Steps::summaryLocalStep(nodeFrom.(FlowSummaryNode).getSummaryNode(),
nodeTo.(FlowSummaryNode).getSummaryNode(), false, model)
or
// object->field conflation for content that is a `TaintInheritingContent`.
exists(DataFlow::ContentSet f |
readStep(nodeFrom, f, nodeTo) and
f.getAReadContent() instanceof TaintInheritingContent
)
) and
model = ""
}
/**
@@ -120,8 +138,8 @@ predicate localExprTaint(Expr e1, Expr e2) {
* 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, model)
}
/**
@@ -141,7 +159,7 @@ predicate defaultTaintSanitizer(DataFlow::Node node) { none() }
* Holds if taint can flow from `nodeIn` to `nodeOut` through a call to a
* modeled function.
*/
predicate modeledTaintStep(DataFlow::Node nodeIn, DataFlow::Node nodeOut) {
predicate modeledTaintStep(DataFlow::Node nodeIn, DataFlow::Node nodeOut, string model) {
// Normal taint steps
exists(CallInstruction call, TaintFunction func, FunctionInput modelIn, FunctionOutput modelOut |
call.getStaticCallTarget() = func and
@@ -150,7 +168,8 @@ predicate modeledTaintStep(DataFlow::Node nodeIn, DataFlow::Node nodeOut) {
nodeIn = callInput(call, modelIn) and nodeOut = callOutput(call, modelOut)
or
exists(int d | nodeIn = callInput(call, modelIn, d) and nodeOut = callOutput(call, modelOut, d))
)
) and
model = "TaintFunction"
or
// Taint flow from one argument to another and data flow from an argument to a
// return value. This happens in functions like `strcat` and `memcpy`. We
@@ -167,7 +186,8 @@ predicate modeledTaintStep(DataFlow::Node nodeIn, DataFlow::Node nodeOut) {
func.(TaintFunction).hasTaintFlow(modelIn, modelMidOut) and
func.(DataFlowFunction).hasDataFlow(modelMidIn, modelOut) and
modelMidOut.isParameterDeref(indexMid) and
modelMidIn.isParameter(indexMid)
modelMidIn.isParameter(indexMid) and
model = "TaintFunction"
)
or
// Taint flow from a pointer argument to an output, when the model specifies flow from the deref
@@ -180,9 +200,11 @@ predicate modeledTaintStep(DataFlow::Node nodeIn, DataFlow::Node nodeOut) {
indirectArgument.hasAddressOperandAndIndirectionIndex(nodeIn.asOperand(), _) and
call.getStaticCallTarget() = func and
(
func.(DataFlowFunction).hasDataFlow(modelIn, modelOut)
func.(DataFlowFunction).hasDataFlow(modelIn, modelOut) and
model = "DataFlowFunction"
or
func.(TaintFunction).hasTaintFlow(modelIn, modelOut)
func.(TaintFunction).hasTaintFlow(modelIn, modelOut) and
model = "TaintFunction"
) and
nodeOut = callOutput(call, modelOut)
)

View File

@@ -0,0 +1,278 @@
private import cpp
private import semmle.code.cpp.ir.IR
private import codeql.typeflow.TypeFlow
private module Input implements TypeFlowInput<Location> {
/** Holds if `alloc` dynamically allocates a single object. */
private predicate isSingleObjectAllocation(AllocationExpr alloc) {
// i.e., `new int`;
alloc instanceof NewExpr
or
// i.e., `malloc(sizeof(int))`
exists(SizeofTypeOperator sizeOf | sizeOf = alloc.getSizeExpr() |
not sizeOf.getTypeOperand().getUnspecifiedType() instanceof ArrayType
)
}
/**
* Holds if `i` is the result of a dynamic allocation.
*
* `isObject` is `true` if the allocation allocated a single object,
* and `false` otherwise.
*/
private predicate isAllocation(Instruction i, boolean isObject) {
exists(AllocationExpr alloc | alloc = i.getUnconvertedResultExpression() |
if isSingleObjectAllocation(alloc) then isObject = true else isObject = false
)
}
private predicate hasExactSingleType(Instruction i) {
// The address of a variable is always a single object
i instanceof VariableAddressInstruction
or
// A reference always points to a single object
i.getResultLanguageType().hasUnspecifiedType(any(ReferenceType rt), false)
or
// `this` is never an array
i instanceof InitializeThisInstruction
or
// An allocation of a non-array object
isAllocation(i, true)
}
private predicate hasExactBufferType(Instruction i) {
// Anything with an array type is a buffer
i.getResultLanguageType().hasUnspecifiedType(any(ArrayType at), false)
or
// An allocation expression that we couldn't conclude allocated a single
// expression is assigned a buffer type.
isAllocation(i, false)
}
private newtype TTypeFlowNode =
TInstructionNode(Instruction i) or
TFunctionNode(IRFunction func)
abstract class TypeFlowNode extends TTypeFlowNode {
/** Gets a textual representation of this node. */
abstract string toString();
/**
* Gets the type of this node. This type may not be the most precise
* possible type, but will be used as a starting point of the analysis.
*/
abstract Type getType();
/** Gets the location of this node. */
abstract Location getLocation();
/** Gets the underlying `Instruction` of this node, if any. */
Instruction asInstruction() { none() }
/** Gets the underlying `IRFunction` of this node, if any. */
IRFunction asFunction() { none() }
/** Holds if the value of this node is always null. */
abstract predicate isNullValue();
}
private class InstructionNode extends TypeFlowNode, TInstructionNode {
Instruction instr;
InstructionNode() { this = TInstructionNode(instr) }
override string toString() { result = instr.toString() }
override Type getType() {
if hasExactSingleType(instr) then result.isSingle() else result.isBuffer()
}
override Location getLocation() { result = instr.getLocation() }
override Instruction asInstruction() { result = instr }
override predicate isNullValue() {
instr.(ConstantInstruction).getValue() = "0" and
instr.getResultIRType() instanceof IRAddressType
}
}
/** Gets the `TypeFlowNode` corresponding to `i`. */
additional InstructionNode instructionNode(Instruction i) { result.asInstruction() = i }
private class FunctionNode extends TypeFlowNode, TFunctionNode {
IRFunction func;
FunctionNode() { this = TFunctionNode(func) }
override string toString() { result = func.toString() }
Instruction getReturnValueInstruction() {
result = func.getReturnInstruction().(ReturnValueInstruction).getReturnValue()
}
override Type getType() { result = instructionNode(this.getReturnValueInstruction()).getType() }
override Location getLocation() { result = func.getLocation() }
override IRFunction asFunction() { result = func }
override predicate isNullValue() {
instructionNode(this.getReturnValueInstruction()).isNullValue()
}
}
/**
* Gets an ultimiate definition of `phi`. That is, an input to `phi` that is
* not itself a `PhiInstruction`.
*/
private Instruction getAnUltimateLocalDefinition(PhiInstruction phi) {
result = phi.getAnInput*() and not result instanceof PhiInstruction
}
/**
* Holds if this function is private (i.e., cannot be accessed outside its
* compilation unit). This means we can use a closed-world assumption about
* calls to this function.
*/
private predicate isPrivate(Function func) {
// static functions have internal linkage
func.isStatic()
or
// anonymous namespaces have internal linkage
func.getNamespace().getParentNamespace*().isAnonymous()
or
// private member functions are only called internally from inside the class
func.(MemberFunction).isPrivate()
}
/**
* Holds if `arg` is an argument for the parameter `p` in a private callable.
*/
pragma[nomagic]
private predicate privateParamArg(InitializeParameterInstruction p, Instruction arg) {
exists(CallInstruction call, int i, Function func |
call.getArgument(pragma[only_bind_into](i)) = arg and
func = call.getStaticCallTarget() and
func.getParameter(pragma[only_bind_into](i)) = p.getParameter() and
isPrivate(func)
)
}
predicate joinStep(TypeFlowNode n1, TypeFlowNode n2) {
// instruction -> phi
getAnUltimateLocalDefinition(n2.asInstruction()) = n1.asInstruction()
or
// return value -> function
n2.(FunctionNode).getReturnValueInstruction() = n1.asInstruction()
or
// function -> call
exists(Function func | func = n1.asFunction().getFunction() |
not func.isVirtual() and
n2.asInstruction().(CallInstruction).getStaticCallTarget() = func
)
or
// Argument -> parameter where the parameter's enclosing function
// is "private".
exists(Instruction arg, Instruction p |
privateParamArg(p, arg) and
n1.asInstruction() = arg and
n2.asInstruction() = p
)
}
/**
* Holds if knowing whether `i1` points to a single object or buffer implies
* knowing whether `i2` points to a single object or buffer.
*/
private predicate instructionStep(Instruction i1, Instruction i2) {
i2.(CopyInstruction).getSourceValue() = i1
or
i2.(CopyValueInstruction).getSourceValue() = i1
or
i2.(ConvertInstruction).getUnary() = i1
or
i2.(CheckedConvertOrNullInstruction).getUnary() = i1
or
i2.(InheritanceConversionInstruction).getUnary() = i1
or
i2.(PointerArithmeticInstruction).getLeft() = i1
}
predicate step(TypeFlowNode n1, TypeFlowNode n2) {
instructionStep(n1.asInstruction(), n2.asInstruction())
}
predicate isNullValue(TypeFlowNode n) { n.isNullValue() }
private newtype TType =
TSingle() or
TBuffer()
class Type extends TType {
string toString() {
this.isSingle() and
result = "Single"
or
this.isBuffer() and
result = "Buffer"
}
/** Holds if this type is the type that represents a single object. */
predicate isSingle() { this = TSingle() }
/** Holds if this type is the type that represents a buffer. */
predicate isBuffer() { this = TBuffer() }
/**
* Gets a super type of this type, if any.
*
* The type relation is `Single <: Buffer`.
*/
Type getASupertype() {
this.isSingle() and
result.isBuffer()
}
}
predicate exactTypeBase(TypeFlowNode n, Type t) {
exists(Instruction instr | instr = n.asInstruction() |
hasExactSingleType(instr) and t.isSingle()
or
hasExactBufferType(instr) and t.isBuffer()
)
}
pragma[nomagic]
private predicate upcastCand(TypeFlowNode n, Type t1, Type t2) {
exists(TypeFlowNode next |
step(n, next)
or
joinStep(n, next)
|
n.getType() = t1 and
next.getType() = t2 and
t1 != t2
)
}
private predicate upcast(TypeFlowNode n, Type t1) {
exists(Type t2 | upcastCand(n, t1, t2) |
// No need for transitive closure since the subtyping relation is just `Single <: Buffer`
t1.getASupertype() = t2
)
}
predicate typeFlowBaseCand(TypeFlowNode n, Type t) { upcast(n, t) }
}
private module TypeFlow = Make<Location, Input>;
/**
* Holds if `i` is an instruction that computes an address that points to a
* single object (as opposed to pointing into a buffer).
*/
pragma[nomagic]
predicate isPointerToSingleObject(Instruction i) {
TypeFlow::bestTypeFlow(Input::instructionNode(i), any(Input::Type t | t.isSingle()), _)
}

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, _)
}
/**

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