Mathias Vorreiter Pedersen
b13123e66e
Merge pull request #9128 from github/release-prep/2.9.2
...
Release preparation for version 2.9.2
2022-05-12 13:04:08 +01:00
Mathias Vorreiter Pedersen
46f237efcb
Update ruby/ql/lib/change-notes/released/0.2.1.md
2022-05-12 11:47:26 +01:00
Mathias Vorreiter Pedersen
103c589c1d
Update python/ql/lib/change-notes/released/0.3.0.md
2022-05-12 11:47:19 +01:00
Mathias Vorreiter Pedersen
7b8c3bdcf9
Update ruby/ql/lib/CHANGELOG.md
2022-05-12 11:47:13 +01:00
Mathias Vorreiter Pedersen
499878a44d
Update python/ql/lib/CHANGELOG.md
2022-05-12 11:47:08 +01:00
Mathias Vorreiter Pedersen
f76d52407d
Update java/ql/lib/change-notes/released/0.2.1.md
2022-05-12 11:47:01 +01:00
Mathias Vorreiter Pedersen
1143b48338
Update java/ql/lib/CHANGELOG.md
2022-05-12 11:46:53 +01:00
Mathias Vorreiter Pedersen
55ce069e30
Update java/ql/lib/change-notes/released/0.2.1.md
2022-05-12 11:43:55 +01:00
Mathias Vorreiter Pedersen
43265c4133
Update python/ql/lib/change-notes/released/0.3.0.md
2022-05-12 11:43:39 +01:00
Mathias Vorreiter Pedersen
b069d1bd17
Update python/ql/lib/CHANGELOG.md
2022-05-12 11:43:33 +01:00
Mathias Vorreiter Pedersen
eb3a35eaea
Update java/ql/src/change-notes/released/0.1.2.md
2022-05-12 11:43:27 +01:00
Mathias Vorreiter Pedersen
11707f8522
Update java/ql/src/CHANGELOG.md
2022-05-12 11:43:19 +01:00
Mathias Vorreiter Pedersen
2ef976a152
Update java/ql/src/CHANGELOG.md
2022-05-12 11:43:08 +01:00
Mathias Vorreiter Pedersen
22bdde6eaa
Update java/ql/lib/change-notes/released/0.2.1.md
2022-05-12 11:43:01 +01:00
Mathias Vorreiter Pedersen
e9e8f3810b
Update java/ql/lib/CHANGELOG.md
2022-05-12 11:41:20 +01:00
Mathias Vorreiter Pedersen
1f7eefe95c
Update java/ql/lib/CHANGELOG.md
2022-05-12 11:41:13 +01:00
github-actions[bot]
ee9980b31c
Release preparation for version 2.9.2
2022-05-12 10:17:28 +00:00
Anders Schack-Mulligen
e0c74d4390
Merge pull request #9124 from github/workflow/coverage/update
...
Update CSV framework coverage reports
2022-05-12 09:06:07 +02:00
Anders Schack-Mulligen
fad7d9ae72
Merge pull request #9120 from igfoo/igfoo/fixes
...
Kotlin: Fix some alerts
2022-05-12 08:29:34 +02:00
Erik Krogh Kristensen
6014614a31
Merge pull request #9103 from erik-krogh/nextParam
...
JS: add support for typed NextJS route-handlers
2022-05-12 08:18:26 +02:00
github-actions[bot]
acaf4517c0
Add changed framework coverage reports
2022-05-12 00:17:30 +00:00
Chris Smowton
85dc1090fe
Merge pull request #9116 from smowton/smowton/feature/accept-conditional-cookie-security
...
Java: tolerate `cookie.setSecure(request.isSecure())`
2022-05-11 21:29:14 +01:00
Tom Hvitved
46ab25b61e
Merge pull request #9098 from aschackmull/dataflow/perf
...
Dataflow: Performance fixes
2022-05-11 20:41:48 +02:00
Ian Lynagh
33e17f1665
Kotlin: Fix some alerts
2022-05-11 17:58:50 +01:00
Ian Lynagh
cfde0a1491
Merge pull request #9109 from igfoo/igfoo/kotlin_merge
...
Initial Kotlin support
2022-05-11 16:16:22 +01:00
Tony Torralba
5be30209c1
Merge pull request #9036 from luchua-bc/java/hardcoded-jwt-key
...
Java: CWE-321 Query to detect hardcoded JWT secret keys
2022-05-11 16:31:34 +02:00
Henry Mercer
6ecc542ca3
Merge pull request #9117 from github/henrymercer/java/tag-telemetry
...
Java: Tag telemetry queries with `telemetry`
2022-05-11 15:13:35 +01:00
Henry Mercer
a626078423
Merge pull request #9118 from github/henrymercer/csharp/tag-telemetry
...
C#: Tag telemetry queries with `telemetry`
2022-05-11 15:13:29 +01:00
Anders Schack-Mulligen
4884520ee1
Dataflow: Review fix.
2022-05-11 15:40:49 +02:00
Chris Smowton
f7e1f3e1a5
Remove URL fragment from Google search
2022-05-11 14:38:09 +01:00
Tom Hvitved
333780e635
Merge pull request #8898 from hvitved/dataflow/clear-expect-summary-components
...
Data flow: Introduce 'with/without content' summary components
2022-05-11 15:16:42 +02:00
Ian Lynagh
c0a755e061
Merge remote-tracking branch 'upstream/main' into igfoo/kotlin_merge
...
Resolving conflicts:
java/ql/lib/semmle/code/java/Expr.qll
2022-05-11 14:13:09 +01:00
Rasmus Wriedt Larsen
46f309c373
Merge pull request #6360 from jorgectf/jorgectf/python/insecure-cookie
...
Python: Add cookie security-related queries
2022-05-11 14:47:11 +02:00
Henry Mercer
b6f1ddcdab
Java: Tag telemetry queries with telemetry
...
This will exclude the results of these queries from the summary tables
produced by `codeql database analyze` in a future version of the CodeQL
CLI.
2022-05-11 13:29:25 +01:00
Henry Mercer
cdd6e0e104
C#: Tag telemetry queries with telemetry
...
This will exclude the results of these queries from the summary tables
produced by `codeql database analyze` in a future version of the CodeQL
CLI.
2022-05-11 13:27:49 +01:00
Rasmus Wriedt Larsen
cff950f5f7
Python: Fix select of py/insecure-cookie
2022-05-11 14:06:30 +02:00
Anders Schack-Mulligen
9a4d86e9b4
Merge pull request #8571 from Marcono1234/marcono1234/statement-expression
...
Java: Add `ValueDiscardingExpr`
2022-05-11 13:37:24 +02:00
Rasmus Wriedt Larsen
fc8633cc01
Python: Fix select for py/cookie-injection
2022-05-11 13:18:14 +02:00
Chris Smowton
0044326884
Add change note
2022-05-11 12:06:27 +01:00
Chris Smowton
c17ef42cc7
Insecure cookie query: accept ServletRequest.isSecure(), and allow more than one possible input to a setSecure(...) call.
2022-05-11 11:59:37 +01:00
luchua-bc
f85c01c975
Correct string source
2022-05-11 10:37:22 +00:00
Chris Smowton
1af0e9b619
Servlets.qll: don't use deprecated library visiblity modifier.
2022-05-11 11:31:14 +01:00
Arthur Baars
a47e429945
Merge pull request #8909 from aibaars/tree-sitter-update
...
Tree sitter update
2022-05-11 12:02:14 +02:00
Rasmus Wriedt Larsen
add6579385
Merge pull request #9022 from RasmusWL/ruby-fix
...
Ruby: Fix `isLocalSourceNode` implementation
2022-05-11 11:52:44 +02:00
Rasmus Wriedt Larsen
27b99c51e9
Python: Add placeholder precision for py/insecure-cookie
2022-05-11 11:36:06 +02:00
Rasmus Wriedt Larsen
a902d3d8f0
Python: Add security-severity for py/insecure-cookie
...
Matching the Java query
7d4767a4f5/java/ql/src/Security/CWE/CWE-614/InsecureCookie.ql (L7)
2022-05-11 11:34:16 +02:00
Rasmus Wriedt Larsen
84ad45c665
Python: Fix Django import
2022-05-11 11:33:35 +02:00
Rasmus Wriedt Larsen
d127d2164a
Merge branch 'main' into jorgectf/python/insecure-cookie
2022-05-11 11:13:47 +02:00
Anders Schack-Mulligen
25336df302
Merge pull request #8873 from atorralba/atorralba/android-startactivity-flowstep
...
Java: Add flow step from startActivity to getIntent
2022-05-11 11:08:08 +02:00
Anders Schack-Mulligen
c217a1e502
Update java/ql/lib/semmle/code/java/Expr.qll
2022-05-11 11:03:13 +02:00
Tony Torralba
43b425d0e4
Merge pull request #9002 from atorralba/atorralba/https-urls-improvs
...
Java: Add OkHttp and Retrofit models
2022-05-11 10:48:08 +02:00
Arthur Baars
907c3db5ca
Address comments
...
Co-authored-by: Nick Rolfe <nickrolfe@github.com >
2022-05-11 09:59:42 +02:00
Erik Krogh Kristensen
5e02a76dfd
add support for typed NextJS route-handlers
2022-05-11 09:45:34 +02:00
Cornelius Riemenschneider
506e09ef32
Merge pull request #9105 from github/criemen/dotnet-lua-tracing-config
...
C#: Lua tracing config: Use API function.
2022-05-11 09:28:09 +02:00
Erik Krogh Kristensen
872b275bd4
Merge pull request #9110 from erik-krogh/qlPackAll
...
QL: add implicit -all to a query pack to match the CodeQL pack resolution
2022-05-10 23:41:26 +02:00
Erik Krogh Kristensen
a5acaeb59c
QL: add implicit -all to a query pack to match the CodeQL pack resolution
2022-05-10 23:25:32 +02:00
Ian Lynagh
b7a0b56e41
Kotlin: Add a this.
2022-05-10 19:51:31 +01:00
Ian Lynagh
8a89251c4f
Kotlin: Tweak dbscheme
2022-05-10 19:51:31 +01:00
Ian Lynagh
3662611b04
Kotlin: Fix compilation_finished upgrade script
2022-05-10 19:51:31 +01:00
Ian Lynagh
b5572422df
Kotlin: Autoformat
2022-05-10 19:51:31 +01:00
Ian Lynagh
8b809459d9
Kotlin: Remove kotlin branch CI test
2022-05-10 19:51:31 +01:00
Ian Lynagh
ab2946cf10
Kotlin: Add release notes
2022-05-10 19:51:31 +01:00
Ian Lynagh
e1d832c2e9
Upgrades: All old diagnostics are generated by the Java extractor
2022-05-10 19:51:31 +01:00
Tamas Vajk
26dfca8010
Add DB upgrade scripts for diagnostics and compilation_finished
2022-05-10 19:51:31 +01:00
Tony Torralba
a5a31db835
Rename AnyEqualsExpr and AnyNotEqualsExpr
2022-05-10 19:51:31 +01:00
Tony Torralba
0e3db78eba
Make GeneratedFileMarker an instance of JavadocElement
2022-05-10 19:51:31 +01:00
Tamas Vajk
4f256d2958
Change LambdaExpr::asMethod to return the big-arity invoke instead of the wrapper
2022-05-10 19:51:31 +01:00
Ian Lynagh
af3bc4f44d
Kotlin: Apply review feedback
2022-05-10 19:51:31 +01:00
Ian Lynagh
2e3d2b8e11
Java: Use the Diagnostics class in DiagnosticsReporting.qll
...
We shouldn't use database types/tables directly in src/
2022-05-10 19:51:31 +01:00
Tamas Vajk
464d13775d
Add QL doc for LambdaExpr::isKotlinFunctionN
2022-05-10 19:51:31 +01:00
Ian Lynagh
1151f79eca
Kotlin: Apply some review feedback
2022-05-10 19:51:31 +01:00
Ian Lynagh
726a005cc2
Update java/ql/lib/semmle/code/java/Expr.qll
...
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com >
2022-05-10 19:51:31 +01:00
Ian Lynagh
1a36b1ab53
Kotlin: Format queries
2022-05-10 19:51:31 +01:00
Ian Lynagh
efe3c0d1ea
Kotlin: Performance tweak
2022-05-10 19:51:30 +01:00
Ian Lynagh
653e74d181
Kotlin: Performance tweak
2022-05-10 19:51:30 +01:00
Ian Lynagh
b9be79473a
Kotlin: Performance tweak
2022-05-10 19:51:30 +01:00
Ian Lynagh
65afd0d776
Kotlin: Performance tweak
2022-05-10 19:51:30 +01:00
Ian Lynagh
f5c0b0ebfe
Kotlin: Performance tweak
2022-05-10 19:51:30 +01:00
Ian Lynagh
e0053cd471
Kotlin: qlformat a query
2022-05-10 19:51:30 +01:00
Ian Lynagh
bfe36558c1
Java/Kotlin: Update stats
2022-05-10 19:51:30 +01:00
Ian Lynagh
43035aef2d
Java: Add an upgrade script
2022-05-10 19:51:30 +01:00
Ian Lynagh
4a6c2c2914
Revert "Java: Add an upgrade script"
...
This reverts commit c964d3262bb344d6c8e55d9bf69ffe2291b2f2cf.
2022-05-10 19:51:30 +01:00
Tamas Vajk
e8b3bf55fa
Code quality improvements
2022-05-10 19:51:30 +01:00
Tamas Vajk
749d606f84
Fix expected file of useless null check test
2022-05-10 19:51:30 +01:00
Tamas Vajk
465a85bb8c
Explicitly check if a when expression is in the expected &&/|| form
2022-05-10 19:51:30 +01:00
Tamas Vajk
3af8273620
Modify extraction of &&/|| to resugar it from when expression
2022-05-10 19:51:30 +01:00
Tamas Vajk
d33224a058
Add test case for missing CFG successor
2022-05-10 19:51:30 +01:00
Tamas Vajk
b66a3141f6
Extract functions using their name from JvmName annotation
2022-05-10 19:51:30 +01:00
Tamas Vajk
a24753f552
Extract final modifier on local variables
2022-05-10 19:51:30 +01:00
Tamas Vajk
4efb87a7dd
Extract enum entry initializers
2022-05-10 19:51:30 +01:00
Ian Lynagh
2647a45239
Kotlin: Fix TypeVariableHidesType performance regression
2022-05-10 19:51:30 +01:00
Tamas Vajk
fc5229a0a5
Extract type access expression for static field access in initializer
2022-05-10 19:51:29 +01:00
Tamas Vajk
c6a75957e9
Fix expected files, fix type access extraction of file level static declarations
2022-05-10 19:51:29 +01:00
Tamas Vajk
1e529b2563
Add missing type access expression for static field accesses
2022-05-10 19:51:29 +01:00
Tamas Vajk
246f228a3b
Add static field access test
2022-05-10 19:51:29 +01:00
Tamas Vajk
f43296a157
Extract type access for enum value access
2022-05-10 19:51:29 +01:00
Tamas Vajk
b5c8d29e40
Extract enum field declarations
2022-05-10 19:51:29 +01:00
Tamas Vajk
d6cbcdc847
Extract type access expression for parameter types
2022-05-10 19:51:29 +01:00
Tamas Vajk
f557719fe5
Extract type access expression for function return types
2022-05-10 19:51:29 +01:00
Tamas Vajk
dcac285a99
Add type access tests
2022-05-10 19:51:29 +01:00
Chris Smowton
7ef9420bfd
Accept test changes
2022-05-10 19:51:29 +01:00
Chris Smowton
23e3bbea73
Fix: don't treat local classes as unspecialised
...
This shouldn't matter either way since they can't be subject to external references
2022-05-10 19:51:29 +01:00
Chris Smowton
4477482990
Share a class instance, not just a label
2022-05-10 19:51:29 +01:00
Chris Smowton
11fed0b4f8
Adjust test expectations
2022-05-10 19:51:29 +01:00
Chris Smowton
d63124a761
Extract a generic specialisation using its own type parameters in the same order like an unbound type
...
This replicates an oddity in the Java extractor that it doesn't differentiate a specialisation Generic<T1, T2, ...> from the unbound type, if T1, T2, ... are Generic's declared type variables occurring in the same order. For example, in `class MyList<T> { void addAll(MyList<T> param) { ... } }`, the type of `param` is an instantiated type, but
gets extracted as an unbound type. This commit can be reverted (except for the improvement to isUnspecialised) if/when that is fixed.
2022-05-10 19:51:29 +01:00
Chris Smowton
f3bd89a5cf
Adjust test expectations
2022-05-10 19:51:29 +01:00
Chris Smowton
375199508e
Always extract static initializers if a class has static members
...
This may not be necessary for anonymous objects, but it is certainly unrelated to `init { ... }` blocks.
2022-05-10 19:51:29 +01:00
Chris Smowton
e21a60bb4b
Only extract anonymous init blocks in an instance initializer context
2022-05-10 19:51:29 +01:00
Chris Smowton
a317dc4246
Extract field initializers
2022-05-10 19:51:29 +01:00
Chris Smowton
9e8e99f4c3
Add interface-delegate test
2022-05-10 19:51:28 +01:00
Chris Smowton
5219ead4d4
Plugin version selection: fix test polarity and use integer not string comparison
...
(Otherwise we'll think that 1.6.10 comes before 1.6.9, for example.) This now implements the desired test: pick a version that exactly matches major and minor versions and which is the least patchlevel that is >= the target compiler.
2022-05-10 19:51:28 +01:00
Chris Smowton
d8b163a589
Fix running on patchlevel versions below the highest of that minor version
...
(For example, picking 1.6.10 to match the host kotlinc when both 1.6.10 and 1.6.20 are available)
2022-05-10 19:51:28 +01:00
Chris Smowton
62f39d7a22
Add test expectation
2022-05-10 19:51:28 +01:00
Chris Smowton
bfe3722018
Extract synthetic coroutine classes
2022-05-10 19:51:28 +01:00
Chris Smowton
a740ead56d
Populate files table once per file, per trap file
...
Otherwise there's a chance the other trap file we're relying upon to populate the files table on our behalf gets overwritten (e.g. superceded by a newer .class file or more appropriate extractor) and we end up with a dangling reference.
This adds only populating the tables when the label is new, to avoid emitting files entries every single time a generic class specialisation is mentioned.
2022-05-10 19:51:28 +01:00
Ian Lynagh
b35b74779a
Revert "Fix CFG construction of ExprStmt and StmtExpr"
...
This reverts commit db8d718cdbf0bef9cdf246221a921b99d4b22bea.
It broke ql/java/ql/test/library-tests/successors/TestDeclarations
2022-05-10 19:51:28 +01:00
Ian Lynagh
d2f6871868
Revert "Fix ExprStmt and StmtExpr in Boolean context"
...
This reverts commit 8a42837578e1c4361ed25682312ea5497ad0a12e.
2022-05-10 19:51:28 +01:00
Ian Lynagh
3aa25013c8
C#: CastingExpr is no longer needed in the main libraries
2022-05-10 19:51:28 +01:00
Tamas Vajk
82b937dedd
Add query and script to plot CFG from DB
2022-05-10 19:51:28 +01:00
Tamas Vajk
037d66de15
Fix ExprStmt and StmtExpr in Boolean context
2022-05-10 19:51:28 +01:00
Ian Lynagh
385691287f
C#: Define CastingExpr
2022-05-10 19:51:28 +01:00
Tamas Vajk
8282e57db5
Fix CFG construction of ExprStmt and StmtExpr
2022-05-10 19:51:28 +01:00
Tamas Vajk
81cb81366b
Add test case for CFG issue with && in if condition
2022-05-10 19:51:28 +01:00
Tamas Vajk
10ef737a60
Adjust kotlin CI job
2022-05-10 19:51:28 +01:00
Tamas Vajk
953c6fdb7b
Fix expected test file
2022-05-10 19:51:28 +01:00
Tamas Vajk
47799ae040
Code quality improvements + add dedicated DeadRefTypes test
2022-05-10 19:51:28 +01:00
Tamas Vajk
cdc7ed0e14
Extract container of adapter function as compiler generated
2022-05-10 19:51:28 +01:00
Tamas Vajk
7f94495601
Add test for adapter function
2022-05-10 19:51:28 +01:00
Tamas Vajk
fc66b73e3b
Extract override modifier for lambda and reflection-like constructs
2022-05-10 19:51:28 +01:00
Tamas Vajk
505ccbbcf6
Extract override modifier
2022-05-10 19:51:28 +01:00
Tamas Vajk
92de139805
Add override tests
2022-05-10 19:51:27 +01:00
Tamas Vajk
ca99cb4999
Code quality improvements
2022-05-10 19:51:27 +01:00
Tamas Vajk
22af7f0e89
Remove duplications of locatable and element in the DB scheme
2022-05-10 19:51:27 +01:00
Ian Lynagh
400654d326
Kotlin: Add latest-url to kotlin_plugin_versions.py
2022-05-10 19:51:27 +01:00
Tamas Vajk
6ab86a1f46
Fix expected test files after 1.6.20 upgrade
2022-05-10 19:51:27 +01:00
Tamas Vajk
4e93134225
Add 1.6.20 support
2022-05-10 19:51:27 +01:00
Ian Lynagh
ff35088b49
Java: Add an upgrade script
2022-05-10 19:51:27 +01:00
Ian Lynagh
843310c466
Kotlin: Remove incorrect upgrade
2022-05-10 19:51:27 +01:00
Tamas Vajk
ad11b3e84a
Add consistency query to verify we always have qualifier for calls
2022-05-10 19:51:27 +01:00
Tamas Vajk
4f3e89dd49
Fix expected test file
2022-05-10 19:51:27 +01:00
Tamas Vajk
a1842f9f17
Remove ExtensionMethodAccess and revert all dataflow changes
2022-05-10 19:51:27 +01:00
Tamas Vajk
95cb0149a3
Fix data flow through ExtensionMethodAccess
2022-05-10 19:51:27 +01:00
Tamas Vajk
38ab7acf3e
Revert "Remove ExtensionMethodAccess to see extension method flows"
...
This reverts commit 9df4f2074379ba4668054a2a66eaaaaf5cb9b6c8.
2022-05-10 19:51:27 +01:00
Tamas Vajk
a9711b8c88
Remove ExtensionMethodAccess to see extension method flows
2022-05-10 19:51:27 +01:00
Tamas Vajk
6fccbaa93b
Add extension method dataflow tests
2022-05-10 19:51:27 +01:00
Ian Lynagh
fac3699a5b
Kotlin: Generate stats
2022-05-10 19:51:27 +01:00
Ian Lynagh
19270369c8
Java: Add an upgrade script
2022-05-10 19:51:27 +01:00
Ian Lynagh
c1629530e5
Kotlin: Fix build on Windows
2022-05-10 19:51:27 +01:00
Chris Smowton
de9648e515
Accept test changes
...
- generics gains extra excluded generic "specialisations" (specifically raw types)
- java_properties stops overwriting the Java extractor's output, which specifically flags isDefConstructor which kotlinc does not
- types naturally gains a lot of new raw types
2022-05-10 19:51:27 +01:00
Chris Smowton
239aab67b6
Populate the files table for generic class instances
...
This is because different instances might see the code in different locations (e.g., the class file exists in more than one jar) or with no location (seen as a .java file passed to kotlinc).
While I'm there, improve the order of checks and fix a trivial bug in withFileOfClass
2022-05-10 19:51:26 +01:00
Chris Smowton
db9ab22437
Erasure: produce raw types, not unbound types
...
This affects the trap labels for methods, and therefore consistency with the Java extractor.
TODO: check whether we can unify `erase` and `toRawType` entirely.
2022-05-10 19:51:26 +01:00
Chris Smowton
97d44d9583
Ensure external class extractions without a VirtualFile are lowest priority
...
Previously by using major version 0 to represent the no-virtual-file case these got highest priority. This meant that a class extracted relating to a .java file seen by the Kotlin compiler, which necessarily lacks a useful source-location, was highest priority. Now that should get overwritten whenever anybody sees it in the form of a .class
file, since this will have version information.
This should in particular eliminate the case where a generic class is extracted with no useful source location (based on .java source), then generic instances are extracted with a useful source location (based on a .class source), but the location isn't in the database.
2022-05-10 19:51:26 +01:00
Tamas Vajk
613d81d231
Extract static modifier and missing type access qualifier for static calls
2022-05-10 19:51:26 +01:00
Ian Lynagh
4cfda638cb
Kotlin: Use -Xopt-in=kotlin.RequiresOptIn when compiling
2022-05-10 19:51:26 +01:00
Ian Lynagh
37cf36bc33
Kotlin: useDeclarationParent: Don't use fakeLabel
2022-05-10 19:51:26 +01:00
Ian Lynagh
5c8e0ff49b
Kotlin: extractTypeParameter: Don't use fakeLabel
2022-05-10 19:51:26 +01:00
Tamás Vajk
48b6c61fdb
Quality improvement: add explicit this in QL
...
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com >
2022-05-10 19:51:26 +01:00
Tamas Vajk
e0afaa462e
Fix Parameter.getACallArgument for parameters of extension methods
2022-05-10 19:51:26 +01:00
Ian Lynagh
1e8d077522
Kotlin: Fix some warnings
2022-05-10 19:51:26 +01:00
Ian Lynagh
f75e711474
Kotlin: Make the build noisier
...
We need to capture output for some commands we run during the build,
but this ended up being refactored so that we ate the output for all
commands. This means that we don't see warnings from the compiler.
Now we not only show the output, but we also print what commands we are
running.
2022-05-10 19:51:26 +01:00
Ian Lynagh
05c062da99
Kotlin: Stop useValueDeclaration returning fakeLabel
2022-05-10 19:51:26 +01:00
Ian Lynagh
c5e73cd6df
Kotlin: Add TypeResult.cast()
2022-05-10 19:51:26 +01:00
Ian Lynagh
86c31cb2e8
Kotlin: Add Label.cast()
2022-05-10 19:51:26 +01:00
Tamas Vajk
c89f3163f9
Revert PrintAst changes related to wrong locations
2022-05-10 19:51:26 +01:00
Tamas Vajk
026ce2a27a
Fix location of parameters in methods of parameterized types
2022-05-10 19:51:26 +01:00
Tamas Vajk
bfcd553c6c
Change location of properties inside parameterized types
2022-05-10 19:51:26 +01:00
Tamas Vajk
0726b6410f
Change location of methods inside parameterized types
2022-05-10 19:51:26 +01:00
Tamas Vajk
3813e6fc10
Fix expected files
2022-05-10 19:51:26 +01:00
Tamas Vajk
acb310e46a
Change parameterized type location to the class file
2022-05-10 19:51:26 +01:00
Tamas Vajk
53f484cd98
Add test for inconsistent generic instantiation locations
2022-05-10 19:51:26 +01:00
Tamas Vajk
49bf53da5d
Make extracted file class public and final
2022-05-10 19:51:25 +01:00
Ian Lynagh
77fec17a36
Kotlin: Autoformat QL
2022-05-10 19:51:25 +01:00
Ian Lynagh
c5e3aefe10
Kotlin: Fix build on Mac (Arm)
...
We were getting:
$ echo foo > bar
$ jar -c -f baz.jar bar
-f : no such file or directory
baz.jar : no such file or directory
K-*��ϳR0�3��r.JM,IM�u�MEX��)h8������y�xk�r�rPYJO�?y_wTbarK���P�e2`wT META-INF/�`wTYJO�??=META-INF/MANIFEST.My_wT�e2~�barPK��
2022-05-10 19:51:25 +01:00
Ian Lynagh
7c571dd551
Kotlin: Allow decoding errors
...
If an error happens, we'd rather see /something/ than get a decoding
error.
2022-05-10 19:51:25 +01:00
Ian Lynagh
aed32cd69b
C#: Autoformat
2022-05-10 19:51:25 +01:00
Tony Torralba
f8ad93a530
Add test case for local variable in anonymous init
...
Also fix another instance of the same issue in extractLocalTypeDeclStmt
2022-05-10 19:51:25 +01:00
Tony Torralba
1926bef050
Don't extract static init when the class already contains an anonymous init
2022-05-10 19:51:25 +01:00
Tony Torralba
3920b64d62
Add support for live literals
2022-05-10 19:51:25 +01:00
Tony Torralba
1f812f856c
Extract static initializers of inner classes
2022-05-10 19:51:25 +01:00
Tamas Vajk
8c50e857e4
Add comments to clarify JVM type substitution for invoke methods
2022-05-10 19:51:25 +01:00
Tamas Vajk
1317d2d578
Fix DB inconsistencies with KFunction and KFunction::invoke call extraction
2022-05-10 19:51:25 +01:00
Tamas Vajk
0b4cf6ec82
Adjust extractEnclosingClass extraction
2022-05-10 19:51:25 +01:00
Tamas Vajk
44c8249a33
Remove outdated TODO comments
2022-05-10 19:51:25 +01:00
Tamas Vajk
5f729f8131
Merge two implementation of enclosing class extraction
2022-05-10 19:51:25 +01:00
Tamas Vajk
fe9333898f
Minor code quality improvements
2022-05-10 19:51:25 +01:00
Tamas Vajk
f12bcc5715
Add dataflow test for property reference being used as lambda
2022-05-10 19:51:25 +01:00
Tamas Vajk
257224aa59
Change base class of property reference classes
2022-05-10 19:51:25 +01:00
Tamas Vajk
cf0be05b44
Add property reference invoke method implementation
2022-05-10 19:51:25 +01:00
Tamas Vajk
abcb367495
Add dataflow tests for lambda-like constructs
...
This commit adds tests for dataflow involving lambdas, big-arity lambdas, SAM conversions, and function references.
2022-05-10 19:51:25 +01:00
Chris Smowton
aab271d81e
Fix extraction of data classes with array members
...
These use compiler-internal intrinsics at the IR layer, which are later lowered to java.util.Arrays calls. This performs that lowering in the same manner.
2022-05-10 19:51:25 +01:00
Chris Smowton
ae2ca183cc
Improve logging when function resolution fails
2022-05-10 19:51:25 +01:00
Ian Lynagh
7dfd99d873
Kotlin: Accept test changes
2022-05-10 19:51:25 +01:00
Ian Lynagh
dbc5e73709
Kotlin: Add a test for annotation classes
2022-05-10 19:51:24 +01:00
Ian Lynagh
34f8d9b9b7
Kotlin: Handle annotation classes
...
Fixes:
[TYPES_NOT_DISJOINT] Base types @class and @interface are not disjoint. A common value is 225832
Relevant element: id=225832
Full ID for 225832: @"class;kotlin.internal.LowPriorityInOverloadResolution"
when Kotlin and Java both see such a class.
2022-05-10 19:51:24 +01:00
Ian Lynagh
b4d04f62b2
Kotlin: Log to the right TRAP file
...
Diagnostics for external classes were ending up in the source file's
TRAP file, and then breaking because `#compilation` isn't defined.
2022-05-10 19:51:24 +01:00
Tamas Vajk
91b7de42ad
Make generated invoke/get/set public
...
The generated `invoke`/`get`/`set` methods are implementing interface members, so they need to be `public`.
2022-05-10 19:51:24 +01:00
Tamas Vajk
878352f69c
Add test for checking generated invoke/get/set visibility
2022-05-10 19:51:24 +01:00
Chris Smowton
61b0efb401
Add test case
2022-05-10 19:51:24 +01:00
Chris Smowton
96908d153d
Accept and amend check for anonymous types with type parameters
2022-05-10 19:51:24 +01:00
Chris Smowton
c0f3988aaa
Tolerate nullable references to anonymous classes
...
This also adds a test case illustrating when this can arise
2022-05-10 19:51:24 +01:00
Chris Smowton
8d6ae50d21
Don't try to assign comments to fake overrides
2022-05-10 19:51:24 +01:00
Chris Smowton
613e6b29a9
Don't log every time a type alias is ignored
...
This is a known TODO; runtime output not required.
2022-05-10 19:51:24 +01:00
Tamas Vajk
5a5d0e15eb
Extract calls to big-arity lambda's invoke by converting the artificial invoke to the existing one
...
Big arity lambda calls in IR look like standard method calls to an `invoke` with N arguments. However, this method doesn't exist in JVM, so instead we need to extract a call to `FunctionN.invoke(Object[])`.
2022-05-10 19:51:24 +01:00
Tamas Vajk
c6bc501207
Fix expected test file
2022-05-10 19:51:24 +01:00
Tamas Vajk
222f2415e2
Fix local function reference extraction
2022-05-10 19:51:24 +01:00
Ian Lynagh
62d9b85b46
Kotlin: This might fix building on Windows
2022-05-10 19:51:24 +01:00
Ian Lynagh
967619f26a
Kotlin: Remove non-ascii character
2022-05-10 19:51:24 +01:00
Ian Lynagh
f138ba5246
C#/Kotlin: Sync SignAnalysisCommon.qll
2022-05-10 19:51:24 +01:00
Chris Smowton
9f294d1ecd
Adjust more test expectations
2022-05-10 19:51:24 +01:00
Chris Smowton
2ea1a6c1f0
Adjust test expectations
...
These all just refer to re-adding empty blocks for classes whose constructors have no initializer statements for simplicity's sake.
2022-05-10 19:51:24 +01:00
Chris Smowton
35d213afc0
Extract varargs constructors
2022-05-10 19:51:24 +01:00
Chris Smowton
e24d78ae14
Create instance variable initializer block eagerly
...
Otherwise when the init block is followed by other constructor statements we can get a gap in a BasicBlock's child sequence due to the child init block never getting created at all.
2022-05-10 19:51:23 +01:00
Chris Smowton
9fd9894f6a
Move abbreviation to external-decl extractor; record full signature.
2022-05-10 19:51:23 +01:00
Chris Smowton
1a656af96a
Make truncation consistent
2022-05-10 19:51:23 +01:00
Chris Smowton
1b91a35df0
Truncate (but keep unique-ish) the names of very long file declarations
2022-05-10 19:51:23 +01:00
Tamas Vajk
b26044b327
Change extension receiver this access to be a parameter access
2022-05-10 19:51:23 +01:00
Tamas Vajk
21f6867cd4
Add test cases for delegating properties to other properties
2022-05-10 19:51:23 +01:00
Tamas Vajk
2f0ad50c08
Adjust trap file names of external file class declarations
2022-05-10 19:51:23 +01:00
Tamas Vajk
f5383bbc17
Add extension receiver type to function signature in trap file names
2022-05-10 19:51:23 +01:00
Ian Lynagh
61728e6a69
Kotlin: Tweak kotlin_plugin_versions.py
2022-05-10 19:51:23 +01:00
Ian Lynagh
0610917435
Kotlin: Workaround for CI on Windows
2022-05-10 19:51:23 +01:00
Ian Lynagh
ef5950197d
Kotlin: Broaden isFake
2022-05-10 19:51:23 +01:00
Ian Lynagh
aee74dd570
Kotlin: Be more consistent in how we deal with "fake" elements
2022-05-10 19:51:23 +01:00
Ian Lynagh
8f85f5552b
Kotlin: Accept test changes
2022-05-10 19:51:23 +01:00
Ian Lynagh
1ff6ada955
Kotlin: Tweak logging
2022-05-10 19:51:23 +01:00
Tamas Vajk
d6feb58bfc
Fix property references to fake overrides
2022-05-10 19:51:23 +01:00
Tony Torralba
4eb1e3a47b
Update ExtensionMethodAccess QLDoc
2022-05-10 19:51:23 +01:00
Tony Torralba
fcb334180d
Create ExtensionMethodAccess class
2022-05-10 19:51:23 +01:00
Ian Lynagh
270beecef5
Kotlin: Write diagnostics to the write TRAP file
...
When a TRAP writer wrote a warning, it was going to the wrong TRAP
file.
2022-05-10 19:51:23 +01:00
Ian Lynagh
62ce28eb68
Kotlin: Populate diagnostic_for
2022-05-10 19:51:23 +01:00
Tamas Vajk
ac3c635fe3
Extract set function for field accessing property references
2022-05-10 19:51:23 +01:00
Tamas Vajk
a6f036d94e
Extract property references with only backing field
2022-05-10 19:51:23 +01:00
Tamas Vajk
90ca47a46b
Extract local delegated property reference
2022-05-10 19:51:23 +01:00
Ian Lynagh
47d8eb458e
Kotlin: Improve top-level error handling
2022-05-10 19:51:23 +01:00
Ian Lynagh
a653054eb3
Kotlin: Make sure the context is empty when it should be
2022-05-10 19:51:23 +01:00
Ian Lynagh
3f4f0e5bec
Kotlin: Accept test changes
2022-05-10 19:51:22 +01:00
Ian Lynagh
43a92f60b2
Kotlin: Give context to diagnostics
...
We now get e.g.
[2022-03-09 13:59:04 K] [ERROR] Diagnostic(com.github.codeql.KotlinUsesExtractor.useSimpleType(KotlinUsesExtractor.kt:505)): Type alias ignored for <root>.Test<kotlin.String>{ <root>.Alias1<kotlin.String> }
...while extracting a function at file:///home/ian/code/dev/ql/java/ql/test/kotlin/library-tests/type_aliases/aliases_with_type_parameters.kt:7:1:7:41
...while extracting a function if real at file:///home/ian/code/dev/ql/java/ql/test/kotlin/library-tests/type_aliases/aliases_with_type_parameters.kt:7:1:7:41
...while extracting a declaration at file:///home/ian/code/dev/ql/java/ql/test/kotlin/library-tests/type_aliases/aliases_with_type_parameters.kt:7:1:7:41
...while extracting a file at file:///home/ian/code/dev/ql/java/ql/test/kotlin/library-tests/type_aliases/aliases_with_type_parameters.kt:1:1:8:0
2022-05-10 19:51:22 +01:00
Tamas Vajk
a7e6ec9d02
Add test case for delegated properties initialized through provideDelegate operator
2022-05-10 19:51:22 +01:00
Tamas Vajk
a3992950b1
Add delegated property call tests
2022-05-10 19:51:22 +01:00
Tamas Vajk
126d780f34
Add delegated property declaration test
2022-05-10 19:51:22 +01:00
Tony Torralba
a6326b69dc
Update java/ql/lib/config/semmlecode.dbscheme
...
Apply suggestion by @igfoo
Co-authored-by: Ian Lynagh <igfoo@github.com >
2022-05-10 19:51:22 +01:00
Tony Torralba
64531dd717
Fix AST representation of WhenExpr and WhenBranch
2022-05-10 19:51:22 +01:00
Tony Torralba
4b22e1a378
Extract WhenBranch as Stmt
2022-05-10 19:51:22 +01:00
Tony Torralba
10ab11cdf7
Handle WhenBranch CFG properly
2022-05-10 19:51:22 +01:00
Tony Torralba
5ea3228768
Fix test expectations
2022-05-10 19:51:22 +01:00
Tony Torralba
9735423c79
Fix WhenExpr flow
2022-05-10 19:51:22 +01:00
Tony Torralba
5979981199
Add test for missing WhenExpr flow
2022-05-10 19:51:22 +01:00
Tamas Vajk
d4701d72d9
Add DelegatedProperty QL class and use it in tests
2022-05-10 19:51:22 +01:00
Tamas Vajk
0ba2daf31a
Adjust extraction to reuse KtProperty* relations
2022-05-10 19:51:22 +01:00
Tamas Vajk
78b4c9403d
Add lazy local delegated property test case
2022-05-10 19:51:22 +01:00
Tamas Vajk
f8343b8cc7
Extract local delegated properties
2022-05-10 19:51:22 +01:00
Chris Smowton
48b99cf55c
Don't try to attribute comments to the implicit this parameter.
2022-05-10 19:51:22 +01:00
Chris Smowton
6abb2529f5
Extract a clinit method for Kotlin files
2022-05-10 19:51:22 +01:00
Tamas Vajk
2d0bb43efe
Do not extract local function containers as anonymous classes
2022-05-10 19:51:22 +01:00
Tamas Vajk
9597932112
Add test that calls a local function multiple times
2022-05-10 19:51:22 +01:00
Ian Lynagh
ea74803053
Kotlin: Add a comment
2022-05-10 19:51:22 +01:00
Ian Lynagh
44375fe1ae
Kotlin: Add LoggerBase to the list of logging classes
2022-05-10 19:51:22 +01:00
Ian Lynagh
79c2ce7f1c
Kotlin: Add tags to log messages (WARN, INFO, etc)
...
Makes it easier to see what's going on
2022-05-10 19:51:21 +01:00
Ian Lynagh
84c7b2310a
Kotlin: Catch all Throwables
...
We want to try to continue even if we hit a stack overflow or an
assertion error.
2022-05-10 19:51:21 +01:00
Chris Smowton
8f929e2498
Avoid recursion through extractFunctionLaterIfExternalFileMember -> useType -> useDeclarationParent
2022-05-10 19:51:21 +01:00
Chris Smowton
1835022c84
Extract external file declarations to individual trap files
2022-05-10 19:51:21 +01:00
Ian Lynagh
2551bb58da
Kotlin: Add a test of recursive instantiations
...
This used to cause a stack overflow
2022-05-10 19:51:21 +01:00
Ian Lynagh
0d79dfc412
Kotlin: Add a test of recursive instantiations
...
This used to cause a stack overflow
2022-05-10 19:51:21 +01:00
Ian Lynagh
90f7cc1223
Kotlin: Move anonymousTypeMapping and locallyVisibleFunctionLabelMapping
...
They're now in LabelManager, so they are shared between extractors.
2022-05-10 19:51:21 +01:00
Ian Lynagh
aad9e5601a
Kotlin: Keep our own stack of extractor contexts
...
For now we only use its length, but in the future we might use this to
give more informatino about the cause of warnings.
2022-05-10 19:51:21 +01:00
Ian Lynagh
9c2df20117
Kotlin: When verbose, make with log when it starts and finishes doing something
2022-05-10 19:51:21 +01:00
Ian Lynagh
8b56302644
Kotlin: Add a concept of 'verbosity'
2022-05-10 19:51:21 +01:00
Ian Lynagh
cffcff93a8
Kotlin: Add a log message
2022-05-10 19:51:21 +01:00
Tamas Vajk
57d4d8e2a8
Code quality improvements
2022-05-10 19:51:21 +01:00
Tamas Vajk
7b2b40cc86
Fix type access extraction of nested generic constructor references
2022-05-10 19:51:21 +01:00
Tamas Vajk
46af85621a
Add nested generic constructor reference test
2022-05-10 19:51:21 +01:00
Tamas Vajk
5e1ebb2545
Fix generic constructor reference extraction
2022-05-10 19:51:21 +01:00
Tamas Vajk
415fcaf605
Add generic constructor reference test
2022-05-10 19:51:21 +01:00
Tamas Vajk
b228ac4814
Code quality improvements
2022-05-10 19:51:21 +01:00
Tamas Vajk
91409534e2
Unify parameter order in type access extraction functions
2022-05-10 19:51:21 +01:00
Tamas Vajk
a8f595c50a
Refactor type access extraction
2022-05-10 19:51:21 +01:00
Tamas Vajk
92e59a3ae1
Add SAM conversion tests
2022-05-10 19:51:21 +01:00
Tamas Vajk
eebfe56c95
Extract more type access expressions
2022-05-10 19:51:21 +01:00
Tamas Vajk
f730aa12b6
Refactor type access extraction for function references and lambdas
2022-05-10 19:51:21 +01:00
Tamas Vajk
a70ade224f
Fix (generic) type access extraction for lambdas
2022-05-10 19:51:21 +01:00
Ian Lynagh
a8c94c500e
Kotlin: Simplify PrimitiveTypeInfo
...
Removes a load of argument-passing
2022-05-10 19:51:20 +01:00
Ian Lynagh
0bf1ff9f2f
Kotlin: Comments and tweaks in Label
2022-05-10 19:51:20 +01:00
Ian Lynagh
2c5dc42db4
Kotlin: Comments and tweaks to TrapWriter.
2022-05-10 19:51:20 +01:00
Ian Lynagh
b1ebcdd524
Kotlin: Add some warnings
2022-05-10 19:51:20 +01:00
Tamas Vajk
4af12e7c9d
Change array.get calls to array indexing in FunctionN.invoke body
2022-05-10 19:51:20 +01:00
Tony Torralba
2da98148dc
Add NotNullExpr flow
2022-05-10 19:51:20 +01:00
Tony Torralba
cf5152baa2
Add test for NotNullExpr flow
2022-05-10 19:51:20 +01:00
Tamas Vajk
4e18974889
Fix type access expression extraction for function/property references
2022-05-10 19:51:20 +01:00
Chris Smowton
73c5f8c591
Accept more test changes
2022-05-10 19:51:20 +01:00
Chris Smowton
f513fdce7b
Accept test changes
2022-05-10 19:51:20 +01:00
Chris Smowton
dc64b536b3
Ensure that initializers are only printed once in a PrintAst run
...
Otherwise the output becomes a DAG not a tree. Java achieves the same by omitting all PrintAst of `<obinit>` routines.
2022-05-10 19:51:20 +01:00
Chris Smowton
13cd145a76
Retain Member.getInitializer for Kotlin programs
...
I opt to identify any syntactic initializer. These are broader in scope than Java's member initializers, which are necessarily context-free, whereas in Kotlin the primary constructor's parameters can be referred to.
2022-05-10 19:51:20 +01:00
Chris Smowton
37543e7a86
Switch to expanding property initializers and init blocks in-place
...
Pros:
* <obinit> no longer emitted: one less function per class
* Parameters to the primary constructor, if any, are no longer referred to out of scope
* Simple primary constructor `val` and `var` declarations work as expected
Cons:
* If there are multiple secondary constructors, no primary constructor and long init blocks, there could be considerable duplicate extraction of those init blocks. Hopefully this case is very rare.
2022-05-10 19:51:20 +01:00
Ian Lynagh
af7d809b8a
Kotlin: Log to a file, not stdout
...
We shouldn't interfere with a build's stdout
2022-05-10 19:51:20 +01:00
Ian Lynagh
a112e9ab5c
Kotlin: Add conditional dumping
2022-05-10 19:51:20 +01:00
Chris Smowton
8d8a2482f1
Accept test changes
...
These are just ordering changes because the bounds of assignment statements relative to their operands have changed.
2022-05-10 19:51:20 +01:00
Chris Smowton
789fe971e4
Fix locations and enclosing statement/callable for assignments
2022-05-10 19:51:20 +01:00
Ian Lynagh
cc0f5d8700
Kotlin: KotlinExtractorExtension tweaks
...
Added/fixed a load of comments.
Adjusted some function visibilities.
2022-05-10 19:51:20 +01:00
Tamas Vajk
67be6a18de
Fix generic callable bindings inside invoke methods
2022-05-10 19:51:20 +01:00
Tamas Vajk
6742496fe3
Get type arguments for property/function references
2022-05-10 19:51:20 +01:00
Tamas Vajk
4b55dce0e9
Add generic function and property reference test cases
2022-05-10 19:51:20 +01:00
Tamas Vajk
18812c810c
Add PropertyRefExpr QL class, change extraction to use it, and add tests
2022-05-10 19:51:19 +01:00
Tamas Vajk
5fea49a3c9
Merge function and property reference extraction logic in helper class
2022-05-10 19:51:19 +01:00
Tamas Vajk
b4b1976bc4
Add get/set method extraction for property references
2022-05-10 19:51:19 +01:00
Tamas Vajk
4ce813a720
Extract anonymous class for property references (class, constructor, call to constructor, optional parameters)
2022-05-10 19:51:19 +01:00
Tamas Vajk
d057530584
Add property reference tests
2022-05-10 19:51:19 +01:00
Chris Smowton
f3b92e7549
Explain why there is no syntheticToRealPropertyMap
2022-05-10 19:51:19 +01:00
Chris Smowton
110a2c7b87
Try our best to fix up the truncated class graph exposed by the Kotlin Android extensions plugin
2022-05-10 19:51:19 +01:00
Chris Smowton
2d1308980a
Remove accidentally committed change
2022-05-10 19:51:19 +01:00
Chris Smowton
9671668782
Remove accidentally committed change
2022-05-10 19:51:19 +01:00
Chris Smowton
dbb7b0bbf0
Update control-flow test expectations
2022-05-10 19:51:19 +01:00
Chris Smowton
5fe65ed983
Extract no-when-branch-found calls
...
These are extracted as "throw new kotlin.NoWhenBranchFoundException();", which is the Java lowering of the intrinsic.
In the process, amend the control-flow graph to let when branches propagate `throw`s outwards, and similarly statement expressions.
2022-05-10 19:51:19 +01:00
Ian Lynagh
d09dff482c
Kotlin: Add diagnostics table to the 'trap' test
2022-05-10 19:51:19 +01:00
Ian Lynagh
a512ee7ac1
Kotlin: Extend long-comment test
2022-05-10 19:51:19 +01:00
Ian Lynagh
f8673d86b5
Kotlin: Don't double-escape TRAP strings
...
The TrapWriter.write* functions are going to escape them for us.
2022-05-10 19:51:19 +01:00
Ian Lynagh
4454ef7f95
Kotlin: Add tests for long comments
2022-05-10 19:51:18 +01:00
Ian Lynagh
9af99c584e
Kotlin: Tweak test
2022-05-10 19:51:18 +01:00
Ian Lynagh
dc7f8a6a5a
Kotlin: Refactor TrapWriter/Logger
...
It's now Tpossible for TrapWriter to log warnings. This required a
little juggling to break the dependency loop between the two classes.
2022-05-10 19:51:18 +01:00
Ian Lynagh
1d824a4e2f
Kotlin: Add a test for truncated literals
2022-05-10 19:51:18 +01:00
Ian Lynagh
6c19409804
Java/Kotlin: Add Diagnostics.qll
2022-05-10 19:51:18 +01:00
Ian Lynagh
0e689a9d35
Kotlin: Avoid name clash
2022-05-10 19:51:18 +01:00
Chris Smowton
da159d7239
Add test showing assign expressions
2022-05-10 19:51:18 +01:00
Chris Smowton
7cb6e19e44
Extract array update operations
...
These are of the form arrExpr[indexExpr] op= rhs
2022-05-10 19:51:18 +01:00
Tamas Vajk
d9c72b1c04
Fix changed expected file
2022-05-10 19:51:18 +01:00
Tamas Vajk
ff5bbee75a
Change extracted base type of function references
2022-05-10 19:51:18 +01:00
Tamas Vajk
55428c0c3c
Update test
2022-05-10 19:51:18 +01:00
Tamas Vajk
42803a161c
WIP: add test for reflective calls
2022-05-10 19:51:18 +01:00
Tony Torralba
c4c254587e
Add StmtExpr flow
2022-05-10 19:51:18 +01:00
Tony Torralba
b626e80a61
Add test for StmtExpr flow
2022-05-10 19:51:18 +01:00
Chris Smowton
8af0f26411
Extract simple in-place operators
...
Complex in-place operators (someFieldOrArrayCell += e) get a harder-to-parse lowering which needs to be intercepted at the IrBlock level
2022-05-10 19:51:18 +01:00
Chris Smowton
2fb54de269
Extract ordinary array get and set operations as ArrayAccesses, not calls
2022-05-10 19:51:18 +01:00
Tamas Vajk
387e8db161
Minor code quality improvements
2022-05-10 19:51:18 +01:00
Tamas Vajk
6154c2be18
Change arguments of big arity invoke call
2022-05-10 19:51:18 +01:00
Tamas Vajk
3f2c275e5f
Fix functional interface selection
2022-05-10 19:51:18 +01:00
Tamas Vajk
46bd6b096e
Add big arity SAM conversion test case
2022-05-10 19:51:18 +01:00
Tamas Vajk
8ab4335562
Add some error handling
2022-05-10 19:51:17 +01:00
Tamas Vajk
a598c7fc0c
Rework SAM conversion extraction (handle arbitrary expression that's being converted)
2022-05-10 19:51:17 +01:00
Tamas Vajk
34ae00fa62
Extract SAM lambda conversion
2022-05-10 19:51:17 +01:00
Chris Smowton
377a0f91f0
Add missing times operator
2022-05-10 19:51:17 +01:00
Chris Smowton
96f3ea460f
Make varargs extraction more Java-like:
...
* Extract varargs as if they are ordinary positional arguments
* Adapt the QL that distinguishes varargs from ordinary arguments to account for Kotlin's varargs which can occur in the middle of the arg list
* Add a test checking dataflow through varargs which doesn't work yet due to array-get and array-set not being extracted as IndexExprs
* Extract the special case arrayOf(*x) as a clone call, which is (equivalent to) the Java lowering of that operation
2022-05-10 19:51:17 +01:00
Chris Smowton
7368b49b16
Implement Any?.String using java.lang.String.valueOf
...
This is how kotlinc does it, and doesn't involve an unchecked null deref like the existing use of Object.toString.
2022-05-10 19:51:17 +01:00
Tamas Vajk
616f20fa52
Handle more cases of qualified this references
2022-05-10 19:51:17 +01:00
Chris Smowton
7fe260c1a2
Convert type-parameter-out-of-scope warning into consistency query
...
The warning in the extractor is inaccurate due to references to enclosing types' type parameters. A consistency query can check that the type parameter is indeed in scope exploiting broader knowledge of the enclosing types.
2022-05-10 19:51:17 +01:00
Chris Smowton
36356c2937
Make IntelliJ parse block TODO properly
2022-05-10 19:51:17 +01:00
Chris Smowton
2a6afff8ba
Remove TODO for method source-declarations
...
This was resolved when method type arguments were implemented.
2022-05-10 19:51:17 +01:00
Chris Smowton
1ecbf8e84b
Clean up and document erase function
2022-05-10 19:51:17 +01:00
Chris Smowton
65f3016a13
Note class-labelling todos resolved
...
Type arguments: yes outer classes can have arguments; they are appended after the full name.
String concatenation: this used to be worse before this unquoted version of the function existed; I think that's what the comment was complaining about.
2022-05-10 19:51:17 +01:00
Chris Smowton
7389e5d687
Note array type signatures are correctly extracted
2022-05-10 19:51:17 +01:00
Chris Smowton
38ad86f850
Note type substitution TODO done
...
`getUnquotedClassLabel` uses `useType` on its args to get their labels; consequently they get substituted for Java types as required.
2022-05-10 19:51:17 +01:00
Chris Smowton
d103bf65bd
Remove inapplicable TODO re: K<->J type substitution
...
Turns out the two use cases the TODO worried about are already taken care of: `Unit` is replaced with `void` only in contexts where primitives can be used, and `List` and similar only have incompatible extension methods, which are declared by `CollectionsKt` not `List`. This is likely deliberate to enable the Kotlin <-> Java substitution to be implemented simply by kotlinc.
2022-05-10 19:51:17 +01:00
Chris Smowton
d593185a8c
Quieten errors relating to generic type aliases
...
Turns out type aliases are always substituted by the compiler, with the `IrSimpleType.abbreviation` field indicating what the original alias was if any. Therefore we're already extracting the right types. This commit simply omits extracting a kt_type for a type alias that uses type parameters as this certainly won't work at present because we don't have IrTypes for the type parameters declared by the alias and used in its RHS.
2022-05-10 19:51:17 +01:00
Chris Smowton
1d47ea30eb
Remove unused function
2022-05-10 19:51:17 +01:00
Chris Smowton
f6db91f294
Update test expectations
2022-05-10 19:51:17 +01:00
Chris Smowton
7dec3f4835
Use EqualityTest for either value or ref comparions, and ReferenceEqualityTest for strictly ref comparison.
2022-05-10 19:51:17 +01:00
Chris Smowton
f95effcf82
Always extract ValueEQ/NEExpr for Kotlin ==/!=
...
I introduce AnyEqualsExpr for either reference or value equality and AnyEqualityTest for the same concept including not-equals operators, and use them wherever the written QL clearly doesn't care about the difference between reference and value comparison, typically because it is concerned with testing against null or against a primitive constant.
2022-05-10 19:51:17 +01:00
Chris Smowton
a120fab9f7
Complete implementation of equality tests
...
- Create a new operator representing an infix value [in]equality test, equivalent to Objects.equals(lhs, rhs)
- Continue to use simple equality where it is clearly possible at the callsite
- Note that ieee754equals is the same as Java's == and != operators
2022-05-10 19:51:17 +01:00
Chris Smowton
b339cf7f2b
Restore CI_TOKEN secret
2022-05-10 19:51:16 +01:00
Chris Smowton
658e6f4009
Try no token
2022-05-10 19:51:16 +01:00
Chris Smowton
f870805c0c
Create test-kotlin.yml
2022-05-10 19:51:16 +01:00
Ian Lynagh
97793b58cd
Kotlin: Tweak diagnostic writing
...
In particular, we now write full exception information, so we can
diagnose problems.
We were using `warn` to log errors in some cases, and generally using
lower-level functions than necessary. We now use the appropriate
functions. I've lost the distinction between e.g. ErrorHigh and ErrorSevere
in this, but we can add it back if it's important.
2022-05-10 19:51:16 +01:00
Ian Lynagh
48c4438a78
Kotlin: Rename the final warn function to diagnostic
2022-05-10 19:51:16 +01:00
Ian Lynagh
ee9f9bb07e
Kotlin: Move a function
2022-05-10 19:51:16 +01:00
Ian Lynagh
79f80e6541
Kotlin: Rename CODEQL_EXTRACTOR_KOTLIN_WARNING_LIMIT to CODEQL_EXTRACTOR_KOTLIN_DIAGNOSTIC_LIMIT
2022-05-10 19:51:16 +01:00
Ian Lynagh
a25b411dd0
Kotlin: Rename "warning" to "diagnostic" a lot
2022-05-10 19:51:16 +01:00
Ian Lynagh
458cb850a7
Kotlin: Accept test changes
2022-05-10 19:51:16 +01:00
Ian Lynagh
9296bf3079
Kotlin: Write extractor name to TRAP file metadata
2022-05-10 19:51:16 +01:00
Chris Smowton
629af664c6
Explicitly specify whether a dispatch or an extension receiver is intended
2022-05-10 19:51:16 +01:00
Chris Smowton
377bd8f2e9
Extract String?.plus as either an AddExpr or a call to an intrinsic
...
If it is used by the compiler to implement the infix plus operator, resugar it and extract a `+` as Java would. If it is literally called by the user (e.g. `(if (x) then "not null" else null).plus(something)`), then extract a call to the real method Intrinsics.stringPlus (a two-arg static method).
2022-05-10 19:51:16 +01:00
Chris Smowton
93e8d5a2d6
Add tests for mutually-recursive types
2022-05-10 19:51:16 +01:00
Chris Smowton
8bb23651ae
Extract type parameter bounds
2022-05-10 19:51:16 +01:00
Tamas Vajk
ec5bc8dad5
Add workaround for unbound symbols (get stub from descriptor)
2022-05-10 19:51:16 +01:00
Tamas Vajk
2965e780cc
Add local dataflow test for string templates
2022-05-10 19:51:16 +01:00
Tony Torralba
6bd6097ed1
Add taint step for StringTemplateExpr
2022-05-10 19:51:16 +01:00
Tamas Vajk
b7914ed77b
Code quality improvements
2022-05-10 19:51:16 +01:00
Tamas Vajk
695b3a6dbd
Add fallback symbol lookup for IrFunctionReference extraction
2022-05-10 19:51:16 +01:00
Tamas Vajk
d495badc1e
Rename companion object QL class
2022-05-10 19:51:16 +01:00
Tamas Vajk
535610452f
Fix missing newline in DB scheme generator
2022-05-10 19:51:16 +01:00
Chris Smowton
b9d8fe72f0
TRAP formatting: adopt Java's standards
...
* Encode dates with D"" strings
* Truncate exceedingly long string values
* Note that floats don't require any special handling
2022-05-10 19:51:16 +01:00
Tamas Vajk
4adf5829e4
Fix expected files
2022-05-10 19:51:16 +01:00
Tamas Vajk
9ff9bbe1c5
Fix merge conflict
2022-05-10 19:51:16 +01:00
Tamas Vajk
b4beddf2f9
Introduce cast for <unsafe-coerce> calls
2022-05-10 19:51:15 +01:00
Ian Lynagh
8d754f5129
Kotlin: Fix bug in, and performance of, NullGuards::clearlyNotNullExpr
2022-05-10 19:51:15 +01:00
Ian Lynagh
03c1845053
Kotlin: Add a TODO comment
2022-05-10 19:51:15 +01:00
Ian Lynagh
76ca0b2776
Kotlin: Pull Kotlin type for localvars out into its own table
2022-05-10 19:51:15 +01:00
Ian Lynagh
7862229807
Kotlin: Pull Kotlin type for params out into its own table
2022-05-10 19:51:15 +01:00
Ian Lynagh
dc26abe341
Kotlin: Pull Kotlin type for methods/constrs out into their own tables
2022-05-10 19:51:15 +01:00
Ian Lynagh
ee008773dc
Kotlin: Pull Kotlin type for fields out into its own table
2022-05-10 19:51:15 +01:00
Ian Lynagh
0f7f90dd4e
Kotlin: Add a consistency query for Kotlin types
2022-05-10 19:51:15 +01:00
Ian Lynagh
86bf126ed8
Kotlin: Pull Kotlin type for expressions out into its own table
2022-05-10 19:51:15 +01:00
Tamas Vajk
cd5555a5dd
Extract companion objects from interfaces
2022-05-10 19:51:15 +01:00
Tamas Vajk
53f40a3f31
Do not extract fake properties
2022-05-10 19:51:15 +01:00
Tamas Vajk
5c38b4e84d
Extract expression body
2022-05-10 19:51:15 +01:00
Chris Smowton
4d408159aa
When extracting a call to an inherited method, substitute the callee's type parameters appropriately.
2022-05-10 19:51:15 +01:00
Chris Smowton
8c9c37ca47
Revert "Kotlin: Extract fake overrides for now"
...
This reverts commit a1ffa7b66b6bc1a9b6fd93da60e7a16c0dc2fb21.
2022-05-10 19:51:15 +01:00
Ian Lynagh
16a27f5258
Kotlin: Provide a way for tests to cause an exception
2022-05-10 19:51:15 +01:00
Ian Lynagh
89eae2407b
Kotlin: Improve error handling
...
Each compilation, and each file within a cmopilation, now gets a
"result" indicating whether it had recoverable or non-recoverable
errors.
2022-05-10 19:51:15 +01:00
Tamas Vajk
4c68b583de
Do not report negative index warning on extension parameters
2022-05-10 19:51:15 +01:00
Ian Lynagh
8d15d0acfb
Kotlin: Extract fake overrides for now
...
When we have Kotlin:
class A {
fun foo(z: OB<G1, G2>.B<E1, E2>) {
val foo = z.someFun()
}
}
and Java:
public class OB<S1, S2> extends OC<F1, F2> {
public class B<T1, T2> extends OC<F1, F2>.C<D1, D2, T1, T2> {
}
}
class OC<U1, U2> {
public class C<X1, X2, Y1, Y2> {
int someFun() {
return 5;
}
}
}
the `someFun` call is to a fake override, and has 4 type arguments.
If we treat it as calling the real function, then 6 type are expected,
and we get IndexOutOfBoundsException when we try to reorder the
type parameters in orderTypeArgsLeftToRight.
So for now, we just extract the fake overrides, so that we at least
don't crash.
2022-05-10 19:51:15 +01:00
Ian Lynagh
46ccd45833
Kotlin: Add tests for fake overrides
2022-05-10 19:51:15 +01:00
Chris Smowton
fdb1668cff
CommentExtractor: use actual file label instead of hopefully correctly guessing its string form
2022-05-10 19:51:15 +01:00
Tamas Vajk
bb7e01988a
Change kotlin dependency version from 1.6.0-RC2 to 1.6.10
2022-05-10 19:51:15 +01:00
Chris Smowton
0d90148f3e
Prefer the Kotlin extractor's version of trap files
2022-05-10 19:51:15 +01:00
Chris Smowton
69c645a594
Log when a class version can't be read
2022-05-10 19:51:15 +01:00
Tamas Vajk
300719a07a
Do not delete temp TRAP files when file level exception is caught
2022-05-10 19:51:14 +01:00
Tamas Vajk
82fe08ea8e
Improve exception handling
2022-05-10 19:51:14 +01:00
Tamas Vajk
29f4eb96e1
Handle exceptions on file level
2022-05-10 19:51:14 +01:00
Ian Lynagh
468a911f83
Kotlin: Use with in a number more cases
2022-05-10 19:51:14 +01:00
Ian Lynagh
f985671d7f
Kotlin: Make with an inline function
2022-05-10 19:51:14 +01:00
Ian Lynagh
3cc79f8b56
Kotlin: 'with' PoC
2022-05-10 19:51:14 +01:00
Ian Lynagh
2868644d36
Kotlin: Remove some code marked 'delete'
2022-05-10 19:51:14 +01:00
Ian Lynagh
4cf88e1a8d
Kotlin: Remove some comments
...
These are now in Kotlin #38
2022-05-10 19:51:14 +01:00
Ian Lynagh
c62ad4b802
Kotlin: Pass dependencyCollector when making a new KotlinFileExtractor
...
I think this only wasn't done previously because it used to make a
KotlinSourceFileExtractor.
2022-05-10 19:51:14 +01:00
Ian Lynagh
5f176beb09
Kotlin: Refactoring: Use a more idiomatic way to prepend to a list
2022-05-10 19:51:14 +01:00
Ian Lynagh
8d2221ea60
Kotlin: getFunctionLabel: Add comments
2022-05-10 19:51:14 +01:00
Ian Lynagh
d1a0a9668f
Kotlin: Remove a default argument
...
It was only defaulted in one case, and it's probably clearer to be
explicit.
2022-05-10 19:51:14 +01:00
Ian Lynagh
c125c1a698
Kotlin: getFunctionLabel: Make parentId be nullable
...
This allows us to simplify the set of functions.
2022-05-10 19:51:14 +01:00
Ian Lynagh
dd51141029
Kotlin: Use variable names more consistently
2022-05-10 19:51:14 +01:00
Ian Lynagh
2f8ede2ae5
Kotlin: Fix a variable shadowing warning
2022-05-10 19:51:14 +01:00
Ian Lynagh
72a6bfe7db
Kotlin: getFunctionLabel: Small refactoring
...
We now pass the IrDeclarationParent of the function to the final
getFunctionLabel function, and that takes care of finding the
enclosing class.
2022-05-10 19:51:14 +01:00
Chris Smowton
27b0d579d0
Add compilation-units test
2022-05-10 19:51:14 +01:00
Chris Smowton
7a756e3be9
Extract compilation-unit package and location for class files
2022-05-10 19:51:14 +01:00
Chris Smowton
024f8c651e
Accept test changes
2022-05-10 19:51:14 +01:00
Chris Smowton
863037ec41
Always extract methods of user-class supertypes
...
This matches the Java extractor's behaviour. Also if we re-visit a class to extract its members, revisit its supertypes to extract their members too.
2022-05-10 19:51:14 +01:00
Tamas Vajk
8f48c1b161
Add test for missing generic method
2022-05-10 19:51:14 +01:00
Chris Smowton
20d56094ee
Note that unusedLocation can raise an alert for used but inaccessible locations
2022-05-10 19:51:13 +01:00
Ian Lynagh
920599fcf5
Kotlin: Make an unnecessarily-optional argument a required argument
2022-05-10 19:51:13 +01:00
Tamas Vajk
52597e5d63
Fix missing declarations in declaration stack
2022-05-10 19:51:13 +01:00
Tamas Vajk
482a37cfe3
Fix unbound symbol.owner references and add todos
2022-05-10 19:51:13 +01:00
Ian Lynagh
41c36760f7
Kotlin: Small refactorings and comments
2022-05-10 19:51:13 +01:00
Ian Lynagh
c0f194316f
Kotlin: Update test following changes to casting operators
2022-05-10 19:51:13 +01:00
Ian Lynagh
ad33c47536
Kotlin: Add a test for Kotlin seeing Java code as properties
2022-05-10 19:51:13 +01:00
Ian Lynagh
579c590ea6
Kotlin: Accept test changes following "casting" operator changes
2022-05-10 19:51:13 +01:00
Ian Lynagh
6566f7b69f
Kotlin: Add types for the different kinds of casts that Kotlin has
...
We might want to unify some of these in future, but doing that
correctly is easier than splitting them up correctly, so I've given each
one its own QL class for now.
I am not familiar with many of the libraries/queries that use CastExpr.
I've briefly looked at them and updated them in a way that looks
superficially reasonable, but some of the uses will probably want to be
refined later.
2022-05-10 19:51:13 +01:00
Ian Lynagh
7cf1289385
Kotlin: Fix build with old JDKs
2022-05-10 19:51:13 +01:00
Chris Smowton
221fa37081
Fix naming of local class instances that fall within generic functions
2022-05-10 19:51:13 +01:00
Ian Lynagh
735520a4ce
Kotlin: Accept test changes in types test
2022-05-10 19:51:13 +01:00
Ian Lynagh
e9fcd4749a
Kotlin: Use ASM9 rather than ASM7
...
This fixes
exception: java.lang.UnsupportedOperationException: PermittedSubclasses requires ASM9
when we encounter ConstantDesc.class in the JDK's modules.
2022-05-10 19:51:13 +01:00
Tamas Vajk
646fc58c25
Fix expected test files
2022-05-10 19:51:13 +01:00
Tamas Vajk
44b731c68e
Exclude extraction of fake overridden properties
2022-05-10 19:51:13 +01:00
Tamas Vajk
55b8e4400d
Code quality improvements
2022-05-10 19:51:13 +01:00
Tamas Vajk
b6e5e1977d
Extract more visibility modifiers
2022-05-10 19:51:13 +01:00
Ian Lynagh
a6d0dc7751
Kotlin: Small refactorings
2022-05-10 19:51:13 +01:00
Ian Lynagh
e1cff50c39
Kotlin: Remove KotlinSourceFileExtractor
2022-05-10 19:51:13 +01:00
Ian Lynagh
c1c4e4f86c
Kotlin: Move extractFileContents into KotlinFileExtractor
2022-05-10 19:51:13 +01:00
Ian Lynagh
d43efd4cc7
Kotlin: KotlinSourceFileExtractor: Take filePath rather than file
2022-05-10 19:51:13 +01:00
Tamas Vajk
8e31bd8ec7
Update expected files after rebase
2022-05-10 19:51:13 +01:00
Tamas Vajk
9e21fa838e
Test case for generic inner type instantiation
2022-05-10 19:51:13 +01:00
Chris Smowton
978978b86a
Accept test changes
2022-05-10 19:51:13 +01:00
Chris Smowton
f4314c1f3d
Substitute all generic types into function trap IDs and signatures, and ensure the subbed types are never primitive
...
The solution for ensuring they are primitive (making the range of the substitution always nullable) will need replacing once we export Kotlin types.
2022-05-10 19:51:12 +01:00
Chris Smowton
3365f3972e
Instantiated generic type substitution: substitute outer class parameters too
2022-05-10 19:51:12 +01:00
Chris Smowton
fd495aa783
Name non-generic functions for their non-erased parameter types
2022-05-10 19:51:12 +01:00
Chris Smowton
f177c2c5ae
Function trap ids: remove spaces between value parameters
...
Otherwise these won't match the IDs used by the Java extractor.
2022-05-10 19:51:12 +01:00
Chris Smowton
f38f03e6c9
Value parameters: provide correct source declaration
2022-05-10 19:51:12 +01:00
Chris Smowton
cd07cc448e
Class trap labels: include outer type parameters
2022-05-10 19:51:12 +01:00
Chris Smowton
94efb427fe
Type parameters: record index Java-style
...
Previously they received indices offset by the number of surrounding class type parameters.
2022-05-10 19:51:12 +01:00
Chris Smowton
178f128bdc
Function labels: include <n> suffix (where n is the number of function type parameters)
...
This matches the Java extractor's behaviour.
2022-05-10 19:51:12 +01:00
Ian Lynagh
448b3d38d3
Kotlin: Duplicate less TRAP
2022-05-10 19:51:12 +01:00
Ian Lynagh
2f435a1a95
Kotlin: file_classes consistency check now passes
2022-05-10 19:51:12 +01:00
Ian Lynagh
368c330ecf
Kotlin: Accept test changes following file-class fixes
2022-05-10 19:51:12 +01:00
Ian Lynagh
194e9fd2da
Kotlin: Handle file classes better
2022-05-10 19:51:12 +01:00
Ian Lynagh
4340fe7044
Kotlin: Comments: Small refactoring
2022-05-10 19:51:12 +01:00
Tamas Vajk
b599ff2792
Change variable location extraction
2022-05-10 19:51:12 +01:00
Tamás Vajk
75e4b6c740
Fix typo in PrintAst.qll
2022-05-10 19:51:12 +01:00
Chris Smowton
33a9b4fb16
Add explanatory comment
2022-05-10 19:51:12 +01:00
Chris Smowton
e16a135a09
Add inner generic class test
2022-05-10 19:51:12 +01:00
Chris Smowton
0a4f97b151
Accept changes to standard library types
...
These are inner classes of the generic class java.lang.invoke.ClassSpecializer, whose generic parameters are no longer inappropriately attributed to its children.
2022-05-10 19:51:12 +01:00
Chris Smowton
997f818643
Accept java-and-kotlin result improvements
...
This happened because setting the type context for the return-type part of a function's label meant that the label now matches Java <-> Kotlin, and therefore it gets a Kotlin-source source location.
2022-05-10 19:51:12 +01:00
Chris Smowton
ab449e0517
Fix: use void as constructor return types in their labels
...
Without this we're incompatible with the Java extractor's constructor labelling
2022-05-10 19:51:12 +01:00
Chris Smowton
5188998bc6
Extract outer <-> inner class relationships for generic instances
2022-05-10 19:51:12 +01:00
Chris Smowton
67e3374a23
Fix inner generic type extraction
...
- Don't attribute type parameters that belong to the outer class to the inner
- Don't extract constructor generic parameters as if they were parameters of the type being instantiated
2022-05-10 19:51:12 +01:00
Tamas Vajk
aa0ddeb29a
Fix external type locations in tests
2022-05-10 19:51:12 +01:00
Tamas Vajk
afd71a00d0
Fix extraction of function references without dispatch receiver
2022-05-10 19:51:12 +01:00
Tamas Vajk
ef2795c88b
Add ktLocalFunction relation and tests for local and anonymous classes
2022-05-10 19:51:11 +01:00
Tamas Vajk
e0bf7d8246
Extract local class declarations
2022-05-10 19:51:11 +01:00
Tamas Vajk
1e64887903
Extract field receiver in field read/write
2022-05-10 19:51:11 +01:00
Tamas Vajk
10ae157682
Extract function references
2022-05-10 19:51:11 +01:00
Tamas Vajk
6950f868fb
Fix type access extraction in field declarations
2022-05-10 19:51:11 +01:00
Tamas Vajk
e5003e4032
Adjust PrintAST query to handle kotlin constructs
2022-05-10 19:51:11 +01:00
Tamas Vajk
73cd497427
Add todo comment to move property from parameter initialization to constructor
2022-05-10 19:51:11 +01:00
Tamas Vajk
313912a131
Fix test expected files
2022-05-10 19:51:11 +01:00
Chris Smowton
2730d07b4c
Extract static method qualifier type accesses
2022-05-10 19:51:11 +01:00
Chris Smowton
ef9a213ae1
Cleanup: use extractTypeAccess wherever possible
2022-05-10 19:51:11 +01:00
Chris Smowton
70841a5896
Add test for companion object
2022-05-10 19:51:11 +01:00
Tamas Vajk
30ff5e2517
Change unknown location to whole file location in source extraction
2022-05-10 19:51:11 +01:00
Tamas Vajk
9d7794185e
Fix temporary variable locations
2022-05-10 19:51:11 +01:00
Chris Smowton
5c77131637
Add tests for generic methods
2022-05-10 19:51:11 +01:00
Tamas Vajk
67d2c52e86
Extract field declarations
2022-05-10 19:51:11 +01:00
Tamas Vajk
5bc28ab45a
Extract externally defined inner classes only once
2022-05-10 19:51:11 +01:00
Chris Smowton
acad36cab4
Implement raw type extraction
2022-05-10 19:51:11 +01:00
Tamas Vajk
6455c988f2
Extract class references
2022-05-10 19:51:11 +01:00
Ian Lynagh
05028e612c
Kotlin: Accept test changes
2022-05-10 19:51:11 +01:00
Ian Lynagh
fb90c70e2e
Kotlin: Extract visibility for properties
2022-05-10 19:51:11 +01:00
Ian Lynagh
348ae357ed
Kotlin: Extract method visibility
2022-05-10 19:51:11 +01:00
Ian Lynagh
6616f452d7
Kotlin: Move extractClassModifiers to KotlinFileExtractor
...
It doesn't need to be in KotlinUsesExtractor any more, and this gives us
better warnings.
2022-05-10 19:51:11 +01:00
Ian Lynagh
5342b13cb6
Kotlin: Add class modifiers
2022-05-10 19:51:11 +01:00
Ian Lynagh
08bb134022
Java/Kotlin: Tweak consistency queries
2022-05-10 19:51:11 +01:00
Ian Lynagh
7c03ed99dc
Java/Kotlin: Add File.is{,Java,Kotlin}SourceFile()
2022-05-10 19:51:10 +01:00
Chris Smowton
70708d69bf
Don't extract or call fake-override methods
2022-05-10 19:51:10 +01:00
Chris Smowton
0c7075c749
Give getters and setters their jvm-lowered names
2022-05-10 19:51:10 +01:00
Chris Smowton
248011e828
Improve generics test to indicate callee decltypes
2022-05-10 19:51:10 +01:00
Chris Smowton
26abb4d0e3
Correctly record methods' and constructors' source-declarations
2022-05-10 19:51:10 +01:00
Chris Smowton
2677115385
Switch comment to use Kotlin syntax
2022-05-10 19:51:10 +01:00
Chris Smowton
44c64f0784
Always extract constructor return type as unit
2022-05-10 19:51:10 +01:00
Chris Smowton
d2e626cbee
Add declaring type to test to distinguish ambiguously-named methods
2022-05-10 19:51:10 +01:00
Chris Smowton
fa9971c6f3
Uniformly use getFunctionShortName
2022-05-10 19:51:10 +01:00
Chris Smowton
c5e85620e7
Rework conditional generic extraction to use global state
2022-05-10 19:51:10 +01:00
Chris Smowton
25674247a2
Accept test changes relating to generic constructors
2022-05-10 19:51:10 +01:00
Chris Smowton
d57ac71cd0
Anonymous objects: always extract as source classes
2022-05-10 19:51:10 +01:00
Chris Smowton
faa7ccfb01
Add test of selective generic extraction
2022-05-10 19:51:10 +01:00
Chris Smowton
b601cdeb8f
Extract generic constructor calls
2022-05-10 19:51:10 +01:00
Chris Smowton
d4519eb1bc
Downgrade assert to warning
2022-05-10 19:51:10 +01:00
Chris Smowton
bb3049a686
Extract generic method prototypes
...
These feature substituted types according to their declaring generic specialisation, with wildcards that reach top-level being converted to their upper or lower bound depending on usage context.
This commit also includes an incidental fix such that constructors declare their return-type as unit, consistent with the Java extractor.
2022-05-10 19:51:10 +01:00
Ian Lynagh
b38f47f9ea
Java/Kotlin: Tweak consistency queries
2022-05-10 19:51:10 +01:00
Ian Lynagh
c04912701a
Java/Kotlin: Speed up toString.ql
...
It's less informative now, but manual debugging will likely be needed
to investigate failures.
2022-05-10 19:51:10 +01:00
Ian Lynagh
ab93d166b8
Java/Kotlin: Tweak consistency queries
2022-05-10 19:51:10 +01:00
Tamas Vajk
fa5c3f9159
Remove and replace @anonymousclassdeclstmt with @localtypedeclstmt
2022-05-10 19:51:10 +01:00
Tamas Vajk
e325925f5a
Extract field declaration directly inside class
2022-05-10 19:51:10 +01:00
Tamas Vajk
929c50f0b3
Adjust build script based on review
2022-05-10 19:51:10 +01:00
Tamas Vajk
0978e522d0
Fix expected files
2022-05-10 19:51:10 +01:00
Tamas Vajk
7b58d01eff
Specify lambda method for big arity lambdas
2022-05-10 19:51:10 +01:00
Tamas Vajk
dec165c5b2
Remove Lambda class as supertype
2022-05-10 19:51:09 +01:00
Tamas Vajk
3cd2583ec8
Handle large arity lambdas, and add missing type access for some constructor calls (needed for anonymous classes)
2022-05-10 19:51:09 +01:00
Tamas Vajk
f4c87cb79d
Extract function expressions
2022-05-10 19:51:09 +01:00
Ian Lynagh
b32ac935f6
Revert "Merge pull request #160 from github/smowton/feature/type-substitution-prototypes"
...
This reverts commit 1dd83a3f0fab407fe94a09fc517c516ed24b1d0c, reversing
changes made to 22aebf8128bfe20bb89e5ecc11e0e8cdd65bf317.
2022-05-10 19:51:09 +01:00
Chris Smowton
4e36b2489c
Add test of selective generic extraction
2022-05-10 19:51:09 +01:00
Chris Smowton
b8af2e6e40
Extract generic constructor calls
2022-05-10 19:51:09 +01:00
Chris Smowton
cfb839ac91
Downgrade assert to warning
2022-05-10 19:51:09 +01:00
Chris Smowton
2f8b8fadc3
Extract generic method prototypes
...
These feature substituted types according to their declaring generic specialisation, with wildcards that reach top-level being converted to their upper or lower bound depending on usage context.
This commit also includes an incidental fix such that constructors declare their return-type as unit, consistent with the Java extractor.
2022-05-10 19:51:09 +01:00
Ian Lynagh
26a0925f99
Kotlin: Add comments saying what generated TRAP files
2022-05-10 19:51:09 +01:00
Ian Lynagh
35ad8f372e
Kotlin: Add a test for Kotlin and Java calling each other
...
Currently kotlin->java causes DB inconsistencies.
2022-05-10 19:51:09 +01:00
Ian Lynagh
1719b921cf
Kotlin: Accept test changes
2022-05-10 19:51:09 +01:00
Ian Lynagh
b57d7f5a75
Kotlin: Extract fakeKotlinType for all kt_types
...
This allows us to make consistent Java+Kotlin databases in the short
term.
2022-05-10 19:51:09 +01:00
Ian Lynagh
40976a91ce
Kotlin: Fix a bad label expansion
...
We were making a key
@"class;ClassLabelResults(classLabel=java.io.Console, shortName=Console)\$LineReader"
2022-05-10 19:51:09 +01:00
Ian Lynagh
c05aab278a
Kotlin: Add a TODO
2022-05-10 19:51:09 +01:00
Ian Lynagh
c35f871c46
Kotlin: Add tests for file classes
2022-05-10 19:51:09 +01:00
Ian Lynagh
43f50888a7
Kotlin: Add a trivial test
2022-05-10 19:51:09 +01:00
Ian Lynagh
c63918d431
Kotlin: Add an empty test
2022-05-10 19:51:09 +01:00
Ian Lynagh
509860b7cf
Kotlin: Add a file_classes consistency query
2022-05-10 19:51:09 +01:00
Ian Lynagh
33757a1266
Kotlin: Extract whether a class is a "file" class
2022-05-10 19:51:09 +01:00
Tamas Vajk
fd27243ec6
Add todo comment regarding class declaration stmt
2022-05-10 19:51:09 +01:00
Tamas Vajk
c446b0ecaf
Move anonymous class and local function label generation to KotlinUsesExtractor
2022-05-10 19:51:09 +01:00
Tamas Vajk
6dbf278269
Add extension tests
2022-05-10 19:51:08 +01:00
Tamas Vajk
058ff0a60b
Remove empty file
2022-05-10 19:51:08 +01:00
Tamas Vajk
2f06c9c03f
Fix spacing
2022-05-10 19:51:08 +01:00
Tamas Vajk
05f22576d1
Fix extraction state resetting
2022-05-10 19:51:08 +01:00
Tamas Vajk
ebf91b79a9
Revert moving extraction to SourceFileExtractor
2022-05-10 19:51:08 +01:00
Tamas Vajk
01f46555b0
Fix disappearing variable labels
2022-05-10 19:51:08 +01:00
Tamas Vajk
27f58f2929
Improve code quality
2022-05-10 19:51:08 +01:00
Tamas Vajk
16ba27c476
Extract local functions
2022-05-10 19:51:08 +01:00
Ian Lynagh
f0949a4936
Kotlin: Add a test
...
This caused a stack overflow on a branch, due to the recursino between
the class and the extension function.
2022-05-10 19:51:08 +01:00
Ian Lynagh
9c4c559ab2
Kotlin: Add some TODO comments
2022-05-10 19:51:08 +01:00
Ian Lynagh
5bc1bdb5a3
Kotlin: Refactor PrimitiveTypeInfo
...
Avoids mentioning the name of IdSignature.PublicSignature, which used to
be IdSignature.CommonSignature, giving us compatibility issues.
2022-05-10 19:51:08 +01:00
Ian Lynagh
d977500047
Kotlin: Make it easier to diagnose build failures
2022-05-10 19:51:08 +01:00
Ian Lynagh
c525d2a633
Kotlin: Consistently use addClassLabel, and have it handle external classes
2022-05-10 19:51:08 +01:00
Tamas Vajk
161463ecae
Fix catch clause location
2022-05-10 19:51:08 +01:00
Tamas Vajk
21af31f3ab
CFG changes for non-null operator + some tests
2022-05-10 19:51:08 +01:00
Ian Lynagh
de137415b8
Kotlin: Use an IrClass for the Java class in the priomitive type handling
...
This means we can add a label for it, and indicate that we use it,
properly.
2022-05-10 19:51:08 +01:00
Chris Smowton
7fa4da8b0c
Add explanatory comments
2022-05-10 19:51:08 +01:00
Chris Smowton
7d62f1d2de
Update test expectations
2022-05-10 19:51:08 +01:00
Chris Smowton
8accd35ce8
Substitute in generic type arguments when extracting the supertypes of an instantiated type
2022-05-10 19:51:08 +01:00
Ian Lynagh
2dcd49c6a5
Kotlin: Build the appropriate single version, rather than always 1.5
2022-05-10 19:51:08 +01:00
Tamas Vajk
abc0da3e60
Extract extension method receivers as parameters
2022-05-10 19:51:08 +01:00
Tamás Vajk
04daa7f28f
Revert "Kotlin: Fix extraction of dispatch and extension receivers"
2022-05-10 19:51:08 +01:00
Ian Lynagh
cd84a6a5b6
Kotlin: Avoid external locations appearing in type_equivalences test
2022-05-10 19:51:08 +01:00
Tamas Vajk
a4275865da
Fix location of variable access in LHS of assignment
2022-05-10 19:51:07 +01:00
Ian Lynagh
40e4c93615
Kotlin: TODO() now works
2022-05-10 19:51:07 +01:00
Ian Lynagh
669fe616dd
Kotlin: Renumber lines in expressions test
2022-05-10 19:51:07 +01:00
Ian Lynagh
50400bf7af
Kotlin: Add TODO() to test; doesn't work yet
2022-05-10 19:51:07 +01:00
Ian Lynagh
2b483597f8
Kotlin: Ranges already work
...
We might want to extract a sugared form of them in the future, but for
now this works.
2022-05-10 19:51:07 +01:00
Ian Lynagh
1abaecf158
Kotlin: String templates are already supported
2022-05-10 19:51:07 +01:00
Ian Lynagh
4c8a87bfb1
Kotlin: Accept test changes
2022-05-10 19:51:07 +01:00
Ian Lynagh
0b3754c932
Kotlin: Fix handling Unit in various places
2022-05-10 19:51:07 +01:00
Ian Lynagh
ec827d2f0a
Kotlin: Add ability to give more type contexts
2022-05-10 19:51:07 +01:00
Ian Lynagh
6c1439c180
Kotlin: Add a test for type equivalences
2022-05-10 19:51:07 +01:00
Ian Lynagh
606b36e21f
Kotlin: Accept test changes
2022-05-10 19:51:07 +01:00
Ian Lynagh
7ca6da1d13
Kotlin/Java: children consistency query: extension receiver is now a gap
2022-05-10 19:51:07 +01:00
Ian Lynagh
75e22da096
Kotlin: Fix extraction of dispatch and extension receivers
...
It is possible for a call to have both, e.g. the `arg.ext()` call in:
class Class1 {
val y = 4
}
class Class2 (val arg:Class1) {
val x = 3
fun someFun() {
arg.ext();
}
fun Class1.ext() {
val z = x + y
}
}
2022-05-10 19:51:07 +01:00
Ian Lynagh
76d7ac9898
Kotlin: Accept test changes
2022-05-10 19:51:07 +01:00
Ian Lynagh
6a16588484
Kotlin: Allow comments on enum entries
2022-05-10 19:51:07 +01:00
Ian Lynagh
cc478eb6ee
Kotlin: Add comments on enum test
2022-05-10 19:51:07 +01:00
Ian Lynagh
03199091cd
Kotlin: Add SAFE_CAST support
2022-05-10 19:51:07 +01:00
Ian Lynagh
1c5f6d70bc
Kotlin: Accept changes
2022-05-10 19:51:07 +01:00
Ian Lynagh
25ccf0569e
Kotlin: ReturnStmt CFG isn't handled properly yet
2022-05-10 19:51:07 +01:00
Ian Lynagh
db7f5a04be
Kotlin: BreakStmt CFG isn't handled properly yet
2022-05-10 19:51:07 +01:00
Ian Lynagh
712d70248a
Kotlin: Add CFG for VarArgExpr
2022-05-10 19:51:07 +01:00
Ian Lynagh
8440bafc42
Kotlin: Add CFG for KtAnonymousClassDeclarationStmt
2022-05-10 19:51:07 +01:00
Ian Lynagh
5ae74949a0
Kotlin: Add CFG for ClassExpr
2022-05-10 19:51:07 +01:00
Ian Lynagh
2135a870d3
Kotlin: Fix CFG for StmtExpr
2022-05-10 19:51:06 +01:00
Ian Lynagh
2e5cf92f8a
Kotlin: Fix CFG for string templates
2022-05-10 19:51:06 +01:00
Ian Lynagh
fcbe4331b4
Kotlin/Java: Add a (currently rather lax) cfgDeadEnds consistency query
2022-05-10 19:51:06 +01:00
Tamas Vajk
874afa7fd7
Fix missing extension receiver extraction
2022-05-10 19:51:06 +01:00
Tamas Vajk
23c5caadc8
Fix String?.plus extraction
2022-05-10 19:51:06 +01:00
Tamas Vajk
ea4e919af5
Extract missing functions directly in kotlin package
2022-05-10 19:51:06 +01:00
Tamas Vajk
3a2f7bec1c
Fix test expected files
2022-05-10 19:51:06 +01:00
Tamas Vajk
6246b2142c
Add enclosing stmt to arrayOf extraction
2022-05-10 19:51:06 +01:00
Tamas Vajk
8de5e39309
Extract arrayOf-like calls
2022-05-10 19:51:06 +01:00
Tamas Vajk
8b81ee7e59
Add array creation tests
2022-05-10 19:51:06 +01:00
Chris Smowton
64e1367e59
Make standard library locations consistent between Java and Kotlin
2022-05-10 19:51:06 +01:00
Ian Lynagh
547b60d68f
Kotlin: Add paramTypes test
2022-05-10 19:51:06 +01:00
Ian Lynagh
d5b4931b7f
Kotlin: Tweak superTypes test to give better locations
2022-05-10 19:51:06 +01:00
Ian Lynagh
50c2d10777
Kotlin: Improve the supertypes test
...
Note the line
| file://<external>/superChain.kt:2:1:2:60 | SuperChain2<T5,String> | file://<external>/superChain.kt:1:1:1:33 | SuperChain1<T3,String> |
is currently wrong; the supertype of SuperChain2<T5,String> should be
SuperChain1<T5,String>.
2022-05-10 19:51:06 +01:00
Ian Lynagh
c05aa7bb68
Kotlin: Add superChain test
2022-05-10 19:51:06 +01:00
Ian Lynagh
b876ee98e5
Kotlin: Tweak the superTypes test
2022-05-10 19:51:06 +01:00
Ian Lynagh
90d7c2b3ce
Java/Kotlin: Add a statementEnclosingExpr consistency test
2022-05-10 19:51:06 +01:00
Ian Lynagh
7baefbb9e5
Kotlin: Add WhenBranch.getWhenExpr()
2022-05-10 19:51:06 +01:00
Ian Lynagh
46f103c243
Kotlin: Accept test changes
2022-05-10 19:51:06 +01:00
Ian Lynagh
5c2ce95b1a
Kotlin: Populate statementEnclosingExpr
2022-05-10 19:51:06 +01:00
Ian Lynagh
2b973fa3b1
Kotlin: Add support for IrSyntheticBody
...
I'm not sure it's worth adding an entity to the database for them,
although that would allow us to use a 'case' in the dbscheme for
the different kinds.
There's no QLL support for this info yet.
2022-05-10 19:51:06 +01:00
Tamas Vajk
4ca024f043
Fix try statement extraction
2022-05-10 19:51:06 +01:00
Tamas Vajk
716b87d200
Extract not-null expression
2022-05-10 19:51:06 +01:00
Ian Lynagh
6603767d94
Kotlin: Clarify !/ paths
2022-05-10 19:51:06 +01:00
Ian Lynagh
f40ab39447
Kotlin: Small fixes and a little more documentation for TrapWriter
2022-05-10 19:51:06 +01:00
Ian Lynagh
d1fefe0246
Kotlin: Refactor TrapWriters
...
Now ClassFileTrapWriter is just FileTrapWriter, which no longer takes a
nullable IrFileEntry.
SourceFileTrapWriter still extends FileTrapWriter, and adds the
IrFileEntry, allowing it to override the location functions with more
useful variants.
populateFileTables no longer has a default. I think that for the sake
of a handful of calls, it's simpler to be explicit so we aren't
confused.
2022-05-10 19:51:05 +01:00
Ian Lynagh
1990b68c21
Kotlin: Return more precise types from PopulateFile.java
2022-05-10 19:51:05 +01:00
Ian Lynagh
83ac77dccc
Kotlin: Start documenting TrapWriter
2022-05-10 19:51:05 +01:00
Tamas Vajk
afabe652c1
Add anonymous class declaration stmt
2022-05-10 19:51:05 +01:00
Ian Lynagh
3e9d12aff0
Kotlin: Accept test changes
2022-05-10 19:51:05 +01:00
Ian Lynagh
37d6bc29dc
Kotlin: Fix Byte tests
2022-05-10 19:51:05 +01:00
Ian Lynagh
1eda692ec8
Kotlin: Import org.jetbrains.kotlin.ir.util.* in KotlinFileExtractor
...
This makes dump() available
2022-05-10 19:51:05 +01:00
Ian Lynagh
2d8a2abe5c
Kotlin: Recognise more numeric types
2022-05-10 19:51:05 +01:00
Ian Lynagh
76151b413f
Kotlin: Add more Long tests
2022-05-10 19:51:05 +01:00
Ian Lynagh
6b5fe14e94
Kotlin: Add tesets for more integer types
2022-05-10 19:51:05 +01:00
Ian Lynagh
1b40f78b9c
Kotlin: Recognise + etc for Double
2022-05-10 19:51:05 +01:00
Ian Lynagh
5b5a6042a9
Kotlin: Add tests for more Double operators
2022-05-10 19:51:05 +01:00
Chris Smowton
35e6b06fe3
Revert "Fix failing tests"
...
This reverts commit 940db3d0828422bc26d7167c138199aa51ab4e89.
2022-05-10 19:51:05 +01:00
Chris Smowton
bb7a17b5bd
Add missing test file
2022-05-10 19:51:05 +01:00
Ian Lynagh
f447d40740
Kotlin: Temporary consistency query tweak to get the tests passing
2022-05-10 19:51:05 +01:00
Tamas Vajk
ae86fcb499
Split main extractor file
2022-05-10 19:51:05 +01:00
Tamas Vajk
2dfe50cbaa
Change constructor and type name of anonymous classes to empty string
2022-05-10 19:51:05 +01:00
Tamas Vajk
b7faa33c60
Fix constructor call type access
2022-05-10 19:51:05 +01:00
Tamas Vajk
b7e0828f78
Extract anonymous object creation
2022-05-10 19:51:05 +01:00
Tamas Vajk
ab6b500475
Fix failing tests
2022-05-10 19:51:05 +01:00
Ian Lynagh
10004c77d1
Kotlin: some TODO stuff works now
2022-05-10 19:51:05 +01:00
Ian Lynagh
a3e70fdb5c
Kotlin: Add support for ieee754equals
2022-05-10 19:51:05 +01:00
Ian Lynagh
78d2ef52c1
Kotlin: Towards better equality checking
2022-05-10 19:51:05 +01:00
Ian Lynagh
5da15ca03b
Kotlin: Resugar !=
2022-05-10 19:51:04 +01:00
Ian Lynagh
b4c3f57bab
Kotlin: Get != working again
2022-05-10 19:51:04 +01:00
Chris Smowton
956c479db3
Document TypeResult
2022-05-10 19:51:04 +01:00
Chris Smowton
ccf21b7183
Implement Java signature extraction
2022-05-10 19:51:04 +01:00
Chris Smowton
6391484692
Add modifiers to array built-in functions
2022-05-10 19:51:04 +01:00
Chris Smowton
b33f2d9952
Merge shortName recursion into useType
2022-05-10 19:51:04 +01:00
Ian Lynagh
36dae240df
Kotlin: Allow building only a single way
2022-05-10 19:51:04 +01:00
Ian Lynagh
0ce6e53386
Kotlin: Remove unused expressions and fix a copy/paste-o
2022-05-10 19:51:04 +01:00
Tamas Vajk
da0e2c276f
Add comment explaining why the annotation is needed
2022-05-10 19:51:04 +01:00
Tamas Vajk
cb406619cb
Reintroduce sealed interfaces for generated DB types
2022-05-10 19:51:04 +01:00
Tamas Vajk
c4ad2f3463
Add kotlin 1.4 support
2022-05-10 19:51:04 +01:00
Tamas Vajk
3939a2a47c
Change build script to build multiple versions of the plugin
2022-05-10 19:51:04 +01:00
Ian Lynagh
22c87b20cc
Kotlin: Add an exception for a consistency check
2022-05-10 19:51:04 +01:00
Ian Lynagh
be5e478718
Kotlin: Accept test change
2022-05-10 19:51:04 +01:00
Ian Lynagh
744f3db68d
Kotlin: Handle binops correctly
2022-05-10 19:51:04 +01:00
Ian Lynagh
d63ef23bda
Kotlin: Remove an out-of-date consistency exception
2022-05-10 19:51:04 +01:00
Ian Lynagh
755bf4d8b3
Java/Kotlin: Add 'children' consistency query
2022-05-10 19:51:04 +01:00
Ian Lynagh
8f1f137fa1
Java/Kotlin: Add UnaryExpr consistency query
2022-05-10 19:51:04 +01:00
Ian Lynagh
90365c9c58
Java/Kotlin: Add a consistency query for BinaryExpr
2022-05-10 19:51:04 +01:00
Ian Lynagh
9e2a3a9da8
Java/Kotlin: Add a consistency query for blocks
2022-05-10 19:51:04 +01:00
Tamas Vajk
ab86778e1d
Remove external property related log messages
2022-05-10 19:51:04 +01:00
Chris Smowton
5ee9135643
Couple more style fixes
2022-05-10 19:51:04 +01:00
Chris Smowton
970e3d64c0
Fix various style warnings highlighted by IntelliJ
2022-05-10 19:51:04 +01:00
Chris Smowton
8f5bbc7bd8
superTypes test: restore location info without full paths
2022-05-10 19:51:03 +01:00
Chris Smowton
87d6313278
Move extractClassInstance to the file extractor
...
Since now we know the file context has been set correctly at this point
2022-05-10 19:51:03 +01:00
Chris Smowton
c4d6321e60
Fix whitespace
2022-05-10 19:51:03 +01:00
Chris Smowton
fcab0474c9
Amend call.ql to avoid external source locations and accept changes
2022-05-10 19:51:03 +01:00
Chris Smowton
2bcc3d425e
Amend a test to avoid external paths and accept changes
2022-05-10 19:51:03 +01:00
Chris Smowton
87b04bc22b
Add test for expected filenames
2022-05-10 19:51:03 +01:00
Chris Smowton
5ec546bcb0
Extract locations for generic instantiations
2022-05-10 19:51:03 +01:00
Chris Smowton
f06285e9c7
Fix: use source information for class actually extracted in case of K<->J substitution
2022-05-10 19:51:03 +01:00
Chris Smowton
bde4534050
Only report locations without a source offset in non-source files
...
Also adjust tests that would otherwise report types with locations outside the source tree (i.e., for the most part in the standard library)
2022-05-10 19:51:03 +01:00
Chris Smowton
c2fef58b21
Extract source files for external types
2022-05-10 19:51:03 +01:00
Tamas Vajk
4c5b4b15a9
Allow associating comments with fields
2022-05-10 19:51:03 +01:00
Tamas Vajk
097d87604f
Add test case to cover comments on properties
2022-05-10 19:51:03 +01:00
Tamas Vajk
d0c470dbac
Add direct field access support
2022-05-10 19:51:03 +01:00
Ian Lynagh
b741dea100
Kotlin: Accept test changes
2022-05-10 19:51:03 +01:00
Ian Lynagh
3a0435b196
Kotlin: Towards 'this' qualifiers
...
This probably handles most cases well enough
2022-05-10 19:51:03 +01:00
Ian Lynagh
9158f0192b
Kotlin: Enhance 'this' test
2022-05-10 19:51:03 +01:00
Ian Lynagh
2320553723
Kotlin: Add tests for this
2022-05-10 19:51:03 +01:00
Ian Lynagh
87e8425603
Kotlin: Extract the abstractness of classes.
2022-05-10 19:51:03 +01:00
Ian Lynagh
45658e5d89
Kotlin: Add writeCallableEnclosingExpr calls
2022-05-10 19:51:03 +01:00
Ian Lynagh
854a03d696
Kotlin: Fix property initialisers
2022-05-10 19:51:03 +01:00
Ian Lynagh
aefe5c5c58
Kotlin: Accept test changes
2022-05-10 19:51:03 +01:00
Ian Lynagh
e6e56238c5
Kotlin: Handle properties better
2022-05-10 19:51:03 +01:00
Chris Smowton
44bf35e623
Add and update tests
2022-05-10 19:51:03 +01:00
Chris Smowton
1b7e33b6e3
Remove Kotlin element and component type from arrays
...
Now that these are no longer required, array extraction can extract kt-types consistently with other parameterised classes.
2022-05-10 19:51:03 +01:00
Chris Smowton
70294bd26b
Array types: distinguish (e.g.) Array<Int> from IntArray
2022-05-10 19:51:03 +01:00
Chris Smowton
380da465b9
Fix bad rebase
2022-05-10 19:51:02 +01:00
Chris Smowton
b4138838fe
Update TODOs
2022-05-10 19:51:02 +01:00
Chris Smowton
329ead2b52
Pull out and tidy array extraction
2022-05-10 19:51:02 +01:00
Ian Lynagh
e947e6234e
Kotlin: Use 2G when compiling
...
For me, kotlinc default to 256M, which isn't enough when we are
extracting.
2022-05-10 19:51:02 +01:00
Ian Lynagh
2625c101ad
Kotlin: Show class name in log messages
2022-05-10 19:51:02 +01:00
Ian Lynagh
0bf60fff53
Kotlin: Add a test that was failing dbcheck, and comment out the cause
2022-05-10 19:51:02 +01:00
Ian Lynagh
8fc75abc6c
Kotlin: Accept test changes
2022-05-10 19:51:02 +01:00
Ian Lynagh
e1cfaaaa9a
Kotlin: Extract listOf(...)
2022-05-10 19:51:02 +01:00
Chris Smowton
3c7fb94002
Update test expectations
2022-05-10 19:51:02 +01:00
Chris Smowton
06c4fd9060
Properly extract wildcard bounds
2022-05-10 19:51:02 +01:00
Tamas Vajk
356639dadd
Add optional exitProcess after extraction
2022-05-10 19:51:02 +01:00
Tamas Vajk
69e8db06cb
Add optional compilation start plugin option + remove exitProcess
2022-05-10 19:51:02 +01:00
Chris Smowton
6fb5854589
Array types: record dimensionality
2022-05-10 19:51:02 +01:00
Chris Smowton
239ee588a6
Update test expectations
2022-05-10 19:51:02 +01:00
Chris Smowton
805b54897e
KotlinType: accept non-class-or-interface Java types
2022-05-10 19:51:02 +01:00
Chris Smowton
1d95431a7a
Always use the nullable type for arrays
2022-05-10 19:51:02 +01:00
Chris Smowton
0ba4753b8f
Restrict Kotlin types describing arrays
...
* Always use a nullable type
* Never use a type projection (same behaviour as IrType.getArrayElementType)
Otherwise the kotlin type doesn't functionally depend on the type label
2022-05-10 19:51:02 +01:00
Chris Smowton
a6dc408c4e
Fix: bracket string template expression properly
2022-05-10 19:51:02 +01:00
Chris Smowton
8016aa7027
Adapt to refactor; useType changes
2022-05-10 19:51:02 +01:00
Chris Smowton
660988d8ac
Ensure Unit type is extracted when needed
2022-05-10 19:51:02 +01:00
Chris Smowton
efe3a77efe
shortName: use boxed types for type arguments and use K->J class substitutions
2022-05-10 19:51:02 +01:00
Chris Smowton
16335b126f
Include type parameters in class short names
2022-05-10 19:51:02 +01:00
Chris Smowton
8acf7d74c1
Restore check for Array<T> type argument
2022-05-10 19:51:02 +01:00
Chris Smowton
dd3bb053e5
Add extracted array length and clone members
2022-05-10 19:51:02 +01:00
Chris Smowton
d62af44baa
Extract array type inheritence graph
2022-05-10 19:51:02 +01:00
Chris Smowton
23553f15ee
Arrays: extract dimensionality
2022-05-10 19:51:01 +01:00
Chris Smowton
c571657fb1
Abbreviate array test
2022-05-10 19:51:01 +01:00
Chris Smowton
f1a3c9ca20
Arrays: note TODOs
2022-05-10 19:51:01 +01:00
Chris Smowton
2cc5f3e5b7
kt_*_types tables: cite correct Kotlin classid for arrays
2022-05-10 19:51:01 +01:00
Chris Smowton
b926521e7a
Only write arrays table on first usage
2022-05-10 19:51:01 +01:00
Chris Smowton
055e9b7797
Convert primitive arrays to Java arrays
2022-05-10 19:51:01 +01:00
Chris Smowton
a92e20e526
Extract nullable arrays as Java arrays
...
Nullability doesn't matter to this conversion since Java's arrays are reftypes
2022-05-10 19:51:01 +01:00
Ian Lynagh
80e2140ca7
Kotlin: Add TrapWriter.writeComment
2022-05-10 19:51:01 +01:00
Ian Lynagh
5cf14e6f39
Kotlin: Tweak a comment
2022-05-10 19:51:01 +01:00
Ian Lynagh
8853489f04
Kotlin: Add a "generted by" field to the diagnostics table
2022-05-10 19:51:01 +01:00
Ian Lynagh
512e4ce41e
Kotlin: Fix bug in DB scheme generator
2022-05-10 19:51:01 +01:00
Ian Lynagh
be75d30ee0
Kotlin: Add support for varargs
2022-05-10 19:51:01 +01:00
Ian Lynagh
497263e92d
Kotlin: Accept test changes
2022-05-10 19:51:01 +01:00
Ian Lynagh
bdaa3ce2b3
Kotlin: Add support for companion objects
2022-05-10 19:51:01 +01:00
Ian Lynagh
f726e6acf8
Kotlin: Fix handling of objects in external dependencies
2022-05-10 19:51:01 +01:00
Ian Lynagh
b460c92c61
Kotlin: Add modifiers to object INSTANCEs
2022-05-10 19:51:01 +01:00
Ian Lynagh
112fac6286
Kotlin: We only support non-companion objects for now
2022-05-10 19:51:01 +01:00
Ian Lynagh
e5cd32bdfe
Kotlin: Get the tests passing again
2022-05-10 19:51:01 +01:00
Ian Lynagh
ceb1e57ddd
Kotlin: Add support for objects
2022-05-10 19:51:01 +01:00
Tamás Vajk
35a15d7eb4
Fix typo
2022-05-10 19:51:01 +01:00
Ian Lynagh
cb1124b5ff
Kotlin: Add a test for type aliases
2022-05-10 19:51:01 +01:00
Ian Lynagh
87b433142c
Kotlin: Add support for Kotlin type aliases
2022-05-10 19:51:01 +01:00
Ian Lynagh
8330a404df
Kotlin: Add warning location to warnings
...
This also tweaks how the "too many warnings" logic works
2022-05-10 19:51:01 +01:00
Ian Lynagh
41d4c21910
Kotlin: Add a warning
2022-05-10 19:51:01 +01:00
Ian Lynagh
2d43e7b2d1
Kotlin: Speed up getAPrimaryQlClass
...
It now gives less useful info, but can be manually investigated if it
fails.
2022-05-10 19:51:00 +01:00
Ian Lynagh
59307285e8
Kotlin: Speed up the toString consistency query
...
Using Top.getAQlClass() means we have to evaluate
SummarizedCallableExternal's charpred, and hence summaryElement,
which is slow.
2022-05-10 19:51:00 +01:00
Ian Lynagh
9a621479cc
Kotlin: accept test changes
2022-05-10 19:51:00 +01:00
Ian Lynagh
9b3f36d1ae
Kotlin: Remove useTypeOld
2022-05-10 19:51:00 +01:00
Ian Lynagh
e61ff60bf8
Kotlin: Add KotlinType to ExtensionMethod
2022-05-10 19:51:00 +01:00
Ian Lynagh
6cf0b755f0
Kotlin: Add KotlinType to localvars
2022-05-10 19:51:00 +01:00
Ian Lynagh
06a41b3923
Kotlin: Add KotlinTypes to arrays
2022-05-10 19:51:00 +01:00
Ian Lynagh
ba56517900
Kotlin: Add Variable.getKotlinType()
2022-05-10 19:51:00 +01:00
Ian Lynagh
ef22194eed
Kotlin: Add KotlinType to params
2022-05-10 19:51:00 +01:00
Ian Lynagh
0d5e471b96
Kotlin: Give methods and constructors a KotlinType
2022-05-10 19:51:00 +01:00
Ian Lynagh
d9822266f5
Kotlin: Fix SafeCastConversionContext QLL
2022-05-10 19:51:00 +01:00
Ian Lynagh
c20ee76826
Kotlin: Give fields a Kotlin type
...
This meant refactoring the EnumEntry extraction a bit. The IR doesn't
give us a type for fields, so we have to make it up based on the parent.
2022-05-10 19:51:00 +01:00
Ian Lynagh
e120059a18
Kotlin: Accept test changes
2022-05-10 19:51:00 +01:00
Ian Lynagh
b3a28af319
Kotlin: Move extractTypeParameter back to KotlinFileExtractor
2022-05-10 19:51:00 +01:00
Ian Lynagh
118d630125
Kotlin: Add a test for instances
2022-05-10 19:51:00 +01:00
Ian Lynagh
7421e95816
Kotlin: Pull more out into KotlinUsesExtractor
2022-05-10 19:51:00 +01:00
Ian Lynagh
db0360d211
Kotlin: Accept test changes
2022-05-10 19:51:00 +01:00
Ian Lynagh
b381556a06
Kotlin: Fix up things that got pulled out into KotlinUsesExtractor
2022-05-10 19:51:00 +01:00
Ian Lynagh
a5a42b4416
Kotlin: Refactor so that we can't give locations to "used" things
...
Things we use may not be in the same file as us, so we aren't able to
generate valid locations for them.
2022-05-10 19:51:00 +01:00
Ian Lynagh
960c436824
Kotlin: Call extractClassCommon later
...
This fixes a "Missing type parameter label" warning from the extractor
with
interface Foo<T>
class Bar<T>: Foo<T> { }
caused by the `: Foo<T>` being extracted before extracting the `T`
in `Bar<T>`.
2022-05-10 19:51:00 +01:00
Ian Lynagh
6c957284de
Kotlin: Add support for enum value accesses
2022-05-10 19:51:00 +01:00
Ian Lynagh
d565a16fe6
Kotlin: Add enums to expr test
2022-05-10 19:51:00 +01:00
Ian Lynagh
84b53ba9cf
Kotlin: Accept test changes
2022-05-10 19:51:00 +01:00
Ian Lynagh
976cc31c7a
Kotlin: Add support for string templates
2022-05-10 19:50:59 +01:00
Ian Lynagh
168786ae71
Kotlin: Add string concatenations to exprs test
2022-05-10 19:50:59 +01:00
Ian Lynagh
81fd7c735a
Kotlin: Add suport for enum classes
2022-05-10 19:50:59 +01:00
Ian Lynagh
2b01c5d825
Kotlin: Follow changes in main
2022-05-10 19:50:59 +01:00
Ian Lynagh
9996d77701
Kotlin: Reinstate disabled test now bug is fixed
2022-05-10 19:50:59 +01:00
Chris Smowton
97f380eddc
Don't abort external class extraction after first duplicate
2022-05-10 19:50:59 +01:00
Ian Lynagh
5bb9357dbe
Kotlin: Disable part of a test that gives us DB check inconsistencies
2022-05-10 19:50:59 +01:00
Ian Lynagh
e8fd9ed948
Kotlin: Add a warning suppression
2022-05-10 19:50:59 +01:00
Ian Lynagh
cbd265ab7a
Kotlin: Add support for try statements
2022-05-10 19:50:59 +01:00
Ian Lynagh
6b5663df46
Kotlin: Handle Short and Byte literals
...
I don't think we need separate DB types for them
2022-05-10 19:50:59 +01:00
Ian Lynagh
f0ac63c466
Kotlin: Extend expressions test
2022-05-10 19:50:59 +01:00
Ian Lynagh
49d2e86b5e
Kotlin: Accept test changes
2022-05-10 19:50:59 +01:00
Ian Lynagh
ba335b0c69
Kotlin: Add StmtExpr
...
In some contexts, Kotlin has what we would call a Stmt inside what we
would call an Expr. This allows us to handle this case.
2022-05-10 19:50:59 +01:00
Ian Lynagh
2ba8ccafa9
Kotlin: Make build compatible with older javac's
2022-05-10 19:50:59 +01:00
Ian Lynagh
6fd8d638a3
Kotlin: Accept test output
2022-05-10 19:50:59 +01:00
Ian Lynagh
9a886260cd
Kotlin: Add support for IMPLICIT_COERCION_TO_UNIT
2022-05-10 19:50:59 +01:00
Ian Lynagh
924c615216
Kotlin: Enhance exprs test
2022-05-10 19:50:59 +01:00
Ian Lynagh
46e55f5990
Kotlin: Add support for IMPLICIT_NOTNULL
2022-05-10 19:50:59 +01:00
Ian Lynagh
d181b4b9cc
Kotlin: Enhance the exprs test
2022-05-10 19:50:59 +01:00
Chris Smowton
dfa9bef5bd
Fix gradle homedir search
2022-05-10 19:50:59 +01:00
Ian Lynagh
a6c504abe3
Kotlin: Add support for implicit casts
2022-05-10 19:50:59 +01:00
Ian Lynagh
62b3e07ae6
Kotlin: Accept test changes
2022-05-10 19:50:58 +01:00
Ian Lynagh
ba7a7535e9
Kotlin: Add support for more type operators
2022-05-10 19:50:58 +01:00
Ian Lynagh
d247e4fcff
Kotlin: WhenBranch isn't postorder
2022-05-10 19:50:58 +01:00
Ian Lynagh
c4880cc935
Kotlin: Fix handling of non-true conditions
2022-05-10 19:50:58 +01:00
Ian Lynagh
b9d6712371
Kotlin: Update test output
2022-05-10 19:50:58 +01:00
Ian Lynagh
7f3ae94d73
Tweak the WhenExpr CFG and QL class
2022-05-10 19:50:58 +01:00
Ian Lynagh
f95934a0c5
Kotlin: Use trace (silently for now) rather than info for writing TRAP files
...
The on-demand "Writing trap file for: " messages are drowning out
everything else while running the tests.
2022-05-10 19:50:58 +01:00
Ian Lynagh
d6692e434a
Kotlin: Add support for "is" ("instanceof")
2022-05-10 19:50:58 +01:00
Ian Lynagh
d05643fa88
Kotlin: Add library-tests/controlflow/paths test (copied from Java)
2022-05-10 19:50:58 +01:00
Ian Lynagh
e755cc92b6
Kotlin: Add controlflow/dominance test (copied from Java)
2022-05-10 19:50:58 +01:00
Ian Lynagh
aebd8edf85
Kotlin: Make library-tests/controlflow/basic quieter
2022-05-10 19:50:58 +01:00
Ian Lynagh
d0bf462a45
Kotlin: Add a copy of Java's controlflow/basic test
2022-05-10 19:50:58 +01:00
Ian Lynagh
715a92c602
Kotlin: Add CFG for when expressions
2022-05-10 19:50:58 +01:00
Chris Smowton
070c0a03f4
Add .fromSource() qualifier to tests
2022-05-10 19:50:58 +01:00
Chris Smowton
3cb68bd7be
kotlin-extractor build: include Java source files
2022-05-10 19:50:58 +01:00
Chris Smowton
124dcb0e5f
Update test expectations
2022-05-10 19:50:58 +01:00
Chris Smowton
4dda475a8d
Fix source location column numbers
2022-05-10 19:50:58 +01:00
Chris Smowton
e65f451af6
erase: retain question-mark qualifier if present
2022-05-10 19:50:58 +01:00
Chris Smowton
48d5561c95
Use getClassLabel for Kotlin <-> Java type correspondences
...
Without this, the table can be non-functional due to mapping one unqualified Kotlin type onto several qualified Java types
2022-05-10 19:50:58 +01:00
Chris Smowton
f5021e8e68
Java: produce Java 8 class files for compatibility with packaged Java 11 binary
2022-05-10 19:50:58 +01:00
Chris Smowton
e5e694f7d3
Adjust Kotlin type correspondence tables when extracting a substituted type
2022-05-10 19:50:58 +01:00
Chris Smowton
12ce2d5829
Substitute Kotlin classes for Java equivalents
2022-05-10 19:50:58 +01:00
Chris Smowton
6de5a36cdc
Write Java class files in gzip format
...
This means our names match those expected by javac
2022-05-10 19:50:58 +01:00
Chris Smowton
4a18705d73
Write .set file for source file
2022-05-10 19:50:58 +01:00
Chris Smowton
b299779750
Create Files table entries for JAR/JRT files
2022-05-10 19:50:58 +01:00
Chris Smowton
8e63d10c1f
Populate Folders, containerparent tables
2022-05-10 19:50:57 +01:00
Chris Smowton
4c3b9e658b
Fix trap file output paths
...
These should be named for the class name, not its fs location
2022-05-10 19:50:57 +01:00
Chris Smowton
debb942c0e
Implement mtime and class version extraction
2022-05-10 19:50:57 +01:00
Chris Smowton
a0671cafb1
Remove trap file compression for now
2022-05-10 19:50:57 +01:00
Chris Smowton
2cc003ff0e
External class extraction prototype
2022-05-10 19:50:57 +01:00
Mathias Vorreiter Pedersen
a7fe37a631
Merge pull request #9047 from geoffw0/xxe6
...
C++: Add support for SAX2XMLReader in the CWE-611 XXE query.
2022-05-10 19:07:35 +01:00
Tamas Vajk
e9b249855b
Add gitignore to kotlin-explorer
2022-05-10 18:46:02 +01:00
Tamas Vajk
b7b506a23d
Improve temp directory cleanup
2022-05-10 18:46:02 +01:00
Tamas Vajk
52341dc99f
Modify build script to build both standalone and embeddable plugin variant
2022-05-10 18:46:02 +01:00
Ian Lynagh
f458745eff
Kotlin: Update tests
2022-05-10 18:46:02 +01:00
Ian Lynagh
286e29cd81
Kotlin: Add exprstmt's where appropriate
2022-05-10 18:46:02 +01:00
Ian Lynagh
8704536f35
Kotlin: local variable indexes start from 1
2022-05-10 18:46:02 +01:00
Ian Lynagh
b3d459d122
Kotlin: Accept test changes
2022-05-10 18:46:02 +01:00
Ian Lynagh
8df5abaef9
Kotlin: Add localvariabledeclstmt
2022-05-10 18:46:02 +01:00
Ian Lynagh
e5e6225d57
Kotlin: Add a build.py script that uses kotlinc to build
2022-05-10 18:46:02 +01:00
Ian Lynagh
1d1b9fe805
Kotlin: Add support for more kind of literal
...
And a test
2022-05-10 18:46:02 +01:00
Tamas Vajk
731d601cdd
Add optional dbscheme path parameter to KotlinExtractorDbScheme.kt generator
2022-05-10 18:46:02 +01:00
Tamas Vajk
48b388daf7
Remove version number from output artifact name
2022-05-10 18:46:02 +01:00
Tamas Vajk
ab102245da
Add codeql-kotlin to the CODEOWNERS file
2022-05-10 18:46:01 +01:00
Ian Lynagh
14a10564f3
Kotlin: Fix File locations, and fromSource/hasSourceLocation for Kotlin code
2022-05-10 18:46:01 +01:00
Ian Lynagh
b9359bd119
Kotlin: Add a test case to be added
...
Found by Tamás
2022-05-10 18:46:01 +01:00
Ian Lynagh
cd41d5b9cf
Kotlin: Add KotlinType to exprs
2022-05-10 18:46:01 +01:00
Ian Lynagh
63e96dffea
Kotlin: Add a testcase as a comment for now, so we don't lose it
2022-05-10 18:46:01 +01:00
Ian Lynagh
45cade8ff8
Kotlin: Accept/update tests
2022-05-10 18:46:01 +01:00
Ian Lynagh
1bce9a131a
Kotlin: Towards KotlinType support
2022-05-10 18:46:01 +01:00
Ian Lynagh
ca96d55476
Typo
2022-05-10 18:46:01 +01:00
Ian Lynagh
636e15f422
Kotlin: Split extractClass into extractClassSource, extractClassInstance
2022-05-10 18:46:01 +01:00
Ian Lynagh
9eadbea5cd
Kotlin: Split useClass into useClassSource and useClassInstance
2022-05-10 18:46:01 +01:00
Ian Lynagh
490e803098
Kotlin: Be more specific about function parents
2022-05-10 18:46:01 +01:00
Tamas Vajk
6f3ae8da47
Improve todo comment
2022-05-10 18:46:01 +01:00
Tamas Vajk
ec889f933f
Remove unneeded extraction warning
2022-05-10 18:46:01 +01:00
Tamas Vajk
1a6d693618
Implement review findings + fix ID of nested types
2022-05-10 18:46:00 +01:00
Tamas Vajk
85e713fa31
Extract generic type parameters as reference types even for primitive Kotlin types + add simplified array extraction
2022-05-10 18:46:00 +01:00
Tamas Vajk
b542769fe9
Fix constructor extraction and extract type arguments of constructor calls
2022-05-10 18:46:00 +01:00
Tamas Vajk
936c29b70c
Handle star type argument
2022-05-10 18:46:00 +01:00
Tamas Vajk
8dff527a0e
WIP: type arg extraction
2022-05-10 18:46:00 +01:00
Tamas Vajk
0c6e20928c
Kotlin: extract type parameters
2022-05-10 18:46:00 +01:00
Tamas Vajk
db5afe84b4
Code quality improvement (fix warning)
2022-05-10 18:46:00 +01:00
Ian Lynagh
088e7adf8c
Kotlin: Handle zero-width locations for generated elements
2022-05-10 18:46:00 +01:00
Tamas Vajk
76fd386055
Extract content of <obinit> methods
2022-05-10 18:46:00 +01:00
Tamas Vajk
b87c8e2529
Extract generated <obinit> method, and calls to it
2022-05-10 18:46:00 +01:00
Tamas Vajk
e31c573fb5
Remove redundant cast
2022-05-10 18:46:00 +01:00
Tamas Vajk
f18ab2e913
Reduce parameter passing, and compute label for enclosing callable on the fly
2022-05-10 18:46:00 +01:00
Tamas Vajk
13048392af
Add constructor tests
2022-05-10 18:46:00 +01:00
Tamas Vajk
84e9fd8dbd
Extract external types with members, so that tests don't produce DB constraint violations
...
The constructor of `Any` was missing. Also, previously members of external types were not extracted to not end up with DB constraint violations, but these I can't reproduce currently in tests.
2022-05-10 18:46:00 +01:00
Tamas Vajk
481c53a44d
Fix merge conflict
2022-05-10 18:45:59 +01:00
Tamas Vajk
a46a9b579e
Extract 'IsEnumType'
2022-05-10 18:45:59 +01:00
Tamas Vajk
5c72b52b97
Extract IrEnumConstructorCall
2022-05-10 18:45:59 +01:00
Tamas Vajk
9587e91f71
WIP: IrAnonymousInitializer/IrInstanceInitializerCall
2022-05-10 18:45:59 +01:00
Tamas Vajk
91eafafcc3
Extract delegating constructor calls
2022-05-10 18:45:59 +01:00
Tamas Vajk
661958488c
Extract constructor calls
2022-05-10 18:45:59 +01:00
Ian Lynagh
2c5a2910d2
Kotlin: Add explorer
2022-05-10 18:45:59 +01:00
Tamas Vajk
5749dbf7d9
Fix package of Location
2022-05-10 18:45:59 +01:00
Tamas Vajk
ab77ed085f
Add QL classes and tests for comments
2022-05-10 18:45:59 +01:00
Ian Lynagh
7d479943db
Kotlin: Remove a redundant warning suppression
2022-05-10 18:45:59 +01:00
Ian Lynagh
93f6b23a91
Kotlin: Revert some now-unnecessary changes to dbscheme
2022-05-10 18:45:59 +01:00
Ian Lynagh
7eebf81ffc
Kotlin: Remove some now-unnecessary casts
2022-05-10 18:45:59 +01:00
Ian Lynagh
bcbcd612a3
Kotlin: Improve the dbscheme generator
...
We now work out the supertype relationships based on the sets of leaf
types that are included, rather than simply following the hierarchy of
declarations. This means that we know about more supertype relationships
that exist, so there is less need to cast types.
2022-05-10 18:45:59 +01:00
Tamas Vajk
5aac46f20f
Fix DB relation names to use plurals
2022-05-10 18:45:58 +01:00
Tamas Vajk
bf4fb13326
Revert extracting this and this@TYPE parameters
2022-05-10 18:45:58 +01:00
Tamas Vajk
d6ec230e2f
Recognize qualified this access of outer class instance
2022-05-10 18:45:58 +01:00
Tamas Vajk
3bfc93daab
Add ExtensionMethod class
2022-05-10 18:45:58 +01:00
Tamas Vajk
7d8b6bac06
Fix this and qualified this parameter extraction
2022-05-10 18:45:58 +01:00
Tamas Vajk
575e5134bb
Extract 'this'-like value parameters
2022-05-10 18:45:58 +01:00
Tamas Vajk
ebee830a01
Handle type parameters which are nullable without question mark
2022-05-10 18:45:58 +01:00
Tamas Vajk
32a61c16cb
Add break/continue QL and tests
2022-05-10 18:45:58 +01:00
Tamas Vajk
aa190f9d65
Store break/continue targets
2022-05-10 18:45:58 +01:00
Tamas Vajk
ae7aa30bda
Extract break/continue/throw
2022-05-10 18:45:58 +01:00
Tamas Vajk
63c22ca5df
Fix failing tests after changing external type declaration extraction
2022-05-10 18:45:58 +01:00
Tamas Vajk
9889f49560
Add QL for ::class expression, and add test
2022-05-10 18:45:58 +01:00
Tamas Vajk
e8a079b56a
Extract all external class declarations (without members)
2022-05-10 18:45:58 +01:00
Tamas Vajk
1cc1daa88b
Extract externally declared classes
2022-05-10 18:45:57 +01:00
Tamas Vajk
3e60841774
Extract ::class expressions
2022-05-10 18:45:57 +01:00
Tamas Vajk
f04eb6b1fa
Add Nothing type test
2022-05-10 18:45:57 +01:00
Tamas Vajk
28afa19bf5
Change tests to select QL class name too
2022-05-10 18:45:57 +01:00
Tamas Vajk
9d76acad5c
Add null extraction test
2022-05-10 18:45:57 +01:00
Tamas Vajk
f97c6af117
Extract nullable types as non-nullable
2022-05-10 18:45:57 +01:00
Tamas Vajk
fb44f1326f
Extract Nothing as null
2022-05-10 18:45:57 +01:00
Tamas Vajk
f222fc6d42
Extract null literal
2022-05-10 18:45:57 +01:00
Ian Lynagh
bb3ebd7325
Kotlin: Fix warnElement counting
...
We were counting calls of warnElement, whereas we want to count its
callers.
2022-05-10 18:45:57 +01:00
Tamas Vajk
c64c950d9a
Remove leftover comment class
2022-05-10 18:45:57 +01:00
Tamas Vajk
7ecb3650cb
Cleanup getLabel
2022-05-10 18:45:57 +01:00
Tamas Vajk
48d019ebbe
Fix review findings, add DB scheme for comments
2022-05-10 18:45:57 +01:00
Tamas Vajk
c23472d736
Rework and simplify comment extraction
2022-05-10 18:45:57 +01:00
Tamas Vajk
1c8be155c9
Extract comments (based on C# comments extraction with element stack)
2022-05-10 18:45:56 +01:00
Ian Lynagh
fd8dd21f75
Kotlin: Follow change in files(...) table
2022-05-10 18:45:56 +01:00
Ian Lynagh
598a2f8cb0
Kotlin: Record compilation and extraction times
2022-05-10 18:45:56 +01:00
Ian Lynagh
396b5882ef
Kotlin: Add a compilations consistency query
2022-05-10 18:45:56 +01:00
Ian Lynagh
79e3cb38a8
Kotlin: Pull TrapWriter out into its own file
2022-05-10 18:45:56 +01:00
Ian Lynagh
2721f6aabf
Kotlin: Pull Logger out into its own file
2022-05-10 18:45:56 +01:00
Ian Lynagh
e8d3125b40
Kotlin: Tweak a string
2022-05-10 18:45:56 +01:00
Chris Smowton
b5a8442e50
Extract type variable references
...
Also erase the types used to name methods; otherwise type-var labels and method labels are mutually recursive.
2022-05-10 18:45:56 +01:00
Ian Lynagh
87204f1634
Kotlin: Populate the compilation_compiling_files table
2022-05-10 18:45:56 +01:00
Ian Lynagh
dc3cc0e72e
Kotlin: Refactoring: Give diagnostic messages locations and severities
2022-05-10 18:45:56 +01:00
Ian Lynagh
90eccc634b
Kotlin: Refactor locations
...
Amongst other tidyups, we now generate correct "unknown location"s
2022-05-10 18:45:56 +01:00
Ian Lynagh
5c06ffae69
Kotlin: Use a TrapWriter for the invocation TRAP
...
We'll probably want to shuffle some more stuff from FileTrapWriter to
TrapWriter, but for now at least we are using the generated TRAP-writing
functions rather than writing raw TRAP.
2022-05-10 18:45:56 +01:00
Ian Lynagh
651847d202
Java/Kotlin: Enhance 'compilations' support
2022-05-10 18:45:56 +01:00
Tamas Vajk
9e4614e574
Add gitignore
2022-05-10 18:45:56 +01:00
Ian Lynagh
059d6798bb
Kotlin: Tweak the definition of "eqwuivalent TRAP file"
...
TRAP files that only differ in their comments are equivalent
2022-05-10 18:45:55 +01:00
Ian Lynagh
c3dd35d98b
Kotlin: Put temporary TRAP files in the correct directory
2022-05-10 18:45:55 +01:00
Ian Lynagh
774616450b
Kotlin: Don't give stack traces for fake labels
...
There might be a significant performance hit for it.
2022-05-10 18:45:55 +01:00
Ian Lynagh
9bd0391c04
Kotlin: Don't fail if a file already exists in the source archive
2022-05-10 18:45:55 +01:00
Ian Lynagh
19ff50d0a6
Kotlin: Add a comment to each TRAP file linking to its invocation TRAP file
2022-05-10 18:45:55 +01:00
Ian Lynagh
4bc326ef82
Kotlin: Fix extraction when 2 invocations produce the same TRAP file
...
The second invocation was failing with a "file already exists" error.
I've also added a checkTrapIdentical flag, which is enabled for now.
This means that if 2 invocations write the same TRAP file, we will awrn
if they are not identical. It may be that this produces false positives,
but we can look at that if it happens.
2022-05-10 18:45:55 +01:00
Ian Lynagh
3e8f9f52a6
Kotlin: Start using invocation TRAP files
2022-05-10 18:45:55 +01:00
Ian Lynagh
71c3a64ff5
Kotlin: Simplify location extraction
2022-05-10 18:45:55 +01:00
Ian Lynagh
330727678a
Kotlin: Add some location information to a warning
2022-05-10 18:45:55 +01:00
Ian Lynagh
486cff5df1
Kotlin: Add support for interfaces
2022-05-10 18:45:55 +01:00
Ian Lynagh
14e970044a
Kotlin: Add some flushes
...
This will make it easier to see where we are if we get crashes in the
future.
2022-05-10 18:45:55 +01:00
Ian Lynagh
dbc3f29426
Kotlin: Put diagnostics in a TRAP file
...
Currently we just put everything in as severe with no location.
2022-05-10 18:45:55 +01:00
Ian Lynagh
a40ebd2520
Kotlin: Add support for supertypes
2022-05-10 18:45:55 +01:00
Ian Lynagh
d10024e7e9
Kotlin: Don't make a *Kt class unless we need one
2022-05-10 18:45:54 +01:00
Chris Smowton
c6deabd6a3
Update path to Java dbscheme
...
This changed when the Java tree was restructured for packaging
2022-05-10 18:45:54 +01:00
Ian Lynagh
f29a45ea98
Kotlin: Add getAPrimaryQlClass.ql consistenty check
2022-05-10 18:45:54 +01:00
Ian Lynagh
4837e4e46a
Kotlin: More top-level stuff
2022-05-10 18:45:54 +01:00
Ian Lynagh
f0e2de1fa9
Kotlin: Add file classes
...
Kotlin invents a class for each file that has a top-level
functionp/property, so that Java can use them.
2022-05-10 18:45:54 +01:00
Ian Lynagh
ed2c6e68ea
Kotlin: Function calls
2022-05-10 18:45:54 +01:00
Ian Lynagh
94eefbff17
Kotlin: Add IrContainerExpression
2022-05-10 18:45:54 +01:00
Ian Lynagh
e7cabfb965
Kotlin: Add assign exprs
2022-05-10 18:45:54 +01:00
Ian Lynagh
a64fedf764
Kotlin: When expressions
2022-05-10 18:45:54 +01:00
Ian Lynagh
bbb9d013e0
Kotlin: Escape TRAP strings
2022-05-10 18:45:54 +01:00
Ian Lynagh
f85cf27df8
Kotlin: Better logging infrastructure
2022-05-10 18:45:54 +01:00
Ian Lynagh
4ae7d19235
Kotlin: More expressions
2022-05-10 18:45:54 +01:00
Ian Lynagh
bb89b25e91
Kotlin: More expressions
2022-05-10 18:45:54 +01:00
Ian Lynagh
1de12e72d4
Kotlin: More expressions
2022-05-10 18:45:53 +01:00
Ian Lynagh
90161b9e9d
Kotlin: Add more expressions
2022-05-10 18:45:53 +01:00
Ian Lynagh
492dc3dfb3
Kotlin: More tests (of unhandled expressions)
2022-05-10 18:45:53 +01:00
Ian Lynagh
b4bc40630f
Kotlin: More expressions
2022-05-10 18:45:53 +01:00
Ian Lynagh
14a46b08b5
Kotlin: Variable accesses
2022-05-10 18:45:53 +01:00
Ian Lynagh
4c8ff16552
Kotlin: Fixes
2022-05-10 18:45:53 +01:00
Ian Lynagh
3daec4376f
Kotlin: Variable initialisers
2022-05-10 18:45:53 +01:00
Ian Lynagh
f5e2826b9f
Kotlin: Accept test changes
2022-05-10 18:45:53 +01:00
Ian Lynagh
4ba13d3663
Kotlin: Extract parameters
2022-05-10 18:45:53 +01:00
Ian Lynagh
799cf64fd2
Kotlin: Local variables
2022-05-10 18:45:53 +01:00
Ian Lynagh
46add88bb5
Kotlin: Add more types
2022-05-10 18:45:53 +01:00
Ian Lynagh
1c39f001e5
Kotlin: Add variables test
2022-05-10 18:45:53 +01:00
Ian Lynagh
b91660a0f0
Kotlin: Extract properties
2022-05-10 18:45:53 +01:00
Ian Lynagh
97722faee9
Kotlin: Add do/while loops
2022-05-10 18:45:52 +01:00
Ian Lynagh
0c429e4f80
Kotlin: Add blocks
2022-05-10 18:45:52 +01:00
Ian Lynagh
a8a6b4c09f
Kotlin: Move some expressions to the right place
2022-05-10 18:45:52 +01:00
Ian Lynagh
b25ea03211
Kotlin: Add while statements
2022-05-10 18:45:52 +01:00
Ian Lynagh
00cff5593f
Kotlin: Fix the tests
...
The handling of Unit is very kludgy at the moment. Will need rethinking.
2022-05-10 18:45:52 +01:00
Ian Lynagh
f0903726bf
Kotlin: Add some if-stmt support
2022-05-10 18:45:52 +01:00
Ian Lynagh
d48739cc92
Kotlin: Check a call actually is an addition
2022-05-10 18:45:52 +01:00
Ian Lynagh
9a75ca7f62
Kotlin: Identify the int type better
2022-05-10 18:45:52 +01:00
Ian Lynagh
f608384085
Kotlin: Add a "bug" case
2022-05-10 18:45:52 +01:00
Ian Lynagh
b68178e8cc
Kotlin: Handle enums better when generating dbscheme
2022-05-10 18:45:52 +01:00
Ian Lynagh
5f991653c1
Kotlin: Generate type aliases for dbscheme
2022-05-10 18:45:52 +01:00
Ian Lynagh
dbef421204
Kotlin: Generate dbscheme deterministically
2022-05-10 18:45:52 +01:00
Ian Lynagh
afea1871a7
Java: Add a variables consistency query
2022-05-10 18:45:52 +01:00
Ian Lynagh
15be80631f
Java: Add a consistency test for expressions
...
They should have exactly 1 Type.
2022-05-10 18:45:52 +01:00
Ian Lynagh
bbbd5d78a7
Java: Add toString consistency query
2022-05-10 18:45:51 +01:00
Ian Lynagh
06d9d305c2
Java: More consistency queries
2022-05-10 18:45:51 +01:00
Ian Lynagh
b2acb7d7a1
Add a consistency query
2022-05-10 18:45:51 +01:00
Ian Lynagh
03d5646c19
Kotlin: Add stmt/expr support
2022-05-10 18:45:51 +01:00
Ian Lynagh
49a4e479da
Kotlin: Extract methods
2022-05-10 18:45:51 +01:00
Ian Lynagh
6dd1027315
Kotlin: Refactoring
2022-05-10 18:45:51 +01:00
Ian Lynagh
fb26859425
Kotlin: Suppress an unchecked cast warning
...
I don't think we can easily do better here.
2022-05-10 18:45:51 +01:00
Ian Lynagh
4e27da33e4
Kotlin: Tweak generator
2022-05-10 18:45:51 +01:00
Ian Lynagh
d28059a1c0
Kotlin: Generate a module from the dbscheme
2022-05-10 18:45:51 +01:00
Ian Lynagh
4721ccd965
Kotlin: Add tests
2022-05-10 18:45:51 +01:00
Ian Lynagh
f15c6dede1
Kotlin: Get extractor working in a Java context
2022-05-10 18:45:51 +01:00
Ian Lynagh
e3ecf4c52d
Kotlin: Add kotlin-extractor
2022-05-10 18:45:51 +01:00
Cornelius Riemenschneider
7c10f3e76b
C#: Lua tracing config: Use API function.
2022-05-10 14:38:53 +00:00
Mathias Vorreiter Pedersen
1d10f14629
Merge pull request #9100 from redsun82/swift-tbd-rework
...
Swift: changes required for TBD node rework
2022-05-10 13:31:43 +01:00
Rasmus Wriedt Larsen
2b6e0cfb44
Merge pull request #8340 from yoff/python/simple-csrf
...
python: minimal CSRF implementation
2022-05-10 13:36:38 +02:00
Rasmus Wriedt Larsen
cb17e2a649
Merge pull request #8595 from porcupineyhairs/pypam
...
Python : Add query to detect PAM authorization bypass
2022-05-10 13:35:12 +02:00
Erik Krogh Kristensen
09360bce20
Merge pull request #9085 from erik-krogh/cash
...
JS: add model for the cash library
2022-05-10 13:20:57 +02:00
Paolo Tranquilli
bf71e4c500
Swift: getPrimaryQlClass -> getAPrimaryQlClass
2022-05-10 12:42:18 +02:00
Paolo Tranquilli
0b9dc9703f
Swift: changes required for TBD node rework
...
These changes are required to allow a new type-safe approach to TBD
nodes, that will come in a separate commit.
This introduces:
* the possibility to add properties to the root `Element`
* a functor taking tags to the corresponding binding trap entry
* `hasProp()` methods for optional properties in QL
* `getPrimaryQlClass()` method
2022-05-10 11:59:25 +02:00
Rasmus Lerchedahl Petersen
aa3d7babf4
python: fix bad merge
...
caused by an optimistic attempt at solving a
merge conflict in the online GUI.
2022-05-10 11:37:41 +02:00
Rasmus Wriedt Larsen
2421076d2f
Merge pull request #8696 from RasmusWL/new-nosql-examples
...
Python: Improve experimental modeling for `pymongo`
2022-05-10 11:03:05 +02:00
yoff
6c3e2db7fd
Merge branch 'main' into python/simple-csrf
2022-05-10 10:55:28 +02:00
Cornelius Riemenschneider
7aa3d0fd26
Merge pull request #9091 from github/criemen/dotnet-lua-tracing-config
...
C#: Port the existing compiler-tracing.spec files to Lua.
2022-05-10 10:54:20 +02:00
Anders Schack-Mulligen
f85e06c2e4
Dataflow: Sync.
2022-05-10 10:12:39 +02:00
Cornelius Riemenschneider
40503aa368
Address review.
2022-05-10 08:06:25 +00:00
yoff
b6605bc330
Merge pull request #8634 from RasmusWL/promote-xxe
...
Python: Promote XXE and XML-bomb queries
2022-05-09 21:54:55 +02:00
Rasmus Lerchedahl Petersen
1c7e533144
python: format
2022-05-09 21:22:27 +02:00
Erik Krogh Kristensen
e80ee46fe4
add model for the cash library
2022-05-09 21:01:07 +02:00
Mathias Vorreiter Pedersen
66ca01a717
Merge pull request #9094 from redsun82/swift-codegen-predicate-properties
...
Swift codegen: add predicate properties
2022-05-09 17:17:10 +01:00
luchua-bc
75e7148912
Standardize the query and update qldoc
2022-05-09 16:10:11 +00:00
Paolo Tranquilli
c08e6fdc1e
Swift codegen: add predicate properties
...
Properties marked with `predicate` in the schema are now accepted.
* in the dbscheme, they will translate to a table with a single `id`
column (and the table name will not be pluralized)
* in C++ classes, they will translate to `bool` fields
* in QL classes, they will translate to predicates
Closes https://github.com/github/codeql-c-team/issues/1016
2022-05-09 17:50:49 +02:00
Paolo Tranquilli
effa9ee207
Merge pull request #9034 from redsun82/swift-cpp-gen
...
Swift: add structured C++ generated classes
2022-05-09 17:49:23 +02:00
Geoffrey White
265500faa8
Merge pull request #8800 from geoffw0/unsafeput
...
C++: Add a test for experimental query NoCheckBeforeUnsafePutUser.ql.
2022-05-09 16:20:19 +01:00
Rasmus Lerchedahl Petersen
2a5908ff49
python: require all settings be vulnerable
...
at least all thos not in tests
2022-05-09 17:08:49 +02:00
Cornelius Riemenschneider
bf0e32ae82
C#: Port the existing compiler-tracing.spec files to Lua.
2022-05-09 14:45:34 +00:00
Rasmus Wriedt Larsen
4a6789182d
Python: Apply suggestions from code review
...
Co-authored-by: yoff <lerchedahl@gmail.com >
2022-05-09 16:37:12 +02:00
Anders Schack-Mulligen
135d7f6e32
Dataflow: Prune more cons-candidates.
2022-05-09 16:21:12 +02:00
Anders Schack-Mulligen
1b0e9d5cd7
Dataflow: Fix join order in nodeMayUseSummary.
2022-05-09 16:21:12 +02:00
Henry Mercer
3c4715928e
Merge pull request #9083 from github/henrymercer/fetch-codeql-with-gh-cli
...
Actions: Fetch CodeQL CLI using `gh` rather than third-party Action
2022-05-09 14:40:29 +01:00
Anders Schack-Mulligen
f24364d951
Merge pull request #9045 from hvitved/dataflow/subpaths-perf-take2
...
Data flow: Speedup `subpaths` predicate (take 2)
2022-05-09 15:39:11 +02:00
Henry Mercer
71d1069a0a
Fix typo
2022-05-09 14:31:05 +01:00
Henry Mercer
198c96982c
Add a comment to explain the unusual Action path
2022-05-09 14:30:41 +01:00
CodeQL CI
e099b94cc4
Merge pull request #9081 from asgerf/js/global-step-refactor
...
Approved by erik-krogh
2022-05-09 06:30:37 -07:00
Rasmus Wriedt Larsen
c218162104
Merge branch 'main' into pypam
2022-05-09 14:20:05 +02:00
Rasmus Wriedt Larsen
ab1252d196
Python: Add @precision high for py/pam-auth-bypass
2022-05-09 14:19:40 +02:00
Geoffrey White
85cc9b8901
C++: Use getClassAndName.
2022-05-09 13:06:44 +01:00
Geoffrey White
28dca3fa9f
Merge pull request #8245 from ihsinme/ihsinme-patch-67
...
CPP: Add query for CWE-476: NULL Pointer Dereference when using exception handling blocks
2022-05-09 12:26:20 +01:00
Geoffrey White
9709c2fa94
C++: Use compliant PascalCase / make the checks happy.
2022-05-09 11:58:57 +01:00
Henry Mercer
804ca3e1a7
Actions: Fetch CodeQL CLI using gh rather than third-party Action
2022-05-09 11:42:01 +01:00
Erik Krogh Kristensen
53b26eba17
Merge pull request #8724 from erik-krogh/postMessage
...
JS: promote the `js/missing-origin-verification` query
2022-05-09 12:28:58 +02:00
Erik Krogh Kristensen
fe1e47bc17
Merge pull request #8710 from bananabr/dragAndDrop
...
JS: drag and drop API Xss sources
2022-05-09 12:22:28 +02:00
Erik Krogh Kristensen
611a412f2a
Merge pull request #8990 from bananabr/selection
...
JS: Selection API DOM text source
2022-05-09 12:22:18 +02:00
Paolo Tranquilli
93f8b6b29d
Swift: add missing trap_affix
2022-05-09 12:20:22 +02:00
Paolo Tranquilli
20317a280b
Swift: make width fields unsigned
2022-05-09 12:19:52 +02:00
Asger F
88b5bbe024
JS: Update test expectation
2022-05-09 11:55:07 +02:00
Rasmus Wriedt Larsen
de05b108fa
Python: Fix singleton set
2022-05-09 11:01:13 +02:00
Rasmus Wriedt Larsen
36349222a9
Python: Fix casing of XMLDomParsing
2022-05-09 11:00:25 +02:00
Rasmus Wriedt Larsen
f22bd039f3
Python: Slight refactor of LxmlParsing
2022-05-09 10:56:39 +02:00
Rasmus Wriedt Larsen
f5854f33da
Python: Apply suggestions from code review
...
Co-authored-by: yoff <lerchedahl@gmail.com >
2022-05-09 10:53:25 +02:00
Michael Nebel
9a45949e8c
Merge pull request #9044 from michaelnebel/csharp/flowsummariestest
...
C#: Flow summaries test should print, whether a summary is generated or not.
2022-05-09 10:06:19 +02:00
Michael Nebel
1401e7ddb3
Merge pull request #8855 from michaelnebel/csharp/singlereadstore
...
C#: Only allow two read and two store steps in model capturing.
2022-05-09 10:05:53 +02:00
Paolo Tranquilli
9c5b2d7e9d
Swift: tweaks for use in the PoC branch
2022-05-09 09:46:47 +02:00
Paolo Tranquilli
918ba1b1fc
Swift: make generator.run accept options
2022-05-09 09:34:49 +02:00
AlexDenisov
c21849bb2e
Merge pull request #9015 from redsun82/swift-enable-dynamic-library
...
Swift: enable dynamic mode
2022-05-09 09:15:37 +02:00
AlexDenisov
fe72dfe7d4
Merge pull request #9028 from redsun82/swift-trapgen
...
Swift: add `trapgen` unit tests
2022-05-09 09:15:22 +02:00
Paolo Tranquilli
6cbfb5a10c
Swift cppgen: emit final trap before bases
2022-05-09 09:02:20 +02:00
Michael Nebel
83aa65ff53
C#/Java: Remove redudandant QL comment in CaptureModel.
2022-05-09 07:36:41 +02:00
Michael Nebel
76fd424795
C#: Turn isAutogenerated predicate into a predicate without result.
2022-05-09 07:30:06 +02:00
Michael Nebel
9b855c30cc
Merge pull request #9043 from michaelnebel/csharp/xml-injection-path
...
C#: Convert xml injection query to a path problem.
2022-05-09 07:18:01 +02:00
Marcono1234
c760d39d59
Merge remote-tracking branch 'remotes/origin/main' into marcono1234/statement-expression
2022-05-09 00:28:19 +02:00
Marcono1234
36f56b5a18
Java: Rename StmtExpr to ValueDiscardingExpr
...
As mentioned by aschackmull during review, StatementExpression as defined
by the JLS only lists possible types of expressions, it does _not_ specify
that their value is discarded. Therefore, for example any method call could
be considered a StatementExpression.
The name ValueDiscardingExpr was chosen as replacement because the JLS uses
the phrase "if the expression has a value, the value is discarded" multiple
times.
2022-05-09 00:27:15 +02:00
Mathias Vorreiter Pedersen
176e40f139
Merge pull request #9052 from github/post-release-prep/codeql-cli-2.9.1
...
Post-release preparation for codeql-cli-2.9.1
2022-05-06 13:15:17 +01:00
github-actions[bot]
1a25457178
Post-release preparation for codeql-cli-2.9.1
2022-05-05 19:05:50 +00:00
ihsinme
b98ddc72f5
Update DangerousUseOfExceptionBlocks.ql
2022-05-05 21:05:22 +03:00
Paolo Tranquilli
a7129c1f4c
Swift: add --ql-format/--no-ql-format to codegen
2022-05-05 18:33:05 +02:00
ihsinme
6dec1182bf
Update DangerousUseOfExceptionBlocks.expected
2022-05-05 19:17:31 +03:00
ihsinme
185a60f034
Update test.cpp
2022-05-05 19:16:54 +03:00
Geoffrey White
453dadea1a
C++: Fix QLDoc.
2022-05-05 16:43:31 +01:00
ihsinme
2d4d7aa094
Update DangerousUseOfExceptionBlocks.ql
2022-05-05 18:40:29 +03:00
Geoffrey White
6b5a1921dd
C++: Support the SAX2XMLReader interface.
2022-05-05 16:35:21 +01:00
Paolo Tranquilli
b2b5fd281f
Swift: add more parametrization
...
This enables codegen to run on the swift PoC branch.
2022-05-05 17:34:00 +02:00
Geoffrey White
c4bc7050a9
C++: Additional test cases.
2022-05-05 16:26:09 +01:00
Tony Torralba
ca2959cf37
Merge pull request #8537 from atorralba/atorralba/unsafe_android_access_improvs
...
Java: Improvements to UnsafeAndroidAccess
2022-05-05 16:46:54 +02:00
Paolo Tranquilli
ac3cceab19
Swift: turn some generated paths to relative
2022-05-05 16:15:16 +02:00
Paolo Tranquilli
7bcc5db4a6
Swift: parametrize namespace and other things in codegen
...
This is so that we can use this in the PoC branch.
2022-05-05 16:01:54 +02:00
Tom Hvitved
04cc73823d
Java: Introduce 'with/without content' summary components
2022-05-05 14:25:48 +02:00
Tom Hvitved
2972af2602
C#: Introduce 'with/without content' summary components
2022-05-05 14:25:48 +02:00
Tom Hvitved
2e780154e2
Ruby: Introduce 'with/without content' summary components
2022-05-05 14:25:48 +02:00
yoff
6169ac6122
Merge pull request #7776 from RasmusWL/django-filefield-uploadto
...
Python: Support Django FileField.upload_to
2022-05-05 14:25:08 +02:00
Erik Krogh Kristensen
58db9226dc
add missing word in qhelp
2022-05-05 14:24:45 +02:00
Tom Hvitved
d9d5372f28
Data flow: Sync files
2022-05-05 13:36:26 +02:00
Tom Hvitved
de6e2c95e7
Data flow: Speedup subpaths predicate (take 2)
2022-05-05 13:36:08 +02:00
Michael Nebel
3c347cab98
C#: Update test output to reflect that the query is now a path-problem query.
2022-05-05 13:13:25 +02:00
Michael Nebel
2dc35c123a
Java/Ruby: Sync files.
2022-05-05 13:08:55 +02:00
Michael Nebel
a8556f4d50
C#: Make sure that test output prints whether the summary is generated or not.
2022-05-05 13:07:22 +02:00
Erik Krogh Kristensen
2d7c7ff372
apply suggestions from doc review
...
Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com >
2022-05-05 13:03:35 +02:00
Asger F
c4d597d60f
JS: Enumerate type-tracking steps through global access paths
2022-05-05 12:59:10 +02:00
ihsinme
75244effc5
Update DangerousUseOfExceptionBlocks.ql
2022-05-05 13:27:17 +03:00
Paolo Tranquilli
c87fb4df53
Swift: remove now unused ql.Property.params
2022-05-05 12:01:13 +02:00
Mathias Vorreiter Pedersen
6f9752ead1
Merge pull request #9019 from geoffw0/xxe4
...
C++: More XXE Tests
2022-05-05 10:59:40 +01:00
Michael Nebel
e416a0629a
C#: Add isAutoGenerated predicate to SummarizedCallable.
2022-05-05 11:54:04 +02:00
Paolo Tranquilli
9798d8ba26
Swift: add ?* modifier to schema specification
...
This indicates a list of optional entries. This is different than
simply repeatind entries because of the indexing.
2022-05-05 11:50:12 +02:00
yoff
0c7184952b
Merge pull request #9023 from RasmusWL/positional-docs
...
Python: Clarify `getArg` is about positional arguments
2022-05-05 11:28:17 +02:00
Arthur Baars
25d9ffd18c
Merge pull request #9033 from github/aibaars/atm-label
...
JS: exclude ATM folder from labeler
2022-05-05 10:53:39 +02:00
Michael Nebel
13f142f143
C#: Convert xml injection query to a path problem.
2022-05-05 10:43:23 +02:00
Jonas Jensen
d747c6eaa9
Merge pull request #8930 from jbj/lower-case-variables-spec
...
QL language reference: variables must be lowerId
2022-05-05 10:02:16 +02:00
Paolo Tranquilli
c2d3aac349
Swift: fix no functools.cache in python 3.8
2022-05-05 09:48:07 +02:00
Michael Nebel
21eb5a1db5
Merge pull request #8894 from michaelnebel/csharp/upgrade-dotnet
...
C#: Upgrade dotnet to 6.0.202.
2022-05-05 09:42:23 +02:00
Erik Krogh Kristensen
bf6663ab12
run the autoformatter
2022-05-05 09:16:27 +02:00
Tom Hvitved
66a9759329
Merge pull request #8870 from hvitved/dataflow/expect-content
...
Data flow: Introduce `expectsContent`
2022-05-05 09:01:40 +02:00
luchua-bc
937ab417b1
Query to detect hardcoded JWT secret keys
2022-05-04 23:09:48 +00:00
Daniel Santos
33e85f8db8
Update javascript/ql/lib/semmle/javascript/security/dataflow/XssThroughDomCustomizations.qll
...
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com >
2022-05-04 11:43:56 -05:00
Paolo Tranquilli
d5d1eb717d
Swift: add structured C++ generated classes
...
This adds `cppgen`, creating structured C++ classes mirroring QL classes
out of `schema.yml`.
An example of generated code at the time of this commit can be found
[in this gist][1].
[1]: https://gist.github.com/redsun82/57304ddb487a8aa40eaa0caa695048fa
Closes https://github.com/github/codeql-c-team/issues/863
2022-05-04 18:20:25 +02:00
Paolo Tranquilli
10c5c8e71f
Swift: add trapgen unit tests
...
Closes: https://github.com/github/codeql-c-team/issues/981
2022-05-04 18:20:06 +02:00
Tom Hvitved
8e33653d25
Merge pull request #9017 from hvitved/dataflow/subpaths-perf
...
Data flow: Speedup `subpaths` predicate
2022-05-04 16:37:52 +02:00
Erik Krogh Kristensen
0d8bef7e92
Merge pull request #6736 from erik-krogh/polyReplace
...
JS: track flow through string replace calls that just replace single chars for js/polynomial-redos
2022-05-04 16:30:20 +02:00
Erik Krogh Kristensen
8425eaf919
Merge pull request #8549 from erik-krogh/unreachableJoin
...
JS: fix bad join in js/unreachable-method-overloads
2022-05-04 16:28:06 +02:00
Erik Krogh Kristensen
b4d4b51bc7
Merge pull request #8147 from erik-krogh/cacheReg
...
JS: cache RegExpCreationNode::getAReference
2022-05-04 16:25:25 +02:00
Arthur Baars
c7b2da5e39
JS: exclude ATM folder from labeler
2022-05-04 16:16:19 +02:00
Rasmus Wriedt Larsen
7bd7bedb1b
Ruby: Simplify isLocalSourceNode implementation
...
The need for `SynthReturnNode` goes away if we don't restrict the nodes
that can't be reached from another entry definition or expression to be
`ExprNode`s
2022-05-04 16:12:20 +02:00
Nick Rolfe
5f59e96fa9
Merge pull request #8975 from github/nickrolfe/flow_summary_joins
2022-05-04 14:24:45 +01:00
Tom Hvitved
9cb63c0a5e
Data flow: Sync files
2022-05-04 14:49:26 +02:00
Tom Hvitved
7f7742216c
Address review comment
...
This reverts commit 2b4fde74bb .
2022-05-04 14:49:03 +02:00
Nick Rolfe
276f8d40f9
Ruby: add comments to address review feedback
2022-05-04 12:07:46 +01:00
Mathias Vorreiter Pedersen
f499f8e946
Merge pull request #9029 from redsun82/swift-codeowners
...
Swift: set @github/codeql-c as owner
2022-05-04 11:34:51 +01:00
Tony Torralba
2d3b15f936
Add more taint models
2022-05-04 12:32:59 +02:00
Michael Nebel
5f1a176a02
Java: Sync CaptureModels implementation to only allow at most two reads and two stores.
2022-05-04 12:29:57 +02:00
Michael Nebel
a488d6b80c
C#: Add an initial flow state to the model generator.
2022-05-04 12:27:34 +02:00
Tony Torralba
8601137602
Fix bad join order by moving WebViewRef::getAnAccess from callsites into predicates
2022-05-04 11:58:47 +02:00
Tony Torralba
3b1210eacb
Update java/ql/lib/semmle/code/java/security/UnsafeAndroidAccess.qll
...
Co-authored-by: Chris Smowton <smowton@github.com >
2022-05-04 10:53:31 +02:00
Tony Torralba
192017635a
Update java/ql/src/change-notes/2022-03-24-unsafe-android-access-improvements.md
...
Co-authored-by: Chris Smowton <smowton@github.com >
2022-05-04 10:53:31 +02:00
Tony Torralba
49259a6575
Remove everything related to WebView CSV models
...
This reverts commit c6c72eb.
2022-05-04 10:53:31 +02:00
Tony Torralba
dce11f3984
Removed unnecessary imports
2022-05-04 10:53:30 +02:00
Tony Torralba
f5e72e6e33
Remove getUnderlyingExpr
2022-05-04 10:53:30 +02:00
Tony Torralba
7ba5a032ce
Add tests and stubs for the new sources and flow steps
2022-05-04 10:53:30 +02:00
Tony Torralba
b678467e9d
Move things around
2022-05-04 10:53:30 +02:00
Tony Torralba
d68311e26d
Consider implicit this accesses in WebViewRef
2022-05-04 10:53:30 +02:00
Tony Torralba
51dfebf4c9
Apply suggestions from code review
...
Co-authored-by: Chris Smowton <smowton@github.com >
2022-05-04 10:53:29 +02:00
Tony Torralba
b9859fe165
Add change note
2022-05-04 10:53:29 +02:00
Tony Torralba
91bdb4299f
Improvements to UnsafeAndroidAccess
2022-05-04 10:53:29 +02:00
Tony Torralba
b876431950
Merge pull request #8706 from luchua-bc/java/unsafe-get-resource
...
Java: CWE-552 Add sources and sinks to to detect unsafe getResource calls in Java EE applications
2022-05-04 10:12:28 +02:00
Tom Hvitved
74e99302d6
Address review comments
2022-05-04 09:57:59 +02:00
Tom Hvitved
ac3bfa1788
Data flow: Mention expectsContent in dataflow.md
2022-05-04 09:57:59 +02:00
Tom Hvitved
da72ba46d4
Data flow: Add stub expectsContent for all languages
2022-05-04 09:57:59 +02:00
Tom Hvitved
6e2e8440eb
Data flow: Sync files
2022-05-04 09:57:59 +02:00
Tom Hvitved
a50f18ab50
Data flow: Introduce expectsContent
2022-05-04 09:57:58 +02:00
bananabr
2e2d4c6e1f
updated tests to consider document.getSelection()
2022-05-03 21:03:35 -05:00
Daniel Santos
880e3e1885
Update javascript/ql/lib/semmle/javascript/security/dataflow/XssThroughDomCustomizations.qll
...
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com >
2022-05-03 11:38:32 -05:00
Daniel Santos
4cd6dcc4d0
Update javascript/ql/lib/change-notes/2022-04-30-xss-selection-source.md
...
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com >
2022-05-03 11:37:45 -05:00
Daniel Santos
d52980573a
Update javascript/ql/lib/semmle/javascript/security/dataflow/XssThroughDomCustomizations.qll
...
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com >
2022-05-03 11:37:26 -05:00
Paolo Tranquilli
b7cdc4ae1f
Swift: set @github/codeql-c as owner
2022-05-03 17:41:23 +02:00
Geoffrey White
5aa862acfd
C++: Fixup after merge.
2022-05-03 16:12:42 +01:00
Geoffrey White
fd5b4dfff2
Merge branch 'main' into xxe4
2022-05-03 16:08:54 +01:00
Mathias Vorreiter Pedersen
b8fd07c0ac
Merge pull request #9018 from geoffw0/xxe5
...
C++: Support libxml2 in the XXE query
2022-05-03 16:00:52 +01:00
Michael Nebel
b8ec2254e8
C#: Update unit tests (looks like new NFloat operator has been introduced).
2022-05-03 16:36:32 +02:00
Michael Nebel
94b046c554
C#: Upgrade dotnet to 6.0.202.
2022-05-03 16:36:32 +02:00
Joe Farebrother
f65f833b11
Merge pull request #9020 from joefarebrother/predictable-seed
...
Java: Add CWE-377 tag to java/predictable-seed
2022-05-03 15:13:58 +01:00
Tony Torralba
02822c6284
Merge pull request #9013 from atorralba/atorralba/private-externalflow-imports
...
Java: Make more ExternalFlow imports private
2022-05-03 16:02:09 +02:00
Tony Torralba
cf55f180c4
Add change note
2022-05-03 15:46:17 +02:00
Tony Torralba
7b3a803d19
Add flow step from startActivity to getIntent
2022-05-03 15:46:17 +02:00
Tony Torralba
9c92454fa7
Merge pull request #8872 from atorralba/atorralba/android-widget-flowstep
...
Java: Add Editable.toString flow step
2022-05-03 15:27:52 +02:00
Joe Farebrother
61f13817cf
Add change note
2022-05-03 14:27:47 +01:00
Geoffrey White
d5be11bf14
C++: Address review comments.
2022-05-03 14:08:19 +01:00
Rasmus Wriedt Larsen
a7b43f7356
Ruby: Accept changes to TypeTracker tests
...
Since this is not using inline-expectation-tests, I'm not entirely sure
whether these changes are OK or not, so hope to get someone else to
signoff on that.
2022-05-03 14:59:06 +02:00
Rasmus Wriedt Larsen
6cacf7b9a6
Ruby: isLocalSourceNode needs SynthReturnNode
2022-05-03 14:43:57 +02:00
Tony Torralba
fbceb8de57
Update java/ql/lib/semmle/code/java/frameworks/OkHttp.qll
...
Co-authored-by: Chris Smowton <smowton@github.com >
2022-05-03 14:40:40 +02:00
Rasmus Wriedt Larsen
d012eaa892
Python: Clarify getArg is about positional arguments
2022-05-03 14:26:23 +02:00
Rasmus Wriedt Larsen
89c4b6c235
Ruby: Fix isLocalSourceNode implementation
...
The old code was equivalent with the code below, which seems wrong
```
not n instanceof ExprNode
or
n instanceof ExprNode and
localFlowStepTypeTracker+(..., n)
```
From running on real DB I found that this meant that the following node
types were also included as local source nodes:
- `TReturningNode`
- `TSynthReturnNode`
- `TSummaryNode`
- `TSsaDefinitionNode`
My understanding is that the first 3 should not be included.
I would guess that SsaDefinitionNode should indeed be included as a
LocalSourceNode, but I'm not 100% sure, so I'll see what the test
results say before making further changes.
2022-05-03 14:16:19 +02:00
Joe Farebrother
f7d0884db1
Java: Add cwe-377 tag to predictable-seed
2022-05-03 12:28:14 +01:00
Geoffrey White
42a78a27e0
C++: Fixup spacing in tests.
2022-05-03 11:48:03 +01:00
Paolo Tranquilli
c2be267feb
Swift: enable dynamic mode
...
Providing `--dynamic_mode=fully` (for example setting it in
`local.bazelrc`) will now work.
All runfiles are now copied in the extractor pack: in dynamic mode,
those will be the executable and the dynamic libraries, while in static
mode only the executable will be part of the runfiles.
Setting the correct `LD_LIBRARY_PATH` in `qltest.sh` then allows to
run tests with this pakcage. If we need something more, we can switch to
a wrapper script in place of `extractor` in the future.
Notice that `LD_LIBRARY_PATH` is also set in static mode, but that has
no consequence.
2022-05-03 12:33:24 +02:00
yoff
56ed68b3eb
Merge pull request #9001 from RasmusWL/files-refactoring
...
Python: Flask: Improve `request.files` modeing
2022-05-03 12:19:55 +02:00
Geoffrey White
9faa825304
C++: Add support for libxml2 in the query.
2022-05-03 11:19:13 +01:00
Tom Hvitved
e9c8f979f9
Data flow: Sync files
2022-05-03 11:46:51 +02:00
Tom Hvitved
2b4fde74bb
Data flow: Speedup subpaths predicate
...
Before
```
[2022-05-02 15:47:16] (1280s) Tuple counts for DataFlowImpl::Subpaths::subpaths#656de156#ffff/4@c5f3dclb after 3m22s:
8389013 ~4% {5} r1 = JOIN DataFlowImpl::Subpaths::subpaths#656de156#ffff#shared WITH DataFlowImpl::PathNode::getASuccessor#dispred#f0820431#ff_10#join_rhs ON FIRST 1 OUTPUT Rhs.1 'arg', Lhs.1, Lhs.2, Lhs.3, Lhs.4 'out'
6689751 ~0% {4} r2 = JOIN r1 WITH DataFlowImpl::Subpaths::subpaths03#656de156#ffffff_034512#join_rhs ON FIRST 4 OUTPUT Rhs.4, Lhs.4 'out', Lhs.0 'arg', Rhs.5 'ret'
1513839768 ~1% {5} r3 = JOIN r2 WITH DataFlowImpl::PathNodeImpl::getNodeEx#dispred#f0820431#ff_10#join_rhs ON FIRST 1 OUTPUT Lhs.1 'out', Lhs.2 'arg', Lhs.3 'ret', Rhs.1 'par', Lhs.3 'ret'
1513839768 ~1% {5} r4 = r3 AND NOT DataFlowImpl::PathNodeImpl::isHidden#dispred#f0820431#f(Lhs.4 'ret')
1513839768 ~5% {4} r5 = SCAN r4 OUTPUT In.1 'arg', In.3 'par', In.0 'out', In.4 'ret'
1513839768 ~2% {4} r6 = JOIN r2 WITH DataFlowImpl::PathNodeImpl::getNodeEx#dispred#f0820431#ff_10#join_rhs ON FIRST 1 OUTPUT Lhs.3 'ret', Lhs.1 'out', Lhs.2 'arg', Rhs.1 'par'
0 ~0% {5} r7 = JOIN r6 WITH boundedFastTC(DataFlowImpl::Subpaths::localStepToHidden#656de156#ff_10#higher_order_body,DataFlowImpl::Subpaths::subpaths#656de156#ffff#higher_order_body) ON FIRST 1 OUTPUT Lhs.1 'out', Lhs.2 'arg', Lhs.0, Lhs.3 'par', Rhs.1 'ret'
0 ~0% {5} r8 = r7 AND NOT DataFlowImpl::PathNodeImpl::isHidden#dispred#f0820431#f(Lhs.4 'ret')
0 ~0% {4} r9 = SCAN r8 OUTPUT In.1 'arg', In.3 'par', In.0 'out', In.4 'ret'
1513839768 ~5% {4} r10 = r5 UNION r9
6689751 ~0% {4} r11 = JOIN r10 WITH DataFlowImpl::PathNode::getASuccessor#dispred#f0820431#ff ON FIRST 2 OUTPUT Lhs.0 'arg', Lhs.1 'par', Lhs.3 'ret', Lhs.2 'out'
return r11
```
After
```
[2022-05-03 11:44:10] (969s) Tuple counts for DataFlowImpl::Subpaths::subpaths#656de156#ffff/4@b26b969r after 11.8s:
8372525 ~0% {3} r1 = JOIN DataFlowImpl::PathNode::getASuccessor#dispred#f0820431#ff_10#join_rhs WITH DataFlowImpl::PathNodeImpl::getNodeEx#dispred#f0820431#ff ON FIRST 1 OUTPUT Lhs.1 'arg', Rhs.1, Rhs.0
6673799 ~6% {9} r2 = JOIN r1 WITH DataFlowImpl::Subpaths::subpaths03#656de156#fffffffff ON FIRST 2 OUTPUT Rhs.3, Rhs.4, Rhs.5, Rhs.7, Rhs.6, Rhs.8, Lhs.2 'par', Lhs.0 'arg', Rhs.2 'ret'
6637884 ~0% {5} r3 = JOIN r2 WITH project#DataFlowImpl::pathNode#656de156#ffffffff_1234560#join_rhs ON FIRST 6 OUTPUT Lhs.6 'par', Lhs.7 'arg', Lhs.8 'ret', Rhs.6 'out', Lhs.8 'ret'
6637884 ~0% {4} r4 = JOIN r2 WITH project#DataFlowImpl::pathNode#656de156#ffffffff_1234560#join_rhs ON FIRST 6 OUTPUT Rhs.6 'out', Lhs.6 'par', Lhs.7 'arg', Lhs.8 'ret'
51867 ~0% {5} r5 = JOIN r4 WITH DataFlowImpl::PathNodeMid::projectToSink#dispred#f0820431#ff ON FIRST 1 OUTPUT Lhs.1 'par', Lhs.2 'arg', Lhs.3 'ret', Rhs.1 'out', Lhs.3 'ret'
6689751 ~0% {5} r6 = r3 UNION r5
6689751 ~0% {5} r7 = r6 AND NOT DataFlowImpl::PathNodeImpl::isHidden#dispred#f0820431#f(Lhs.4 'ret')
6689751 ~0% {4} r8 = SCAN r7 OUTPUT In.1 'arg', In.0 'par', In.4 'ret', In.3 'out'
6637884 ~0% {4} r9 = JOIN r2 WITH project#DataFlowImpl::pathNode#656de156#ffffffff_1234560#join_rhs ON FIRST 6 OUTPUT Lhs.8 'ret', Lhs.6 'par', Lhs.7 'arg', Rhs.6 'out'
51867 ~0% {4} r10 = JOIN r4 WITH DataFlowImpl::PathNodeMid::projectToSink#dispred#f0820431#ff ON FIRST 1 OUTPUT Lhs.3 'ret', Lhs.1 'par', Lhs.2 'arg', Rhs.1 'out'
6689751 ~0% {4} r11 = r9 UNION r10
0 ~0% {5} r12 = JOIN r11 WITH boundedFastTC(DataFlowImpl::Subpaths::localStepToHidden#656de156#ff_10#higher_order_body,DataFlowImpl::Subpaths::subpaths#656de156#ffff#higher_order_body) ON FIRST 1 OUTPUT Lhs.1 'par', Lhs.2 'arg', Lhs.0, Lhs.3 'out', Rhs.1 'ret'
0 ~0% {5} r13 = r12 AND NOT DataFlowImpl::PathNodeImpl::isHidden#dispred#f0820431#f(Lhs.4 'ret')
0 ~0% {4} r14 = SCAN r13 OUTPUT In.1 'arg', In.0 'par', In.4 'ret', In.3 'out'
6689751 ~0% {4} r15 = r8 UNION r14
return r15
```
2022-05-03 11:45:28 +02:00
Anders Schack-Mulligen
249f771fad
Merge pull request #8952 from cklin/fix-ql-comments-syntax
...
Fix syntax errors in QL comments
2022-05-03 11:15:56 +02:00
Jeroen Ketema
904ff1a569
Merge pull request #8943 from jbj/remove-gvn-imports
...
C++: Remove import order workarounds
2022-05-03 11:01:02 +02:00
Nick Rolfe
00bf352b50
Ruby: fix some flow summary join orders
...
The flow summaries that are implemented with an abstract base class
restricting the method name, and child classes using that method name,
had unfortunate join orders:
r1 = JOIN Call::MethodCall::getMethodName#dispred#f0820431#ff WITH Call::MethodCall::getMethodName#dispred#f0820431#ff ON FIRST 1 OUTPUT Lhs.0, (Lhs.1 ++ "_arg"), Rhs.1
2022-05-03 09:58:40 +01:00
mc
58a2677cf7
Merge pull request #8860 from github/jf205-patch-1
...
Fix broken link in analyzing-databases-with-the-codeql-cli.rst
2022-05-03 09:56:49 +01:00
Mathias Vorreiter Pedersen
73886b1040
Merge pull request #8948 from geoffw0/xxe3
...
C++: Add support for SAXParser to the CWE-611 XXE query.
2022-05-03 09:42:10 +01:00
Tony Torralba
c66e583aea
Make more ExternalFlow imports private
2022-05-03 10:31:29 +02:00
Arthur Baars
19e4d34581
Update ruby/ql/lib/change-notes/2022-04-30-update-grammar.md
...
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com >
2022-05-03 10:08:29 +02:00
Erik Krogh Kristensen
806dacb0e3
Merge pull request #8989 from erik-krogh/mentionAll
...
JS/RB: have `ApiGraphModelsSpecific.qll` mention all the required predicates
2022-05-03 09:42:41 +02:00
Tony Torralba
5c574906fe
Merge pull request #9010 from github/workflow/coverage/update
...
Update CSV framework coverage reports
2022-05-03 09:23:53 +02:00
github-actions[bot]
433beaf637
Add changed framework coverage reports
2022-05-03 00:15:34 +00:00
Daniel Santos
fddb465260
Update javascript/ql/lib/semmle/javascript/security/dataflow/XssThroughDomCustomizations.qll
...
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com >
2022-05-02 14:00:45 -05:00
Tony Torralba
de8b5f927b
Adjust test expectations
2022-05-02 16:55:11 +02:00
Tony Torralba
29b430e49b
Make commits private
2022-05-02 16:55:01 +02:00
Anders Schack-Mulligen
86516b157b
Merge pull request #8884 from JLLeitschuh/feat/JLL/additional-file-taint-flow
...
Java: Add additional `File` taint value flow models
2022-05-02 16:30:45 +02:00
Tony Torralba
9a35aba465
Add change notes
2022-05-02 15:45:44 +02:00
Tony Torralba
1cf4b60769
Simplify non-https-url query
2022-05-02 15:43:07 +02:00
Tony Torralba
8602a6f6c9
Add models for OkHttp and Retrofit
2022-05-02 15:42:15 +02:00
Rasmus Wriedt Larsen
7e1be3172e
Python: Add change-note
2022-05-02 14:24:13 +02:00
Rasmus Wriedt Larsen
de4390cdf6
Python: Improve Flask request.files handling even more
2022-05-02 14:19:45 +02:00
Rasmus Wriedt Larsen
fb0133d276
Python: Fix Flask request.files modeling
2022-05-02 14:14:58 +02:00
Rasmus Wriedt Larsen
0c62916af5
Python: Highlight problem with Flask request.files modeling
2022-05-02 14:14:53 +02:00
yoff
1d44694280
Merge pull request #8732 from RasmusWL/dataflow-imports
...
Python: Don't re-export `python` under `DataFlow::`
2022-05-02 12:08:28 +02:00
Taus
231def026f
Merge pull request #8890 from tausbn/python-add-global-attribute-writes
...
Python: Add support for global attribute writes
2022-05-02 12:03:41 +02:00
yoff
c67b06b1fd
Update python/ql/test/experimental/dataflow/typetracking/attribute_tests.py
...
Co-authored-by: Taus <tausbn@github.com >
2022-05-02 11:36:58 +02:00
Rasmus Wriedt Larsen
714465bf39
Python: Refactor SaxParserSetFeatureCall
...
Originally made by @erik-krogh in
https://github.com/github/codeql/pull/8693/files#diff-9627c1fb9a1cc77fb93e6b7e31af1a4fa908f2a60362cfb34377d24debb97398
Could not be applied directly to this PR, since this PR deletes the file.
2022-05-02 11:29:54 +02:00
Rasmus Wriedt Larsen
5f01fc24e4
Merge branch 'main' into promote-xxe
2022-05-02 11:25:55 +02:00
Rasmus Wriedt Larsen
3c1a37e7e1
Merge branch 'main' into new-nosql-examples
2022-05-02 11:21:36 +02:00
Tom Hvitved
29f30a19e7
Merge pull request #8955 from hvitved/csharp/useless-cast-fp
...
C#: Add FP test for `cs/useless-cast-to-self`
2022-05-02 10:32:28 +02:00
Anders Schack-Mulligen
b2e9555075
Merge pull request #8345 from jorgectf/mybatis-new-sinks
...
Java: Add `MyBatis`' `Providers` sinks
2022-05-02 09:44:28 +02:00
bananabr
ed58ee86fe
documented getSelectionCall
2022-05-01 20:41:43 -05:00
bananabr
57ae07017f
adds the Selection API as a new DOM text source
2022-04-30 18:27:31 -05:00
Erik Krogh Kristensen
f87312d4ba
have ApiGraphModelsSpecific.qll mention all the required predicates/types
2022-04-30 20:29:44 +02:00
luchua-bc
920a7cd2e6
Put back the taint step removed during merge
2022-04-29 20:29:04 +00:00
Geoffrey White
034c4faf19
Merge branch 'main' into xxe3
2022-04-29 21:06:16 +01:00
Jonathan Leitschuh
c8e0d7f847
Summary model for File should include overriden methods
2022-04-29 14:51:26 -04:00
Henry Mercer
811a2c0053
Merge pull request #8957 from github/henrymercer/upgrade-codeql-action
...
Use codeql-action/upload-sarif@main in CSV coverage metrics workflow
2022-04-29 17:06:21 +01:00
Arthur Baars
cf4325c86f
Add change note
2022-04-29 16:19:11 +02:00
Geoffrey White
614a7650a6
Merge pull request #8775 from porcupineyhairs/cpam
...
CPP: PAM Authorization Bypass
2022-04-29 14:55:33 +01:00
Jorge
37b051a851
Apply suggestions from code review
...
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com >
2022-04-29 14:44:17 +02:00
AlexDenisov
5c6e5173ad
Merge pull request #8959 from AlexDenisov/alexdenisov/pip-install-from-bazel
...
Swift: teach bazel to install python dependencies
2022-04-29 14:31:37 +02:00
Paolo Tranquilli
8fc78fae74
Merge pull request #8960 from redsun82/swift-cc-wrappers
...
Swift: cc wrapper rules
2022-04-29 14:30:54 +02:00
Geoffrey White
812a24fc18
C++: Add test cases for libxml2.
2022-04-29 13:23:29 +01:00
Paolo Tranquilli
2fe38c2bbb
Swift: cc wrapper rules
2022-04-29 14:18:36 +02:00
Alex Denisov
7332460268
Swift: teach bazel to install python dependencies
2022-04-29 14:05:36 +02:00
yoff
7efb4ab4e4
Merge pull request #8581 from tausbn/python-fix-bad-join-in-import_star_read
...
Python: Fix bad join in `import_star_read`
2022-04-29 13:14:14 +02:00
Henry Mercer
d1cc835cad
Merge pull request #8949 from github/henrymercer/fix-typo
...
JS: Nit: Fix typo in QLDoc
2022-04-29 12:04:09 +01:00
Henry Mercer
08b6b1d209
Use codeql-action/upload-sarif@main in CSV coverage metrics workflow
2022-04-29 11:26:32 +01:00
Tom Hvitved
a0e003e33c
C#: Add FP test for cs/useless-cast-to-self
2022-04-29 11:59:51 +02:00
Henry Mercer
d3e92f72c4
JS: Nit: Fix typo in QLDoc
2022-04-29 10:54:07 +01:00
Geoffrey White
dd258781ed
C++: More test cases.
2022-04-29 10:38:31 +01:00
Geoffrey White
1d71f042db
C++: Turns out DOMLSParser is not an AbstractDOMParser and works a little differently than I'd thought.
2022-04-29 10:38:31 +01:00
Geoffrey White
c6deddb290
C++: For consistency.
2022-04-29 10:35:34 +01:00
Geoffrey White
4be3161891
C++: Move some stuff from tests3.cpp to common tests.h
2022-04-29 10:35:34 +01:00
Geoffrey White
397efd1648
C++: Split off the createLSParser tests into their own file.
2022-04-29 10:35:33 +01:00
Geoffrey White
b02519bf0b
C++: Make the createLSParser test a bit closer to real life.
2022-04-29 10:33:47 +01:00
Geoffrey White
a1542322e2
C++: Add test cases for SAX2XMLReader.
2022-04-29 10:33:46 +01:00
Erik Krogh Kristensen
080271f14f
Merge pull request #8221 from erik-krogh/libProto
...
JS: recognize more module exports from the factory pattern
2022-04-29 11:23:53 +02:00
Stephan Brandauer
fa377ac763
Merge pull request #8946 from kaeluka/deepFillIn-FN
...
JS: fix a FN for prototype polluting function query
2022-04-29 10:14:41 +01:00
Erik Krogh Kristensen
b74d1fdb1a
Merge pull request #8783 from erik-krogh/jsAbstractBi
...
JS: don't initialize sanitizer-guards in the standard library
2022-04-29 11:12:16 +02:00
Geoffrey White
7fb1069d69
C++: Use GVN on the values passed into set* functions.
2022-04-29 10:09:52 +01:00
Geoffrey White
215453e4db
Update cpp/ql/src/Security/CWE/CWE-611/XXE.ql
...
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com >
2022-04-29 09:07:25 +01:00
Tony Torralba
9eb6022bbe
Merge pull request #8954 from github/workflow/coverage/update
...
Update CSV framework coverage reports
2022-04-29 10:06:57 +02:00
Geoffrey White
33d499c12d
C++: Address review comments.
2022-04-29 09:02:11 +01:00
luchua-bc
0aa1251ffe
Add more test cases
2022-04-29 02:31:43 +00:00
github-actions[bot]
1032dcd7e6
Add changed framework coverage reports
2022-04-29 00:15:05 +00:00
jorgectf
548721a8cf
Fix MyBatisInjectionSink
2022-04-28 23:36:51 +02:00
Jorge
193ea1a86e
Merge branch 'main' into mybatis-new-sinks
2022-04-28 22:26:38 +02:00
Stephan Brandauer
3f13a5e082
fix a FN for prototype polluting function query
2022-04-28 22:00:09 +02:00
Jorge
50e95b5aad
Apply suggestions from code review
...
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com >
2022-04-28 21:56:20 +02:00
Jorge
834f2e845d
Delete MyBatisAbstractSql and inline MyBatisAbstractSqlMethodsStep
2022-04-28 21:55:15 +02:00
Chuan-kai Lin
d6f0bbb816
Fix syntax errors in QL comments
2022-04-28 11:53:36 -07:00
AlexDenisov
f6769735e5
Merge pull request #8939 from AlexDenisov/alexdenisov/swift-tracer-integration
...
Swift: tracer integration
2022-04-28 19:20:55 +02:00
Geoffrey White
79d1ffc1d9
C++: Change note.
2022-04-28 17:49:41 +01:00
Tom Hvitved
3fd93b460f
Merge pull request #8935 from hvitved/ruby/typetracker-kw-test
2022-04-28 18:22:51 +02:00
Geoffrey White
2ccd5a5531
C++: Add support for SAXParser in the query.
2022-04-28 16:13:21 +01:00
Geoffrey White
4e2344c488
C++: Add test cases for SAXParser.
2022-04-28 16:11:08 +01:00
Paolo Tranquilli
75265f7c42
Merge pull request #8947 from redsun82/swift-pragma-once
...
Swift: use `#pragma once`
2022-04-28 16:59:50 +02:00
AlexDenisov
a59d7f6a85
Update swift/extractor/main.cpp
2022-04-28 16:52:34 +02:00
Paolo Tranquilli
c4fae0806f
Swift: use #pragma once
2022-04-28 16:39:27 +02:00
AlexDenisov
84bcc2e64a
Merge branch 'main' into alexdenisov/swift-tracer-integration
2022-04-28 16:28:48 +02:00
Paolo Tranquilli
2374e6b401
Merge pull request #8934 from redsun82/swift-trapgen
...
Swift: added trapgen
2022-04-28 16:00:46 +02:00
Mathias Vorreiter Pedersen
69af3b123d
Merge pull request #8941 from github/release-prep/2.9.1
...
Release preparation for version 2.9.1
2022-04-28 14:45:32 +01:00
Jonas Jensen
f1fa7cba5a
C++: Remove import order workarounds
...
These workarounds are no longer needed from CodeQL CLI 2.9.0.
2022-04-28 14:40:57 +02:00
Anders Schack-Mulligen
9d2f386032
Merge pull request #8878 from aschackmull/java/validationmethod-joinorder
...
Java: Fix join-order.
2022-04-28 14:35:20 +02:00
Tom Hvitved
8d2bf2228b
Merge pull request #7914 from hvitved/ruby/generalize-element-content
...
Ruby: Generalize `ArrayElementContent` to `ElementContent`
2022-04-28 14:23:08 +02:00
Jeroen Ketema
2e6addab03
Fix one more change note
2022-04-28 14:22:41 +02:00
Jeroen Ketema
4a648f3c89
Fix change note items
2022-04-28 14:14:19 +02:00
github-actions[bot]
8e4cf190e9
Release preparation for version 2.9.1
2022-04-28 11:59:05 +00:00
Michael Nebel
ec316750d3
Merge pull request #8905 from michaelnebel/csharp/generatedcomment
...
C#: Add auto generated comment to generated models as data files.
2022-04-28 13:57:38 +02:00
Tom Hvitved
f7669815ce
Address review comments
2022-04-28 13:50:26 +02:00
Arthur Baars
ccc18640db
Ruby: add upgrade and downgrade scripts
2022-04-28 13:47:14 +02:00
Arthur Baars
d055f9a186
Update tests
2022-04-28 13:47:10 +02:00
Alex Denisov
85918173a6
Swift: ensure the folder for trap files exists
2022-04-28 13:19:25 +02:00
Alex Denisov
9c73ae5a97
Swift: teach extractor to not produce artifacts
2022-04-28 13:18:20 +02:00
Michael Nebel
9d767b8ad8
Merge pull request #8869 from michaelnebel/csharp/frameworkcoverage
...
C#: Port the java FrameworkCoverage query.
2022-04-28 13:17:50 +02:00
Alex Denisov
5b75b4db79
Swift: add tracer config
2022-04-28 13:17:35 +02:00
Alex Denisov
4a03976a15
Swift: set compiler flags explicitly
2022-04-28 13:17:05 +02:00
Taus
95d235416c
Python: Fix bad antijoin in getAKeyword
...
Before:
```
Tuple counts for Exprs::Call::getAKeyword_dispred#ff#antijoin_rhs/3@7bc202ij after 9s:
1 ~0% {1} r1 = CONSTANT(unique int)[2]
4244385 ~2% {1} r2 = JOIN r1 WITH py_dict_items_10#join_rhs ON FIRST 1 OUTPUT Rhs.1 'arg0'
4244352 ~3% {3} r3 = JOIN r2 WITH AstGenerated::Call_::getNamedArg_dispred#ffb_201#join_rhs ON FIRST 1 OUTPUT Rhs.1 'arg1', Lhs.0 'arg0', Rhs.2 'arg2'
66618690 ~3% {5} r4 = JOIN r3 WITH AstGenerated::Call_::getNamedArg_dispred#ffb ON FIRST 1 OUTPUT Lhs.1 'arg0', Lhs.0 'arg1', Lhs.2 'arg2', Rhs.1, Rhs.2
31187133 ~0% {5} r5 = SELECT r4 ON In.3 < In.2 'arg2'
31187133 ~1% {5} r6 = SCAN r5 OUTPUT In.4, 0, In.0 'arg0', In.1 'arg1', In.2 'arg2'
0 ~0% {3} r7 = JOIN r6 WITH py_dict_items ON FIRST 2 OUTPUT Lhs.2 'arg0', Lhs.3 'arg1', Lhs.4 'arg2'
return r7
Tuple counts for Exprs::Call::getAKeyword_dispred#ff/2@1dc9468b after 421ms:
1 ~0% {1} r1 = CONSTANT(unique int)[2]
4244385 ~2% {1} r2 = JOIN r1 WITH py_dict_items_10#join_rhs ON FIRST 1 OUTPUT Rhs.1 'result'
4244352 ~0% {3} r3 = JOIN r2 WITH AstGenerated::Call_::getNamedArg_dispred#ffb_201#join_rhs ON FIRST 1 OUTPUT Lhs.0 'result', Rhs.1 'this', Rhs.2
4244352 ~0% {3} r4 = r3 AND NOT Exprs::Call::getAKeyword_dispred#ff#antijoin_rhs(Lhs.0 'result', Lhs.1 'this', Lhs.2)
4244352 ~6% {2} r5 = SCAN r4 OUTPUT In.1 'this', In.0 'result'
return r5
```
Oof. All that work to produce zero tuples. Luckily we can improve
matters somewhat.
Basically, there's no reason to test _all_ dictionary unpackings, since
we're only interested in a lower bound. Thus, we can use `min` instead
which is much more efficient. For convenience I factored this into its
own (private) helper predicate.
Now the tuple counts look as follows:
```
Tuple counts for Exprs::Call::getMinimumUnpackingIndex_dispred#ff#min_range/2@39b0e9sm after 1ms:
246 ~0% {2} r1 = JOIN Keywords::DictUnpackingOrKeyword#class#f#shared WITH AstGenerated::Call_::getNamedArg_dispred#ffb_201#join_rhs ON FIRST 1 OUTPUT Rhs.1 'arg0', Rhs.2 'arg1'
return r1
Registering Exprs::Call::getMinimumUnpackingIndex_dispred#ff#min_range/2@39b0e9sm + with content 9ea2f123k8necpu015v6tpsc2t1
>>> Created relation Exprs::Call::getMinimumUnpackingIndex_dispred#ff#min_range/2@39b0e9sm with 246 rows.
Starting to evaluate predicate Exprs::Call::getMinimumUnpackingIndex_dispred#ff#min_term/3@9f4ca5g8
Tuple counts for Exprs::Call::getMinimumUnpackingIndex_dispred#ff#min_term/3@9f4ca5g8 after 0ms:
246 ~2% {3} r1 = JOIN Keywords::DictUnpackingOrKeyword#class#f#shared WITH AstGenerated::Call_::getNamedArg_dispred#ffb_201#join_rhs ON FIRST 1 OUTPUT Rhs.1 'arg0', Rhs.2 'arg2', Rhs.2 'arg2'
return r1
Tuple counts for Exprs::Call::getAKeyword_dispred#ff/2@000a0alb after 906ms:
1 ~0% {1} r1 = CONSTANT(unique int)[2]
4244385 ~2% {1} r2 = JOIN r1 WITH py_dict_items_10#join_rhs ON FIRST 1 OUTPUT Rhs.1 'result'
4244352 ~0% {3} r3 = JOIN r2 WITH AstGenerated::Call_::getNamedArg_dispred#ffb_201#join_rhs ON FIRST 1 OUTPUT Lhs.0 'result', Rhs.1 'this', Rhs.2
4244280 ~0% {3} r4 = r3 AND NOT Exprs::Call::getMinimumUnpackingIndex_dispred#ff_0#antijoin_rhs(Lhs.1 'this')
4244280 ~6% {2} r5 = SCAN r4 OUTPUT In.1 'this', In.0 'result'
4244352 ~3% {3} r6 = JOIN r2 WITH AstGenerated::Call_::getNamedArg_dispred#ffb_201#join_rhs ON FIRST 1 OUTPUT Rhs.1 'this', Lhs.0 'result', Rhs.2
72 ~4% {4} r7 = JOIN r6 WITH Exprs::Call::getMinimumUnpackingIndex_dispred#ff ON FIRST 1 OUTPUT Lhs.1 'result', Lhs.0 'this', Lhs.2, Rhs.1
72 ~4% {4} r8 = SELECT r7 ON In.2 <= In.3
72 ~0% {2} r9 = SCAN r8 OUTPUT In.1 'this', In.0 'result'
4244352 ~6% {2} r10 = r5 UNION r9
return r10
```
This is not the perfect join order (note the similarity between `r3`
and `r6`) but overall it's a win.
2022-04-28 11:11:37 +00:00
Taus
80ef09f034
Python: Fix bad join in declaredAttributeVar
...
Before:
```
Tuple counts for PointsTo::declaredAttributeVar#fbf/3@99d5aenq after 1.1s:
451054 ~7% {2} r1 = SCAN variable OUTPUT In.0, In.2 'name'
1296149 ~0% {2} r2 = JOIN r1 WITH Essa::EssaVariable::getSourceVariable_dispred#ff_10#join_rhs ON FIRST 1 OUTPUT Rhs.1 'var', Lhs.1 'name'
12179900 ~4% {3} r3 = JOIN r2 WITH Essa::EssaVariable::getAUse_dispred#ff ON FIRST 1 OUTPUT Rhs.1, Lhs.1 'name', Lhs.0 'var'
8028 ~2% {3} r4 = JOIN r3 WITH Scope::Scope::getANormalExit_dispred#bf_10#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.1 'name', Lhs.2 'var'
8028 ~2% {3} r5 = JOIN r4 WITH Classes::PythonClassObjectInternal::getScope_dispred#ff_10#join_rhs ON FIRST 1 OUTPUT Rhs.1 'cls', Lhs.1 'name', Lhs.2 'var'
return r5
```
After:
```
Tuple counts for PointsTo::declaredAttributeVar#fbf/3@cccf36hb after 4ms:
1450 ~0% {2} r1 = SCAN Classes::PythonClassObjectInternal::getScope_dispred#ff OUTPUT In.1, In.0 'cls'
1450 ~7% {2} r2 = JOIN r1 WITH Scope::Scope::getANormalExit_dispred#bf ON FIRST 1 OUTPUT Rhs.1, Lhs.1 'cls'
8028 ~0% {2} r3 = JOIN r2 WITH Essa::EssaVariable::getAUse_dispred#ff_10#join_rhs ON FIRST 1 OUTPUT Rhs.1 'var', Lhs.1 'cls'
8028 ~0% {3} r4 = JOIN r3 WITH Essa::EssaVariable::getSourceVariable_dispred#ff ON FIRST 1 OUTPUT Rhs.1, Lhs.1 'cls', Lhs.0 'var'
8028 ~2% {3} r5 = JOIN r4 WITH variable ON FIRST 1 OUTPUT Lhs.1 'cls', Rhs.2 'name', Lhs.2 'var'
return r5
```
2022-04-28 11:11:37 +00:00
Taus
d28f9f41e8
Python: Fix bad join in import_star_read
...
Makes this
```
(21s) Tuple counts for DataFlowPublic::import_star_read#ff/2@fcd5e6nr after 8.5s:
9743 ~6% {3} r1 = SCAN num#DataFlowPublic::TModuleVariableNode#fff OUTPUT In.1, In.0, In.2 'result'
9743 ~1% {3} r2 = JOIN r1 WITH Variables::Variable::getId_dispred#ff ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2 'result'
390808917 ~3% {3} r3 = JOIN r2 WITH Flow::NameNode::getId_dispred#ff_10#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2 'result'
307 ~0% {2} r4 = JOIN r3 WITH ImportStar::ImportStar::importStarResolvesTo#ff ON FIRST 2 OUTPUT Lhs.0, Lhs.2 'result'
307 ~0% {2} r5 = JOIN r4 WITH num#DataFlowPublic::TCfgNode#ff ON FIRST 1 OUTPUT Rhs.1 'n', Lhs.1 'result'
return r5
```
become this
```
(17s) Tuple counts for DataFlowPublic::resolved_import_star_module#fff/3@f5e84aic after 0ms:
307 ~0% {3} r1 = JOIN ImportStar::ImportStar::importStarResolvesTo#ff WITH num#DataFlowPublic::TCfgNode#ff ON FIRST 1 OUTPUT Lhs.0, Lhs.1 'm', Rhs.1 'n'
307 ~0% {3} r2 = JOIN r1 WITH Flow::NameNode::getId_dispred#ff ON FIRST 1 OUTPUT Lhs.1 'm', Rhs.1 'name', Lhs.2 'n'
return r2
(17s) Registering DataFlowPublic::resolved_import_star_module#fff/3@f5e84aic + with content f29281ig38r98icro4ege09mrva
(17s) >>> Created relation DataFlowPublic::resolved_import_star_module#fff/3@f5e84aic with 307 rows.
(17s) Starting to evaluate predicate DataFlowPublic::import_star_read#ff/2@57b0c06e
(17s) Tuple counts for DataFlowPublic::import_star_read#ff/2@57b0c06e after 2ms:
9743 ~0% {3} r1 = SCAN num#DataFlowPublic::TModuleVariableNode#fff OUTPUT In.1, In.0, In.2 'result'
9743 ~0% {3} r2 = JOIN r1 WITH Variables::Variable::getId_dispred#ff ON FIRST 1 OUTPUT Lhs.1, Rhs.1, Lhs.2 'result'
307 ~0% {2} r3 = JOIN r2 WITH DataFlowPublic::resolved_import_star_module#fff ON FIRST 2 OUTPUT Rhs.2 'n', Lhs.2 'result'
return r3
```
2022-04-28 11:11:37 +00:00
Arthur Baars
20a3e3a8ae
Update library
2022-04-28 13:00:02 +02:00
Arthur Baars
65989ae564
Update dbscheme stats
2022-04-28 13:00:02 +02:00
Arthur Baars
a848929069
Regenerate QLL library
2022-04-28 13:00:02 +02:00
Arthur Baars
0d9354322e
Update tree-sitter-ruby
2022-04-28 13:00:02 +02:00
Arthur Baars
7359ffaa2e
Ruby: add tree-sitter test case
2022-04-28 12:59:56 +02:00
Erik Krogh Kristensen
3c07ab59a1
Merge pull request #8936 from jketema/camel-case
...
QL: Improve camel case query
2022-04-28 12:32:46 +02:00
yoff
4553a0913f
Merge pull request #8897 from tausbn/python-fix-bad-methodcallsite-join
...
Python: Fix bad join in `MethodCallsiteRefinement`
2022-04-28 12:17:33 +02:00
Jeroen Ketema
b6cf536f01
QL: Fix formatting
2022-04-28 12:05:47 +02:00
Paolo Tranquilli
773ef62406
Swift: added trapgen
...
This checks in the trapgen script generating trap entries in C++.
The codegen suite has been slightly reorganized, moving the templates
directory up one level and chopping everything into smaller bazel
packages. Running tests is now done via
```
bazel run //swift/codegen/test
```
With respect to the PoC, the nested `codeql::trap` namespace has been
dropped in favour of a `Trap` prefix (or suffix in case of entries)
within the `codeql` namespace. Also, generated C++ code is not checked
in in git any more, and generated during build. Finally, labels get
printed in hex in the trap file.
`TrapLabel` is for the moment only default-constructible, so only one
single label is possible. `TrapArena`, that is responsible for creating
disjoint labels will come in a later commit.
2022-04-28 12:01:59 +02:00
Tony Torralba
604a5fc71f
Merge pull request #8639 from atorralba/atorralba/spring-beans-improvements
...
Java: Improve Spring models
2022-04-28 11:59:51 +02:00
Michael Nebel
150d9ba52c
Update .github/workflows/csv-coverage-metrics.yml
...
Co-authored-by: Henry Mercer <henry.mercer@me.com >
2022-04-28 11:57:53 +02:00
Henry Mercer
52a417b02d
Merge pull request #8921 from github/dependabot/github_actions/actions/setup-python-3
...
Bump actions/setup-python from 2 to 3
2022-04-28 10:57:02 +01:00
Jeroen Ketema
62831e93fe
QL: Add filter for NewType to camel case query
2022-04-28 11:54:42 +02:00
Henry Mercer
03c311181a
Merge pull request #8922 from github/dependabot/github_actions/actions/download-artifact-3
...
Bump actions/download-artifact from 2 to 3
2022-04-28 10:45:49 +01:00
Jeroen Ketema
3db9d56259
QL: Improve message for camel cazse query
2022-04-28 11:41:17 +02:00
Jeroen Ketema
52fc2dac47
QL: Add camel case tests
2022-04-28 11:38:14 +02:00
Mathias Vorreiter Pedersen
2517371a37
Merge pull request #8933 from MathiasVP/revert-globals
...
C++: Revert #8515
2022-04-28 10:38:08 +01:00
Tom Hvitved
29f1c533a9
Ruby: Add type tracker tests for flow through keyword/positional parameters
2022-04-28 11:34:12 +02:00
Michael Nebel
c606121ae7
C#: Move autogenerated comment to file level instead of having it on each class.
2022-04-28 11:27:49 +02:00
Michael Nebel
57fc4d987f
C#: Fix indentation.
2022-04-28 11:19:54 +02:00
Michael Nebel
583b9b61de
C#: Add job for running the framework coverage query for C#.
2022-04-28 11:19:49 +02:00
Michael Nebel
98b2bc06ce
C#: Port the java FrameworkCoverage query.
2022-04-28 11:18:12 +02:00
Tom Hvitved
db856798b9
Merge pull request #8920 from github/dependabot/github_actions/actions/setup-dotnet-2
...
Bump actions/setup-dotnet from 1 to 2
2022-04-28 10:47:28 +02:00
Stephan Brandauer
f4104e2b72
Merge pull request #8886 from kaeluka/add-rest-parameter-flowstep
...
JS: Add flow step to `...rest` parameters
2022-04-28 08:39:50 +01:00
Tony Torralba
1f1581cc97
Merge pull request #8913 from github/workflow/coverage/update
...
Update CSV framework coverage reports
2022-04-28 09:34:52 +02:00
Jonas Jensen
0c65e67d18
QL language reference: variables must be lowerId
...
To prepare for a future QL language change where variable names must
start with a lower-case letter, this commit updates the QL language
reference (including the language specification) to change the variable
name grammar from `simpleId` to `lowerId`.
2022-04-28 09:13:36 +02:00
dependabot[bot]
8c4e92d065
Bump actions/download-artifact from 2 to 3
...
Bumps [actions/download-artifact](https://github.com/actions/download-artifact ) from 2 to 3.
- [Release notes](https://github.com/actions/download-artifact/releases )
- [Commits](https://github.com/actions/download-artifact/compare/v2...v3 )
---
updated-dependencies:
- dependency-name: actions/download-artifact
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-04-28 03:32:59 +00:00
dependabot[bot]
c8fd94a830
Bump actions/setup-python from 2 to 3
...
Bumps [actions/setup-python](https://github.com/actions/setup-python ) from 2 to 3.
- [Release notes](https://github.com/actions/setup-python/releases )
- [Commits](https://github.com/actions/setup-python/compare/v2...v3 )
---
updated-dependencies:
- dependency-name: actions/setup-python
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-04-28 03:32:57 +00:00
dependabot[bot]
6526ee797d
Bump actions/setup-dotnet from 1 to 2
...
Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet ) from 1 to 2.
- [Release notes](https://github.com/actions/setup-dotnet/releases )
- [Commits](https://github.com/actions/setup-dotnet/compare/v1...v2 )
---
updated-dependencies:
- dependency-name: actions/setup-dotnet
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-04-28 03:32:55 +00:00
github-actions[bot]
018558b823
Add changed framework coverage reports
2022-04-28 00:18:25 +00:00
Harry Maclean
ba1d43dd42
Merge pull request #8658 from hmac/hmac/insecure-download
...
Ruby: Add InsecureDownload query
2022-04-28 11:07:35 +12:00
Harry Maclean
f4453f4da2
Merge pull request #8573 from hmac/hmac/missing-regexp-anchor
...
Ruby: Add MissingRegExpAnchor query
2022-04-28 11:06:33 +12:00
luchua-bc
590b9d8519
Standardize the query and update qldoc
2022-04-27 22:17:17 +00:00
Chris Smowton
bb049bffbd
Merge pull request #8765 from artem-smotrakov/cover-jms
...
Java: Add flow sources and steps for RabbitMQ and JMS
2022-04-27 21:27:05 +01:00
Taus
b4a31e572f
Python: Add global attribute writes
2022-04-27 16:45:00 +00:00
Taus
f71cf2e1fc
Python: Add test
2022-04-27 15:48:11 +00:00
Paolo Tranquilli
f95b5853c1
Merge pull request #8788 from AlexDenisov/alexdenisov/swift-first-extractor-test
...
Swift: file extraction
2022-04-27 17:47:17 +02:00
Mathias Vorreiter Pedersen
dc96d55943
Merge pull request #8888 from geoffw0/xxe2
...
C++: Add support for createLSParser to the CWE-611 XXE query.
2022-04-27 16:24:27 +01:00
Anna Railton
00b74d8b1c
Merge pull request #8895 from github/annarailton-patch-1
...
ATM: Update `TaintedPathInjection` -> `TaintedPath`
2022-04-27 16:15:46 +01:00
Mathias Vorreiter Pedersen
abbb7f861f
Merge pull request #8904 from MathiasVP/sync-swift-schema
...
Swift: Sync schema after extractor changes
2022-04-27 16:14:46 +01:00
Alex Denisov
272aa594cc
Swift: compiler options moved to .bazelrc
2022-04-27 17:11:16 +02:00
Mathias Vorreiter Pedersen
75c1e56bbd
Revert "Merge pull request #8515 from rdmarsh2/rdmarsh2/ir-global-vars"
...
This reverts commit 800e4ea7df , reversing
changes made to 7ce040f331 .
2022-04-27 16:04:28 +01:00
Henry Mercer
897bc2374a
Merge pull request #8906 from github/henrymercer/workflow-codeowners
...
Add CODEOWNERS for Actions workflows
2022-04-27 15:47:11 +01:00
Tony Torralba
e99cee4913
Merge branch 'main' into java/unsafe-get-resource
2022-04-27 16:45:42 +02:00
Geoffrey White
d04078f989
C++: Fix.
2022-04-27 15:45:23 +01:00
Henry Mercer
c39eaf64ca
Merge pull request #8901 from github/dependabot/github_actions/actions/checkout-3
...
Bump actions/checkout from 2 to 3
2022-04-27 15:40:07 +01:00
Henry Mercer
6777090f36
Add CODEOWNERS for Actions workflows
2022-04-27 15:26:15 +01:00
Stephan Brandauer
ee280cda32
Improve docs after PR comment
...
Co-authored-by: Asger F <asgerf@github.com >
2022-04-27 16:24:20 +02:00
dependabot[bot]
c63a0e7010
Bump actions/checkout from 2 to 3
...
Bumps [actions/checkout](https://github.com/actions/checkout ) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases )
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md )
- [Commits](https://github.com/actions/checkout/compare/v2...v3 )
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-04-27 14:13:33 +00:00
Henry Mercer
3e80c78612
Merge pull request #8903 from github/dependabot/github_actions/actions/stale-5
...
Bump actions/stale from 3 to 5
2022-04-27 15:13:03 +01:00
Henry Mercer
b6a787d4a0
Merge pull request #8902 from github/dependabot/github_actions/actions/cache-3
...
Bump actions/cache from 2 to 3
2022-04-27 15:12:58 +01:00
Henry Mercer
f876ef91a3
Merge pull request #8900 from github/dependabot/github_actions/actions/labeler-4
...
Bump actions/labeler from 2 to 4
2022-04-27 15:12:52 +01:00
Henry Mercer
52475cd917
Merge pull request #8899 from github/dependabot/github_actions/actions/upload-artifact-3
...
Bump actions/upload-artifact from 2 to 3
2022-04-27 15:12:39 +01:00
Paolo Tranquilli
cde5ba7987
Merge pull request #8889 from redsun82/swift-codegen-unit-tests
...
Swift: add unit tests to code generation
2022-04-27 16:07:54 +02:00
Stephan Brandauer
4964f2df9a
add flow step to rest parameters
2022-04-27 16:03:19 +02:00
Chris Smowton
db90bf9900
Move change note
2022-04-27 15:00:26 +01:00
Michael Nebel
52b59d0eed
C#: Add auto generated comment to generated models as data files.
2022-04-27 15:40:23 +02:00
Mathias Vorreiter Pedersen
141e8fcd5b
Swift: Sync schema.
2022-04-27 14:39:13 +01:00
Tony Torralba
51bb33ae65
Merge pull request #8876 from atorralba/atorralba/externalflow-import-private
...
Java: Make all imports of ExternalFlow private
2022-04-27 15:24:55 +02:00
dependabot[bot]
c71c6f6dbe
Bump actions/stale from 3 to 5
...
Bumps [actions/stale](https://github.com/actions/stale ) from 3 to 5.
- [Release notes](https://github.com/actions/stale/releases )
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md )
- [Commits](https://github.com/actions/stale/compare/v3...v5 )
---
updated-dependencies:
- dependency-name: actions/stale
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-04-27 13:17:41 +00:00
dependabot[bot]
2c1ee564aa
Bump actions/cache from 2 to 3
...
Bumps [actions/cache](https://github.com/actions/cache ) from 2 to 3.
- [Release notes](https://github.com/actions/cache/releases )
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md )
- [Commits](https://github.com/actions/cache/compare/v2...v3 )
---
updated-dependencies:
- dependency-name: actions/cache
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-04-27 13:17:37 +00:00
dependabot[bot]
70ba8e3a5c
Bump actions/labeler from 2 to 4
...
Bumps [actions/labeler](https://github.com/actions/labeler ) from 2 to 4.
- [Release notes](https://github.com/actions/labeler/releases )
- [Commits](https://github.com/actions/labeler/compare/v2...v4 )
---
updated-dependencies:
- dependency-name: actions/labeler
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-04-27 13:17:30 +00:00
dependabot[bot]
e1e68e96dc
Bump actions/upload-artifact from 2 to 3
...
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact ) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases )
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3 )
---
updated-dependencies:
- dependency-name: actions/upload-artifact
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-04-27 13:17:28 +00:00
Henry Mercer
295c0fcbb5
Merge pull request #8896 from github/henrymercer/dependabot-actions-updates
...
Enable Dependabot updates for Actions
2022-04-27 14:16:46 +01:00
Geoffrey White
4aa41dfa52
Update cpp/ql/src/Security/CWE/CWE-611/XXE.ql
...
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com >
2022-04-27 13:06:02 +01:00
yoff
39753d5a0b
Merge pull request #8693 from erik-krogh/pyApi
...
PY: more API-graphs refactorings
2022-04-27 13:19:50 +02:00
Taus
d3a05b8b7e
Python: Fix bad join in MethodCallsiteRefinement
...
Observed on `FreeCAD/FreeCAD`:
```
Tuple counts for Essa::MethodCallsiteRefinement#24e22a14#f/1@274967ic after 34.5s:
638284 ~0% {2} r1 = SCAN Essa::TEssaNodeRefinement#24e22a14#ffff OUTPUT In.0, In.3 'this'
636521 ~0% {2} r2 = r1 AND NOT Essa::SingleSuccessorGuard#class#24e22a14#f(Lhs.1 'this')
1579493668 ~0% {2} r3 = JOIN r2 WITH SsaDefinitions::SsaSource::method_call_refinement#9197156e#fff ON FIRST 1 OUTPUT Lhs.1 'this', Rhs.2
266673 ~3% {1} r4 = JOIN r3 WITH Essa::EssaNodeRefinement::getDefiningNode#dispred#f0820431#ff ON FIRST 2 OUTPUT Lhs.0 'this'
return r4
```
After a bit of unbinding, we have:
```
Tuple counts for Essa::MethodCallsiteRefinement#24e22a14#f/1@d73d8e27 after 66ms:
215168 ~1% {2} r1 = SCAN Definitions::SsaSourceVariable#class#486534ab#f OUTPUT In.0, In.0
283965 ~2% {2} r2 = JOIN r1 WITH SsaDefinitions::SsaSource::method_call_refinement#9197156e#fff ON FIRST 1 OUTPUT Rhs.2, Lhs.1
401274 ~0% {2} r3 = JOIN r2 WITH Essa::EssaNodeRefinement::getDefiningNode#dispred#f0820431#ff_10#join_rhs ON FIRST 1 OUTPUT Lhs.1, Rhs.1 'this'
266671 ~2% {1} r4 = JOIN r3 WITH Essa::TEssaNodeRefinement#24e22a14#ffff_03#join_rhs ON FIRST 2 OUTPUT Lhs.1 'this'
266671 ~2% {1} r5 = r4 AND NOT Essa::SingleSuccessorGuard#class#24e22a14#f(Lhs.0 'this')
return r5
```
(I'm somewhat confused about the slight difference in tuples, but it's
probably just because the compiler moved some stuff around.)
2022-04-27 11:13:37 +00:00
Geoffrey White
6ada1bd05b
C++: Match createLSParser more precisely.
2022-04-27 11:51:17 +01:00
Erik Krogh Kristensen
e1c7d369be
Merge pull request #8796 from erik-krogh/redundantImport
...
Remove redundant imports
2022-04-27 12:39:51 +02:00
Henry Mercer
60ebf4d9b7
Enable Dependabot updates for Actions
...
This will automatically create update PRs for workflow files referencing Actions that have since had a major update.
2022-04-27 11:37:22 +01:00
yoff
9d774463f5
Merge pull request #8859 from tausbn/python-fix-bad-essa-joins
...
Python: Fix a bunch of bad joins
2022-04-27 12:27:50 +02:00
Anna Railton
1f1ef22f90
Update TaintedPathInjection -> TaintedPath
...
Lines up with usual naming in https://github.com/github/ml-ql-adaptive-threat-modeling-backend
2022-04-27 11:27:43 +01:00
Geoffrey White
a21af8e262
C++: Address QLDoc alerts.
2022-04-27 11:05:11 +01:00
Tom Hvitved
790d97714f
Ruby: Replace Element with Element[any]
...
To make it look more like `Argument` tokens.
2022-04-27 11:53:25 +02:00
Tom Hvitved
d1c9d68e14
Ruby: Generalize ArrayElementContent to ElementContent
2022-04-27 11:53:21 +02:00
Tom Hvitved
597424809f
Merge pull request #8893 from hvitved/ruby/simplify-fetch-summary
...
Ruby: Simplify flow summary for `fetch`
2022-04-27 11:47:11 +02:00
Paolo Tranquilli
0100c7171d
Swift: testing non-trivial dataclass properties
2022-04-27 10:17:49 +02:00
Paolo Tranquilli
7f0476049f
Swift: removed spurious mock import
2022-04-27 09:11:14 +02:00
Paolo Tranquilli
68231bfc27
Swift: bump python version to 3.8 in workflow
2022-04-27 08:55:27 +02:00
Tom Hvitved
3b7fe06858
Ruby: Simplify flow summary for fetch
2022-04-27 08:26:24 +02:00
Paolo Tranquilli
f171ce6341
Swift: add unit tests to code generation
...
Tests can be run with
```
bazel test //swift/codegen:tests
```
Coverage can be checked installing `pytest-cov` and running
```
pytest --cov=swift/codegen swift/codegen/test
```
2022-04-27 08:24:11 +02:00
Harry Maclean
992cc517a8
Ruby: Minor changes to InsecureDownload
2022-04-27 18:04:21 +12:00
Harry Maclean
f35379bf8c
Ruby: Add change note for rb/insecure-download
2022-04-27 12:47:09 +12:00
Harry Maclean
a85811ad69
Remove unused field
2022-04-27 12:47:09 +12:00
Harry Maclean
6998608257
Ruby: Document missing test result
2022-04-27 12:47:09 +12:00
Harry Maclean
bb3fb0325b
Ruby: Add InsecureDownload query
...
This query finds cases where a potentially unsafe file is downloaded
over an unsecured connection.
2022-04-27 12:47:09 +12:00
Harry Maclean
ce7675ef43
Ruby: Identify domain in Net::HTTP requests
2022-04-27 12:47:09 +12:00
Harry Maclean
bbc3043836
Add change note for rb/regex/missing-regexp-anchor
2022-04-27 10:12:33 +12:00
Harry Maclean
af2965c2a0
Explain anchors in MissingRegExpAnchor qlhelp
2022-04-27 10:12:33 +12:00
Harry Maclean
6f9dc5eb7e
Ruby: Update import for file move
2022-04-27 10:12:33 +12:00
Harry Maclean
2feb4a48be
Ruby: Add hasMisleadingAnchorPrecedence to MissingRegExpAnchor
2022-04-27 10:12:33 +12:00
Harry Maclean
3f8b27c0cd
Ruby: Add RegExpNonWordBoundary to RegExpTreeView
2022-04-27 10:12:33 +12:00
Harry Maclean
e3c3c00c68
Ruby: Add MissingRegExpAnchor query
2022-04-27 10:12:33 +12:00
Harry Maclean
debc57b417
Ruby: Add RegExpAnchor to RegExpTreeView
2022-04-27 10:12:33 +12:00
Harry Maclean
d95f533d19
Ruby: Add getLastChild to RegExpParent
2022-04-27 10:12:33 +12:00
Nick Rolfe
2d05ea3519
Merge pull request #8885 from SukkaW/replace-git-io-link
2022-04-26 20:29:32 +01:00
Mathias Vorreiter Pedersen
800e4ea7df
Merge pull request #8515 from rdmarsh2/rdmarsh2/ir-global-vars
...
C++: generate IR for global variables with initializers
2022-04-26 18:17:13 +01:00
Geoffrey White
7ce040f331
Merge pull request #8736 from geoffw0/xxe
...
C++: New query for CWE-611 / XML External Entity Expansion (XXE)
2022-04-26 17:21:06 +01:00
Nick Rolfe
649d7dd022
Merge pull request #8607 from github/nickrolfe/incomplete_sanitization
...
Ruby: port of `js/incomplete-sanitization`
2022-04-26 17:10:24 +01:00
Geoffrey White
742949154b
C++: Apply code style suggestion.
2022-04-26 16:53:24 +01:00
Taus
7d736952db
Python: Update expected output
2022-04-26 15:49:40 +00:00
Anna Railton
eacfceb6ce
Merge pull request #8605 from github/annarailton/new-query-label-mappings
...
Experimental (ATM): update query label mappings
2022-04-26 16:39:06 +01:00
SukkaW
0c4885caa7
Replace git.io link with the actual URL
2022-04-26 23:28:34 +08:00
Jonathan Leitschuh
2565cdb964
Add additional File taint value flow models
...
Adds
- File::getAbsoluteFile
- File::getCanonicalFile
- File::getAbsolutePath
- File::getCanonicalPath
2022-04-26 10:42:53 -04:00
Nick Rolfe
2a4d65f917
Merge pull request #8881 from github/nickrolfe/graph_ordering_typo
2022-04-26 14:30:49 +01:00
Nick Rolfe
a7185e8a75
Ruby: fix typo in edge key for graph query
2022-04-26 13:56:38 +01:00
Erik Krogh Kristensen
7dba2b5868
PY: revert deletion of redundant-import in ClientSuppliedIpUsedInSecurityCheckLib.qll
2022-04-26 14:51:21 +02:00
Chris Smowton
d01c847839
Make import private
...
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com >
2022-04-26 13:34:24 +01:00
Chris Smowton
c0c50147b3
Replace singleton set
2022-04-26 13:34:24 +01:00
Artem Smotrakov
03d86306b2
Use doc-comment in JMS.qll
2022-04-26 13:34:24 +01:00
Artem Smotrakov
12ca1f0b11
Fixed library-tests/frameworks/guava/handwritten/flow.ql
2022-04-26 13:34:24 +01:00
Artem Smotrakov
52b7fbf484
Removed non-ASCII characters
2022-04-26 13:34:24 +01:00
Artem Smotrakov
e86fd72529
Moved RabbitMQ tests to java/ql/test/library-tests/frameworks/rabbitmq
2022-04-26 13:34:23 +01:00
Artem Smotrakov
3369ffc3c2
Removed RabbitMQ import in FlowSteps.qll
2022-04-26 13:34:23 +01:00
Artem Smotrakov
d7ad13b8de
Fixed typos in JMS.qll
2022-04-26 13:34:23 +01:00
Artem Smotrakov
20f185e772
Use tainted tag in JMS tests
2022-04-26 13:34:23 +01:00
Artem Smotrakov
7158fd1ce8
minorAnalysis in 2022-04-17-jms.md
...
Co-authored-by: Chris Smowton <smowton@github.com >
2022-04-26 13:34:23 +01:00
Artem Smotrakov
152de1533e
Added a change note for JMS
2022-04-26 13:34:23 +01:00
Artem Smotrakov
b6bd4f92d1
Added sources and steps for JMS API
2022-04-26 13:34:21 +01:00
Artem Smotrakov
5c6aa15fe5
Fixed model for DataInput
...
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com >
2022-04-26 13:34:05 +01:00
Artem Smotrakov
269143a19f
Java: Added sources and flow steps for RabbitMQ
2022-04-26 13:34:04 +01:00
Artem Smotrakov
fb39e0f577
Java: Added flow steps for DataInput and ObjectInput
2022-04-26 13:32:48 +01:00
Erik Krogh Kristensen
d389012b75
Merge branch 'main' into redundantImport
2022-04-26 14:24:51 +02:00
Nick Rolfe
3737248deb
Merge pull request #8879 from github/nickrolfe/graph_ordering
...
Ruby: fix graph query tests by defining total ordering
2022-04-26 13:22:53 +01:00
yoff
76f2eca1ee
Merge pull request #8560 from erik-krogh/movePolyTest
...
PY: move the polynomialbacktracking-test to the test folder
2022-04-26 14:21:30 +02:00
Tony Torralba
75b7234a77
Add missing QLDoc
2022-04-26 14:07:07 +02:00
Nick Rolfe
a2f66e8631
Ruby: specify total ordering for test graph queries
2022-04-26 12:58:44 +01:00
Tony Torralba
b69d81ce24
Make all imports of ExternalFlow private
2022-04-26 13:48:44 +02:00
Anders Schack-Mulligen
ff1c6ca4d6
Java: Fix join-order.
2022-04-26 13:43:41 +02:00
Alex Denisov
5db18bb845
Swift: add a comment clarifying swift::FrontendObserver
2022-04-26 13:35:10 +02:00
Tony Torralba
2ee83e2ba2
Add Editable.toString flow step
2022-04-26 13:34:16 +02:00
Alex Denisov
e2332fc5ec
Swift: Replace SwiftExtractor class with a function
2022-04-26 13:32:14 +02:00
Anders Schack-Mulligen
e5eef51e9d
Merge pull request #8875 from aschackmull/java/useless-imports
...
Java: Remove some useless imports.
2022-04-26 13:32:09 +02:00
Anders Schack-Mulligen
8cd506e513
Merge pull request #8874 from smowton/smowton/fix/insecure-cookies-look-through-named-constants
...
Java insecure cookies query: look through named constants
2022-04-26 12:52:12 +02:00
Erik Krogh Kristensen
881e5e16b5
Java: revert deletion of redundant imports
2022-04-26 12:47:39 +02:00
Anders Schack-Mulligen
7002f49abc
Java: Remove some useless imports.
2022-04-26 12:37:03 +02:00
Chris Smowton
2a8f179d6f
Merge pull request #8865 from smowton/smowton/admin/claim-java-18-support
...
Claim Java 18 support
2022-04-26 11:25:26 +01:00
Chris Smowton
8d7098245b
Add change note
2022-04-26 10:38:20 +01:00
Alex Denisov
ebd2ff4fc0
Swift: rename classes to reflect they belong to Swift
2022-04-26 11:33:35 +02:00
Chris Smowton
7d4767a4f5
Java insecure cookies query: look through named constants
2022-04-26 10:32:13 +01:00
Alex Denisov
81e4f9165e
Swift: remove -frontend option as we don't need it yet
2022-04-26 11:27:41 +02:00
Mathias Vorreiter Pedersen
3719875861
Merge pull request #8871 from erik-krogh/qlDeleteSyncScript
...
QL: delete old copy of the identical files scripts
2022-04-26 10:08:34 +01:00
Erik Krogh Kristensen
ba3aa4f186
QL: delete old copy of the identical files scripts
2022-04-26 10:37:14 +02:00
Erik Krogh Kristensen
6738270b65
Merge pull request #8229 from erik-krogh/parenSan
...
JS: step through parentheses in barrier functions
2022-04-26 10:30:21 +02:00
Alex Denisov
5fc4fab38e
Swift: add missing 'overrides'
2022-04-26 10:07:41 +02:00
Anders Schack-Mulligen
59aedc2872
Merge pull request #8853 from aschackmull/dataflow/fix-join
...
Dataflow: Fix join-on-config producing a CP.
2022-04-26 09:52:50 +02:00
Jeroen Ketema
e7580b68d8
Merge pull request #8852 from jketema/frontend-update
...
Fix test regressions due to C++ frontend update
2022-04-26 09:52:34 +02:00
Mathias Vorreiter Pedersen
8d2bd66d85
Merge pull request #8861 from MathiasVP/update-schema
...
Swift: Update `schema.yml` and regenerate files
2022-04-26 08:45:54 +01:00
Anders Schack-Mulligen
d5fcb4342e
Merge pull request #8868 from github/workflow/coverage/update
...
Update CSV framework coverage reports
2022-04-26 08:55:38 +02:00
github-actions[bot]
51b2eb78a9
Add changed framework coverage reports
2022-04-26 00:15:54 +00:00
Mathias Vorreiter Pedersen
aca4c8727f
Merge pull request #8802 from github/post-release-prep/codeql-cli-2.9.0
...
Post-release preparation for codeql-cli-2.9.0
2022-04-25 22:52:55 +01:00
Chris Smowton
9cebbaa370
Claim Java 18 support
2022-04-25 21:21:03 +01:00
Jeroen Ketema
73e4f0c044
C++: Set clang_version to the default from previous frontend version
...
This ensures that `__atomic_fetch_min` parses and that the number of
builtins does not changed compared to the previous version of the
frontend.
2022-04-25 21:15:28 +02:00
Jeroen Ketema
ccd545336c
C++: Fix tests where float128 error message has changed
2022-04-25 21:14:20 +02:00
Jeroen Ketema
8e7066600a
C++: Fix test failures where location of reference dereference in lambda changed
2022-04-25 21:14:17 +02:00
Jeroen Ketema
6c1e21cd91
C++: Fix test where variable access position is more accurate in frontend
2022-04-25 21:14:06 +02:00
Jeroen Ketema
5b0603a5b9
C++: Artificial block insertion for loops and switches has changed in frontend
...
There are now more artificial blocks containing more than one instruction
(artificial blocks containing a single instruction have the extractor only
emit that instruction and not the block). The second instruction in each case
is the label for breaking out of a loop or switch.
2022-04-25 21:13:52 +02:00
Jeroen Ketema
d43ae9b7ed
C++: More artificially inserted blocks carry location information in frontend
2022-04-25 21:13:29 +02:00
Jeroen Ketema
a546e6e01c
C++: Update test to run with C++14
...
The test uses an `auto` return type without a trailing return type, which is
a C++14 feature.
2022-04-25 21:13:24 +02:00
Jeroen Ketema
b9e7045a2f
C++: Update vector type test to reflect it uses old-clang features
...
These features are no longer available and the frontend does stricter checking
on this.
2022-04-25 21:13:04 +02:00
Robert Marsh
d0fc348ad9
C++: autoformat
2022-04-25 14:17:49 -04:00
Mathias Vorreiter Pedersen
2c33a7cdd8
Merge pull request #8862 from github/add-swift-to-labeler
...
Include Swift in `labeler.yml`
2022-04-25 17:10:38 +01:00
Jean Helie
47fdb79cf8
Merge pull request #8751 from github/jhelie/add-gitkeep-to-model-resources
...
ML: add .gitkeep to resources dir in which ML models are to be found
2022-04-25 18:08:24 +02:00
Mathias Vorreiter Pedersen
00b1e4b3dd
Include Swift in labeler.yml
2022-04-25 16:57:47 +01:00
Mathias Vorreiter Pedersen
8869038b4f
Swift: Update schema.yml and regenerate files.
2022-04-25 16:15:37 +01:00
Alex Denisov
906ce34e2f
Swift: generate QL files properly
2022-04-25 17:09:29 +02:00
Mathias Vorreiter Pedersen
8e1d079db7
Merge pull request #8858 from github/erik-krogh/enable-ql-for-ql-swift
...
QL: add swift to QL-for-QL
2022-04-25 16:00:56 +01:00
Alex Denisov
355504a86a
Swift: use File from QL library
2022-04-25 16:58:30 +02:00
James Fletcher
5a7043f528
Update analyzing-databases-with-the-codeql-cli.rst
2022-04-25 15:57:18 +01:00
Alex Denisov
6f0ddaa431
Merge branch 'main' into alexdenisov/swift-first-extractor-test
2022-04-25 16:53:22 +02:00
Taus
d4fc096ea8
Python: Use local flow in Pythagorean.ql
...
The hand-rolled notion of flow was causing some severe performance
issues (on a few databases):
```
Tuple counts for Pythagorean::square#168e234a#f#loop_invariant_prefix/2@c86989kr after 6m35s:
175000 ~5% {2} r1 = JOIN SSA::SsaVariable::getDefinition#dispred#f0820431#ff_10#join_rhs WITH Flow::ControlFlowNode::getNode#dispred#f0820431#bf ON FIRST 1 OUTPUT Lhs.1, Rhs.1 'arg0'
174500 ~6% {2} r2 = JOIN r1 WITH SSA::SsaVariable::getVariable#dispred#f0820431#ff ON FIRST 1 OUTPUT Rhs.1, Lhs.1 'arg0'
1467782500 ~5% {3} r3 = JOIN r2 WITH AstGenerated::Name_::getVariable#dispred#f0820431#ff_10#join_rhs ON FIRST 1 OUTPUT 3, Rhs.1 'arg1', Lhs.1 'arg0'
1467553000 ~0% {2} r4 = JOIN r3 WITH py_expr_contexts_12#join_rhs ON FIRST 2 OUTPUT Lhs.2 'arg0', Lhs.1 'arg1'
return r4
```
Rewriting it to use the data flow library made all of this go away. 🎉
2022-04-25 14:35:37 +00:00
Taus
b2cc91369a
Python: Fix bad join in firstUse
...
This was what it looked like (at the point when I killed the evaluation):
```
Tuple counts for SsaCompute::SsaComputeImpl::AdjacentUsesImpl::firstUse#c5fa2be7#ff/2@i1#be98bwif after 1m50s:
274000 ~7% {4} r1 = SCAN SsaCompute::SsaComputeImpl::AdjacentUsesImpl::definesAt#c5fa2be7#ffff OUTPUT In.1, In.0 'def', In.2, In.3
2731768000 ~1% {7} r2 = JOIN r1 WITH SsaCompute::SsaComputeImpl::AdjacentUsesImpl::variableSourceUse#c5fa2be7#ffff ON FIRST 1 OUTPUT Rhs.0, Lhs.2, Lhs.3, Rhs.2, Rhs.3, Rhs.1 'use', Lhs.1 'def'
178000 ~4% {2} r3 = JOIN r2 WITH SsaCompute::SsaComputeImpl::AdjacentUsesImpl::adjacentVarRefs#c5fa2be7#fffff ON FIRST 5 OUTPUT Lhs.6 'def', Lhs.5 'use'
return r3
```
And this is what it looks like now:
```
Tuple counts for SsaCompute::SsaComputeImpl::AdjacentUsesImpl::firstUse#c5fa2be7#ff/2@i1#f9d6ewsi after 207ms:
931353 ~2% {4} r1 = SCAN SsaCompute::SsaComputeImpl::AdjacentUsesImpl::variableSourceUse#c5fa2be7#ffff OUTPUT In.0, In.2, In.3, In.1 'use'
1050477 ~0% {4} r2 = JOIN r1 WITH SsaCompute::SsaComputeImpl::AdjacentUsesImpl::adjacentVarRefs#c5fa2be7#fffff_03412#join_rhs ON FIRST 3 OUTPUT Lhs.0, Rhs.3, Rhs.4, Lhs.3 'use'
506626 ~0% {2} r3 = JOIN r2 WITH SsaCompute::SsaComputeImpl::AdjacentUsesImpl::definesAt#c5fa2be7#ffff_1230#join_rhs ON FIRST 3 OUTPUT Rhs.3 'def', Lhs.3 'use'
return r3
```
2022-04-25 14:33:31 +00:00
Erik Krogh Kristensen
f5e1aa7c98
QL: add swift to QL-for-QL
2022-04-25 16:29:44 +02:00
Taus
49233268a9
Python: Fix bad join in getValue
...
We were building essentially a CP of all control flow nodes:
```
Tuple counts for Essa::AssignmentDefinition::getValue#dispred#f0820431#ff/2@dd1f67vl after 2m45s:
733365 ~6% {3} r1 = JOIN Essa::TEssaNodeDefinition#24e22a14#ffff_30#join_rhs WITH Essa::EssaNodeDefinition::getDefiningNode#dispred#f0820431#ff ON FIRST 1 OUTPUT Lhs.1, Rhs.1, Rhs.0
376588 ~0% {2} r2 = JOIN r1 WITH SsaDefinitions::SsaSource::assignment_definition#9197156e#fff ON FIRST 2 OUTPUT Lhs.2 'this', Rhs.2 'result'
376588 ~0% {3} r3 = JOIN r2 WITH Essa::TEssaNodeDefinition#24e22a14#ffff_30#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.0 'this', Lhs.1 'result'
6965593033 ~2% {3} r4 = JOIN r3 WITH project#SsaDefinitions::SsaSource::assignment_definition#9197156e ON FIRST 1 OUTPUT Lhs.1 'this', Rhs.1, Lhs.2 'result'
376588 ~0% {2} r5 = JOIN r4 WITH Essa::EssaNodeDefinition::getDefiningNode#dispred#f0820431#ff ON FIRST 2 OUTPUT Lhs.0 'this', Lhs.2 'result'
return r5
```
We first tried preventing the join on `result`, but this caused the
characteristic predicate to blow up instead. Finally, we figured just
putting the `value` part in a field would be sufficient, and this did
the trick.
2022-04-25 14:28:00 +00:00
Tony Torralba
85d5b122f7
Merge pull request #8817 from atorralba/atorralba/cleartext-storage-sharedprefs-improvs
...
Java: Add value-preserving flow steps for Android's SharedPreferences
2022-04-25 16:16:46 +02:00
Erik Krogh Kristensen
0a26e891a2
include startsWith/endsWith checks in js/missing-origin-check
2022-04-25 15:28:50 +02:00
Erik Krogh Kristensen
17005dde2d
QL: fix query-id, and add description
2022-04-25 15:21:35 +02:00
Mathias Vorreiter Pedersen
3199a690aa
Merge pull request #8854 from redsun82/swift-ql-gen
...
Swift: QL generation script
2022-04-25 14:05:25 +01:00
Paolo Tranquilli
643471f400
add temporary exception for Swift for QLdoc
2022-04-25 14:24:22 +02:00
Erik Krogh Kristensen
fe3d71ebc2
fix qhelp: the window, not the origin, is sending the message
...
Co-authored-by: Esben Sparre Andreasen <esbena@github.com >
2022-04-25 14:07:01 +02:00
Paolo Tranquilli
cdb10a2151
Swift: fix codegen check
2022-04-25 14:03:48 +02:00
Paolo Tranquilli
9bf4c72085
Swift: split codegen action and fix dependencies
2022-04-25 14:00:41 +02:00
Anders Schack-Mulligen
60eb341b49
Merge pull request #8851 from aschackmull/shared/accesspathsyntax-cleanup
...
Minor clean-up in AccessPathSyntax.qll
2022-04-25 13:47:22 +02:00
Mathias Vorreiter Pedersen
faaa2cedcd
Merge pull request #8849 from JohnMcSandwich/main
...
C++: add new Windows pool allocation functions in `Allocation.qll`
2022-04-25 12:46:31 +01:00
Paolo Tranquilli
de0fa9e456
Swift: QL generation script
...
Also added code generation to the swift checks.
2022-04-25 13:23:36 +02:00
Anders Schack-Mulligen
c06efa1f42
Dataflow: Sync.
2022-04-25 13:11:04 +02:00
Anders Schack-Mulligen
f4d93f089a
Dataflow: Fix join-on-config producing a CP.
2022-04-25 13:10:31 +02:00
Tony Torralba
f1e5e57d76
Update java/ql/lib/semmle/code/java/frameworks/android/SharedPreferences.qll
2022-04-25 12:39:01 +02:00
Anders Schack-Mulligen
40a16325a9
Minor clean-up in AccessPathSyntax.
2022-04-25 12:27:48 +02:00
Alex Denisov
5b20d580be
Swift: use parenthesis instead of curly braces
2022-04-25 12:26:34 +02:00
Anders Schack-Mulligen
cbdd4927ce
Merge pull request #8582 from Marcono1234/marcono1234/JumpStmt-superclass
...
Java: Make `JumpStmt` a proper superclass
2022-04-25 12:22:20 +02:00
Anders Schack-Mulligen
fd2904d49c
Merge pull request #8760 from Marcono1234/patch-1
...
Clarify `min`, `max` and `rank` documentation
2022-04-25 12:20:00 +02:00
Tom Hvitved
bffa8fa7cb
Merge pull request #8641 from hvitved/dataflow/interpret-read-store
...
Data flow: Introduce `ContentSet`
2022-04-25 12:17:34 +02:00
Mathias Vorreiter Pedersen
516ef8d27a
Update cpp/ql/lib/change-notes/2022-04-25-windows-pool-allocation-functions.md
...
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com >
2022-04-25 10:54:12 +01:00
Mathias Vorreiter Pedersen
12c8d9c60e
C++: Add change note.
2022-04-25 10:51:49 +01:00
Alex Denisov
8bcdfb2e4f
Swift: initialize LLVM
...
No need to shutdown LLVM, it's done by the PROGRAM_START macro
2022-04-25 11:49:21 +02:00
Alex Denisov
462133e0f0
Swift: add more comments
2022-04-25 11:48:51 +02:00
Erik Krogh Kristensen
b5193d99d7
have getSourceType() depend on which kind of event it is
2022-04-25 11:32:52 +02:00
Anders Schack-Mulligen
b21f077e8e
Update java/ql/lib/semmle/code/java/Statement.qll
2022-04-25 11:02:23 +02:00
Jeroen Ketema
ba2a884a45
Merge pull request #8818 from jketema/links
...
Replace `help.semmle.com` links by `codeql.github.com` links
2022-04-25 10:25:42 +02:00
JohnMcSandwich
b3dff77d1a
C++: add new Windows pool allocation functions in Allocation.qll
...
Add:
- ExAllocatePool2
- ExAllocatePool3
- ExAllocatePoolZero
2022-04-25 10:21:42 +02:00
Mathias Vorreiter Pedersen
e8b6bfbe0e
Merge pull request #8813 from jketema/buffer
...
C++: Cover variable sized member arrays without a size in `Buffer.qll`
2022-04-25 09:20:31 +01:00
Tom Hvitved
2466288656
Data flow: Simplify revFlowStore
2022-04-25 10:11:54 +02:00
Tom Hvitved
cf0a1e748a
Add change notes
2022-04-25 09:17:40 +02:00
Jeroen Ketema
79164056d1
Replace help.semmle.com links by codeql.github.com links
2022-04-22 20:42:11 +02:00
Jeroen Ketema
a4711206c8
Merge pull request #8769 from felickz/patch-1
...
Docs - Supported Queries - Fixing broken link
2022-04-22 18:29:27 +02:00
Tony Torralba
d982aeaf6f
Add change note
2022-04-22 17:50:47 +02:00
Mathias Vorreiter Pedersen
1e61fdde8b
Merge pull request #8815 from jketema/unreachable-test-case
...
C++: Add non-returning function test case using `__builtin_expect`
2022-04-22 16:47:44 +01:00
Tony Torralba
f1c08bc492
Add value-preserving steps for SharedPreferences
2022-04-22 17:44:59 +02:00
Jeroen Ketema
97d4a12fb2
C++: Add non-returning function test case using __builtin_expect
2022-04-22 17:10:54 +02:00
Jeroen Ketema
dee0f09197
C++: Cover variable sized member arrays without a size in Buffer.qll
...
Currently the extractor incorrectly emits 0 for the array `data` below:
```
struct myStruct { // c
...
char data[]; // v
};
```
This will change in the future, and no size will be emitted anymore.
This commit makes sure `Buffer.qll` handles arrays without sizes.
2022-04-22 16:57:24 +02:00
Robert Marsh
ebdf553621
Merge pull request #8806 from dbartol/dbartol/typedefs/work
...
C++: Work around missing size for typedef
2022-04-22 10:09:24 -04:00
Rasmus Wriedt Larsen
3e8274ede8
Merge pull request #8812 from RasmusWL/stdlib-FileSystemAccess-improvement
...
Python: Minor Stdlib file system access improvement
2022-04-22 16:06:41 +02:00
Tom Hvitved
3edc72feb6
Update CaptureModels.qll
2022-04-22 15:49:17 +02:00
Erik Krogh Kristensen
45080e7777
PY: add missing qldoc
2022-04-22 15:30:31 +02:00
Erik Krogh Kristensen
acac8919b3
PY: update expected output for deprecation warning in test file
2022-04-22 15:28:31 +02:00
Tom Hvitved
bc6ee10583
Data flow: Sync files
2022-04-22 15:10:00 +02:00
Tom Hvitved
488a4ede94
Data flow: Inline getAStoreContent up-front
2022-04-22 15:09:59 +02:00
annarailton
9c25da20a4
Update queryNames
2022-04-22 13:42:29 +01:00
CodeQL CI
06e5962da7
Merge pull request #8791 from asgerf/js/static-accessors
...
Approved by erik-krogh
2022-04-22 13:39:32 +01:00
Tom Hvitved
b033f107df
Merge remote-tracking branch 'upstream/main' into dataflow/interpret-read-store
2022-04-22 14:35:02 +02:00
Rasmus Wriedt Larsen
03c0366fd4
Merge branch 'main' into stdlib-FileSystemAccess-improvement
2022-04-22 14:31:31 +02:00
Erik Krogh Kristensen
789b0a46d1
Merge pull request #8578 from erik-krogh/labelNaming
...
JS: update `toString()` on API-graph labels.
2022-04-22 14:27:25 +02:00
Erik Krogh Kristensen
3b0066e93d
address review comments
2022-04-22 14:01:24 +02:00
Geoffrey White
d859a91a14
C++: Add support for createLSParser.
2022-04-22 12:24:01 +01:00
Erik Krogh Kristensen
8fcbaea273
Merge branch 'main' into labelNaming
2022-04-22 13:19:44 +02:00
Erik Krogh Kristensen
ff73dbc35c
delete redundant imports
2022-04-22 12:55:28 +02:00
Geoffrey White
79aba67036
Merge branch 'main' into xxe
2022-04-22 11:50:41 +01:00
Erik Krogh Kristensen
ae20393e38
QL: add redundant-import query
2022-04-22 12:47:13 +02:00
Erik Krogh Kristensen
a96489b23d
delete duplicate imports
2022-04-22 12:41:30 +02:00
Erik Krogh Kristensen
c015ef6ef4
Merge pull request #8810 from erik-krogh/rubyPathgraph
...
Ruby: dont import the PathGraph module from Query.qll files
2022-04-22 12:02:59 +02:00
Mathias Vorreiter Pedersen
489355cdab
Merge pull request #8793 from MathiasVP/exclude-internal-diagnostics
...
Exclude internal diagnostics from all selectors
2022-04-22 10:55:38 +01:00
Tom Hvitved
093a3879be
Merge pull request #8794 from hvitved/ruby/capture-barrier-guards
...
Ruby: Handle captured variables in `BarrierGuard::getAGuardedNode()`
2022-04-22 11:47:36 +02:00
Erik Krogh Kristensen
a737350f27
RB: dont import the PathGraph module from Query.qll files
2022-04-22 11:46:06 +02:00
Anders Schack-Mulligen
bf921177f4
Merge pull request #8811 from erik-krogh/syncLate
...
Java: get tainttracking3/TaintTrackingImpl.qll in sync
2022-04-22 11:21:01 +02:00
Asger F
0187e9a3b1
Merge pull request #8808 from vovikhangcdv/doublevkay/fixing-PrototypePollutngAssignment-examples
...
Javascript: Fix PrototypePollutingAssignment example which is incorrect use of express leads to no result when scanning.
2022-04-22 11:18:23 +02:00
Tom Hvitved
be5363ea53
Merge pull request #8801 from hvitved/ruby/exclude-splat-in-taint-tracking
...
Ruby: Exclude `SplatExpr` from taint tracking
2022-04-22 11:12:05 +02:00
Rasmus Wriedt Larsen
650d57083b
Python: Recognize path arguments to pathlib methods
2022-04-22 11:01:59 +02:00
Rasmus Wriedt Larsen
bcaba45202
Python: Expand pathlib tests
2022-04-22 11:01:59 +02:00
Rasmus Wriedt Larsen
059dea713d
Python: Fix os.path.samefile modeling
2022-04-22 11:01:59 +02:00
Erik Krogh Kristensen
dca74a1f45
get tainttracking3/TaintTrackingImpl.qll in sync
2022-04-22 10:37:31 +02:00
Chris Smowton
d309e15072
Merge pull request #8748 from smowton/smowton/admin/dependent-dataflow-configs
...
Java: Avoid higher-numbered dataflow configs that depend on lower-numbered ones
2022-04-22 08:56:00 +01:00
Alex Denisov
aa13891667
Swift: regenerate dbscheme
2022-04-22 09:42:22 +02:00
Mathias Vorreiter Pedersen
35471ff23c
Merge pull request #8809 from AlexDenisov/alexdenisov/rename-swift-db-columns
...
Swift: rename certain dbscheme columns
2022-04-22 08:17:37 +01:00
Mathias Vorreiter Pedersen
52dc016a7a
Merge pull request #8798 from jketema/using
...
C++: Fix tests after extractor changes that improve `using` position accuracy
2022-04-22 08:15:34 +01:00
Alex Denisov
2ce46a9b60
Swift: remove test table from dbscheme
2022-04-22 08:48:44 +02:00
Alex Denisov
c6c51e1ab9
Swift: build with Clang on Linux
2022-04-22 08:48:44 +02:00
Alex Denisov
62d36a29f7
Swift: Extract files
2022-04-22 08:48:38 +02:00
Alex Denisov
e85cdf2ec3
Swift: rename certain dbscheme columns
2022-04-22 08:31:09 +02:00
AlexDenisov
a5189eae9f
Merge pull request #8735 from redsun82/swift-dbscheme-gen
...
Swift: dbscheme generator
2022-04-22 08:26:59 +02:00
Khang. Võ Vĩ
f4581ae866
fix PrototypePollutingAssignment examples
2022-04-22 11:55:45 +07:00
Dave Bartolomeo
83fdff54c4
Work around missing size for typedef
...
See #8805 for the underlying issue. The symptom was bad IR generation on a large number of functions because we never generated an `IRVariable` for a parameter with the affected type.
2022-04-21 16:16:09 -04:00
github-actions[bot]
1aecfc67c2
Post-release preparation for codeql-cli-2.9.0
2022-04-21 19:22:19 +00:00
Tom Hvitved
c20ce62767
Ruby: Exclude SplatExpr from taint tracking
...
`SplatExpr`s are modelled using flow summaries, so there is no need to include them
explicitly in `defaultAdditionalTaintStep`.
2022-04-21 20:27:04 +02:00
Mathias Vorreiter Pedersen
813de65118
Merge pull request #8799 from jketema/comment-fix
...
C++: Fix the layout of comments in `getBufferSize`
2022-04-21 17:17:42 +01:00
Mathias Vorreiter Pedersen
7df7e99761
Merge pull request #8797 from github/release-prep/2.9.0
...
Release preparation for version 2.9.0
2022-04-21 17:14:52 +01:00
Geoffrey White
40da7a1055
C++: Add a test of NoCheckBeforeUnsafePutUser.ql.
2022-04-21 16:55:50 +01:00
Jeroen Ketema
a09fd8c35e
C++: Fix the layout of comments in getBufferSize
2022-04-21 17:42:10 +02:00
Jeroen Ketema
8139e1a2a8
C++: Fix tests after extractor changes that improve using position accuracy
2022-04-21 17:36:11 +02:00
Dave Bartolomeo
410bc6f2e0
Fix formatting in change log
2022-04-21 11:04:30 -04:00
Dave Bartolomeo
71b4570765
Fix formatting in change log
2022-04-21 11:03:52 -04:00
Dave Bartolomeo
55e1ec2b47
Fix formatting in change log
2022-04-21 11:03:18 -04:00
Dave Bartolomeo
e9be6fcf86
Fix formatting in change log
2022-04-21 11:02:58 -04:00
Dave Bartolomeo
b2fe530f1c
Fix formatting in change log
2022-04-21 11:02:31 -04:00
Dave Bartolomeo
136d3ff1f4
Fix formatting in change log
2022-04-21 11:02:07 -04:00
Dave Bartolomeo
d0687303f4
Fix formatting in change log
2022-04-21 11:01:39 -04:00
Dave Bartolomeo
033694d7f7
Fix formatting in change log
2022-04-21 11:00:38 -04:00
Dave Bartolomeo
b224f81e24
Fix formatting in change log
2022-04-21 10:59:38 -04:00
Dave Bartolomeo
fb710cd944
Fix formatting in change log
2022-04-21 10:59:03 -04:00
Dave Bartolomeo
f042d9bfea
Fix formatting in change log
2022-04-21 10:58:26 -04:00
Dave Bartolomeo
36ca792986
Fix formatting in change log
2022-04-21 10:57:35 -04:00
Dave Bartolomeo
ab50df829e
Fix formatting in change log
2022-04-21 10:57:05 -04:00
github-actions[bot]
eeaf233c29
Release preparation for version 2.9.0
2022-04-21 14:49:00 +00:00
Tom Hvitved
bd09c61504
Merge pull request #8786 from hvitved/ruby/dataflow/argument-tokens
...
Ruby: Implement `Argument[any]` and `Argument[n..]`
2022-04-21 16:31:24 +02:00
Michael Nebel
0ec5aa6095
Merge pull request #8675 from michaelnebel/csharp/capturemodelimprovement
...
C#: CaptureModel improvements
2022-04-21 15:16:35 +02:00
Tom Hvitved
addb92f13b
Ruby: Handle captured variables in BarrierGuard::getAGuardedNode()
2022-04-21 13:25:47 +02:00
Tom Hvitved
325b451288
Ruby: Add barrier guards test involving captured variables
2022-04-21 13:25:40 +02:00
Michael Nebel
6180970ae7
C#: Address review comments.
2022-04-21 13:05:32 +02:00
Mathias Vorreiter Pedersen
74906fcbaf
Add exclusion rules for internal diagnostics queries to all the suite selectors (previously it was only excluded in the Code Scanning selector).
2022-04-21 10:11:26 +01:00
Tom Hvitved
b6309c9db0
Merge pull request #8792 from hvitved/csharp/exclude-model-generation-from-cs-suites
...
C#: Exclude model generation queries from all suites
2022-04-21 11:06:56 +02:00
Tom Hvitved
f65b6ae3d1
C#: Exclude model generation queries from all suites
2022-04-21 09:51:52 +02:00
Mathias Vorreiter Pedersen
966c6f108b
Merge pull request #8720 from MathiasVP/smaller-join-in-get-root-cause
...
C++: Remove TC from `Element.getRootCause`
2022-04-21 08:23:05 +01:00
Erik Krogh Kristensen
c1798c4ebd
remove redundant extends clause
2022-04-21 09:13:18 +02:00
Erik Krogh Kristensen
6007dfa101
fix qldoc in StoredXssCustomizations
...
Co-authored-by: Asger F <asgerf@github.com >
2022-04-21 09:11:08 +02:00
Erik Krogh Kristensen
b9a7c563d1
fix typo in change note
...
Co-authored-by: Asger F <asgerf@github.com >
2022-04-21 09:09:56 +02:00
Asger Feldthaus
c6e66edb97
JS: Change note
2022-04-21 08:32:01 +02:00
Harry Maclean
3ea6ba5398
Merge pull request #8618 from hmac/hmac/qlhelp-comment-workflow
...
Update existing qhelp comment, if it exists
2022-04-21 14:01:17 +12:00
Erik Krogh Kristensen
9927a82520
Merge pull request #8789 from erik-krogh/apiIpaBranches
...
JS/PY: mention newtype constructors in API graph label classes
2022-04-20 23:39:46 +02:00
Erik Krogh Kristensen
7e73ecceab
add change-note
2022-04-20 23:31:42 +02:00
Porcupiney Hairs
06edb3f3a1
fix formatting issues
2022-04-21 00:23:49 +05:30
Erik Krogh Kristensen
ff5b873557
Merge pull request #8773 from erik-krogh/exhaustion
...
JS: promote `js/resource-exhaustion` out of experimental
2022-04-20 19:33:42 +02:00
Erik Krogh Kristensen
9c5f3e9406
remove leftover debug comments
2022-04-20 18:42:46 +02:00
Erik Krogh Kristensen
aec8413487
PY: mention newtype constructors in API graph label classes
2022-04-20 18:38:44 +02:00
Erik Krogh Kristensen
ef51b46795
JS: mention newtype constructors in API graph label classes
2022-04-20 18:37:19 +02:00
Erik Krogh Kristensen
8bd975a6ec
Merge pull request #8785 from hvitved/ruby/api-graph-labels
...
Ruby: Mention `newtype` constructors in API graph label classes
2022-04-20 18:32:09 +02:00
Erik Krogh Kristensen
06394c8dc6
move storedXss sources to the Customizations file
2022-04-20 18:17:49 +02:00
Erik Krogh Kristensen
58fcdbc406
QL: remove some benign results from ql/abstract-class-import
2022-04-20 18:17:08 +02:00
Erik Krogh Kristensen
81ce8ac715
ATM: fix compiler warnings about unused variables
2022-04-20 18:10:59 +02:00
Erik Krogh Kristensen
4bc36d82f6
update expected output for ATM
2022-04-20 18:10:56 +02:00
Erik Krogh Kristensen
c1c66a0200
refactor CountAlertAndEndpoints to not refer to deprecated files
2022-04-20 18:10:56 +02:00
Erik Krogh Kristensen
c5f7df17ee
add .actual files to .gitignore for ATM tests
2022-04-20 18:10:56 +02:00
Erik Krogh Kristensen
1c5d59f885
fix an instance of ql/acronyms-should-be-pascal-case
2022-04-20 18:10:53 +02:00
Erik Krogh Kristensen
ea6b68fc59
add missing qldoc
2022-04-20 18:10:53 +02:00
Erik Krogh Kristensen
12e60c7a06
move TypeTestGuard to the Query.qll file
2022-04-20 18:10:53 +02:00
Erik Krogh Kristensen
b1bad271d5
only activate the PrefixString label in Query.qll files
2022-04-20 18:10:53 +02:00
Erik Krogh Kristensen
8a5b1668f9
move initialization of sanitizer-guards to Query.qll files
2022-04-20 18:10:53 +02:00
Erik Krogh Kristensen
73dbe44824
remove dead import
2022-04-20 18:10:53 +02:00
Erik Krogh Kristensen
8d3bd9d7cd
move the ExceptionXss sources into the Customizations file
2022-04-20 18:10:53 +02:00
Erik Krogh Kristensen
25708c5091
move the XssThroughDom sources into the Customizations file
2022-04-20 18:10:53 +02:00
Erik Krogh Kristensen
ad14bbae90
create a customizations file for StoredXss
2022-04-20 18:10:53 +02:00
Erik Krogh Kristensen
162a4992a5
move the ReflectedXss sources/sinks into the Customizations file
2022-04-20 18:10:53 +02:00
Erik Krogh Kristensen
173e1d0262
move the DomBasedXss sources/sinks into the Customizations file
2022-04-20 18:10:53 +02:00
Erik Krogh Kristensen
9631b68de9
move LocalUrlSanitizingGuard out of the customizations file
2022-04-20 18:10:52 +02:00
Arthur Baars
040dd09c5a
Merge pull request #8718 from github/sj/codeowners-pms
...
Update CODEOWNERS for documentation and license changes
2022-04-20 18:08:43 +02:00
Arthur Baars
98df392b4f
Merge pull request #8719 from github/sj/update-readme-license-explanation
...
Update README to clarify license explanation
2022-04-20 18:07:00 +02:00
AlexDenisov
a187939424
Merge pull request #8784 from AlexDenisov/alexdenisov/swift-package-test-sdk
...
Swift: package test SDK
2022-04-20 16:07:40 +02:00
Bas van Schaik
732a2c32a8
Update README.md
2022-04-20 15:03:49 +01:00
Anders Schack-Mulligen
677c436e99
Merge pull request #8703 from aschackmull/dataflow/revert-state-in-out-barriers
...
Dataflow: Revert support for flow-state based in-/out-barriers
2022-04-20 14:54:02 +02:00
Tom Hvitved
ea229d361c
Sync files
2022-04-20 13:55:18 +02:00
Tom Hvitved
b4542c58c2
Ruby: Implement Argument[any] and Argument[n..]
2022-04-20 13:55:18 +02:00
Rasmus Wriedt Larsen
bb6969a175
Merge branch 'main' into promote-xxe
2022-04-20 13:42:02 +02:00
Tom Hvitved
501b03149f
Ruby: Mention newtype constructors in API graph label classes
2022-04-20 13:37:55 +02:00
Nick Rolfe
9b2a98326c
Ruby: update use of PostUpdateNode now that it's public
2022-04-20 12:08:41 +01:00
Nick Rolfe
9b6e610e24
Merge remote-tracking branch 'origin/main' into nickrolfe/incomplete_sanitization
2022-04-20 12:05:22 +01:00
Nick Rolfe
3d109a4051
Merge pull request #8777 from github/nickrolfe/post_update_node
...
Ruby: make PostUpdateNode public
2022-04-20 12:04:37 +01:00
Alex Denisov
682c910d49
Swift: package test SDK
2022-04-20 12:35:19 +02:00
Mathias Vorreiter Pedersen
3388196c27
Merge branch 'main' into smaller-join-in-get-root-cause
2022-04-20 11:16:00 +01:00
Rasmus Wriedt Larsen
888a38c060
Python: Add change-note
2022-04-20 11:46:09 +02:00
Rasmus Wriedt Larsen
d70f247001
Python: More private import python
2022-04-20 11:42:13 +02:00
Rasmus Wriedt Larsen
084c8eb22e
Python: Don't re-export python under DataFlow::
2022-04-20 11:42:10 +02:00
Rasmus Wriedt Larsen
5dbbd17bb2
Python: Add test to ensure we keep DataFlow imports clean
...
Currently we're not in a good state :(
2022-04-20 11:41:01 +02:00
Asger F
e60475618d
Merge pull request #8728 from asgerf/ql/library-coverage
...
QL: Add facilities for data flow
2022-04-20 11:40:18 +02:00
Nick Rolfe
f1b8af1db9
Ruby: rename PostUpdateNode::Range to PostUpdateNodeImpl
2022-04-20 10:35:40 +01:00
Asger Feldthaus
44216b29a9
JS: Autoformat
2022-04-20 11:14:42 +02:00
Asger Feldthaus
4c66f50352
JS: More tests
2022-04-20 11:14:42 +02:00
Asger Feldthaus
fec2837c1e
JS: Ensure accessors do not appear to be calls
2022-04-20 11:14:42 +02:00
Asger Feldthaus
ddb682b181
JS: Show all accessor calls in CG test
2022-04-20 11:14:41 +02:00
Asger Feldthaus
37a76f4441
JS: PropWrite is not a SourceNode
2022-04-20 11:14:41 +02:00
Asger Feldthaus
c9db6201ef
JS: Add call-graph test for accessor calls
2022-04-20 11:14:41 +02:00
Asger Feldthaus
7d5c80433d
JS: Handle accessor-calls to static accessors
2022-04-20 11:14:41 +02:00
Asger Feldthaus
37b3a6e5c0
JS: Add ClassNode.getStaticMember
2022-04-20 11:14:41 +02:00
Anders Schack-Mulligen
cb898ae03f
Merge pull request #8701 from aschackmull/doc/any-none
...
Doc: Add any() and none() to the language reference.
2022-04-20 10:49:42 +02:00
yoff
0c7130602a
Merge pull request #8731 from RasmusWL/delete-old-readme
...
Python: Delete old dataflow readme
2022-04-20 10:36:12 +02:00
yoff
a66153d73e
Merge pull request #8733 from RasmusWL/split-dataflow-private
...
Python: Split `DataFlowPrivate`
2022-04-20 10:21:05 +02:00
Erik Krogh Kristensen
10130eef6d
Merge pull request #8678 from erik-krogh/fileSource
...
JS: Add files as a source for `js/xss-through-dom`
2022-04-20 09:18:38 +02:00
Harry Maclean
942388e8bc
Pipe to jq --arg instead of gh api --jq
2022-04-20 11:41:38 +12:00
Harry Maclean
eba303dea7
Fix typo
2022-04-20 11:21:06 +12:00
luchua-bc
b76873fc8d
Add more test cases
2022-04-19 22:22:15 +00:00
Robert Marsh
f94fcf11cd
C++: accept dataflow test changes
2022-04-19 13:32:19 -04:00
Felicity Chapman
b10e7300ae
Update docs/codeql/ql-language-reference/formulas.rst
2022-04-19 17:29:31 +01:00
Nick Rolfe
c02670aca2
Ruby: make PostUpdateNode public
2022-04-19 17:12:51 +01:00
Felicity Chapman
d663102ffb
Update docs/codeql/ql-language-reference/formulas.rst
2022-04-19 16:57:05 +01:00
luchua-bc
f0c4b1955b
Change getResource() to be a taint step
2022-04-19 15:55:09 +00:00
Felicity Chapman
6fbe227cbc
Try to fix Sphinx warning in formulas.rst
2022-04-19 16:36:42 +01:00
Stephan Brandauer
2fb3147b7b
Merge pull request #8430 from kaeluka/js/CVE-2022-24718
...
JS: Add taint step for handlebars model
2022-04-19 15:57:58 +01:00
Michael Nebel
91324d40b5
Merge pull request #8659 from michaelnebel/csharp/capturemodelsmetadata
...
C#: Add kind tag to Capture model queries.
2022-04-19 16:39:03 +02:00
Anders Schack-Mulligen
48fbbf2531
Dataflow: Add change notes.
2022-04-19 15:29:35 +02:00
Anders Schack-Mulligen
b521d64156
Dataflow: Sync.
2022-04-19 15:29:35 +02:00
Anders Schack-Mulligen
4ae59b530b
Dataflow: Revert flow-state versions of in-/out-barriers.
2022-04-19 15:29:34 +02:00
Nick Rolfe
08f6fbbe10
Ruby: make comment about backslash escaping clearer
2022-04-19 14:05:17 +01:00
Porcupiney Hairs
85c751cb7f
CPP: PAM Authorization Bypass
...
This PR is similar to my other PRs for
[Python](https://github.com/github/codeql/pull/8595 ) and
[Golang](https://github.com/github/codeql-go/pull/709 ).
This PR aims to detect instances were an initiated PAM Transaction invokes the `pam_authenticate` method but does not invoke a call to the pam_acct_mgmt` method. This is bad as a call to `pam_authenticate` only verifies the users credentials. It does not check if the user account is still is a valid state.
If only a call to `pam_authenticate` is used to verify the user, a user with an expired account password would still be able to login. This can be prevented by calling the `pam_acct_mgmt` function after a `pam_authenticate` function.
2022-04-19 18:24:19 +05:30
Geoffrey White
3326fd5400
C++: Update test .expected.
2022-04-19 13:43:17 +01:00
Geoffrey White
5698638d1f
Apply suggestions from code review (documentation)
...
Co-authored-by: hubwriter <hubwriter@github.com >
2022-04-19 13:38:00 +01:00
Erik Krogh Kristensen
8669bbd948
update expected output of rate-limit query after test reorg
2022-04-19 14:27:24 +02:00
Nick Rolfe
76c6a521fd
Ruby: add clarifying comment
2022-04-19 13:10:57 +01:00
Anders Schack-Mulligen
82463c9290
Merge pull request #8774 from MathiasVP/nomagic-revPartialPathStep
...
Add `nomagic` to `revPartialPathStep`
2022-04-19 14:02:04 +02:00
Michael Nebel
c79c9dd573
C#: Don't generate models for any higher order callables.
2022-04-19 12:50:51 +02:00
Michael Nebel
8726766465
C#: Remove the API special case for GetHashCode, Equals and IEquatable.Equals as these are now excluded based on their type.
2022-04-19 12:50:51 +02:00
Michael Nebel
f6fd401df1
C#: Add some testcases, where we don't get a summary due to the use of simple types.
2022-04-19 12:50:51 +02:00
Michael Nebel
f9e5c6b77d
C#: Don't use simple types in summaries test cases as these will be excluded in generation purely based on the type.
2022-04-19 12:50:51 +02:00
Michael Nebel
f533636ad7
C#: Remove taint when it flows via a primitive/simple type (as is the case for java).
2022-04-19 12:50:51 +02:00
Nick Rolfe
76587c4144
Ruby: fix capitalisation of String in qhelp
2022-04-19 11:42:31 +01:00
Nick Rolfe
468c718da0
Ruby: simplify predicate
2022-04-19 11:32:26 +01:00
Nick Rolfe
ac805f0cdc
Ruby: simplify predicate by using DataFlow::CallNode
2022-04-19 11:27:33 +01:00
Nick Rolfe
ca4dc0583d
Ruby: fix comment typos
2022-04-19 11:15:34 +01:00
Geoffrey White
6e184f2438
C++: Rename variables 'a' and 'b'.
2022-04-19 10:57:42 +01:00
Nick Rolfe
14de91ce94
Ruby: make StringSubstitutionCal extend DataFlow::CallNode
2022-04-19 10:52:14 +01:00
Mathias Vorreiter Pedersen
a7c0113bc7
Merge pull request #8741 from geoffw0/autogen
...
C++: Fix issue with extremely long comments in AutogeneratedFile.qll
2022-04-19 10:45:16 +01:00
Geoffrey White
da38c9041c
C++: Improvements from PR comments.
2022-04-19 10:25:00 +01:00
Geoffrey White
50c7e47dd9
C++: Improve QLDoc.
2022-04-19 10:15:12 +01:00
Erik Krogh Kristensen
6799232009
fix typo in qldoc
2022-04-19 11:09:27 +02:00
Geoffrey White
da454128ed
Update cpp/ql/src/Security/CWE/CWE-611/XXE.ql
...
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com >
2022-04-19 10:08:07 +01:00
Geoffrey White
0aa1945f30
C++: Comments.
2022-04-19 10:04:15 +01:00
Mathias Vorreiter Pedersen
91b413d59f
Dataflow: Sync identical files.
2022-04-19 09:57:21 +01:00
Erik Krogh Kristensen
4b6d8e6865
add missing qldoc
2022-04-19 10:56:58 +02:00
Mathias Vorreiter Pedersen
d5722ffa61
C++: Add 'nomagic' to 'revPartialPathStep'.
2022-04-19 09:56:41 +01:00
Erik Krogh Kristensen
8e5a7bcd76
add change-note
2022-04-19 10:53:48 +02:00
Erik Krogh Kristensen
e0b5197d3c
a slight refactor
2022-04-18 22:21:41 +02:00
Erik Krogh Kristensen
7f592a6c64
merge Clipboard.qll and DragAndDrop.qll, and support InputEvent
2022-04-18 22:17:31 +02:00
Robert Marsh
cae08c505f
Merge branch 'main' into rdmarsh2/ir-global-vars
2022-04-18 15:25:03 -04:00
Robert Marsh
b5c8413f5c
Merge branch 'main' into rdmarsh2/ir-global-vars
2022-04-18 15:19:25 -04:00
Chuan-kai Lin
b433f08cef
Merge pull request #8770 from cklin/csharp-downgrades-remove-version
...
C#: remove version from downgrades pack
2022-04-18 09:41:21 -07:00
Chuan-kai Lin
8e850ee564
C#: remove version from downgrades pack
2022-04-18 08:46:05 -07:00
Chad Bentz
990b7a29e8
Docs - Supported Queries - Fixing broken link
...
update link target
2022-04-18 10:30:24 -04:00
Marcono1234
6a48ba955c
Clarify that min, max and rank may have multiple results
2022-04-16 19:12:25 +02:00
Marcono1234
8fdfe5426f
Clarify min, max and rank documentation regarding expression type
2022-04-16 18:53:07 +02:00
jorgectf
9e1b98e5a4
Detach MyBatisAbstractSqlMethodsStep from MyBatisAbstractSql
2022-04-15 13:08:04 +02:00
Jean Helie
f1f00ccac5
ML: add .gitkeep to resources dir in which ML models are to be found
2022-04-15 12:19:06 +02:00
Chris Smowton
90505949c7
Generally define lower-numbered data-flow configs in terms of higher-numbered ones
...
Since usually we have DataFlow3::Configurations that stand alone, DataFlow2::Configurations that depend on them, and finally DataFlow::Configurations that produce a top-level query result (for example), qll files where the reverse pattern holds will usually not be concurrently importable due to dataflow configuration recursion prevention.
2022-04-15 09:25:40 +01:00
Chris Smowton
27d87e9300
Add TaintTracking3
2022-04-15 09:25:26 +01:00
Erik Krogh Kristensen
2e5d435bea
add CWE-400, and add a reference to DoS attacks
2022-04-14 18:37:50 +02:00
Geoffrey White
8a32c17c56
C++: Fix the issue.
2022-04-14 17:03:28 +01:00
Paolo Tranquilli
24697feebc
Swift: integrated template name in dataclass
2022-04-14 15:53:15 +02:00
Paolo Tranquilli
197ea5b8f3
Swift: use more @property in codegen
2022-04-14 12:28:52 +02:00
Paolo Tranquilli
71f9b25500
Swift: uses classes instead of Enum for Properties
2022-04-14 11:35:11 +02:00
Paolo Tranquilli
64496b4c97
Swift: cleanup and some docstrings for codegen
...
Also added code generation and clang formatting to the pre-commit
configuration.
2022-04-14 11:27:41 +02:00
Paolo Tranquilli
91fd83a554
Swift: dbscheme generator
...
This patch introduces the basic infrastructure of the code generation
suite and the `dbscheme` generator.
Notice that the checked in `schema.yml` should reflect swift 5.6 but
might need some tweaking.
Closes https://github.com/github/codeql-c-team/issues/979
2022-04-14 11:27:41 +02:00
Jean Helie
d094bbc06d
Merge pull request #8546 from github/jhelie/enforce-unknown-incompatibiliy-with-notasink
...
ML: add defensive check to ensure Unknown endpoints cannot also be NotASink
2022-04-14 11:21:18 +02:00
Geoffrey White
2ac21d6932
C++: Use isBarrier rather than isBarrierOut (which is going away).
2022-04-14 09:21:57 +01:00
Harry Maclean
cf0611d1e7
Pass args to jq via --arg
2022-04-14 13:50:41 +12:00
Harry Maclean
a90647798e
Fail workflow if COMMENT_ID fails validation
...
And print an error message to STDERR.
2022-04-14 13:21:38 +12:00
Harry Maclean
c9a5cb4bf6
Distinguish between validated and raw COMMENT_ID
2022-04-14 13:19:14 +12:00
Harry Maclean
c3f1fba985
Merge pull request #8598 from hmac/hmac/insecure-dep-resolution
...
Ruby: Add rb/insecure-dependency query
2022-04-14 02:09:44 +02:00
Erik Krogh Kristensen
4c97f68a3d
remove postmessage events as source for js/resource-exhaustion
2022-04-13 23:14:42 +02:00
Erik Krogh Kristensen
51a0b6d501
remove client-side remote-flow from js/resource-exhaustion
2022-04-13 23:05:59 +02:00
Geoffrey White
27b6b99cd0
C++: Correct and improve some comments and naming.
2022-04-13 18:34:15 +01:00
Nick Rolfe
a1a7d2c088
Ruby: add changenote for rb/incomplete-sanitization
2022-04-13 17:32:38 +01:00
Nick Rolfe
fdca896614
Ruby: improve handling of [g]sub!
...
rb/incomplete-sanitization has a few cases where we find flow from one
one string substitution call to another, e.g.
a.sub(...).sub(...)
But this didn't find typical chained uses of the destructive variants,
e.g.
a.sub!(...)
a.sub!(...)
We now handle those cases by tracking flow from the post-update node for
the receiver of the first call.
2022-04-13 17:19:25 +01:00
Jean Helie
1e39a9caae
ML: update regression test output following fix to getAnUnknown predicate
2022-04-13 18:14:16 +02:00
Jean Helie
f87cd164ce
ML: add defensive check to ensure Unknown endpoints cannot also be NotASink
2022-04-13 18:14:16 +02:00
Jean Helie
f2b813a6e7
ML: add regression test for effective sink that is also NotASink
2022-04-13 18:14:16 +02:00
Henry Mercer
6603f8ab94
Merge pull request #8734 from github/henrymercer/non-extending-subtypes-minor-fixes
...
Docs: Fix typo and formatting in "Non-extending subtypes"
2022-04-13 17:11:33 +01:00
Nick Rolfe
bbb8177176
Ruby: add rc/incomplete-sanitization query
2022-04-13 16:48:43 +01:00
Henry Mercer
54b3d4d0d7
Docs: Fix typo and formatting in "Non-extending subtypes"
...
- Fix typo `select any(Foo f) would yield bar` -> `select any(Foo f).foo() would yield bar`
- Fix inline code formatting
- Change `foo_method` to `fooMethod` to follow QL style guide
2022-04-13 16:12:42 +01:00
Geoffrey White
2ad81e63a5
C++: Change note.
2022-04-13 16:11:14 +01:00
AlexDenisov
df2cc181a0
Merge pull request #8726 from redsun82/swift-prebuilt-fetching
...
Swift: fetch prebuilt swift and link against it
2022-04-13 16:58:36 +02:00
Geoffrey White
dfd846bb7b
C++: Changes to the qhelp.
2022-04-13 15:53:13 +01:00
Paolo Tranquilli
aaf9e7da2f
turn off universal_binaries for now
2022-04-13 16:45:23 +02:00
Paolo Tranquilli
9e3401ce59
make self repository name parametric
...
In a workspace macro we must use the exact repository name, and this
can be different when importing the workspace (it is different in
semmle-code).
2022-04-13 16:22:27 +02:00
Paolo Tranquilli
73d5691d91
update swift package
2022-04-13 16:22:27 +02:00
Paolo Tranquilli
e68172f4b0
Swift: fetch prebuilt swift and link against it
...
This is known to break linux integration in sembuild.
2022-04-13 16:22:27 +02:00
Geoffrey White
d83aea5ea3
C++: Copy the qhelp from Javascript.
2022-04-13 15:16:01 +01:00
Geoffrey White
b149666f45
C++: Query metadata (precision is provisional, might up it to 'high' later).
2022-04-13 15:15:28 +01:00
Rasmus Wriedt Larsen
a271e17f04
Python: Move dataflow call-graph to new qll file
...
Seems like all other languages use a file called `DataFlowDispatch`. I
want to introduce a setup where we have (old) points-to based approach
in one file, and can develop a type-tracking based approach in another
file, so that's the reason for the naming differing slightly.
For which predicates go in which files, I have taken mostly inspiration
from C# and Ruby.
2022-04-13 15:56:57 +02:00
Rasmus Wriedt Larsen
3d15205084
Python: Autoformat
2022-04-13 15:36:16 +02:00
Rasmus Wriedt Larsen
ded4e9250c
Python: Move IterableUnpacking to own file
2022-04-13 15:36:05 +02:00
Rasmus Wriedt Larsen
c740894408
Python: Move MatchUnpacking to own file
...
I had hoped that git would be able to see this as a rename, and
therefore I haven't done autoformat
2022-04-13 15:36:05 +02:00
AlexDenisov
058ac5bcae
Merge pull request #8717 from AlexDenisov/alexdenisov/swift-ql-ci
...
Swift: enable QL tests on CI
2022-04-13 14:42:27 +02:00
Geoffrey White
be0df1662c
C++: Rename the query file.
2022-04-13 13:20:02 +01:00
Geoffrey White
ffbe724040
C++: Remove unfinished parts for now.
2022-04-13 13:18:23 +01:00
Jean Helie
407a8a7715
ML: fix ATM expected tests outputs
2022-04-13 14:02:12 +02:00
Rasmus Wriedt Larsen
2e60172bfa
Python: Delete old dataflow readme
2022-04-13 12:09:38 +02:00
Rasmus Wriedt Larsen
6235dc5039
Python: Handle find_library assignment to temp variable
2022-04-13 11:44:15 +02:00
Rasmus Wriedt Larsen
c87b3087be
Python: Add test for Django FileField upload_to
...
The output from running the test script is:
```
'rootdir/bar'
[13/Apr/2022 09:20:36] "POST /app/file-test/ HTTP/1.1" 200 2
'rootdir/bar'
[13/Apr/2022 09:20:36] "POST /app/file-test/ HTTP/1.1" 200 2
'rootdir/foo%2fbar'
[13/Apr/2022 09:20:36] "POST /app/file-test/ HTTP/1.1" 200 2
'rootdir/%2e%2e%2fbar'
[13/Apr/2022 09:20:36] "POST /app/file-test/ HTTP/1.1" 200 2
'rootdir/foo%c0%afbar'
[13/Apr/2022 09:20:36] "POST /app/file-test/ HTTP/1.1" 200 2
```
I didn't add a `.py` extension, so it wasn't extracted, since we don't
actually care about what we model in that file.
2022-04-13 11:27:18 +02:00
Rasmus Wriedt Larsen
304713ca87
Python: Handle django v4 as well in tests
2022-04-13 11:21:44 +02:00
Paolo Tranquilli
6166f0601c
Merge pull request #8727 from redsun82/bazel_workspace_rename
...
Bazel: rename workspace to codeql
2022-04-13 10:51:10 +02:00
Alex Denisov
60c6241382
Swift: run QL tests on macOS
2022-04-13 10:35:15 +02:00
Rasmus Wriedt Larsen
bdadf2b445
Python: Fix warnings
2022-04-13 10:30:59 +02:00
Asger Feldthaus
a5ad4c8263
QL: Update printAst output
...
Annotations are not longer their own children/parent.
2022-04-13 10:29:21 +02:00
Rasmus Wriedt Larsen
4927f0018b
Merge branch 'main' into django-filefield-uploadto
2022-04-13 10:22:28 +02:00
Erik Krogh Kristensen
41bdd8f4da
minor fixes
2022-04-13 10:11:07 +02:00
Erik Krogh Kristensen
b13e7c055b
move the sanitizer-guard to the Query.qll file
2022-04-13 09:58:33 +02:00
Erik Krogh Kristensen
96e4633dfe
remove more code that did nothing
2022-04-13 09:57:32 +02:00
Erik Krogh Kristensen
a9595af01e
update expected output
2022-04-13 09:43:21 +02:00
Erik Krogh Kristensen
d35604ed82
remove the length sanitizer from loop-bound-injection - it did nothing
2022-04-13 09:43:21 +02:00
Erik Krogh Kristensen
dd28157d0a
add test of a length check
2022-04-13 09:43:21 +02:00
Erik Krogh Kristensen
8e47a9b242
add sanitizer step for .length in js/resource-exhaustion
2022-04-13 09:30:09 +02:00
Stephan Brandauer
fb66ccff39
handlebars taint step: conservatively assume unknown templates have no flow to helpers
2022-04-13 09:27:59 +02:00
Asger Feldthaus
c1827cfd30
QL: Add test for getAStringValue
2022-04-13 08:45:25 +02:00
Asger Feldthaus
4c72c31a5a
QL: Add InlineExpectationsTest
2022-04-13 08:45:25 +02:00
Asger Feldthaus
b0801c9b2f
QL: Add some missing qldoc
2022-04-13 08:45:25 +02:00
Asger Feldthaus
8188e2876c
QL: Autoformat
2022-04-13 08:45:25 +02:00
Asger Feldthaus
6632b7da1c
QL: Add FrameworkCoverage query
2022-04-13 08:45:25 +02:00
Alex Denisov
b8c1f1a6e1
Swift: run QL tests on Linux
2022-04-13 07:44:19 +02:00
Porcupiney Hairs
785dc1af3c
Include changes from review
2022-04-12 21:17:39 +05:30
Paolo Tranquilli
141ba2e039
Bazel: rename workspace to codeql
2022-04-12 17:37:29 +02:00
Robert Marsh
0e3e35f233
C++: don't dump global vars without initializers
2022-04-12 11:21:41 -04:00
Paolo Tranquilli
03ebf8b049
Merge pull request #8700 from redsun82/swift-skeleton
...
Swift: first skeleton extractor
2022-04-12 17:14:42 +02:00
Paolo Tranquilli
8ef28787b6
Swift: do not fail pack creation if dir does not exist
2022-04-12 17:05:26 +02:00
Erik Krogh Kristensen
a2d2626c9c
add security severity
2022-04-12 16:34:00 +02:00
Erik Krogh Kristensen
d64df30724
reintroduce the reverted qhelp
2022-04-12 16:33:06 +02:00
Erik Krogh Kristensen
ebf9ba7250
remove the type-overloaded new Buffer() as a sink
2022-04-12 16:29:58 +02:00
Erik Krogh Kristensen
e2b7f7d05d
reintroduce the number sinks
2022-04-12 16:26:10 +02:00
Erik Krogh Kristensen
029459cc35
reorganize CWE-770 tests
2022-04-12 16:15:40 +02:00
Paolo Tranquilli
6440242268
Swift+Bazel: apply review comments
2022-04-12 16:03:20 +02:00
Erik Krogh Kristensen
688b2b6898
use the Query.qll pattern
2022-04-12 15:52:52 +02:00
Erik Krogh Kristensen
8fb54c3f32
move js/resource-exhaustion out of experimental
2022-04-12 15:51:36 +02:00
Asger Feldthaus
4b74fa628c
QL: Add global flow and type-tracking
2022-04-12 15:25:09 +02:00
Asger Feldthaus
0ffb558e48
QL: Support local flow via unification
2022-04-12 15:25:06 +02:00
Asger Feldthaus
49d5b662ff
QL: Add Node.getEnclosingPredicate
2022-04-12 15:25:03 +02:00
Asger Feldthaus
2b8454001a
QL: Add scoped variable nodes
2022-04-12 15:24:59 +02:00
Asger Feldthaus
2d640e7e95
QL: Add basic data flow nodes
2022-04-12 15:24:55 +02:00
Asger Feldthaus
c9b9751894
QL: Add NodeNumbering library
2022-04-12 15:24:52 +02:00
Asger Feldthaus
60a22b71b4
QL: Remove redundant union part
2022-04-12 15:24:48 +02:00
Asger Feldthaus
f02912bdf5
QL: Add VarDef.getAnAccess
2022-04-12 15:24:45 +02:00
Asger Feldthaus
85403cd4de
QL: Fix up parent-child relation in tree
2022-04-12 15:24:42 +02:00
Erik Krogh Kristensen
df295e69d6
add change-note
2022-04-12 14:37:51 +02:00
Erik Krogh Kristensen
bca4d14129
rename files
2022-04-12 14:37:43 +02:00
Erik Krogh Kristensen
591fcda862
various improvements to the js/missing-origin-verification query
2022-04-12 14:20:41 +02:00
Erik Krogh Kristensen
2d6d304d7c
add InclusionTest to PostMessageEventSanitizer
2022-04-12 14:12:36 +02:00
Paolo Tranquilli
f2f99611bd
.gitignore CLion project files
2022-04-12 12:41:00 +02:00
Paolo Tranquilli
a205b465ba
Bazel: reorganization
...
* fixed 5.0.0 as bazel version
* made dependencies better loadable
* moved `//swift/install` to `//swift:create-extractor-pack` (following
the clearer ruby naming)
* renamed `extractor_pack` to `extractor-pack` for consistency with Ruby
2022-04-12 12:40:59 +02:00
Paolo Tranquilli
13b2442fed
Bazel: code reorganization
2022-04-12 12:40:59 +02:00
Paolo Tranquilli
664d5ba0a9
Swift: moved install to a separate package
...
When importing the workspace from semmle-code, we do not need nor want
to instantiate `@util`, so that must be in a separate bazel package.
2022-04-12 12:40:59 +02:00
Paolo Tranquilli
95dbf2d666
Swift: first skeleton extractor
...
This adds a first dummy extractor for swift.
Running `bazel run //swift:install` will create an `extractor_pack`
directory in `swift`. From that moment providing `--search-path=swift`
will pick up the extractor.
2022-04-12 12:40:59 +02:00
Erik Krogh Kristensen
e2badab251
update expected output after test reorganization
2022-04-12 10:39:28 +02:00
Erik Krogh Kristensen
ec9c308d06
reorganize the tests in CWE-020
2022-04-12 10:39:28 +02:00
Erik Krogh Kristensen
18532bae54
move js/missing-postmessageorigin-verification out of experimental
2022-04-12 10:39:27 +02:00
CodeQL CI
a43f3a21a8
Merge pull request #8550 from erik-krogh/classJoin
...
Approved by asgerf
2022-04-12 09:23:58 +01:00
Erik Krogh Kristensen
34abef8a6c
Merge branch 'main' into dragAndDrop
2022-04-11 23:59:46 +02:00
bananabr
57fac949fd
included ClipboardEvent and DragEvent as XSS sources
2022-04-11 16:37:00 -05:00
luchua-bc
7029802f3b
Add sinks for getClass() and getClassLoader()
2022-04-11 21:03:48 +00:00
Erik Krogh Kristensen
aafa8ddc9f
add support for domNode.onpaste for copy-paste events
2022-04-11 20:10:56 +02:00
Erik Krogh Kristensen
6713b2c671
add support for domNode.ondrop for drag-and-drop events
2022-04-11 20:06:12 +02:00
bananabr
121aad7fd2
updated change notes
2022-04-11 12:45:37 -05:00
Geoffrey White
cb211f8844
Merge pull request #8599 from 4B5F5F4B/main
...
C++: refactor some code, and add access_ok cases
2022-04-11 15:57:27 +01:00
Mathias Vorreiter Pedersen
e86b6b182f
C++: Remove TC from 'Element.getRootCause'.
2022-04-11 15:27:10 +01:00
Bas van Schaik
c3912b2f29
Update README to clarify license explanation
2022-04-11 14:30:56 +01:00
CodeQL CI
9c8dee2a4d
Merge pull request #8687 from asgerf/js/missing-flow-fixes
...
Approved by erik-krogh
2022-04-11 14:08:15 +01:00
Bas van Schaik
422255b859
Update CODEOWNERS for documentation and license
...
To make sure the right people are pinged when a change like #5893 is made
2022-04-11 12:33:23 +01:00
Marcono1234
bc5dc6ad50
Java: Remove TODO comment for getRuleExpression() behavior
...
Predicate behavior has been fixed on `main`.
2022-04-10 18:24:26 +02:00
Marcono1234
7bed14bbf0
Merge remote-tracking branch 'remotes/origin/main' into marcono1234/statement-expression
2022-04-10 18:23:45 +02:00
Marcono1234
348a186df8
Java: Make JumpStmt a concrete class again
...
Public abstract classes can be error-prone, when users unintentionally
implement a new subclass instead of refining the set of existing subclasses.
2022-04-10 17:54:47 +02:00
bananabr
0f1582f3f6
included JavaScript drag and drop API Xss sources
2022-04-09 22:33:30 -05:00
luchua-bc
eccd97c7b7
Query to detect unsafe getResource calls in Java EE applications
2022-04-09 01:14:15 +00:00
Taus
626770aaab
Merge pull request #8004 from ahmed-farid-dev/ZipSlip
...
Add query to detect ZipSlip
2022-04-08 23:55:02 +02:00
Jeroen Ketema
4cfe04567f
Merge pull request #8702 from jketema/command-line-sanitizer
...
C++: Use `isSanitizerOut(DataFlow::Node node)` in `cpp/command-line-injection`
2022-04-08 23:42:35 +02:00
Taus
3d14c5f3c3
Python: Update tests
...
We need to import `tty` in order to be able to detect the standard library correctly.
2022-04-08 23:20:47 +02:00
Taus
ab81247b7c
Python: Fix modelling in ZipSlip.qll
...
- Remove use of points-to.
- Exclude sources and sinks in the standard library (to prevent test brittleness).
2022-04-08 23:19:41 +02:00
Taus
57beeaada0
Python: Fix name clash in CopyFile.qll
2022-04-08 23:18:03 +02:00
Taus
e1371151f9
Python: Autoformat Concepts.qll
2022-04-08 23:16:41 +02:00
Taus
8521f9a008
Python: Autoformat ZipSlip.ql
2022-04-08 23:13:38 +02:00
Taus
4b580820c8
Python: Fix broken QHelp
2022-04-08 23:12:46 +02:00
Edoardo Pirovano
3d41a5cae3
Merge pull request #8704 from github/edoardo/3.5-mergeback
...
Merge `rc/3.5` branch into `main`
2022-04-08 19:32:58 +01:00
Dave Bartolomeo
9f074cd8fd
Bump a few more versions
...
Also fixes up some dependency declarations that should have been "*" because they refer to packs in the same workspace.
2022-04-08 13:01:41 -04:00
Geoffrey White
8d1e8e9ecb
C++: Flow states and transformers.
2022-04-08 17:19:18 +01:00
Edoardo Pirovano
f25618eed6
Bump minor version of all packs
2022-04-08 15:38:58 +01:00
Edoardo Pirovano
ce82c54b94
Merge branch 'main' into edoardo/3.5-mergeback
2022-04-08 15:30:58 +01:00
Ian Lynagh
3e5b5bee8a
Merge pull request #8642 from github/post-release-prep/codeql-cli-2.8.5
...
Post-release preparation for codeql-cli-2.8.5
2022-04-08 15:09:21 +01:00
Jeroen Ketema
83d35a9a96
C++: Use isSanitizerOut(DataFlow::Node node) in cpp/command-line-injection
2022-04-08 11:28:17 +02:00
annarailton
8ae905aef9
Update endpointTypeEncoded -> label
...
Fixes https://github.com/github/ml-ql-adaptive-threat-modeling/issues/1821
2022-04-08 10:22:13 +01:00
annarailton
b0ab7218db
Add test for query mappings
2022-04-08 10:22:13 +01:00
annarailton
4808eb9926
Change encoding -> label and description -> labelName
...
Fixes https://github.com/github/ml-ql-adaptive-threat-modeling/issues/1820
2022-04-08 10:22:13 +01:00
annarailton
de4e01a8f2
Change NotASinkType to NegativeType
...
Fixes https://github.com/github/ml-ql-adaptive-threat-modeling/issues/1819
2022-04-08 10:22:13 +01:00
Anders Schack-Mulligen
35d30d6c3c
Doc: Add any() and none() to the language reference.
2022-04-08 10:28:13 +02:00
Geoffrey White
3aaa058308
C++: Get the simplest part of the query working, disable the rest for now, fix metadata, formatting etc.
2022-04-07 19:01:30 +01:00
Geoffrey White
9a0880f516
C++: Clean up the tests, make them a bit more realistic, and add many more test cases.
2022-04-07 19:00:30 +01:00
Geoffrey White
e2eda65fe1
C++: Rename test, add .expected.
2022-04-07 18:59:51 +01:00
Tony Torralba
9833fa2451
Add tests for SpringController
2022-04-07 18:17:50 +02:00
Rasmus Wriedt Larsen
517444b5ff
Python: Fix SimpleXmlRpcServer.expected
2022-04-07 16:42:40 +02:00
Rasmus Wriedt Larsen
ec66f26ade
Python: Handle get_collection on pymongo DB
2022-04-07 16:32:20 +02:00
Rasmus Wriedt Larsen
89eeaf85d5
Python: Handle get_database on MongoClient instance
2022-04-07 16:31:17 +02:00
Rasmus Wriedt Larsen
7ca19653df
Python: mongoDBInstance refactor
2022-04-07 16:22:57 +02:00
Rasmus Wriedt Larsen
e58e9a273b
Python: mongoClientInstance refactoring
2022-04-07 16:22:16 +02:00
Rasmus Wriedt Larsen
0ce2ced1aa
Python: Model pymongo.mongo_client.MongoClient
2022-04-07 16:22:16 +02:00
Rasmus Wriedt Larsen
81fdc1bd78
Python: Add more pymongo NoSQL tests
2022-04-07 16:22:16 +02:00
Rasmus Wriedt Larsen
30fff1cf8b
Python: Merge pymongo NoSQL tests
2022-04-07 16:04:25 +02:00
Rasmus Wriedt Larsen
8191be9d75
Python: Move last XXE/XML bomb out of experimental
2022-04-07 15:37:56 +02:00
Rasmus Wriedt Larsen
405480c410
Python: Rename sink definitions for XXE/XML bomb
2022-04-07 15:37:56 +02:00
Anders Schack-Mulligen
4eaec3953a
Merge pull request #8694 from aschackmull/dataflow/cleanup-unused
...
Dataflow: Cleanup unused column
2022-04-07 15:16:27 +02:00
Anders Schack-Mulligen
c0f48b6c14
Merge pull request #8681 from JLLeitschuh/fix/JLL/os_check_bugs
...
Java: Fix Local Temp File/Dir Incorrect Guard Logic
2022-04-07 14:00:13 +02:00
Anders Schack-Mulligen
7beed570f2
Dataflow: Sync.
2022-04-07 13:53:48 +02:00
Anders Schack-Mulligen
876a9f80ce
Dataflow: remove unused column.
2022-04-07 13:53:27 +02:00
Erik Krogh Kristensen
7e4c76c63b
revert API-graph change in Flask.qll
2022-04-07 13:52:14 +02:00
Erik Krogh Kristensen
bdfd6bdc79
fix a ql/field-only-used-in-charpred warning
2022-04-07 13:52:14 +02:00
Erik Krogh Kristensen
50bfc8eaa0
refactor uses of API::Node::getAUse() that should have been something else
2022-04-07 13:52:13 +02:00
Erik Krogh Kristensen
4e5afab082
refactor more python type-trackers to API-graphs
2022-04-07 13:51:40 +02:00
Jeroen Ketema
319ff35bd7
Merge pull request #8692 from jketema/implied-cctor-source
...
Revert "Revert "Merge pull request #8592 from jketema/implied-cctor-source""
2022-04-07 13:38:39 +02:00
Asger Feldthaus
b85739cb7e
JS: Update test output
2022-04-07 13:23:26 +02:00
Jeroen Ketema
bfe9fb1721
Revert "Revert "Merge pull request #8592 from jketema/implied-cctor-source""
...
This reverts commit b1d9a070f4 .
2022-04-07 12:29:43 +02:00
Mathias Vorreiter Pedersen
a6f7bd102a
Merge pull request #8691 from jketema/revert-8592
...
Revert "Merge pull request #8592 from jketema/implied-cctor-source"
2022-04-07 11:26:33 +01:00
Owen Mansel-Chan
32f96c84ed
Merge pull request #8677 from github/RasmusWL/update-codeowners
...
Remove @xcorail from CODEOWNERS
2022-04-07 11:16:01 +01:00
Jeroen Ketema
b1d9a070f4
Revert "Merge pull request #8592 from jketema/implied-cctor-source"
...
This reverts commit d4834cb7ff , reversing
changes made to 268a3fd1c5 .
2022-04-07 12:02:37 +02:00
Mathias Vorreiter Pedersen
d4834cb7ff
Merge pull request #8592 from jketema/implied-cctor-source
...
C++: Add tests for copy constructor calls with implied source
2022-04-07 11:00:40 +01:00
Rasmus Wriedt Larsen
268a3fd1c5
Merge pull request #8680 from RasmusWL/subclass
...
Python: Refactor how we find a `Class` from `API::Node`
2022-04-07 11:52:52 +02:00
Rasmus Wriedt Larsen
e9df2f8fca
Update CODEOWNERS
...
remove extra blank line
2022-04-07 11:51:23 +02:00
Rasmus Wriedt Larsen
142ca78c7d
Update CODEOWNERS
...
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com >
2022-04-07 11:28:42 +02:00
Rasmus Wriedt Larsen
7728b6cf1b
Python: Change XmlBomb vulnerability kind
2022-04-07 10:56:35 +02:00
Asger Feldthaus
81cf3d4574
JS: Use Class#getAnInstanceReference
2022-04-07 10:43:29 +02:00
Rasmus Wriedt Larsen
218c698498
Update CODEOWNERS
...
Co-authored-by: Chuan-kai Lin <cklin@github.com >
2022-04-07 10:11:26 +02:00
Asger Feldthaus
2a67085d9d
JS: Change note
2022-04-07 10:02:21 +02:00
Erik Krogh Kristensen
ef9b6a11a6
Merge pull request #8679 from erik-krogh/getUrl
...
Java: rename existing getUrl predicate to getRepositoryUrl
2022-04-07 10:01:14 +02:00
Asger Feldthaus
4eda6f643f
JS: Recognize subclasses of HTMLElement in domValueRef
2022-04-07 09:57:31 +02:00
Asger Feldthaus
cff8dc0537
JS: Improve flow through Array.prototype.reduce
2022-04-07 09:57:31 +02:00
Michael Nebel
72d4c97463
Merge pull request #8628 from michaelnebel/csharp/generatedkind
...
C#: Introduce generated flag as a part of the kind column for flow summaries
2022-04-07 08:43:30 +02:00
Erik Krogh Kristensen
489d4cb908
add change-note
2022-04-06 23:23:50 +02:00
Jonathan Leitschuh
2753521650
Java: Fix Local Temp File/Dir Incorrect Guard Logic
...
Resolves https://github.com/github/codeql/pull/8032#discussion_r841723906
2022-04-06 12:16:09 -04:00
Rasmus Wriedt Larsen
f2f0873d91
Python: Use new API::CallNode for XML constant check
...
This also means that the detection of the values passed to these keyword
arguments will no longer just be from a local scope, but can also be
across function boundaries.
2022-04-06 15:49:06 +02:00
Rasmus Wriedt Larsen
c784f15762
Python: Rename more XML classes to follow convention
...
- `XMLEtree` to `XmlEtree`
- `XMLSax` to `XmlSax`
- `LXML` to `Lxml`
- `XMLParser` to `XmlParser`
2022-04-06 15:44:54 +02:00
Erik Krogh Kristensen
563d0d6532
rename existing getUrl predicate to getRepositoryUrl
2022-04-06 15:32:33 +02:00
Rasmus Wriedt Larsen
f8f41428df
Python: Minor refactor for FlaskViewClass
2022-04-06 15:15:42 +02:00
Rasmus Wriedt Larsen
1c2323eb85
Python: Refactor how we find a Class from API::Node
...
Using `getAnImmediateUse` might give better performance than `getAUse`.
Since all the changed code is about `API::Node`s that are found after
doing `.getASubclass*()`, this change is OK.
It's also nice to align how we actually do this.
2022-04-06 15:12:24 +02:00
Anders Schack-Mulligen
879b8a1200
Merge pull request #8676 from pwntester/java_hotspots_mods
...
Make security-related TaintTracking Configuration public
2022-04-06 14:40:14 +02:00
Robert Marsh
3a35a40062
WIP: start on CWE-611 tests
2022-04-06 12:55:56 +01:00
Robert Marsh
370dd057dc
C++: more WIP on Xerces XXE query
2022-04-06 12:55:54 +01:00
Robert Marsh
9b6c1bc691
WIP: Xerces XXE
2022-04-06 12:55:52 +01:00
Tom Hvitved
4099d1318f
Data flow: Tweak two join-orders
...
Before
```
[2022-04-06 13:19:29] (96s) Tuple counts for DataFlowImpl2::Stage1::revFlowConsCand#7ad53399#ff/2@i14#aa10f2wi after 4.4s:
10681 ~0% {2} r1 = SCAN DataFlowImpl2::Stage1::revFlow#7ad53399#fff#prev_delta OUTPUT In.0, In.2 'config'
982 ~1% {3} r2 = JOIN r1 WITH DataFlowImpl2::readSet#7ad53399#ffff_2301#join_rhs ON FIRST 2 OUTPUT Rhs.3, Lhs.1 'config', Rhs.2
83691528 ~2% {3} r3 = JOIN r2 WITH DataFlowPublic::ContentSet::getAReadContent#dispred#f0820431#ff ON FIRST 1 OUTPUT Lhs.1 'config', Lhs.2, Rhs.1 'c'
83581763 ~2% {3} r4 = r3 AND NOT DataFlowImpl2::Stage1::revFlowConsCand#7ad53399#ff#prev(Lhs.2 'c', Lhs.0 'config')
83581763 ~0% {3} r5 = SCAN r4 OUTPUT In.2 'c', In.0 'config', In.1
0 ~0% {3} r6 = JOIN r5 WITH DataFlowImpl2::Stage1::fwdFlowConsCand#7ad53399#ff ON FIRST 2 OUTPUT Lhs.2, Lhs.1 'config', Lhs.0 'c'
0 ~0% {2} r7 = JOIN r6 WITH DataFlowImpl2::Stage1::fwdFlow#7ad53399#2#fff_02#join_rhs ON FIRST 2 OUTPUT Lhs.2 'c', Lhs.1 'config'
return r7
```
After
```
[2022-04-06 13:44:38] (6s) Tuple counts for DataFlowImpl2::Stage1::revFlowConsCand#7ad53399#ff/2@i14#5abbf2wn after 6ms:
10681 ~0% {2} r1 = SCAN DataFlowImpl2::Stage1::revFlow#7ad53399#fff#prev_delta OUTPUT In.0, In.2 'config'
982 ~1% {3} r2 = JOIN r1 WITH DataFlowImpl2::readSet#7ad53399#ffff_2301#join_rhs ON FIRST 2 OUTPUT Rhs.3, Lhs.1 'config', Rhs.2
109765 ~0% {3} r3 = JOIN r2 WITH DataFlowImpl2::Stage1::fwdFlowConsCandSet#7ad53399#fff#reorder_0_2_1 ON FIRST 2 OUTPUT Lhs.1 'config', Lhs.2, Rhs.2 'c'
0 ~0% {3} r4 = r3 AND NOT DataFlowImpl2::Stage1::revFlowConsCand#7ad53399#ff#prev(Lhs.2 'c', Lhs.0 'config')
0 ~0% {3} r5 = SCAN r4 OUTPUT In.1, In.0 'config', In.2 'c'
0 ~0% {2} r6 = JOIN r5 WITH DataFlowImpl2::Stage1::fwdFlow#7ad53399#2#fff_02#join_rhs ON FIRST 2 OUTPUT Lhs.2 'c', Lhs.1 'config'
return r6
```
2022-04-06 13:52:30 +02:00
Erik Krogh Kristensen
943af17d10
Merge pull request #8619 from erik-krogh/atmSteps
...
JS-ML: fix isKnownStepSrc such that it recognizes taint-steps
2022-04-06 12:56:53 +02:00
Rasmus Wriedt Larsen
23637fd691
Merge branch 'main' into promote-xxe
2022-04-06 12:56:31 +02:00
Erik Krogh Kristensen
0435cee57f
add a taint-step through URL.createObjectURL for js/xss-through-dom
2022-04-06 12:18:47 +02:00
Rasmus Wriedt Larsen
b99767ef52
Merge pull request #8668 from RasmusWL/use-instanceof
...
Python: Rewrite concepts to use `extends ... instanceof ...`
2022-04-06 12:09:12 +02:00
Erik Krogh Kristensen
b11d48e749
add files in the DOM as a source for js/xss-through-dom
2022-04-06 12:09:07 +02:00
Anders Schack-Mulligen
bbb6d08071
Merge pull request #8661 from Marcono1234/marcono1234/getMethod-public-only
...
Java: Fix reflection predicate for `getMethod` having non-public method result
2022-04-06 12:03:14 +02:00
Alvaro Muñoz Sanchez
9ccd0e564b
Add QLDocs
2022-04-06 12:00:41 +02:00
Rasmus Wriedt Larsen
4d2a3b38d2
Merge pull request #8511 from RasmusWL/use-query-suffix
...
Python: Use `Query.qll` suffix for dataflow configuration definitions
2022-04-06 11:59:29 +02:00
Rasmus Wriedt Larsen
2e9505e7f2
Remove @xcorail from CODEOWNERS
...
Since @xcorail didn't have write access to this repo, that caused troubles with the CODEOWNERS file.
2022-04-06 11:48:38 +02:00
Anders Schack-Mulligen
d0b5b99e74
Merge pull request #8611 from github/smowton/doc/switch-expr-accessors
...
Java: make SwitchCase.getRuleExpression/Statement more consistent
2022-04-06 11:16:40 +02:00
Tom Hvitved
31ec2988df
Merge pull request #8674 from hvitved/csharp/useless-upcast-lambda-tests
...
C#: Add more tests for `cs/useless-cast-to-self`
2022-04-06 11:11:40 +02:00
Tom Hvitved
cee527e03a
Document flow through arrays in dataflow.md
2022-04-06 11:11:02 +02:00
Alvaro Muñoz Sanchez
19b8d51c0b
Update CommandLineQuery
...
Make TaintTracking configuration public
2022-04-06 10:58:56 +02:00
Alvaro Muñoz Sanchez
abaa71e2c5
Update Sql Injection queries
...
move java/ql/src/Security/CWE/CWE-089/SqlInjectionLib.qll -> java/ql/lib/semmle/code/java/security/SqlInjectionQuery.qll
2022-04-06 10:57:14 +02:00
Geoffrey White
6c70cb4581
Merge pull request #8672 from jketema/unused-locals
...
C++: Add `cpp/unused-local-variable` test case with `switch` initializer
2022-04-06 09:03:12 +01:00
Tom Hvitved
02b11084bc
C#: Add more tests for cs/useless-cast-to-self
2022-04-06 09:36:59 +02:00
4B5F5F4B
04538d0599
Autoformated to make CodeQL happy
2022-04-06 11:59:26 +08:00
ihsinme
275b29a288
Update DangerousUseOfExceptionBlocks.expected
2022-04-05 22:48:11 +03:00
Jeroen Ketema
d19504fca2
C++: Add cpp/unused-local-variable test case with switch initializer
...
This is similar to the test case with the `if` initializer, and we should
not forget about it once we support `if` initialization.
2022-04-05 18:27:53 +02:00
Alex Ford
ccd7bb5e70
Merge pull request #8421 from alexrford/ruby/weak-cryptographic-algorithm
...
Ruby: Add `rb/weak-cryptographic-algorithm` query
2022-04-05 14:34:45 +01:00
Ahmed Farid
29f69bde75
Update zipslip_bad.py
2022-04-05 12:46:51 +00:00
Ahmed Farid
dfe7f532ac
Update CopyFile.qll
2022-04-05 12:42:05 +00:00
Ahmed Farid
0d6d07886b
Rename Zip.qll to CopyFile.qll
2022-04-05 12:37:14 +00:00
Ahmed Farid
8882bc1533
Update Frameworks.qll
2022-04-05 12:32:10 +00:00
Ahmed Farid
68bfe38529
Update Zip.qll
2022-04-05 12:31:30 +00:00
Michael Nebel
2562910b94
C#: Update Csv validation to allow sources and sink kinds to be prefixed with generated.
2022-04-05 14:25:34 +02:00
Michael Nebel
d7bf024318
Java: Add testcase for generated summary model.
2022-04-05 14:25:34 +02:00
Michael Nebel
0374f84c05
Java: Make support for generated as a part of kind.
2022-04-05 14:25:34 +02:00
Michael Nebel
3a04e9a03d
Java: Update java capture models with new kind column (including tests).
2022-04-05 12:55:47 +02:00
Michael Nebel
412699f407
C#: Modify generator and update test output with updated kind column.
2022-04-05 12:51:01 +02:00
Rasmus Wriedt Larsen
5b96db26b3
Python: Rewrite concepts to use extends ... instanceof ...
...
This solved performance problems experienced in
https://github.com/github/codeql/pull/8634 , and this commit+PR is to
ensure we get this change in as fast as possible.
2022-04-05 12:34:15 +02:00
Rasmus Wriedt Larsen
b7f56dd17e
Python: Rewrite concepts to use extends ... instanceof ...
...
This caused compilation time for `ConceptsTest.ql` to go from 1m24s to
7s
2022-04-05 12:31:09 +02:00
Rasmus Wriedt Larsen
a7dab53ed2
Python: Add change-note
2022-04-05 11:46:49 +02:00
Rasmus Wriedt Larsen
1f285b8983
Python: Rename to XmlParsingVulnerabilityKind
...
To keep up with style guide
2022-04-05 11:07:12 +02:00
Rasmus Wriedt Larsen
ab59d5c786
Python: Rename to XmlParsing
...
To follow our style guide
2022-04-05 11:06:22 +02:00
Michael Nebel
c2920405fc
C#: Add a query for detecting flow summaries that are discarded due to existing handwritten models.
2022-04-05 08:55:12 +02:00
Michael Nebel
3937714f9f
C#: The CaptureSummaryModels query should only produce summary models that will not be discarded at run-time.
2022-04-05 08:55:12 +02:00
Michael Nebel
784327c183
Java/Ruby: Hardcode generated flag to false.
2022-04-05 08:55:12 +02:00
Michael Nebel
8e1fa35367
C#: Add testcase, where generated flow summary is ignored.
2022-04-05 08:55:12 +02:00
Michael Nebel
de76df3988
C#: Only use generated summaries, if no handwritten model exist for a particular dataflow callable.
2022-04-05 08:55:12 +02:00
Michael Nebel
30dc4ae788
C#: Add testcase with multiple generated flow summaries.
2022-04-05 08:55:12 +02:00
Michael Nebel
689e8f1952
C#: Small testcase with a summary flow model that is listed as generated.
2022-04-05 08:55:12 +02:00
Michael Nebel
26ad4861a3
C#: Introduce parsing of the kind field.
2022-04-05 08:55:12 +02:00
Michael Nebel
f8b094ac1f
C#: Only use generated flow summaries in case no handwritten summary exists.
2022-04-05 08:55:11 +02:00
Michael Nebel
4d953da480
C#: Initial steps to allow generated as a part of the kind.
2022-04-05 08:55:11 +02:00
Michael Nebel
1f72f6c2cd
Merge pull request #8559 from michaelnebel/csharp/generateflowmodelsscript
...
C#: Generate Flow Models script
2022-04-05 08:43:22 +02:00
Harry Maclean
1df1f42589
Fail workflow if files cannot be uploaded
2022-04-05 14:16:42 +12:00
Harry Maclean
5739a3b4e8
Fix typo
2022-04-05 14:14:39 +12:00
Harry Maclean
342bb17fb6
Simplify shell script
2022-04-05 14:03:29 +12:00
Harry Maclean
de743418e2
Add more validations to workflow inputs
2022-04-05 13:36:34 +12:00
Harry Maclean
815c6f4113
Use env vars instead of contexts
2022-04-05 12:03:10 +12:00
Harry Maclean
8f3578c92a
Ruby: Include query results in test
2022-04-05 10:20:02 +12:00
Robert Marsh
a3072fcd83
Merge pull request #8664 from geoffw0/privdata3
...
C++: More enhancements to PrivateData.qll
2022-04-04 14:43:19 -04:00
ihsinme
73de757f39
Update DangerousUseOfExceptionBlocks.ql
2022-04-04 21:38:03 +03:00
Geoffrey White
04b8306f06
C++: Add some more patterns.
2022-04-04 16:57:00 +01:00
Geoffrey White
d2e7f22d1b
C++: Group all phone number related exprs together.
2022-04-04 16:48:03 +01:00
Geoffrey White
d42ee7d279
C++: Extend tests.
2022-04-04 16:46:56 +01:00
Michael Nebel
8c3be653c2
C#: Update test output.
2022-04-04 16:07:46 +02:00
Michael Nebel
3fe941aae2
C#: Add missing empty ext column in generated summaries.
2022-04-04 15:58:35 +02:00
Michael Nebel
c6fe54c41b
C#: Add script for running CaptureModel queries and generate qll source file.
2022-04-04 15:58:35 +02:00
Marcono1234
6dd14a6cb3
Java: Fix reflection predicate for getMethod having non-public method result
2022-04-04 15:10:49 +02:00
Tom Hvitved
415a1c2107
Java/C#: Update CaptureModels.qll
2022-04-04 13:51:44 +02:00
Tom Hvitved
57f2a74636
Python: Implement ContentSet
2022-04-04 13:51:44 +02:00
Tom Hvitved
7113c1b29c
C#: Implement ContentSet
2022-04-04 13:51:44 +02:00
Tom Hvitved
b91858e7cf
Java: Implement ContentSet
2022-04-04 13:51:44 +02:00
Tom Hvitved
d99bb65ea9
C++: Implement ContentSet
2022-04-04 13:51:44 +02:00
Tom Hvitved
725d76e934
Ruby: Implement ContentSet
2022-04-04 13:51:44 +02:00
Tom Hvitved
c4fbc618a9
Data flow: Sync files
2022-04-04 13:51:44 +02:00
Tom Hvitved
309fd937c1
Data flow: Introduce ContentSet
2022-04-04 13:51:43 +02:00
Tom Hvitved
a5040fd0ce
Ruby: Add data-flow test for reverse array stores
2022-04-04 13:51:43 +02:00
Asger F
de169277cb
Merge pull request #8576 from asgerf/js/decorated-method-or-class
...
JS: Add decorator edges in API graphs and corresponding MaD tokens
2022-04-04 12:49:28 +02:00
Jeroen Ketema
e91c04234e
C++: Update tests for copy constructor calls with implied source
2022-04-04 12:48:02 +02:00
Jeroen Ketema
e710cf7921
C++: Add tests for copy constructor direct initializations
2022-04-04 12:48:01 +02:00
Jeroen Ketema
82b1cd69d2
Merge pull request #8554 from jketema/bitwise-lambda-capture-init
...
C++: Handle bitwise copies in lambda captures
2022-04-04 12:23:05 +02:00
Michael Nebel
3466adaf8c
C#: Add kind tag to Capture model queries.
2022-04-04 11:00:58 +02:00
Michael Nebel
25881d673e
Merge pull request #8626 from michaelnebel/csharp/equalsgethashcodeoverrides
...
C#: Exclude Equals and GetHashCode overrides from model generation.
2022-04-04 09:40:31 +02:00
Harry Maclean
ee81bf2767
Use --paginate to get all comments
2022-04-04 10:21:26 +12:00
Harry Maclean
1cf2530feb
Use environment variable instead of GH context
2022-04-04 10:18:41 +12:00
Harry Maclean
c2b94e8d1d
Rename workflow to reflect its generic nature
...
This workflow can (pretty much) be used by any other workflow that wants
to post a PR comment.
2022-04-04 10:16:48 +12:00
Harry Maclean
e34911118f
Use gh api instead of third-party actions
...
Also move more steps to the unprivileged workflow.
2022-04-04 10:16:48 +12:00
Harry Maclean
9116dbd670
Update QHelp PR comment if it already exists
...
If we've already commented on a PR with a preview of the QHelp changes,
then update the existing comment instead of creating a new one.
2022-04-04 10:16:48 +12:00
Tom Hvitved
50dc3820c6
Merge pull request #8589 from hvitved/regex/speedup-concretise
2022-04-03 17:56:07 +02:00
ihsinme
61860c9ae9
Update DangerousUseOfExceptionBlocks.ql
2022-04-02 13:44:40 +03:00
Jeroen Ketema
e1fa58a6f2
C++: Update tests after generating reference conversion
2022-04-01 18:32:46 +02:00
Jeroen Ketema
1d51b618d1
C++: Update tests for handling op bitwise copy in lambda captures
2022-04-01 18:32:46 +02:00
Jeroen Ketema
dea510ac95
C++: Add change note for cpp/unused-local-variable changes
2022-04-01 18:32:46 +02:00
Jeroen Ketema
4f49f9d6e1
C++: Remove exception from cpp/unused-local-variable that is no longer needed
2022-04-01 18:32:46 +02:00
Jeroen Ketema
3fed59fd13
C++: Add more lambda capture IR tests
2022-04-01 18:32:45 +02:00
github-actions[bot]
6af568b16d
Post-release preparation for codeql-cli-2.8.5
2022-04-01 16:22:14 +00:00
Chris Smowton
3119885a9b
Merge pull request #8638 from smowton/smowton/docs/additional-flow-step-description
...
Improve wording of isAdditionalFlow/TaintStep qldoc
2022-04-01 16:41:04 +01:00
Paolo Tranquilli
a323cce03e
Merge pull request #8630 from redsun82/bazel-workspace
...
Bazel: add skeleton bazel workspace
2022-04-01 15:46:59 +02:00
Mathias Vorreiter Pedersen
002f7cd438
Merge pull request #8623 from geoffw0/privdata2
...
C++: Some enhancements to SensitiveExprs.qll
2022-04-01 13:49:44 +01:00
Chris Smowton
28fa49dcd6
dataflow -> data-flow
2022-04-01 13:22:58 +01:00
Rasmus Wriedt Larsen
ba011fb13f
Merge pull request #8601 from zbazztian/recognize-flask-named-body-param
...
Python: Flask: Identify body contents passed via named response parameter in invocations of Response constructor
2022-04-01 14:19:28 +02:00
Paolo Tranquilli
1cc7621300
Bazel: add to CODEOWNERS and move around doc note
2022-04-01 14:04:50 +02:00
Paolo Tranquilli
3772efd193
.gitignore bazel symlinks
2022-04-01 14:04:50 +02:00
Paolo Tranquilli
8a5e611453
Bazel: add skeleton bazel workspace
...
This moves in codeql some internal bazel definitions in preparation for
future work.
2022-04-01 14:04:50 +02:00
Sebastian Bauersfeld
504e7e4a55
Update python/ql/lib/change-notes/2022-03-30-flask-recognize-body-param.md
...
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com >
2022-04-01 18:41:27 +07:00
Erik Krogh Kristensen
29a5bdb601
Merge pull request #7339 from erik-krogh/pyPerf
...
Python: Cache more predicates to improve performance.
2022-04-01 13:37:21 +02:00
Michael Nebel
81904cc993
C#: Refactor isIrrelevantOverrideOrImplementation to make it easier to extend it with more methods later.
2022-04-01 13:27:05 +02:00
Erik Krogh Kristensen
eae2a6af36
update expected output for Locations.ql
2022-04-01 12:58:00 +02:00
Erik Krogh Kristensen
ed7e1206ff
rename isBeforeCode to isCommentAfterCode
2022-04-01 12:55:00 +02:00
Tony Torralba
4cf0ebc5a8
Add change note
2022-04-01 12:43:27 +02:00
Tony Torralba
cc9b16beff
Fix wrong models of spring-web
2022-04-01 12:37:30 +02:00
Tony Torralba
3747aec144
Improve models of spring-beans
2022-04-01 12:37:22 +02:00
Chris Smowton
3b0bd3bc0f
Improve wording
2022-04-01 11:31:31 +01:00
Chris Smowton
81e60eb145
Add change note
2022-04-01 11:20:03 +01:00
Chris Smowton
99026a6071
Improve wording of isAdditionalFlow/TaintStep qldoc
2022-04-01 11:07:27 +01:00
Michael Nebel
5cb2bd9245
C#: Exclude IEquatable Equals implementations.
2022-04-01 11:39:41 +02:00
Michael Nebel
02a0cbf0f4
C#: Add test cases.
2022-04-01 11:32:10 +02:00
Michael Nebel
99bbca8c31
C#: Exclude overrides of Equals and GetHashCode in model generation.
2022-04-01 11:32:10 +02:00
Michael Nebel
f480ab9fd2
Merge pull request #8629 from michaelnebel/csharp/capturemodelmetadata
...
C#: Improve query meta data.
2022-04-01 10:40:05 +02:00
Michael Nebel
c139850cd6
Merge pull request #8609 from michaelnebel/csharp/operatorsummaries
...
C#: Operator flow
2022-04-01 09:04:04 +02:00
Michael Nebel
01e57e90c9
C#: Fix query name for source model generation.
2022-04-01 08:54:35 +02:00
Harry Maclean
ae60d40511
Ruby: Fix typo in rb/insecure-dependency qhelp
...
Co-authored-by: Nick Rolfe <nickrolfe@github.com >
2022-04-01 15:35:53 +13:00
Harry Maclean
5814db19d5
Ruby: Fix bug in rb/insecure-dependency query
...
Only look at the first component of strings for the prefix.
Co-authored-by: Nick Rolfe <nickrolfe@github.com >
2022-04-01 15:35:21 +13:00
Harry Maclean
3d96c5e6db
Ruby: Add test case for rb/insecure-dependency
...
This tests that we recognise kwargs in hashrocket style:
gem "foo", "1.2.3", :git => "..."
as well as the modern style:
gem "foo", "1.2.3", git: "..."
2022-04-01 15:30:07 +13:00
Chris Smowton
9309a652df
Merge pull request #8493 from JLLeitschuh/feat/JLL/test_assertion_guard_preconditions
...
[Java]: Add precondition support for testing library asserts
2022-03-31 22:30:09 +01:00
Rasmus Wriedt Larsen
d2b03bb480
Python: Fix SimpleXmlRpcServer.ql
2022-03-31 20:37:28 +02:00
Rasmus Wriedt Larsen
4abab22066
Python: Promote XXE and XML-bomb queries
...
Need to write a change-note as well, but will do that tomorrow
2022-03-31 18:47:50 +02:00
Rasmus Wriedt Larsen
b8d3c5e96f
Python: Remove last bits of experimental XML modeling
2022-03-31 18:40:26 +02:00
Rasmus Wriedt Larsen
5083023aa8
Python: Move XML parsing PoC
...
Since the folder where it used to live is now empty otherwise :O
2022-03-31 18:37:47 +02:00
Alex Ford
8b0ebbfecc
Ruby: replace use of deprecated getStringOrSymbol()
2022-03-31 17:21:17 +01:00
Rasmus Wriedt Larsen
673220b231
Python: Minor cleanup of XmlParsingTest
2022-03-31 18:18:35 +02:00
Alex Ford
882f78c6f9
Merge remote-tracking branch 'origin/main' into ruby/weak-cryptographic-algorithm
2022-03-31 17:17:46 +01:00
Rasmus Wriedt Larsen
b4c0065aeb
Python: Extend FileSystemAccess for xml.sax and xml.dom.* parsing
2022-03-31 18:08:47 +02:00
Rasmus Wriedt Larsen
1d7cec60ae
Python: xml.sax.parse is not a method call
...
And it's not possible to provide a parser argument either
2022-03-31 17:50:23 +02:00
Rasmus Wriedt Larsen
e11269715d
Python: Promote xml.sax and xml.dom.* modeling
2022-03-31 17:44:00 +02:00
Rasmus Wriedt Larsen
05bb0ef976
Python: Align xml.etree.ElementTree modeling
...
I didn't find a good way to actually share the stuff, so we kinda just
have 2 things that look very similar :|
2022-03-31 17:24:16 +02:00
Rasmus Wriedt Larsen
70b3eecdd5
Python: Merge xml.etree.ElementTree models
...
I forgot about the existing ones when I promoted it
2022-03-31 17:13:11 +02:00
Alex Ford
2b66dfa93e
Ruby: replace a range field with instanceof
2022-03-31 15:39:11 +01:00
Chris Smowton
9bcf466aa8
Accept expected test result improvement
2022-03-31 15:19:08 +01:00
Stephan Brandauer
2cbb25acaa
another review fix
2022-03-31 16:04:04 +02:00
Chris Smowton
2829770003
Autoformat and fix typo
2022-03-31 14:11:09 +01:00
Michael Nebel
2edd6d72c0
C#: Improve query meta data.
2022-03-31 14:56:23 +02:00
Anders Schack-Mulligen
f1ec2e3260
Merge pull request #8426 from atorralba/atorralba/missing-severities
...
Java: Add missing security-severity scores
2022-03-31 14:53:47 +02:00
Chris Smowton
fa8791f1d5
Merge pull request #8620 from jketema/doc-typo-fix
...
CLI docs: make the running text match the example
2022-03-31 12:36:51 +01:00
Anders Schack-Mulligen
8d9ce5fb4c
Merge pull request #8625 from aschackmull/java/qldoc-casing-fix
...
Java: Fix acronym casing in qldoc referring to Java class names.
2022-03-31 13:33:11 +02:00
Chris Smowton
04325abfa5
Add test
2022-03-31 12:26:38 +01:00
Chris Smowton
c2d461bcee
Format
2022-03-31 12:19:53 +01:00
Chris Smowton
0d9c353c37
Represent switch statement and switch expression results alike
2022-03-31 12:19:11 +01:00
Chris Smowton
96bf754f01
Accept intrigus suggested doc clarifications
...
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com >
2022-03-31 12:09:45 +01:00
Tom Hvitved
46d69cf544
Regex: Further tweaks to concretise computations
2022-03-31 12:52:43 +02:00
Tom Hvitved
5181544790
Sync shared files
2022-03-31 12:52:42 +02:00
Tom Hvitved
5052452ef9
SuperlinearBackTracking: Speedup concretise
2022-03-31 12:52:42 +02:00
Tom Hvitved
7efe698e56
Address review comment
2022-03-31 12:52:42 +02:00
Tom Hvitved
0fb28f4bc9
Sync shared files
2022-03-31 12:52:42 +02:00
Tom Hvitved
20f4d5a584
ExponentialBackTracking: Speedup concretise
2022-03-31 12:52:42 +02:00
Tom Hvitved
9c90385846
Merge pull request #8624 from hvitved/ruby/fix-import
...
Ruby: Fix broken import
2022-03-31 12:51:50 +02:00
Anders Schack-Mulligen
f28da00ec4
Java: Fix qldoc as followup to https://github.com/github/codeql/pull/8323
2022-03-31 12:50:36 +02:00
Stephan Brandauer
8f1a3597a7
autoformat
2022-03-31 12:32:29 +02:00
Tom Hvitved
40986bfcb1
Ruby: Fix broken import
2022-03-31 12:32:03 +02:00
Geoffrey White
fbd71cd050
C++: Update to regexpMatch.
2022-03-31 11:27:20 +01:00
Rasmus Wriedt Larsen
db43d043c4
Python: Add test showing misalignment of xml.etree modeling
2022-03-31 11:55:46 +02:00
Rasmus Wriedt Larsen
543454eff2
Python: Model file access from XML parsing
2022-03-31 11:47:29 +02:00
Michael Nebel
27b1d1e1e0
Merge pull request #8348 from michaelnebel/csharp/externalapi-telemetry
...
C#: ExternalAPI implementation for Telemetry.
2022-03-31 11:36:07 +02:00
Rasmus Wriedt Larsen
386ff53614
Python: Model lxml.iterparse
2022-03-31 11:32:22 +02:00
Geoffrey White
9035ca236e
C++: Change note.
2022-03-31 10:24:18 +01:00
Geoffrey White
b296b0150a
C++: Some enhancements to SensitiveExprs.qll as well, inspired by csharp.
2022-03-31 10:24:17 +01:00
Rasmus Wriedt Larsen
12cbdcde28
Python: Model lxml.etree.XMLID
2022-03-31 11:21:24 +02:00
Rasmus Wriedt Larsen
6774085e7a
Python: Add note about parseid/XMLID
2022-03-31 11:19:25 +02:00
Rasmus Wriedt Larsen
a315aa84b2
Python: Add some links in QLDocs
2022-03-31 11:16:50 +02:00
Geoffrey White
146318dbc1
Merge pull request #8580 from geoffw0/privdata
...
C++: Port PrivateData.qll from C# and use it in cpp/cleartext-transmission
2022-03-31 10:12:46 +01:00
Rasmus Wriedt Larsen
64aa503cc3
Python: Promote xml.etree modeling
2022-03-31 11:12:02 +02:00
Arthur Baars
15c54f6100
Merge pull request #8354 from aibaars/incomplete-url-string-sanitization
...
Incomplete url string sanitization
2022-03-31 10:59:51 +02:00
Stephan Brandauer
a6d2ecdc4d
review comments
2022-03-31 10:49:33 +02:00
Rasmus Wriedt Larsen
7f5f7679f8
Python: Promote xmltodict modeling
2022-03-31 10:28:34 +02:00
Rasmus Wriedt Larsen
80b5cde3a2
Python: Promote lxml parsing modeling
2022-03-31 10:19:08 +02:00
Jeroen Ketema
85e2367769
CLI docs: make the running text match the example
2022-03-31 10:14:30 +02:00
Rasmus Wriedt Larsen
3040adfd9b
Python: Handle XMLParser().close() for XPath
2022-03-31 10:08:26 +02:00
Rasmus Wriedt Larsen
c4473c5f65
Python: Rename lxml XPath tests
2022-03-31 10:08:02 +02:00
Arthur Baars
7e866ed376
Merge pull request #8617 from cklin/qldoc-coverage-new-language
...
QLdoc check: handle new languages gracefully
2022-03-31 10:00:36 +02:00
Rasmus Wriedt Larsen
1ea4bcc59f
Python: Make XMLParsing a Decoding subclass
2022-03-31 09:52:55 +02:00
Rasmus Wriedt Larsen
35ccba2ec1
Python: Promote XMLParsing concept test
2022-03-31 09:52:55 +02:00
Rasmus Wriedt Larsen
e45288e812
Python: => XMLParsingVulnerabilityKind
...
Since there are other XML vulnerabilities that are not about parsing,
this is more correct.
2022-03-31 09:52:55 +02:00
Rasmus Wriedt Larsen
e005a5c0ab
Python: Promote XMLParsing concept
2022-03-31 09:52:55 +02:00
Rasmus Wriedt Larsen
9caf4be21b
Python: Add PortSwigger link to Xxe.qhelp
...
I found this resource quite good myself at least :)
2022-03-31 09:52:55 +02:00
Rasmus Wriedt Larsen
56b9c891d8
Python: Adjust XmlBomb.qhelp from JS
2022-03-31 09:52:55 +02:00
Rasmus Wriedt Larsen
b00766b054
Python: Adjust XXE qhelp
...
and remove the old copy, we don't need it anymore :)
2022-03-31 09:52:55 +02:00
Rasmus Wriedt Larsen
c365337867
Python: Delete XmlEntityInjection.ql
...
Kept the test of SimpleXmlRpcServer, and kept the qhelp so it can be
used to write the new qhelp files
2022-03-31 09:52:55 +02:00
Rasmus Wriedt Larsen
769f5691d0
Python: Add taint for StringIO and BytesIO
2022-03-31 09:52:54 +02:00
Rasmus Wriedt Larsen
57b9780428
Python: XXE: Add example of exfiltrating data through dtd-retrival
2022-03-31 09:52:54 +02:00
Rasmus Wriedt Larsen
a1d88e39a7
Python: Adjust XXE PoC for newer lxml versions
...
Which doesn't raise that syntax error (at least not on my laptop)
2022-03-31 09:52:54 +02:00
Rasmus Wriedt Larsen
91795b8577
Python: Add simple test of Xxe/XmlBomb
...
Note that most of the testing happens in the framework specific tests,
with an inline-expectation test
2022-03-31 09:52:54 +02:00
Rasmus Wriedt Larsen
e45f9d69cc
Python: Adjust Xxe/XmlBomb for Python
...
I changed a few QLdocs so they fit the style we have used in Python...
although I surely do regret having introduced a new style for how these
QLDocs look :D
2022-03-31 09:52:54 +02:00
Rasmus Wriedt Larsen
65907c9762
Python: Copy Xxe/XmlBomb queries from JS
...
After internal discussion, these will replace the `XmlEntityInjection`
query, so we can have separate severities on DoS and the other (more
serious) attacks.
Note: These clearly don't work, since they are verbatim copies of the JS
code, but I split it into multiple commits to clearly highlight what
changes were made.
2022-03-31 09:52:54 +02:00
Erik Krogh Kristensen
67e1ffdd3e
fix isKnownStepSrc such that it actually includes taint/dataflow-steps
2022-03-31 09:46:01 +02:00
Erik Krogh Kristensen
e038baed36
add .gitignore ignoring test dbs
2022-03-31 09:45:28 +02:00
Chuan-kai Lin
1ff0fda5d1
QLdoc check: handle new languages gracefully
2022-03-30 14:58:13 -07:00
Erik Krogh Kristensen
1218c4f4ed
fix ql/name-casing, and drive-by QL-for-QL typo fix
2022-03-30 22:59:14 +02:00
Erik Krogh Kristensen
1847a5713b
remove TODO
2022-03-30 22:54:01 +02:00
Erik Krogh Kristensen
7ca6426ea5
revert the Taint stage, as it caused an alert for ql/abstract-class-import
2022-03-30 22:54:01 +02:00
Erik Krogh Kristensen
7e4ab4c60b
Revert "import all the frameworks that extend RegexString"
...
This reverts commit 84bc9042de4e876685f8f5ffdd88893383d1cfdc.
It caused ql/abstract-class-import alerts
2022-03-30 22:54:01 +02:00
Erik Krogh Kristensen
3b9335c051
nomagic on containsInScope
2022-03-30 22:54:01 +02:00
Erik Krogh Kristensen
5caff81ff9
import all the frameworks that extend RegexString
2022-03-30 22:54:01 +02:00
Erik Krogh Kristensen
b959705531
revert changes in MRO.qll
2022-03-30 22:54:01 +02:00
Erik Krogh Kristensen
b74852ffd6
cache a bit more (again)
2022-03-30 22:54:01 +02:00
Erik Krogh Kristensen
d9ced55e2c
make private predicates private
2022-03-30 22:54:01 +02:00
Erik Krogh Kristensen
040196f40d
cache more basicblock predicates
2022-03-30 22:54:01 +02:00
Erik Krogh Kristensen
79713e0ef8
a bit more caching
2022-03-30 22:54:00 +02:00
Erik Krogh Kristensen
7643aac207
revert bad nomagic
2022-03-30 22:54:00 +02:00
Erik Krogh Kristensen
35c7fa58a7
joiner order fixes
2022-03-30 22:54:00 +02:00
Erik Krogh Kristensen
88e896992e
cache the remainder of the pointsto layer
2022-03-30 22:54:00 +02:00
Erik Krogh Kristensen
79da0970cc
various join order fixes
2022-03-30 22:54:00 +02:00
Erik Krogh Kristensen
3e9ee887d4
fix bad mistake
2022-03-30 22:54:00 +02:00
Erik Krogh Kristensen
758a5d7a85
few join order fixes
2022-03-30 22:54:00 +02:00
Erik Krogh Kristensen
6eca4ba2d3
get around identical files by adding the ref() call somewhere else
2022-03-30 22:54:00 +02:00
Erik Krogh Kristensen
4089788629
revert caching of some large predicates that caused the DB size to increase too much
2022-03-30 22:54:00 +02:00
Erik Krogh Kristensen
0da80f90d3
rename the SSA stages to AST
2022-03-30 22:54:00 +02:00
Erik Krogh Kristensen
c9e3a62953
cached stages iteration 5
2022-03-30 22:54:00 +02:00
Erik Krogh Kristensen
a8f9a91e38
cached stages iteration 4
2022-03-30 22:54:00 +02:00
Erik Krogh Kristensen
f68357a063
cached stages iteration 3.5
2022-03-30 22:54:00 +02:00
Erik Krogh Kristensen
37a9b41e26
cached stages iteration 3
2022-03-30 22:54:00 +02:00
Erik Krogh Kristensen
60b5af215f
cached stages iteration 2
2022-03-30 22:53:59 +02:00
Erik Krogh Kristensen
71eacea90b
add the cached stages pattern to Python
2022-03-30 22:53:59 +02:00
Chuan-kai Lin
48015e5a2e
Merge pull request #8597 from cklin/run-js-ml-tests
...
JS: Fix expected test output for ATM queries
2022-03-30 13:10:02 -07:00
Chuan-kai Lin
a8dabb238d
JS: Fix expected test output for ATM queries
2022-03-30 11:35:17 -07:00
Robert Marsh
3ce7c521d1
C++: fix IR global var init for string constants
2022-03-30 14:01:59 -04:00
Robert Marsh
e01799827a
C++: add test for string global var inits in IR
2022-03-30 13:38:25 -04:00
Robert Marsh
fb0a848e5a
C++: fix inconsistency with global var constructor
2022-03-30 13:32:02 -04:00
Robert Marsh
9d4aac61fd
C++: add IR tests for global var with constructor
2022-03-30 13:20:26 -04:00
Chris Smowton
19cd97e426
Java: Clarify the meaning of getRuleExpression/Statement
2022-03-30 17:58:11 +01:00
Nick Rolfe
fa1bb82701
Merge pull request #8610 from github/nickrolfe/re-fix-location-join-order
...
Ruby: undo accidental revert of #8538
2022-03-30 16:31:52 +01:00
Nick Rolfe
10b75bff76
Ruby: undo accidental revert of 13be9919
2022-03-30 16:02:12 +01:00
Chris Smowton
9675f34cf5
Merge pull request #8257 from luchua-bc/java/insecure-webview-resource-response
...
Java: CWE-200 Query to detect insecure WebResourceResponse implementation
2022-03-30 15:56:27 +01:00
Arthur Baars
031d183bdf
Merge pull request #8532 from aibaars/regex-refactor-2
...
JS/Ruby/Python: rename RegExpTreeView.qll to ReDoSUtilSpecific.qll
2022-03-30 16:38:47 +02:00
Robert Marsh
417b0b5353
C++: accept test changes for updated extractor
2022-03-30 10:23:17 -04:00
Michael Nebel
8238c99199
C#: Only include APIs that has a proper namespace.
2022-03-30 15:22:32 +02:00
Michael Nebel
5c13391580
C#: Add test cases for operators.
2022-03-30 15:09:44 +02:00
Michael Nebel
04960fc0c6
C#: Filter out explicit and implicit conversion operators, when creating summaries.
2022-03-30 15:09:26 +02:00
Michael Nebel
8b08ddf7ad
C#: Use callables qualified name instead of name, when printing summary like information.
2022-03-30 15:05:57 +02:00
Michael Nebel
4163078ecc
C#: The qualified name of the operator should use the function name instead of the displayed name.
2022-03-30 15:05:03 +02:00
Sebastian Bauersfeld
a3c3a7fe0d
Python: Identify alternative body argument in invocations of Response constructor.
2022-03-30 19:34:54 +07:00
Dave Bartolomeo
70c44734e6
Merge pull request #8445 from dbartol/dbartol/ir-range/semantic-scratch
...
Sign, Modulus, and Range analysis for C++ using sharable semantic layer
2022-03-30 07:08:09 -04:00
Dave Bartolomeo
e2396a5e03
Remove PrintIR tests for range analysis
...
These were only used for debugging, and don't actually make good tests.
2022-03-30 06:45:28 -04:00
Dave Bartolomeo
19789fa738
Merge remote-tracking branch 'upstream/main' into semantic-scratch
2022-03-30 06:39:14 -04:00
Nick Rolfe
a274af2b16
Merge pull request #7985 from github/nickrolfe/constant_regexp
...
Ruby: separate constant propagation of regexps from strings
2022-03-30 11:37:33 +01:00
ihsinme
b95094235c
Apply suggestions from code review
...
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com >
2022-03-30 10:51:38 +03:00
4B5F5F4B
9ab773422a
refactor some code, and add access_ok cases
2022-03-30 12:25:32 +08:00
Harry Maclean
167bda2d4e
Ruby: Add QLDoc for InsecureDependencyQuery.qll
2022-03-30 13:50:12 +13:00
Harry Maclean
d13bbbaf35
Ruby: Add change note for rb/insecure-dependency
2022-03-30 13:39:35 +13:00
Harry Maclean
37cedda63a
Ruby: Add InsecureDependencyResolution query
...
This query looks for places in a Gemfile where URLs with insecure
protocols (HTTP or FTP) are specified.
2022-03-30 13:39:15 +13:00
Marcono1234
a93b4ed0f2
Java: Make JumpStmt a proper superclass
2022-03-30 00:30:27 +02:00
Erik Krogh Kristensen
48ef3b106f
fix mistake in inlining
2022-03-29 23:39:22 +02:00
Erik Krogh Kristensen
090c5c39f6
add explicit this
2022-03-29 22:44:03 +02:00
Erik Krogh Kristensen
cebba05b8b
rename getAClassReferenceStep to getAClassReferenceRec
2022-03-29 22:44:03 +02:00
Erik Krogh Kristensen
be6c122b27
improve the join order of getAClassReference
2022-03-29 22:44:02 +02:00
Erik Krogh Kristensen
979fa2386a
autoformat
2022-03-29 22:38:23 +02:00
Robert Marsh
9442be1a27
Autoformat
2022-03-29 16:23:57 -04:00
Porcupiney Hairs
92033047a5
Python : Add query to detect PAM authorization bypass
...
Using only a call to `pam_authenticate` to check the validity of a login can
lead to authorization bypass vulnerabilities. A `pam_authenticate` only
verifies the credentials of a user. It does not check if a user has an
appropriate authorization to actually login. This means a user with a
expired login or a password can still access the system.
This PR includes a qhelp describing the issue, a query which detects instances where a call to
`pam_acc_mgmt` does not follow a call to `pam_authenticate` and it's
corresponding tests.
This PR has multiple detections. Some of the public one I can find are :
* [CVE-2022-0860](https://nvd.nist.gov/vuln/detail/CVE-2022-0860 ) found
in [cobbler/cobbler](https://www.github.com/cobbler/cobbler )
* [fredhutch/motuz](https://www.huntr.dev/bounties/d46f91ca-b8ef-4b67-a79a-2420c4c6d52b/ )
2022-03-30 00:47:58 +05:30
Robert Marsh
8d21c8b7c5
Merge pull request #8423 from 4B5F5F4B/main
...
[CPP][Linux Kernel]Add ql to detect CVE-2017-5123
2022-03-29 15:10:15 -04:00
luchua-bc
fa2a6a7da3
Remove unnecessary taint step and update qldoc
2022-03-29 17:52:49 +00:00
Jeroen Ketema
e5ac492b62
Merge pull request #8593 from jketema/pointless-options
...
C++: Remove debugging options from library tests
2022-03-29 17:55:47 +02:00
Jeroen Ketema
d1857a9e37
C++: Remove debugging options from library tests
2022-03-29 17:24:18 +02:00
Geoffrey White
e04298d532
C++: Delete experimental PrivateData.qll.
2022-03-29 15:26:46 +01:00
Asger Feldthaus
8bb58a3222
Merge branch 'js/decorated-method-or-class' of github.com:asgerf/codeql into js/decorated-method-or-class
2022-03-29 16:13:54 +02:00
Asger Feldthaus
75a84378ac
JS: Do not generate def-nodes for decorated parameters
2022-03-29 16:13:45 +02:00
Asger Feldthaus
ca145f21b0
JS: Add test showing why parameter-sinks wont actually work well in JS
2022-03-29 16:06:53 +02:00
Geoffrey White
cf5c6baadd
C++: More test cases for salary.
2022-03-29 15:05:27 +01:00
Asger Feldthaus
3bcfca421f
JS: Add test case for decorated parameter sinks
2022-03-29 15:55:43 +02:00
Geoffrey White
0e3e145e53
C++: Add CWE-359 tag to cpp/cleartext-transmission.
2022-03-29 14:44:06 +01:00
Asger F
6e630cccc2
Apply suggestions from code review
...
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com >
2022-03-29 15:41:20 +02:00
Michael Nebel
db7abb429f
C#: Remove unneeded exists.
2022-03-29 14:59:32 +02:00
Michael Nebel
6be41b0c29
C#/Java: Address review comments.
2022-03-29 14:52:57 +02:00
Michael Nebel
b0a24a7a44
C#: Change the implementation on getAnInput and getAnOutput based on hvitveds recommendations.
2022-03-29 14:52:57 +02:00
Michael Nebel
c2196a04aa
C#: Update the description of the telemetry queries.
2022-03-29 14:52:57 +02:00
Michael Nebel
bfb206c810
C#: Let ExternalApi extend DataFlowCallable instead of Callable.
2022-03-29 14:52:57 +02:00
Michael Nebel
e1d4c1b68c
C#/Java: Reorder code in terms of dependency, rename ExternalAPI to ExternalApi and add some missing predicate qualifiers.
2022-03-29 14:52:52 +02:00
Michael Nebel
4f00666591
C#: Add query and test case for supported external taint.
2022-03-29 14:49:37 +02:00
Michael Nebel
03c1bf6d87
C#: Mark Xunit as uninteresting.
2022-03-29 14:49:37 +02:00
Michael Nebel
18b1b51d07
C#: Add test for known sources telemetry query.
2022-03-29 14:49:37 +02:00
Michael Nebel
1f1059bfc6
C#: Add telemetry query for supported sources.
2022-03-29 14:49:37 +02:00
Michael Nebel
a7ece69f2b
C#: Add test for supported sinks query.
2022-03-29 14:49:37 +02:00
Michael Nebel
d81e73f9c6
C#: Add telemetry query for supported sinks.
2022-03-29 14:49:37 +02:00
Michael Nebel
e4f6321851
C#: Add test for unsupported uses of library code.
2022-03-29 14:49:37 +02:00
Michael Nebel
e014cae7df
C#: Add test and output for all library usages.
2022-03-29 14:49:37 +02:00
Michael Nebel
7cef859253
C#: Add sample code file that calls both supported and unsupported library code with respect to flow summaries.
2022-03-29 14:49:37 +02:00
Michael Nebel
918a6c7425
C#: Telemetry query for measuring (unsupport dataflow) library usage.
2022-03-29 14:49:37 +02:00
Michael Nebel
c023808657
C#: Telemetry query for measuring all library usage.
2022-03-29 14:49:37 +02:00
Michael Nebel
0650c6d395
C#: Add initial port of the java implementation of ExternalAPI.qll.
2022-03-29 14:49:37 +02:00
Michael Nebel
e9070b010b
C#: Add getCall predicate to ArgumentNode.
2022-03-29 14:49:37 +02:00
Michael Nebel
c552ab4138
Java: Remove duplicate import statement in ExternalAPI.qll.
2022-03-29 14:49:37 +02:00
Michael Nebel
c3ac5aba57
Merge pull request #8482 from michaelnebel/csharp/capturesourcesink-models
...
C#: Capture[Source|Sink]Models utility.
2022-03-29 14:43:10 +02:00
yoff
3416f074e8
Update python/ql/src/Security/CWE-352/CSRFProtectionDisabled.ql
...
Explain why `TestScope` is not used.
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com >
2022-03-29 13:59:04 +02:00
Dave Bartolomeo
c9f79047b3
Improve QLDoc
2022-03-29 07:27:45 -04:00
Dave Bartolomeo
01c747ccb7
Remove debugging code
2022-03-29 07:14:51 -04:00
Dave Bartolomeo
820beed085
Remove Java portion (moved to separate PR)
2022-03-29 07:09:33 -04:00
Tony Torralba
e564481e9f
Organize imports
2022-03-29 11:38:24 +02:00
Asger F
68575f3655
Merge pull request #8579 from asgerf/js/literal-csv-rows
...
JS: write all CSV rows as literals
2022-03-29 11:13:19 +02:00
Michael Nebel
8e60073d5a
Java: Remove dataflow imports for java.qll.
2022-03-29 11:07:58 +02:00
Michael Nebel
f734edf8ff
C#/Java: Minor refactor and re-arranging of code to align the CaptureModel specific implementations.
2022-03-29 11:07:58 +02:00
Michael Nebel
dd267b353a
C#: Move isRelevantMemberAccess out of PropagateToSinkConfigurationSpecific.
2022-03-29 11:07:58 +02:00
Michael Nebel
3933dfa78e
Java: Make imports private and add parts of the dataflow library to java.qll (same as in C#).
2022-03-29 11:07:58 +02:00
Michael Nebel
ad90c55bc6
C#: Improve encapsulation in CaptureModelsSpecific.
2022-03-29 11:07:57 +02:00
Michael Nebel
26d5eb64b3
C#/Java: Initial merge ModelGeneratorUtils into CaptureModels.
2022-03-29 11:07:57 +02:00
Michael Nebel
9b7691a5fc
C#/Java: Address comments on re-exposing functionality.
2022-03-29 11:07:57 +02:00
Michael Nebel
1710b66003
C#/Java: Some minor variable name changes and QL Doc updates.
2022-03-29 11:07:57 +02:00
Michael Nebel
4298024cd6
C#: Refactor isRelevantForModels.
2022-03-29 11:07:57 +02:00
Michael Nebel
5970fd9904
C#: Also include property reads in possible new sink discovery. Only include public fields and properties.
2022-03-29 11:07:57 +02:00
Michael Nebel
8a65efbae4
C#/Java: Add isRelevantSinkKind predicate with language specific implementation.
2022-03-29 11:07:57 +02:00
Michael Nebel
0009d781d7
Java: Make most imports private.
2022-03-29 11:07:57 +02:00
Michael Nebel
1c7d764d54
C#: Make most module imports private.
2022-03-29 11:07:57 +02:00
Michael Nebel
ad27a5a1a6
C#/Java: Add some more QL Doc to the CaptureModels[Specific] implementation.
2022-03-29 11:07:57 +02:00
Michael Nebel
62dcbff67f
C#: Update sync files config.
2022-03-29 11:07:57 +02:00
Michael Nebel
5d62c48890
C#/Java: Move libraries to internal folder as these are for internal use only.
2022-03-29 11:07:57 +02:00
Michael Nebel
3d2ce57c9e
Java: Collapse all the specific code for summary, source and sink models into a single file.
2022-03-29 11:07:57 +02:00
Michael Nebel
43c9f9d7bb
C#: Collapse all the specific code for summary, source and sink models into a single file.
2022-03-29 11:07:57 +02:00
Michael Nebel
852d8a2770
Java: Collapse all the shared code for summary, source and sink models into a single file.
2022-03-29 11:07:57 +02:00
Michael Nebel
4f2227f206
C#: Collapse all the shared code for summary, source and sink models into a single file.
2022-03-29 11:07:57 +02:00
Michael Nebel
79fd2e6a40
C#/Java: Make configurations private and sprinkle some QL Doc.
2022-03-29 11:07:57 +02:00
Michael Nebel
6194d5cf63
C#: Add test for CaptureSinkModel query.
2022-03-29 11:07:57 +02:00
Michael Nebel
5babb0e66a
C#: Update stubs to include one more known sink method.
2022-03-29 11:07:57 +02:00
Michael Nebel
858508fa33
C#: Make sure that language independent parts of CaptureSinkModels is in sync.
2022-03-29 11:07:57 +02:00
Michael Nebel
db21a6a0f3
C#: Add CaptureSummaryModels query.
2022-03-29 11:07:57 +02:00
Michael Nebel
fb2a7dfb48
Java: Refactor CaptureSinkModels into language specific and generic part.
2022-03-29 11:07:57 +02:00
Michael Nebel
cc5fbbb7c5
Java: Minor cleanup in CaptureSinkModels.
2022-03-29 11:07:56 +02:00
Michael Nebel
cc4e26466f
C#: Add test case for CaptureSummaryModels query.
2022-03-29 11:07:56 +02:00
Michael Nebel
b4efd0e154
C#: Make sure that the shared CaptureSummaryModel is in sync.
2022-03-29 11:07:56 +02:00
Michael Nebel
4ae5dc323f
C#: Add CaptureSourceModel query.
2022-03-29 11:07:56 +02:00
Michael Nebel
45234b1631
Java: Refactor CaptureSourceModel to enable re-use.
2022-03-29 11:07:56 +02:00
Michael Nebel
f00837578b
Java: isPublic and fromSource check as this is already ensured by the TargetApi characteristic predicate.
2022-03-29 11:07:56 +02:00
Michael Nebel
f42ed1e3ad
Java: Cleanup imports in CaptureSourceModels.
2022-03-29 11:07:56 +02:00
Geoffrey White
b94ade3bdd
C++: Improve the regexps.
2022-03-29 10:03:58 +01:00
Erik Krogh Kristensen
ae3b32409a
update expected output of tests that relied on API::Node::toString()
2022-03-29 10:59:08 +02:00
Geoffrey White
393819837c
C++: Convert to regexp.
2022-03-29 09:33:16 +01:00
Tony Torralba
6799838ece
Simplification
2022-03-29 09:43:37 +02:00
4B5F5F4B
9358b824c0
modify select clause to make codeql happy:)
2022-03-29 10:41:12 +08:00
luchua-bc
833d842113
Drop the getPath check from the library
2022-03-28 20:14:40 +00:00
Robert Marsh
3c1ec5a595
Merge branch 'main' into rdmarsh2/ir-global-vars
2022-03-28 16:06:17 -04:00
luchua-bc
657f615703
Fine tune the query and update qldoc
2022-03-28 20:05:12 +00:00
Robert Marsh
af6a4f31e7
C++: TranslatedInstructionContainer to RootElement
2022-03-28 15:20:48 -04:00
Robert Marsh
5811d0b2ad
C++: add AliasedDefinition to IR global var inits
2022-03-28 14:53:43 -04:00
Stephan Brandauer
9c3fcb6268
precise tracking of handlebars arguments
2022-03-28 17:26:43 +02:00
Asger Feldthaus
cf596a1856
JS: Add decorator edges in API graphs and corresponding MaD tokens
2022-03-28 15:34:40 +02:00
Erik Krogh Kristensen
20599d1846
Merge branch 'main' of github.com:github/codeql into labelNaming
2022-03-28 15:30:33 +02:00
Asger Feldthaus
e152416317
JS: write all CSV rows as literals
2022-03-28 15:30:18 +02:00
Asger F
e5f2b830f3
Merge pull request #8577 from asgerf/fix-mad-warning
...
JS/Ruby: Fix regexp in MaD checking
2022-03-28 15:29:16 +02:00
Asger F
f22df765ed
Merge pull request #8533 from asgerf/mad-receiver-token
...
JS/Ruby: Represent non-positional arguments with Argument/Parameter tokens
2022-03-28 15:28:52 +02:00
Geoffrey White
611b820cbc
C++: Change notes.
2022-03-28 14:27:21 +01:00
Erik Krogh Kristensen
e79eecb640
update toString() of API::Node, and update expected output that depends on the former
2022-03-28 15:23:45 +02:00
Nick Rolfe
9406aa2f29
Merge remote-tracking branch 'origin/main' into nickrolfe/constant_regexp
2022-03-28 13:05:34 +01:00
Asger Feldthaus
0b30ecf36a
Ruby: add select clause back to Summaries.ql
2022-03-28 13:57:50 +02:00
Erik Krogh Kristensen
36db492aa2
move the polynomialbacktracking-test to the test folder
2022-03-28 13:22:26 +02:00
Erik Krogh Kristensen
c5fb19c377
update the JS API-graph labels toString() to print the predicate calls on the API-graphs
2022-03-28 13:19:16 +02:00
Arthur Baars
85c4daa2bf
Address comments
2022-03-28 13:15:32 +02:00
Asger Feldthaus
d5bcd14733
Sync ApiGraphModels.qll
2022-03-28 12:43:55 +02:00
Asger Feldthaus
7e6206ed36
JS: Fix the regexp for valid MaD token arguments
2022-03-28 12:43:43 +02:00
Arthur Baars
2ae5e8158e
Python: import RegExpTreeView correctly
2022-03-28 12:41:32 +02:00
Nick Rolfe
a9eac19dac
Ruby: address review feedback
2022-03-28 11:19:24 +01:00
Arthur Baars
b103679d8a
JS/Ruby/Python: rename RegExpTreeView.qll to ReDoSUtilSpecific.qll
2022-03-28 12:17:26 +02:00
Arthur Baars
af1d949d06
Merge pull request #8489 from aibaars/regex-refactor
...
Ruby: refactor regex libraries
2022-03-28 12:17:00 +02:00
Geoffrey White
18f80eb3e3
C++: Loosen a few constraints slightly.
2022-03-28 11:16:57 +01:00
Geoffrey White
850646b8ba
C++: Deprecate the experimental version, forward to the new one.
2022-03-28 11:16:56 +01:00
Geoffrey White
3fed7bf6d0
C++: Extend cpp/cleartext-transmission using PrivateData.qll.
2022-03-28 11:16:56 +01:00
Geoffrey White
202b6d44a5
C++: Update SensitiveExprs.qll to clarify the relationship.
2022-03-28 10:54:56 +01:00
Geoffrey White
0453c0f0a1
C++: Convert to C++ and make it look more like SensitiveExprs.qll.
2022-03-28 10:54:55 +01:00
Geoffrey White
ec98269a24
C++: Copy PrivateData.qll from csharp.
2022-03-28 10:54:54 +01:00
Geoffrey White
bb272003b4
C++: More test cases.
2022-03-28 10:54:54 +01:00
Erik Krogh Kristensen
c98d024c0e
Merge pull request #8575 from erik-krogh/qlFixTypo
...
QL: fix Import::getImportString
2022-03-28 11:41:59 +02:00
Arthur Baars
accdd9499a
Ruby: drop unused predicates that do not exist in Python variant
2022-03-28 11:32:52 +02:00
Erik Krogh Kristensen
7ac6f5849c
fix Import::getImportString
2022-03-28 11:04:18 +02:00
Ahmed Farid
53f756b078
Update ZipSlip.expected
2022-03-28 08:54:44 +00:00
Mathias Vorreiter Pedersen
57c39e9642
Merge pull request #8574 from erik-krogh/qlForQlFixes
...
QL: two small improvements
2022-03-28 09:26:43 +01:00
Erik Krogh Kristensen
77aff04429
add a getImportString utility predicate to Import
2022-03-28 10:14:27 +02:00
Erik Krogh Kristensen
d4c8f42336
add QLDoc to the child relation for TopLevel
2022-03-28 09:54:08 +02:00
yoff
5efc19c39d
Merge pull request #7806 from erik-krogh/pyDef
...
Python: Add def nodes to API graphs
2022-03-28 08:09:14 +02:00
Rasmus Lerchedahl Petersen
d39410aa2d
python: backport review comment to Ruby
2022-03-28 07:35:14 +02:00
Rasmus Lerchedahl Petersen
774c811e97
python: move CSRF concepts inside HTTP::Server
2022-03-28 07:35:13 +02:00
Ahmed Farid
d89ed8b98b
Update zipslip_bad.py
2022-03-28 01:40:08 +00:00
Ahmed Farid
a50f051cdd
Update zipslip_bad.py
2022-03-28 01:38:58 +00:00
Ahmed Farid
cafbd98454
Update zipslip_bad.py
2022-03-28 01:08:39 +00:00
Ahmed Farid
f364e41dbe
Update ZipSlip.expected
2022-03-28 01:02:38 +00:00
Ahmed Farid
a8c14ed6c3
Update zipslip_bad.py
2022-03-28 01:00:38 +00:00
Ahmed Farid
ddba3b7784
Update ZipSlip.qll
2022-03-28 00:59:56 +00:00
Ahmed Farid
0fac4f195d
Update Concepts.qll
2022-03-28 00:47:27 +00:00
Ahmed Farid
413f1945ce
Update Zip.qll
2022-03-28 00:44:56 +00:00
Marcono1234
f19ade3446
Java: Add StmtExpr
2022-03-27 01:42:34 +01:00
4B5F5F4B
2d7b9c0c4f
modify a little cute typo
2022-03-26 22:55:27 +08:00
4B5F5F4B
7a091f808b
Create NoCheckBeforeUnsafePutUser.ql
2022-03-26 22:45:03 +08:00
4B5F5F4B
64863d493b
Delete cve-2017-5123.ql
2022-03-26 22:42:59 +08:00
Edoardo Pirovano
8faabb837a
Merge pull request #8561 from erik-krogh/latestTools
...
QL: use latest tools in codeql-action/init
2022-03-25 15:12:58 -04:00
Erik Krogh Kristensen
21192b7593
use latest tools in codeql-action/init
2022-03-25 19:26:10 +01:00
Andrew Eisenberg
5fb84a774b
Merge pull request #8553 from github/aeisenberg/cpp-suites
...
Suites: Remove self-referential `from` directives
2022-03-25 09:15:53 -07:00
Michael Nebel
79f3da8af1
Merge pull request #8506 from michaelnebel/java/generalize-generate-flow-model
...
Java/C#: Generalize script for generating flow models.
2022-03-25 16:20:53 +01:00
Geoffrey White
2014599f88
Merge pull request #8318 from geoffw0/cwe497b
...
C++: New query cpp/potential-system-data-exposure
2022-03-25 14:55:00 +00:00
Taus
b75ac4e827
Merge pull request #8540 from tausbn/python-add-points-to-call-graph-meta-query
...
Python: Add call graph meta-query
2022-03-25 15:36:33 +01:00
Erik Krogh Kristensen
9e71d9bada
Merge pull request #8556 from erik-krogh/bumpAction
...
QL: update codeql-action version in QL-for-QL
2022-03-25 14:46:31 +01:00
Erik Krogh Kristensen
68c07fe1c0
pin the commit of codeql-action in the remaining steps/workflows
2022-03-25 14:35:44 +01:00
Erik Krogh Kristensen
8f377f4101
pin the commit
...
Co-authored-by: Esben Sparre Andreasen <esbena@github.com >
2022-03-25 14:19:29 +01:00
Erik Krogh Kristensen
cf57eb825c
update codeql-action version in QL-for-QL
2022-03-25 13:37:27 +01:00
Taus
d56caa2398
Merge pull request #8547 from RasmusWL/regexstring-imports
...
Python: Import framework-modeling in `regex.qll`
2022-03-25 13:26:04 +01:00
Geoffrey White
9f3fd57534
Merge branch 'main' into cwe497b
2022-03-25 11:57:30 +00:00
Mathias Vorreiter Pedersen
c115c68247
Merge pull request #8542 from MathiasVP/public-iterated-dominance-frontier
...
C++: Use `iterated (post)dominance frontier` algorithm in `IRBlock`
2022-03-25 11:51:15 +00:00
Jeroen Ketema
b91914bd89
Merge pull request #8534 from jketema/bitwise-ctor-field-init
...
C++: Handle bitwise copies in copy constructors
2022-03-25 12:47:57 +01:00
Geoffrey White
e377eebdbc
C++: More 'adversary' -> 'malicious user' and related doc changes.
2022-03-25 11:34:37 +00:00
Rasmus Lerchedahl Petersen
1e9840d779
python: broaden local protection concept
2022-03-25 12:28:33 +01:00
Geoffrey White
11074b6d77
Update cpp/ql/src/Security/CWE/CWE-497/PotentiallyExposedSystemData.ql
...
Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com >
2022-03-25 11:08:07 +00:00
Nick Rolfe
c7ba7fd389
Ruby: add changenotes for regexp constant value changes
2022-03-25 11:08:01 +00:00
Geoffrey White
6b6ee61d3f
Apply suggestions from code review
...
Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com >
2022-03-25 11:06:46 +00:00
Rasmus Lerchedahl Petersen
179f77b123
python: clearer comment
2022-03-25 11:51:24 +01:00
Rasmus Lerchedahl Petersen
778a88f32c
python: update qhelp
...
removing custom middleware stack
will _not_ enable CSRF protection
2022-03-25 11:49:06 +01:00
Jeroen Ketema
94f014d948
C++: Update tests for handling of bitwise copies in copy constructors
2022-03-25 11:43:01 +01:00
Jeroen Ketema
b18b86b2e2
C++: Remove check for value-less literals in constructors
2022-03-25 11:43:01 +01:00
yoff
85f1d92a0d
Apply suggestions from code review
...
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com >
2022-03-25 11:42:32 +01:00
Chris Smowton
f0168d00d1
Merge pull request #8529 from github/smowton/admin/commons-lang3-test-typo
...
Java: Fix harmless search-replace mistake
2022-03-25 10:36:00 +00:00
Asger Feldthaus
8e2ffc2508
Ruby: add the inline test expectations
2022-03-25 11:31:22 +01:00
Asger Feldthaus
5703f63afa
Ruby: use InlineFlowTest in Summaries.ql test
2022-03-25 11:18:52 +01:00
Erik Krogh Kristensen
cf94c93b1a
Merge pull request #8481 from erik-krogh/schemeChain
...
JS: recognize string replacement chains as scheme checks in js/incomplete-url-scheme-check
2022-03-25 11:13:10 +01:00
Nick Rolfe
034fce0682
Ruby: show constant value type in tests
2022-03-25 08:25:07 +00:00
Andrew Eisenberg
99f14af56a
Suites: Remove self-referential from directives
...
Fixes https://github.com/github/codeql/issues/8412
See https://github.com/github/codeql/issues/8412#issuecomment-1078281668
for more detail.
2022-03-24 14:19:20 -07:00
Nick Rolfe
0613fda57f
Ruby: separate constant propagation of regexps from strings
2022-03-24 17:46:58 +00:00
Erik Krogh Kristensen
47a9376e81
fix bad join in js/unreachable-method-overloads
2022-03-24 16:09:10 +01:00
Tom Hvitved
e12b6df118
Merge pull request #8484 from hvitved/ruby/constant-value-rework
...
Ruby: Rework `getConstantValue` implementation
2022-03-24 14:32:31 +01:00
Rasmus Wriedt Larsen
d51aaf2f91
Python: Import framework-modeling in regex.qll
2022-03-24 14:28:44 +01:00
Mathias Vorreiter Pedersen
80630972b1
Merge branch 'main' into public-iterated-dominance-frontier
2022-03-24 12:50:29 +00:00
Rasmus Wriedt Larsen
98c0d73ffe
Merge pull request #8524 from RasmusWL/ruby-update-ssrf-concept
...
Ruby: Minor change of SSRF concept
2022-03-24 13:48:06 +01:00
Stephan Brandauer
a28e9c5b6e
documentation for handlebars.js flow step
2022-03-24 13:08:52 +01:00
Rasmus Lerchedahl Petersen
ce017394e6
python: fix change note (hepofully)
2022-03-24 12:01:46 +01:00
Stephan Brandauer
0bd9e9f298
add handlebars taint step
2022-03-24 11:46:16 +01:00
Rasmus Lerchedahl Petersen
aecf4e48f8
python: add change note
2022-03-24 11:43:07 +01:00
Chris Smowton
005a020f04
Merge pull request #8508 from igfoo/igfoo/error_elements
...
Java: Add ErrorExpr, ErrorStmt
2022-03-24 10:39:14 +00:00
Arthur Baars
15801fcc85
Apply suggestions from code review
...
Co-authored-by: Nick Rolfe <nickrolfe@github.com >
2022-03-24 11:37:03 +01:00
Arthur Baars
eef0da09bb
Ruby: move RegExpTreeView.qll out of 'internal'
2022-03-24 11:37:03 +01:00
Arthur Baars
1a9aaf4543
Apply suggestions from code review
...
Co-authored-by: yoff <lerchedahl@gmail.com >
2022-03-24 11:37:03 +01:00
Arthur Baars
5f787144c0
Add change note
2022-03-24 11:37:03 +01:00
Arthur Baars
3c434931ec
Ruby: make ParseRegExp.qll and RegExpTreeView.qll internal libraries
2022-03-24 11:37:03 +01:00
Arthur Baars
74aea81fe3
Ruby: refactor regex libraries
2022-03-24 11:37:02 +01:00
Arthur Baars
65f8f56095
Merge branch 'main' into incomplete-url-string-sanitization
2022-03-24 11:27:30 +01:00
Arthur Baars
496aab78a7
Merge pull request #8535 from aibaars/setter-method-arg-location
...
Ruby: fix location of setter-call argument
2022-03-24 11:26:13 +01:00
Tom Hvitved
eff7cf6396
Merge pull request #8538 from hvitved/ruby/regexpterm-location-perf
...
Ruby: Fix bad join-order in `RegExpTerm::hasLocationInfo`
2022-03-24 10:01:12 +01:00
Tom Hvitved
2699412160
Merge pull request #8543 from hmac/hmac/test-naming-fix
...
Ruby: Fix bad name of lambda in test
2022-03-24 09:46:04 +01:00
Harry Maclean
28a430a2f2
Ruby: Fix bad name of lambda in test
...
This isn't the identity function, so it's confusing for it to be named
so.
2022-03-24 12:44:41 +13:00
Ahmed Farid
eab6568cda
Update zipslip_good.py
2022-03-24 00:35:24 +01:00
Ahmed Farid
8dea7248ea
Update zipslip_bad.py
2022-03-24 00:34:52 +01:00
Ahmed Farid
b5f1e9de08
Update zipslip_bad.py
2022-03-24 00:33:28 +01:00
Ahmed Farid
a05318f10c
Update zipslip_good.py
2022-03-24 00:32:11 +01:00
Ahmed Farid
1836723ecb
Merge branch 'main' into ZipSlip
2022-03-23 19:27:12 -04:00
Harry Maclean
3b4206cebf
Merge pull request #8517 from hmac/hmac/lambda-captured-var
...
Ruby: fix bug with captured variable reads in lambdas
2022-03-24 10:00:19 +13:00
Mathias Vorreiter Pedersen
61c944201f
Merge pull request #8461 from Paul1nh0/dev_cve_2016_6480
...
Add query for double-fetch vulnerability
2022-03-23 18:15:05 +00:00
Asger Feldthaus
b0b795dbbb
JS: Autoformat
2022-03-23 19:15:01 +01:00
Mathias Vorreiter Pedersen
c76a323246
C++/C#: Sync identical files.
2022-03-23 17:27:25 +00:00
Mathias Vorreiter Pedersen
1b4fb45089
C++: Use the iterated (post)dominance frontier algorithm in the public '(post)dominanceFrontier' predicate on 'IRBlocks'.
2022-03-23 17:27:16 +00:00
Asger Feldthaus
69eb24e748
Ruby: fix toCsv representation of argument/parameter positions
2022-03-23 18:11:09 +01:00
Asger Feldthaus
6870a19ace
Ruby: autoformat
2022-03-23 18:06:12 +01:00
Asger Feldthaus
0d51804b5e
Ruby: update a comment mentioning Receiver
2022-03-23 18:06:12 +01:00
Asger Feldthaus
ce54eb3c78
Ruby: Add Argument[foo:] syntax for keyword arguments
2022-03-23 18:06:12 +01:00
Asger Feldthaus
c923b9bb9b
Ruby: Replace Receiver with Argument[self]
2022-03-23 18:06:12 +01:00
Asger Feldthaus
ec30a0f975
Ruby: replace BlockArgument with Argument[block]
2022-03-23 18:06:12 +01:00
Asger Feldthaus
6d84baf276
Ruby: Support self,block in Argument/Parameter tokens
2022-03-23 18:06:12 +01:00
Asger Feldthaus
95122b2b6c
JS: Support Argument[this] token
2022-03-23 18:06:12 +01:00
Asger Feldthaus
d476f976fe
JS: Support Parameter[this] token
2022-03-23 18:06:12 +01:00
Taus
af888f7604
Python: Add call graph meta-query
2022-03-23 16:36:28 +00:00
CodeQL CI
ac29d5f51b
Merge pull request #8523 from asgerf/js/api-graph-receiver-label
...
Approved by erik-krogh
2022-03-23 15:31:12 +00:00
Mathias Vorreiter Pedersen
8b8f0ca6e5
Merge pull request #8479 from geoffw0/widecharperf
...
C++: Fix expensive getWideCharType().
2022-03-23 14:22:17 +00:00
Anna Railton
41418e729e
Merge pull request #8536 from github/codeql-ci/js-atm-new-release
...
JS: Bump version numbers of ML-powered packs after 0.2.0 release
2022-03-23 14:16:11 +00:00
Tom Hvitved
13be99196f
Ruby: Fix bad join-order in RegExpTerm::hasLocationInfo
...
Before:
```
[2022-03-23 14:50:16] (776s) Tuple counts for RegExpTreeView::RegExpTerm::hasLocationInfo#dispred#f0820431#ffffff/6@5f6cf7if after 1m4s:
707103 ~7% {2} r1 = SCAN Literal::StringlikeLiteral::getNumberOfComponents#dispred#f0820431#ff OUTPUT In.0, (In.1 - 1)
64721 ~0% {5} r2 = JOIN r1 WITH RegExpTreeView::RegExpTerm#7783c185#ffff_1023#join_rhs ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Rhs.1 'this', Rhs.2, Rhs.3
64721 ~0% {5} r3 = JOIN r2 WITH Literal::StringlikeLiteral::getComponent#dispred#f0820431#fff ON FIRST 2 OUTPUT Rhs.2, Lhs.0, Lhs.2 'this', Lhs.3, Lhs.4
64721 ~0% {5} r4 = JOIN r3 WITH AST::AstNode::getLocation#dispred#f0820431#bf ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2 'this', Lhs.3, Lhs.4
64721 ~3% {6} r5 = JOIN r4 WITH Locations::Location::hasLocationInfo#dispred#f0820431#ffffff ON FIRST 1 OUTPUT Rhs.1 'filepath', Lhs.1, Lhs.2 'this', Lhs.3, Lhs.4, Rhs.4 'endline'
353247577 ~1% {10} r6 = JOIN r5 WITH Locations::Location::hasLocationInfo#dispred#f0820431#ffffff_1023#join_rhs ON FIRST 1 OUTPUT Lhs.1, 0, Lhs.2 'this', Lhs.3, Lhs.4, Lhs.0 'filepath', Lhs.5 'endline', Rhs.1, Rhs.2 'startline', Rhs.3
353247577 ~0% {9} r7 = JOIN r6 WITH Literal::StringlikeLiteral::getComponent#dispred#f0820431#fff ON FIRST 2 OUTPUT Rhs.2, Lhs.7, Lhs.2 'this', Lhs.3, Lhs.4, Lhs.5 'filepath', Lhs.6 'endline', Lhs.8 'startline', Lhs.9
64721 ~2% {6} r8 = JOIN r7 WITH AST::AstNode::getLocation#dispred#f0820431#bf ON FIRST 2 OUTPUT Lhs.2 'this', Lhs.5 'filepath', Lhs.7 'startline', (Lhs.8 + Lhs.3), Lhs.6 'endline', ((Lhs.8 + Lhs.4) - 1)
return r8
```
After:
```
[2022-03-23 14:58:35] (247s) Tuple counts for RegExpTreeView::RegExpTerm::componentHasLocationInfo#f0820431#fbfffff/7@de55ac7l after 1.1s:
12956 ~0% {3} r1 = SCAN files OUTPUT In.0, 0, In.1 'filepath'
9850785 ~0% {7} r2 = JOIN r1 WITH locations_default_102345#join_rhs ON FIRST 1 OUTPUT Rhs.1, 0, Lhs.2 'filepath', Rhs.2 'startline', Rhs.3 'startcolumn', Rhs.4 'endline', Rhs.5 'endcolumn'
823486 ~0% {8} r3 = JOIN r2 WITH AST::AstNode::getLocation#dispred#f0820431#bf_10#join_rhs ON FIRST 1 OUTPUT 0, Rhs.1, 0, Lhs.2 'filepath', Lhs.3 'startline', Lhs.4 'startcolumn', Lhs.5 'endline', Lhs.6 'endcolumn'
698251 ~4% {7} r4 = JOIN r3 WITH Literal::StringlikeLiteral::getComponent#dispred#f0820431#fff_120#join_rhs ON FIRST 2 OUTPUT Rhs.2, 0, Lhs.3 'filepath', Lhs.4 'startline', Lhs.5 'startcolumn', Lhs.6 'endline', Lhs.7 'endcolumn'
64721 ~1% {7} r5 = JOIN r4 WITH RegExpTreeView::RegExpTerm#7783c185#ffff_10#join_rhs ON FIRST 1 OUTPUT Rhs.1 'this', 0, Lhs.2 'filepath', Lhs.3 'startline', Lhs.4 'startcolumn', Lhs.5 'endline', Lhs.6 'endcolumn'
return r5
[2022-03-23 14:58:35] (247s) Tuple counts for RegExpTreeView::RegExpTerm::hasLocationInfo#dispred#f0820431#ffffff/6@ad66b12q after 53ms:
707103 ~7% {2} r1 = SCAN Literal::StringlikeLiteral::getNumberOfComponents#dispred#f0820431#ff OUTPUT In.0, (In.1 - 1)
64721 ~0% {4} r2 = JOIN r1 WITH RegExpTreeView::RegExpTerm#7783c185#ffff_1023#join_rhs ON FIRST 1 OUTPUT Rhs.1 'this', Lhs.1, Rhs.2, Rhs.3
64721 ~5% {5} r3 = JOIN r2 WITH project#RegExpTreeView::RegExpTerm::componentHasLocationInfo#f0820431#bffffff ON FIRST 2 OUTPUT Lhs.0 'this', Rhs.2 'filepath', Lhs.2, Lhs.3, Rhs.3 'endline'
64721 ~2% {6} r4 = JOIN r3 WITH project#RegExpTreeView::RegExpTerm::componentHasLocationInfo#f0820431#fbfffff ON FIRST 2 OUTPUT Lhs.0 'this', Lhs.1 'filepath', Rhs.2 'startline', (Rhs.3 + Lhs.2), Lhs.4 'endline', ((Rhs.3 + Lhs.3) - 1)
return r4
```
2022-03-23 14:55:06 +01:00
Geoffrey White
9ae1ec69dc
C++: Autoformat.
2022-03-23 13:37:39 +00:00
Michael Nebel
6804e20e4a
Merge pull request #8451 from michaelnebel/csharp/modelgenerator-improvements
...
C#: Model generator improvements and more tests
2022-03-23 13:30:58 +01:00
Arthur Baars
06a99c3987
Ruby: fix location of setter-call argument
2022-03-23 12:55:52 +01:00
github-actions[bot]
1e620c99c6
JS: Bump patch version of ML-powered library and query packs post-release
2022-03-23 11:53:34 +00:00
github-actions[bot]
dc0c8374d2
JS: Bump minor version of ML-powered library and query packs
2022-03-23 11:47:53 +00:00
github-actions[bot]
2b42d84ccd
JS: Bump patch version of ML-powered model pack post-release
2022-03-23 11:47:53 +00:00
github-actions[bot]
6fbc0e6e32
JS: Bump ML model pack dependency of ML-powered model building and query packs
2022-03-23 11:47:53 +00:00
github-actions[bot]
8d13662315
JS: Bump minor version of ML-powered model pack
2022-03-23 11:47:08 +00:00
Rasmus Lerchedahl Petersen
93336bcb16
python: allow alternative middleware
...
(observed [on LGTM](9d6a7ee180/files/mozillians/settings.py (L96) ))
2022-03-23 12:27:51 +01:00
yoff
647d37492d
Merge pull request #8289 from tausbn/python-remove-with-test-syntax-error
...
Python: Fix syntax error in `with` test output
2022-03-23 12:25:11 +01:00
Rasmus Lerchedahl Petersen
6c2449564a
python: add concept tests
2022-03-23 12:05:09 +01:00
Mathias Vorreiter Pedersen
a81024a485
Merge pull request #8525 from MathiasVP/more-precise-is-before
...
C++: Consider columns in `Location.isBefore`
2022-03-23 11:04:34 +00:00
Mathias Vorreiter Pedersen
0eab54d385
Merge pull request #8491 from jketema/command-line-injection-with-flow-state
...
C++: Use flow states in `cpp/command-line-injection`
2022-03-23 11:03:29 +00:00
Rasmus Lerchedahl Petersen
441e206cfa
python: CSRF -> Csrf
2022-03-23 11:29:27 +01:00
Michael Nebel
b204f783fb
C#: Remove special handling of bulk types.
2022-03-23 11:26:49 +01:00
Rasmus Wriedt Larsen
671889372b
Ruby: Update wording of change-note
...
Co-authored-by: Nick Rolfe <nickrolfe@github.com >
2022-03-23 11:26:41 +01:00
Rasmus Wriedt Larsen
e66932c728
Ruby: Make deprecated getURL work with new modeling
...
So an "old" query using the deprecated predicate, will still find the
same results, even when the modeling has been updated.
2022-03-23 11:22:34 +01:00
Tom Hvitved
4bcd4d75a9
Address review comments
2022-03-23 11:22:25 +01:00
Asger Feldthaus
f2285709bd
JS: Change note
2022-03-23 10:42:51 +01:00
Asger Feldthaus
59d5c54432
JS: Update test output from knex
2022-03-23 10:42:51 +01:00
Asger Feldthaus
73071bdc08
JS: Change getAParameter to not return the receiver
2022-03-23 10:42:51 +01:00
Asger Feldthaus
6bef5a70b3
JS: Add dedicated API graph label for receiver, instead of parameter -1
2022-03-23 10:42:51 +01:00
Mathias Vorreiter Pedersen
a84ee50af0
Update cpp/ql/src/change-notes/2022-03-21-command-line-injection-with-flow-states.md
2022-03-23 09:35:41 +00:00
Michael Nebel
bbe28bc668
Java: Do not explicitly require python3 when executing the GenerateFlowModel.py.
2022-03-23 10:35:32 +01:00
Michael Nebel
7eddc1e7ec
Java: Adjust scripts for new location.
2022-03-23 10:35:32 +01:00
Michael Nebel
7fc11be787
Java: Move generate_flow_model file into a shared models-as-data script folder.
2022-03-23 10:35:32 +01:00
Michael Nebel
bd89de3c43
Java: Make sure to use python3 during workflow execution (required for python string interpolation).
2022-03-23 10:35:32 +01:00
Michael Nebel
6c9d1a3edb
Java: Make standalone library for shared functionality.
2022-03-23 10:35:32 +01:00
Michael Nebel
9564f8bf5c
Java: Put remainings parts of the generator code into the class.
2022-03-23 10:35:32 +01:00
Michael Nebel
20414c0e56
Java: Move Generator creation into class definition.
2022-03-23 10:35:32 +01:00
Michael Nebel
3f33cdf688
Java: Introduce generator class.
2022-03-23 10:35:32 +01:00
Michael Nebel
6ed1424679
Java: Refactor language specific parts into variable.
2022-03-23 10:35:32 +01:00
Michael Nebel
1ac988323a
Java: Add dry-run optional paramteter to generator script.
2022-03-23 10:35:31 +01:00
Michael Nebel
586fd5a43b
Java: Rename file for generating flow models.
2022-03-23 10:35:31 +01:00
Rasmus Wriedt Larsen
bbf60b875e
Merge pull request #8476 from RasmusWL/shared-concepts-scaffolding
...
Python/JS/Ruby: Shared concepts scaffolding
2022-03-23 10:22:42 +01:00
Paul1nh0
5a1dc61d9d
modify arguments check logic
...
As far as I can tell, root cause of double-fetech issue is read from the same user mode memory twice, so it makes sense that only check whether user mode pointer is same or not
2022-03-23 11:20:08 +08:00
Paul1nh0
6a6cd61d83
automated using CodeQL for VSCode extension
2022-03-23 09:37:45 +08:00
Mathias Vorreiter Pedersen
01929d484e
Merge pull request #8526 from MathiasVP/internal-diagmetric-queries-ql
...
C++: Add internal `ExtractionError` query
2022-03-22 17:26:38 +00:00
Robert Marsh
12ccf3662a
C#: match IR global variable changes
2022-03-22 13:22:37 -04:00
Robert Marsh
6be3db8575
C++: update test expectations for extractor changes
2022-03-22 13:01:56 -04:00
Owen Mansel-Chan
efc0d95535
Merge pull request #8528 from github/smowton/admin/fix-go-doc-links
...
Fix broken links
2022-03-22 16:25:41 +00:00
Taus
f9120167b4
Python: Fix syntax error in with test output
...
Depends on an internal PR. The two lines in question were caused by
the insertion of an extra node due to the failure to parse a trailing
comma corrcetly.
2022-03-22 16:22:03 +00:00
Jonathan Leitschuh
bd87be636a
Refactor to conditionCheckArgument deprecate old method
2022-03-22 11:56:43 -04:00
Rasmus Wriedt Larsen
64a5c5d9aa
Ruby: Keep getURL predicate for easier deprecation
...
Notice that we still don't fully keep our standard deprecation support,
since the new `getAUrlPart` is still abstract, and therefore will cause
compile errors if not implemented.
2022-03-22 16:48:14 +01:00
Paul1nh0
f2728f5284
delete some unused code
2022-03-22 23:20:30 +08:00
Chris Smowton
b5c05a580d
Java: Fix harmless search-replace mistake
2022-03-22 14:42:09 +00:00
yoff
47e062cfb9
Merge pull request #8486 from aibaars/incomplete-hostname-python
...
Python: switch to shared implementation of IncompleteHostnameRegExp.ql
2022-03-22 15:06:14 +01:00
Rasmus Lerchedahl Petersen
53de8287f5
python: rule out test code for CSRF
2022-03-22 14:57:05 +01:00
Erik Krogh Kristensen
8ae04e04d4
Merge pull request #8509 from erik-krogh/fpXss
...
JS: filter away reads of .src that end in a URL sink for js/xss-through-dom
2022-03-22 14:51:17 +01:00
Mathias Vorreiter Pedersen
c35b385383
C++: Fix 'implicit this' warning.
2022-03-22 13:32:46 +00:00
Tom Hvitved
c06508570a
Ruby: Cache ConstantReadAccess::getValue
2022-03-22 14:15:07 +01:00
Paul1nh0
afe4a8435f
Using globalValueNumber to match same arguments
2022-03-22 21:14:07 +08:00
Rasmus Lerchedahl Petersen
0f2c21c8bd
python: require local protection to be absent
...
for CSRF to be likely
2022-03-22 13:42:52 +01:00
Chris Smowton
35af797683
Fix broken links
2022-03-22 12:34:22 +00:00
Mathias Vorreiter Pedersen
93346a574f
C++: Add a new 'Location.isBefore' predicate that also considers columns.
2022-03-22 12:16:53 +00:00
Mathias Vorreiter Pedersen
c6c3206031
C++: Add example of 'goto' on the same line as the destination label.
2022-03-22 12:11:29 +00:00
Mathias Vorreiter Pedersen
5cdf0b5ee2
Merge pull request #8507 from geoffw0/sde-perf
...
C++: Make getUnderlyingType nomagic
2022-03-22 11:12:44 +00:00
Paul1nh0
d476493c3e
Add double-fetch.ql under CWE-362 directory
2022-03-22 19:08:44 +08:00
Paul1nh0
dd4e82126c
remove to another directory
2022-03-22 19:06:53 +08:00
Paul1nh0
2dad2c477b
query description added
2022-03-22 19:06:03 +08:00
Geoffrey White
5d5904d6c8
C++: Autoformat.
2022-03-22 10:55:04 +00:00
Mathias Vorreiter Pedersen
5cbd86519b
C++: Add internal extraction errors query and modify the 'code-scanning-selectors' to exclude internal queries.
2022-03-22 10:52:02 +00:00
Michael Nebel
b95a332ded
C#: Simplify the isCollectionType predicate.
2022-03-22 11:25:14 +01:00
Rasmus Wriedt Larsen
9254b2904e
Ruby: Adjust HttpClients test
2022-03-22 11:19:55 +01:00
Rasmus Wriedt Larsen
6bd9d82610
Merge pull request #8061 from RasmusWL/orm
...
Python: Add data-flow through Django ORM models
2022-03-22 11:14:08 +01:00
Rasmus Wriedt Larsen
945b52fc46
Ruby: autoformat
...
😳
2022-03-22 10:59:26 +01:00
Michael Nebel
1d45996001
Merge pull request #8466 from michaelnebel/csharp/refactor-aspartial
...
C#: Refactor asPartial to allow re-use.
2022-03-22 10:54:54 +01:00
Rasmus Wriedt Larsen
68de6a4e3c
Ruby: Add change-note
2022-03-22 10:53:55 +01:00
Rasmus Wriedt Larsen
9c2fc1b415
Ruby: client request: getUrl => getAUrlPart
...
This is a port of the same change in Python from
f8fc583af3
The description of that commit was:
> I think `getUrl` is a bit too misleading, since from the name, I would
> only ever expect ONE result for one request being made.
>
> `getAUrlPart` captures that there could be multiple results, and that
> they might not constitute a whole URl.
>
> Which is the same naming I used when I tried to model this a long time ago
> a80860cdc6/python/ql/lib/semmle/python/web/Http.qll (L102-L111)
2022-03-22 10:53:55 +01:00
Rasmus Wriedt Larsen
311cbb4e13
Merge branch 'main' into shared-concepts-scaffolding
2022-03-22 10:36:33 +01:00
Rasmus Wriedt Larsen
414764ccee
Concepts: Minor rewrite in qldoc
...
As suggested by @hmac
2022-03-22 10:33:58 +01:00
Rasmus Wriedt Larsen
e50a9421a6
JS: Update dataflow import in ConceptsImports.qll
...
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com >
2022-03-22 10:32:20 +01:00
Erik Krogh Kristensen
099d91ba6f
update qldoc
2022-03-22 10:27:21 +01:00
Tom Hvitved
99ddfb489f
Ruby: Rework getConstantValue implementation
2022-03-22 10:07:44 +01:00
Erik Krogh Kristensen
ea065b7d8a
Merge pull request #8521 from erik-krogh/getRubyMoreInSync
...
Ruby: sync ExponentialBackTracking.qll
2022-03-22 09:59:20 +01:00
Erik Krogh Kristensen
90a6717932
sync ExponentialBackTracking.qll for ruby
2022-03-22 09:27:04 +01:00
Tamás Vajk
36c7e10195
Merge pull request #8519 from github/revert-8294-tamasvajk/fix/mad-adjustments
...
Revert "Fix MaD workflows to be more resilient to missing files"
2022-03-22 09:19:14 +01:00
Tamás Vajk
87e1641772
Revert "Fix MaD workflows to be more resilient to missing files"
2022-03-22 09:08:56 +01:00
Tamás Vajk
80fb021e32
Merge pull request #8294 from github/tamasvajk/fix/mad-adjustments
...
Fix MaD workflows to be more resilient to missing files
2022-03-22 09:02:37 +01:00
Rasmus Lerchedahl Petersen
f5b53083ae
python: require authentication middleware
...
for CSRF to be relevant
2022-03-22 08:44:19 +01:00
Harry Maclean
99b5c580a5
Ruby: Fix captured reads in lambdas
...
These were previously identified as method calls. The fix is to
recognise lambdas as a scope which can inherit variables from its
parent.
2022-03-22 15:35:43 +13:00
Harry Maclean
c891e62a0e
Ruby: Add some tests for method calls in lambdas
...
This reveals a bug where we identify reads of captured variables in
lambdas as method calls. This is fixed in a followup commit.
2022-03-22 15:33:22 +13:00
Harry Maclean
3e8bc8b0f2
Merge pull request #8224 from github/hmac/http-to-file-access
...
Ruby: Add rb/http-to-file-access query
2022-03-22 13:46:36 +13:00
Jeroen Ketema
2d9b630fa8
C++: Fix ExecTainted.ql formatting
2022-03-21 23:28:58 +01:00
Harry Maclean
b1ae548f4c
Ruby: Fix doc comment formatting
2022-03-22 11:10:09 +13:00
Harry Maclean
c2d4bc50c9
Add missing file doc comment
2022-03-22 11:10:09 +13:00
Harry Maclean
91a7e9405c
Share HttpToFileAccessQuery between JS and Ruby
...
There's so little in this query that it may not be worth sharing, but
it's an interesting exercise in figuring out how we do it nicely.
2022-03-22 11:10:08 +13:00
Harry Maclean
130d93dded
Ruby: Make HttpToFileAccess more specific
...
Only consider sources from HTTP requests, rather than any remote flow
source.
2022-03-22 11:09:08 +13:00
Harry Maclean
fac17384c3
Ruby: Add RequestInputAccess concept
...
This sits in between RemoteFlowSource and specific classes like
ParamsSource from ActionController. It represents any user-controller
input from an incoming HTTP request.
This more closely aligns our concepts with the JS library, and allows us
to specifically target sources from HTTP requests in the
HttpToFileAccess query.
2022-03-22 11:09:08 +13:00
Harry Maclean
ff1d96c922
Ruby: Add rb/http-to-file-access query
2022-03-22 11:09:08 +13:00
Jeroen Ketema
b79eb6d10d
C++: Encode string value of data flow nodes in ExecState
2022-03-21 21:29:42 +01:00
Robert Marsh
23e9963a19
Merge branch 'main' into rdmarsh2/ir-global-vars
2022-03-21 16:13:40 -04:00
Robert Marsh
32e128d207
C#: sync IR files
2022-03-21 16:01:53 -04:00
Robert Marsh
5bb6441047
C++: Fix consistency issues with aggregate inits
2022-03-21 16:01:24 -04:00
Harry Maclean
6c18e1d7ac
Merge pull request #8272 from hmac/hmac/tainted-format-string
2022-03-22 08:37:47 +13:00
Rasmus Wriedt Larsen
88184ba9f5
Python: Update path-injection .expected
...
AHA! This change happened because we are no longer importing all the old
deprecated implementation.
2022-03-21 20:24:12 +01:00
Robert Marsh
a36c6f2dab
C++: restrict IR generation to global vars w inits
2022-03-21 14:26:29 -04:00
Mathias Vorreiter Pedersen
aff76b7295
Merge pull request #8512 from github/fix-dead-select-clause-link
...
Fix dead link in `CONTRIBUTING.md`
2022-03-21 17:39:07 +00:00
Robert Marsh
c27dfb5120
C++: IR translation for global variable inits
2022-03-21 13:17:05 -04:00
Mathias Vorreiter Pedersen
2e55fd6be3
Update CONTRIBUTING.md
...
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com >
2022-03-21 16:49:59 +00:00
Mathias Vorreiter Pedersen
cf54006c86
Fix dead link in CONTRIBUTING.md
...
cc @felicitymay.
2022-03-21 16:05:57 +00:00
Erik Krogh Kristensen
c8385a1e80
js/xss-through-dom: filter away reads of .src that end in a URL sink
2022-03-21 16:48:59 +01:00
Rasmus Wriedt Larsen
758a81cc0f
Python: Remove import of Concepts in DataFlowPrivate
...
As discussed in PR review
2022-03-21 16:22:15 +01:00
Jonathan Leitschuh
b3ee1bd313
Refactor Preconditions and add Tests
2022-03-21 11:20:05 -04:00
Rasmus Wriedt Larsen
978ef05571
Python: Add change-note
2022-03-21 16:18:40 +01:00
Rasmus Wriedt Larsen
b8dee25cce
Python: ReflectedXSS -> ReflectedXss for new Query file
...
So we stick to the naming conventions.
This rename is OK, since the new file was only just introduced in this
PR.
2022-03-21 16:12:38 +01:00
Arthur Baars
79cd7bf8ed
Python: create semmle/python/dataflow/new/Regex.qll
2022-03-21 15:57:19 +01:00
Jonathan Leitschuh
db0879ec25
Apply suggestions from code review
...
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com >
2022-03-21 10:35:13 -04:00
Rasmus Wriedt Larsen
695553ba9f
Python: Deprecate old non-Query.qll dataflow defs
2022-03-21 15:03:22 +01:00
Rasmus Wriedt Larsen
db86a18791
Python: Autoformat
2022-03-21 14:53:53 +01:00
Rasmus Wriedt Larsen
0125aea91b
Python: Re-introduce old dataflow configs .qll files
...
and move all the old deprecated aliases to that file. We now have a
situation where all queries should work as they did before, and we just
have these new Query.qll files that contain the implementation.
(deprecation comes later)
2022-03-21 14:53:53 +01:00
Rasmus Wriedt Larsen
1bf8fa6a3b
Python: Adopt Query.qll suffix for dataflow config defs
...
This commit in itself makes everything break, but should make it easy to
follow the overall changes being made.
2022-03-21 14:53:53 +01:00
Michael Nebel
92f8a90f31
C#: Introduce a collectionType predicate.
2022-03-21 14:44:38 +01:00
Michael Nebel
8e2277e4f3
C#: Improve some of the QL Doc string.
2022-03-21 14:24:51 +01:00
Michael Nebel
d31ef371ec
Merge pull request #8391 from michaelnebel/csharp/gvn-interface
...
C#: Deprecate the StructuralComparisonConfiguration interface and use sameGvn instead.
2022-03-21 14:10:53 +01:00
Geoffrey White
97fef4b3a5
C++: Switch strategy to nomagic.
2022-03-21 12:58:06 +00:00
Ian Lynagh
7295a5d313
Java: Add an upgrade script
2022-03-21 11:51:36 +00:00
Ian Lynagh
6284362868
Java: Update stats
2022-03-21 11:44:19 +00:00
Geoffrey White
7f825c12eb
C++: Make getUnderlyingType 'nomagic'.
2022-03-21 11:12:18 +00:00
Jeroen Ketema
e05227d3fe
C++: Add change note for the cpp/command-line-injection changes
2022-03-21 11:30:39 +01:00
Jeroen Ketema
8b4c42dd07
C++: Add cpp/command-line-injection test using a wrapper macro
2022-03-21 11:19:54 +01:00
ihsinme
151c93f502
Update DangerousUseOfExceptionBlocks.cpp
2022-03-21 09:52:14 +03:00
ihsinme
22cf3f7b20
Update test.cpp
2022-03-21 09:50:30 +03:00
Harry Maclean
5a6da827d0
Ruby: Avoid FP in TaintedFormatString query
...
Kernel#printf supports two call signatures:
printf(String, *args)
printf(IO, String, *args)
We want to identify the String argument, which is the format string.
Previously we would return the 0th and 1st arguments, which gives some
FPs when the 1st arg is not a format string.
We now try to rule out the trivial case by checking if arg 0 has a
string value, and then assuming it is the format string. Otherwise we
fall back to returning both arguments.
This still has some false positive potential, but less than previously.
2022-03-21 12:51:47 +13:00
Harry Maclean
5dcf0ad759
Ruby: Make IOPrintfCall more sensitive
...
It will now identify cases like this:
file = File.open "foo.txt", "a"
file.printf(params[:format], arg)
2022-03-21 12:51:47 +13:00
Harry Maclean
c253bddbe0
Ruby: Make getFormatArgument 0-indexed
2022-03-21 12:51:47 +13:00
Harry Maclean
c73dc8ad0c
Ruby: Add change note for rb/tainted-format-string
2022-03-21 12:51:47 +13:00
Harry Maclean
10a411e5cc
Ruby: Remove duplicate CWE reference
2022-03-21 12:51:47 +13:00
Harry Maclean
d79a6ddcb2
Ruby: Improve qhelp for rb/tainted-format-string
2022-03-21 12:51:47 +13:00
Harry Maclean
0cfe37dff4
Share TaintedFormatString between Ruby and JS
2022-03-21 12:51:46 +13:00
Harry Maclean
4249e30824
Ruby: Test tainted interpolated format arg
2022-03-21 12:51:18 +13:00
Harry Maclean
63199024a2
Add missing QLDoc
2022-03-21 12:51:18 +13:00
Harry Maclean
f6215d4c7e
Ruby: Add rb/tainted-format-string query
2022-03-21 12:51:18 +13:00
Alex Ford
b79bb72153
Ruby: split up CipherInstantiation charpred
2022-03-20 18:32:47 +00:00
Jonathan Leitschuh
1d0275344d
[Java]: Add precondition support for testing library asserts
2022-03-18 20:39:24 -04:00
Jeroen Ketema
f8198c3123
C++: Use flow states in cpp/command-line-injection
2022-03-18 20:06:45 +01:00
Arthur Baars
9412b331db
Revert "Revert "Python: switch to shared implementation of IncompleteHostnameRegExp.ql""
...
This reverts commit 6d24591416 .
2022-03-18 16:31:22 +01:00
Arthur Baars
bf888f0f0b
Merge remote-tracking branch 'upstream/main' into incomplete-url-string-sanitization
...
Conflicts:
config/identical-files.json
javascript/ql/src/Security/CWE-020/IncompleteUrlSubstringSanitization.ql
javascript/ql/src/Security/CWE-020/IncompleteUrlSubstringSanitization.qll
ruby/ql/src/queries/security/cwe-020/IncompleteUrlSubstringSanitization.qll
2022-03-18 16:09:20 +01:00
Alex Ford
2bd25da8e3
Ruby: Tidy an exists
2022-03-18 14:43:45 +00:00
Alex Ford
62bc0357ea
Ruby: Improve Cryptography module qldoc
2022-03-18 14:38:14 +00:00
Erik Krogh Kristensen
693c77f3df
add test for string replacement chains of URL schemes
2022-03-18 11:05:59 +01:00
Erik Krogh Kristensen
235aa9c24e
recognize string replacement chains as scheme checks in js/incomplete-url-scheme-check
2022-03-18 10:37:20 +01:00
Geoffrey White
ff3bedcab9
C++: Fix expensive getWideCharType().
2022-03-17 14:41:57 +00:00
Rasmus Wriedt Larsen
2b9408b0c3
Concepts: Add some architecture documentation
2022-03-17 13:49:10 +01:00
Harry Maclean
36c421346b
Introduce ConceptsShared.qll
2022-03-17 13:49:10 +01:00
4B5F5F4B
d4c7314484
Delete cve-2016-6480.ql
...
commit by mistake
2022-03-17 09:49:28 +08:00
Dave Bartolomeo
606e015afb
Update cpp/ql/lib/experimental/semmle/code/cpp/semantic/analysis/RangeAnalysis.qll
...
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com >
2022-03-16 13:07:35 -04:00
Dave Bartolomeo
e275ab3951
Update cpp/ql/lib/experimental/semmle/code/cpp/semantic/analysis/RangeAnalysisSpecific.qll
...
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com >
2022-03-16 13:07:15 -04:00
Dave Bartolomeo
6adc11b10e
Update cpp/ql/lib/experimental/semmle/code/cpp/semantic/analysis/RangeAnalysisSpecific.qll
...
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com >
2022-03-16 13:07:08 -04:00
Dave Bartolomeo
b36281dd8c
Update cpp/ql/lib/experimental/semmle/code/cpp/semantic/analysis/RangeAnalysisSpecific.qll
...
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com >
2022-03-16 13:07:02 -04:00
Dave Bartolomeo
db4963ada0
Update cpp/ql/lib/experimental/semmle/code/cpp/semantic/analysis/RangeAnalysisSpecific.qll
...
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com >
2022-03-16 13:06:54 -04:00
Michael Nebel
4a68b74aa3
C#: Re-use the asPartialModel for DataFlowPrivate in tests.
2022-03-16 17:02:00 +01:00
Michael Nebel
115cef2484
C#: Move asPartialModel into DataFlowPrivate (to enable re-use).
2022-03-16 16:44:24 +01:00
Arthur Baars
f95e1efb67
Ruby: remove wrong clause
2022-03-16 16:25:42 +01:00
Arthur Baars
fb8cc6e1a4
Ruby: String.index method returns 'nil', not '-1'
2022-03-16 16:18:19 +01:00
Michael Nebel
138eb485c6
C#: Address review comments.
2022-03-16 16:00:48 +01:00
Dave Bartolomeo
571c034549
Update cpp/ql/lib/experimental/semmle/code/cpp/semantic/analysis/RangeAnalysisSpecific.qll
...
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com >
2022-03-16 10:14:45 -04:00
Tony Torralba
8790df7a34
Style fixes
2022-03-16 15:11:04 +01:00
Arthur Baars
f2ec5132ba
Apply suggestions from code review
...
Co-authored-by: Nick Rolfe <nickrolfe@github.com >
2022-03-16 14:46:34 +01:00
Ian Lynagh
565f607096
Java: Add a changenote for ErrorExpr/ErrorStmt
2022-03-16 13:20:33 +00:00
Geoffrey White
95a63a69a5
Merge branch 'main' into cwe497b
2022-03-16 11:09:46 +00:00
Rasmus Wriedt Larsen
ae1ba11d57
Merge branch 'main' into orm
2022-03-16 11:23:14 +01:00
Paul1nh0
85b22647ac
Add query for double-fetch vulnerability
2022-03-16 18:16:49 +08:00
4B5F5F4B
2a29c201ff
Merge branch 'github:main' into main
2022-03-16 18:06:16 +08:00
Rasmus Wriedt Larsen
f1e6271d20
Python: Apply suggestions from code review
...
Co-authored-by: yoff <lerchedahl@gmail.com >
2022-03-16 10:53:19 +01:00
4B5F5F4B
baf1c8d76b
Create cve-2016-6480.ql
2022-03-16 17:49:05 +08:00
Rasmus Wriedt Larsen
461e2f3663
Python: Apply suggestions from code review
...
Co-authored-by: yoff <lerchedahl@gmail.com >
2022-03-16 10:43:20 +01:00
Michael Nebel
8b16c1f585
C#: Add some test cases for inheritance.
2022-03-16 10:40:49 +01:00
Michael Nebel
e69ea8f577
C#: Add some testcases for generics.
2022-03-16 10:20:55 +01:00
jorgectf
f6eb83fd22
Update MyBatisAnnotationSqlInjection.qlref
...
By adding more imports in the test file, the expected result's lines changed.
2022-03-16 10:12:38 +01:00
Michael Nebel
814947b876
C#: Add some test cases for methods that are not properly exposed and will this not get their summary captured.
2022-03-16 09:47:14 +01:00
Michael Nebel
a555e04b55
C#: Bulk array flow.
2022-03-16 09:30:15 +01:00
Michael Nebel
226a874a74
C#: Test cases for IEnumerable.
2022-03-16 09:22:18 +01:00
Michael Nebel
ec6dab89d8
C#: Update the Summary model generator with better support for IEnumerable typed parameters.
2022-03-16 09:21:02 +01:00
ihsinme
ccbb4434de
Update DangerousUseOfExceptionBlocks.expected
2022-03-16 09:54:35 +03:00
ihsinme
cd561dd19c
Update test.cpp
2022-03-16 09:53:45 +03:00
ihsinme
2959150198
Update DangerousUseOfExceptionBlocks.ql
2022-03-16 09:30:38 +03:00
Geoffrey White
92d748e006
C++: Fix ODR/dbcheck issue in test.
2022-03-15 20:00:19 +00:00
Dave Bartolomeo
7359e3253d
Fix reference to deprecated predicate
2022-03-15 15:59:35 -04:00
Dave Bartolomeo
62553ab089
Merge remote-tracking branch 'upstream/main' into semantic-scratch
2022-03-15 15:53:50 -04:00
Dave Bartolomeo
f22c91b762
Update cpp/ql/lib/experimental/semmle/code/cpp/semantic/analysis/RangeUtils.qll
...
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com >
2022-03-15 15:01:32 -04:00
Dave Bartolomeo
c8a0a86354
Fix Code Scanning warning
2022-03-15 14:53:43 -04:00
Dave Bartolomeo
7623b3d04d
Update cpp/ql/lib/experimental/semmle/code/cpp/semantic/SemanticType.qll
...
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com >
2022-03-15 14:49:20 -04:00
Dave Bartolomeo
ea9a5b782c
Don't bother hiding toString() and getLocation()
2022-03-15 14:47:26 -04:00
Ian Lynagh
2116e6d120
Java: Add ErrorExpr, ErrorStmt
2022-03-15 17:30:19 +00:00
jorgectf
e0952ba432
Fix change note
...
Thanks @atorralba!
2022-03-15 16:41:32 +01:00
jorgectf
3356bc4085
Add change note
2022-03-15 16:26:34 +01:00
Geoffrey White
46f3f28a11
C++: Fix broken merge.
2022-03-15 14:53:25 +00:00
Michael Nebel
4f2678fc72
C#: Add some testcases for model generation of methods using Lists.
2022-03-15 15:44:06 +01:00
Michael Nebel
a9bbe6889b
C#: Use CollectionType instead of ArrayType when generating models.
2022-03-15 15:41:46 +01:00
Geoffrey White
71e0da738d
Merge branch 'main' into cwe497b
2022-03-15 13:29:32 +00:00
jorgectf
ed198709b4
Refactor MyBatisAbstractSQLMethodsStep
...
Set output to `Argument[-1]` instead of `ReturnValue` to be able to get rid of `MyBatisAbstractSQLAnonymousClassStep`.
Thanks @pwntester!
2022-03-15 13:46:06 +01:00
jorgectf
9aa440e5b6
Refactor MyBatisAbstractSQLMethodsStep and MyBatisAbstractSQLMethod
...
See https://github.com/github/codeql/pull/8345\#discussion_r826734537
2022-03-15 13:23:23 +01:00
Geoffrey White
28315df405
Merge branch 'main' into cwe497b
2022-03-15 11:23:00 +00:00
Dave Bartolomeo
72725875a5
Undo debugging changes
2022-03-15 06:05:33 -04:00
Dave Bartolomeo
c9fbf83c1c
Working range analysis for C++
2022-03-15 06:02:54 -04:00
Dave Bartolomeo
f53a66b52a
Add working sign and modulus analysis
2022-03-15 05:16:23 -04:00
Michael Nebel
ba67ea0445
C#: Fix performance issue with UselessNullCoalescingExpression query.
2022-03-15 09:09:45 +01:00
ihsinme
62ecf54aaa
Update DangerousUseOfExceptionBlocks.cpp
2022-03-15 08:53:38 +03:00
ihsinme
e99eaeb256
Apply suggestions from code review
...
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com >
2022-03-15 08:53:00 +03:00
Robert Marsh
143b79c0cc
C++/WIP: Generate IR for global variables
2022-03-14 17:12:30 -04:00
jorgectf
f10dac31f9
Format some tests
2022-03-14 22:12:22 +01:00
Robert Marsh
bf21a471ed
C++: add some global variables to IR tests
2022-03-14 17:11:36 -04:00
jorgectf
b62b8c8d28
Use SummaryModelCsv for the toString taint step
2022-03-14 21:47:06 +01:00
jorgectf
c683b48af7
Add MyBatisInjectionSink's QLDoc
2022-03-14 21:41:36 +01:00
jorgectf
8482c01959
Make MyBatisProviderStep an AdditionalValueStep
2022-03-14 21:35:26 +01:00
jorgectf
32f494eba1
Use SummaryModelCsv in MyBatisAbstractSQLMethodsStep
2022-03-14 21:32:55 +01:00
jorgectf
d47fcedd21
Add tests
2022-03-14 21:31:51 +01:00
Jorge
158366ab46
Apply suggestions from code review
...
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com >
2022-03-14 21:27:37 +01:00
Geoffrey White
73710e9edb
C++: Fix QLDoc.
2022-03-14 19:11:43 +00:00
Geoffrey White
7c93eb1eaf
C++: Fix large newtype.
2022-03-14 19:06:41 +00:00
Geoffrey White
d1b04b4e07
C++: Use asDefiningArgument() where appropriate.
2022-03-14 17:53:47 +00:00
Dave Bartolomeo
20c3cfb1a0
Squash a few sign analysis diffs due to range analysis fixes
2022-03-14 13:07:45 -04:00
Michael Nebel
432ac7a824
C#: Deprecate the StructuralComparisonConfig class.
2022-03-14 14:17:56 +01:00
Michael Nebel
5a4a97569f
C#: Use Gvn comparison instead of StructuralComparisonConfiguration in Constants.
2022-03-14 14:17:56 +01:00
Michael Nebel
5b5ea140d2
C#: Delete the Internal StructuralComparisonConfiguration class as it is no longer needed.
2022-03-14 14:17:56 +01:00
Michael Nebel
bf4dc0034a
C#: Use Gvn comparison instead of StructuralComparisonConfiguration in Guards.
2022-03-14 14:17:56 +01:00
Michael Nebel
90b4eb9e13
C#: Use Gvn comparison instead of StructuralComparisonConfiguration in UnsafeLazyInitialization.
2022-03-14 14:17:56 +01:00
Michael Nebel
74b8e73133
C#: Use Gvn comparison instead of StructuralComparisonConfiguration in MissedTernaryOpportunity.
2022-03-14 14:17:56 +01:00
Michael Nebel
94999d4df5
C#: Use Gvn comparison instead of StructuralComparisonConfiguration in UselessIsBeforeAs.
2022-03-14 14:17:56 +01:00
Michael Nebel
8e7c7d8259
C#: Use Gvn comparison instead of StructuralComparisonConfiguration in UselessNullCoalescingExpression.
2022-03-14 14:17:56 +01:00
Michael Nebel
4a1981edfd
C#: Use Gvn comparison instead of StructuralComparisonConfiguration in NestedLoopsSameVariable.
2022-03-14 14:17:56 +01:00
Michael Nebel
b4f2fc60ec
C#: Use Gvn comparison instead of StructuralComparisonConfiguration in SelfAssignment.
2022-03-14 14:17:56 +01:00
Michael Nebel
f241eef2ea
C#: Use Gvn comparison instead of StructuralComparisonConfiguration in structuralComparison test.
2022-03-14 14:17:56 +01:00
Michael Nebel
6f5b2e8440
C#: Use Gvn comparison instead of StructuralComparisonConfiguration in UseTryGetValue.
2022-03-14 14:17:56 +01:00
jorgectf
a0bf68f7cd
Generally extend TaintTracking::AdditionalTaintStep
2022-03-14 13:39:20 +01:00
Alex Ford
6eca036b44
Ruby: Add qldoc for Cryptography module (from python version)
2022-03-14 08:57:13 +00:00
Tony Torralba
1f4f4207b5
Add missing security-severity scores
2022-03-14 09:50:14 +01:00
4B5F5F4B
597603a3a6
Create cve-2017-5123.ql
...
Add query to detect CVE-2017-5123
2022-03-14 09:44:30 +08:00
4B5F5F4B
4030561eb7
Delete CVE
2022-03-14 09:43:04 +08:00
4B5F5F4B
880c12bd34
Create CVE
2022-03-14 09:42:40 +08:00
Alex Ford
fc232ce55f
Ruby: changenote for rb/weak-cryptographic-algorithm
2022-03-13 21:25:28 +00:00
Alex Ford
94d5f3bb1f
Ruby: Add rb/weak-cryptographic-algorithm query
2022-03-13 21:25:28 +00:00
Alex Ford
40b87e6df7
Ruby: tests for rb/weak-cryptographic-algorithm
2022-03-13 21:25:24 +00:00
Alex Ford
446141ada3
Ruby: qhelp for rb/weak-cryptographic-algorithm
2022-03-13 21:25:12 +00:00
Alex Ford
4234cfeeec
Ruby: model CipherOperations for OpenSSL
2022-03-13 21:21:52 +00:00
Alex Ford
489391eb4c
Ruby: add CryptographicOperation concept
2022-03-13 21:21:52 +00:00
Dave Bartolomeo
afa3399e27
Zero diffs between Java AST and Semantic range analysis
2022-03-13 13:38:21 -04:00
jorgectf
ded9663f2b
Finish taint steps
2022-03-13 13:59:03 +01:00
Dave Bartolomeo
8b4d6a26ef
Performance improvements for semantic layer construction
2022-03-12 11:28:12 -05:00
Ahmed Farid
3c9de6f488
Update Zip.qll
2022-03-11 18:50:37 +01:00
Ahmed Farid
f092cd8d80
Update Zip.qll
2022-03-11 14:15:05 +01:00
Ahmed Farid
eb71cdf7a2
Update ZipSlip.ql
2022-03-11 14:13:28 +01:00
Ahmed Farid
0de1cef26e
Update ZipSlip.qll
2022-03-11 14:03:17 +01:00
Taus
4ee4bba4d1
Merge branch 'main' into ZipSlip
2022-03-10 13:30:51 +01:00
Dave Bartolomeo
00ae5de780
Make semantic modulus analysismatch Java results
2022-03-09 18:06:43 -05:00
Arthur Baars
747c7f6b5e
JS/Ruby: share implementation of IncompleteUrlSubstringSanitization query
2022-03-09 12:11:14 +01:00
Dave Bartolomeo
ec3e643120
Remove direct dependencies on import java
2022-03-09 00:06:17 -05:00
jorgectf
447636bf1c
Attempt to add MyBatis' sinks and taint steps to SQL and OGNL injection queries
2022-03-09 04:21:26 +01:00
jorgectf
e000163614
Properly model AbstractSQL sinks and taint steps
2022-03-09 04:20:34 +01:00
Ahmed Farid
475cca0d7e
Update ZipSlip.qll
2022-03-09 00:00:52 +01:00
Ahmed Farid
27b9d6c752
Update ZipSlip.qll
2022-03-08 23:59:03 +01:00
Ahmed Farid
23bd53a325
Update zipslip_good.py
2022-03-08 23:55:17 +01:00
Dave Bartolomeo
09a5fded1c
Clean up SemanticCFG
2022-03-08 17:36:13 -05:00
Dave Bartolomeo
04fae43734
Minimize language-specific code for sign analysis
2022-03-08 17:13:06 -05:00
Geoffrey White
9ebdb2ac1d
C++: QLDoc.
2022-03-08 16:12:58 +00:00
Arthur Baars
49b4fe77ad
Add missing QLdoc
2022-03-07 17:59:06 +01:00
Arthur Baars
a1873cc803
Ruby: IncompleteUrlSubstringSanitization.ql
2022-03-07 16:17:32 +01:00
Arthur Baars
c9fa1fb5bb
Ruby: copy JS version of IncompleteUrlSubstringSanitization.ql
2022-03-07 16:17:08 +01:00
Arthur Baars
eeb9a1d270
JavaScript: fix typos in documentation
2022-03-07 16:09:13 +01:00
Rasmus Lerchedahl Petersen
895ce755c1
python: correct file name
2022-03-07 13:03:04 +01:00
Geoffrey White
cb33ed4fc2
C++: Only look for sensitive strings in appropriate parameters.
2022-03-07 11:29:09 +00:00
Geoffrey White
f1d6234483
C++: Add more information about registry query parameters.
2022-03-07 09:45:31 +00:00
Ahmed Farid
3b8c7e8944
Update ZipSlip.expected
2022-03-07 10:11:34 +01:00
Ahmed Farid
8402d661df
Update zipslip_bad.py
2022-03-07 10:11:00 +01:00
Ahmed Farid
6685c6b4b3
Update ZipSlip.qll
2022-03-07 10:09:53 +01:00
Ahmed Farid
35a1c80ceb
Update zipslip_bad.py
2022-03-07 00:24:45 +01:00
Ahmed Farid
0d9436892a
Update zipslip_bad.py
2022-03-07 00:24:25 +01:00
Ahmed Farid
6233309028
Update ZipSlip.expected
2022-03-07 00:23:48 +01:00
Ahmed Farid
ce7923c8b3
Update zipslip_bad.py
2022-03-07 00:23:19 +01:00
Ahmed Farid
e8449d8f40
Update zipslip_bad.py
2022-03-07 00:23:03 +01:00
Ahmed Farid
b7d4715c4e
Create ZipSlip.expected
2022-03-07 00:06:24 +01:00
Ahmed Farid
b9b52d4c7c
Update zipslip_bad.py
2022-03-07 00:02:50 +01:00
Ahmed Farid
d7dacfc6bd
Update zipslip_good.py
2022-03-07 00:01:55 +01:00
Ahmed Farid
908db6a05f
Update zipslip_bad.py
2022-03-07 00:01:09 +01:00
Ahmed Farid
7f2d242702
Update zipslip_good.py
2022-03-06 23:59:11 +01:00
Ahmed Farid
8649375be3
Update ZipSlip.qll
2022-03-06 23:56:02 +01:00
Ahmed Farid
91b5f2ad34
Update Zip.qll
2022-03-06 23:54:46 +01:00
Ahmed Farid
466f75bad8
Update Concepts.qll
2022-03-06 23:53:00 +01:00
Geoffrey White
4316026720
C++: VariableAccess -> Expr.
2022-03-04 18:00:54 +00:00
Erik Krogh Kristensen
7691807713
delete the getLastParameter predicate from ApiGraphs
2022-03-04 16:24:54 +01:00
Rasmus Lerchedahl Petersen
93750fe17f
python: minimal CSRF implementation
...
- currectly only looks for custom django middleware
2022-03-04 12:47:23 +01:00
Erik Krogh Kristensen
934e06ca3b
fix mistake in argumentPassing. The type-tracking was not required to be in an end state
2022-03-04 09:49:42 +01:00
Ahmed Farid
be7c619ca8
Update zipslip_bad.py
2022-03-04 00:48:45 +01:00
Dave Bartolomeo
952e495ef5
New SemanticExpr implementation
...
Cleans up SignAnalysis to reduce need for language-specific enhancements
2022-03-03 18:18:58 -05:00
Ahmed Farid
5e14d89714
Update ZipSlip.qll
2022-03-03 17:12:06 +01:00
Geoffrey White
6848b6095b
C++: Autoformat.
2022-03-03 12:51:54 +00:00
Geoffrey White
5c6923c099
C++: Improve and differentiate the qhelp.
2022-03-03 11:04:55 +00:00
Geoffrey White
88b7a085b0
C++: Make the bulk of test cases in tests.cpp more relevant.
2022-03-03 10:40:17 +00:00
Geoffrey White
07b4bf7023
C++: Use the same trick as in ExposedSystemData to catch a few more results.
2022-03-03 10:33:39 +00:00
Geoffrey White
6e5729c924
C++: Fix typo and adjust violation message wording.
2022-03-03 10:28:53 +00:00
Geoffrey White
9e193f624c
C++: Change note.
2022-03-03 09:55:02 +00:00
Geoffrey White
2a14a4f14e
C++: Fill in metadata.
2022-03-02 18:52:52 +00:00
Geoffrey White
66b9356eb9
C++: There is no overlap between OutputWrite and RemoteFlowSinkFunction.
2022-03-02 18:16:39 +00:00
Geoffrey White
a1ace7122d
C++: Move SystemData class into a library.
2022-03-02 18:01:06 +00:00
Geoffrey White
70e4a409fd
C++: Add the new query to tests.
2022-03-02 17:56:53 +00:00
Geoffrey White
d95b56fca0
C++: Create prototype query.
2022-03-02 17:56:49 +00:00
Geoffrey White
67aa1449ce
C++: Add some more test cases (moved from the private repo).
2022-03-02 17:23:07 +00:00
Ahmed Farid
c45b67c316
Create zipslip_good.py
2022-03-02 18:10:24 +01:00
Ahmed Farid
aef1df122b
Create zipslip_bad.py
2022-03-02 18:09:45 +01:00
Ahmed Farid
c8f73ec845
Create ZipSlip.qlref
2022-03-02 18:08:32 +01:00
Geoffrey White
19718fa280
C++: Add a couple of new test cases.
2022-03-02 15:18:04 +00:00
Geoffrey White
da740cfa05
C++: Test layout.
2022-03-02 15:18:04 +00:00
Rasmus Wriedt Larsen
2309f67e9b
Python: Apply suggestions from code review
...
Co-authored-by: yoff <lerchedahl@gmail.com >
2022-03-01 15:50:21 +01:00
Rasmus Wriedt Larsen
27d5349a74
Python: ORM: Remove imports from test code
...
These are no longer needed, as data-flow now has this import by default
2022-03-01 15:39:52 +01:00
Rasmus Wriedt Larsen
a1c7ec8c6d
Python: Accept .exepcted changes from importing frameworks from data-flow
...
Since `python.qll` has `private import
semmle.python.dataflow.new.DataFlow`, that means that all tests now
implicitly imports the frameworks modeling, and therefore any python
class is part of the DjangoViewClassHelper ql class.
de8ecb214f/python/ql/lib/python.qll (L44)
2022-03-01 15:37:16 +01:00
Rasmus Wriedt Larsen
cd58c12bbe
Merge branch 'main' into orm
2022-03-01 12:01:54 +01:00
Rasmus Wriedt Larsen
98c60a706e
Python: Autoformat
...
Oops
2022-03-01 11:54:09 +01:00
Rasmus Wriedt Larsen
e32f8d98b0
Python: Always import ORM steps for data-flow
...
For C#, see
fdd787b89c/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll (L16)
that import EntityFramework, which is ORM library.
2022-03-01 11:32:36 +01:00
Ahmed Farid
70c0c7e461
Update zipslip_bad.py
2022-03-01 00:24:33 +01:00
Ahmed Farid
85bcaa96ce
Update Concepts.qll
2022-03-01 00:23:06 +01:00
Ahmed Farid
c22b032bbe
Update Zip.qll
2022-03-01 00:11:33 +01:00
Ahmed Farid
67d3498891
Update ZipSlip.ql
2022-03-01 00:07:37 +01:00
Ahmed Farid
b29936716d
Update Frameworks.qll
2022-03-01 00:06:22 +01:00
Ahmed Farid
76bd3317eb
Create Zip.qll
2022-03-01 00:05:30 +01:00
Ahmed Farid
abe25da3df
Create ZipSlip.qll
2022-03-01 00:04:02 +01:00
Ahmed Farid
3eae13161f
Delete ZipSlipCheckLib.ql
2022-03-01 00:01:34 +01:00
Ahmed Farid
21f6ad5190
Update and rename ZipSlipCheck.ql to ZipSlip.ql
2022-03-01 00:01:06 +01:00
Tamas Vajk
1538e89bd9
Use generate-report.py from base SHA
2022-02-28 20:36:23 +01:00
Tamas Vajk
bd30c63aa1
Fix expected file comparer to handle missing files better in MaD workflows
2022-02-28 20:16:20 +01:00
Tamas Vajk
714659c706
Change cp to mv in CSV coverage PR job
2022-02-28 20:07:23 +01:00
Rasmus Wriedt Larsen
8afd560c64
Python: ORM: Handle load of PolymorphicModels
2022-02-28 16:38:41 +01:00
Rasmus Wriedt Larsen
48fba87273
Python: ORM: add flow to base-class
2022-02-28 16:38:40 +01:00
Rasmus Wriedt Larsen
6b9dd49499
Python: ORM: Model polymorphic.models.PolymorphicModel as Django ORM class
2022-02-28 16:38:40 +01:00
Rasmus Wriedt Larsen
e1191cf63c
Python: ORM: Add tests for inheritance
2022-02-28 16:38:40 +01:00
Rasmus Wriedt Larsen
092cfceb18
Python: Add dataflow consistency checks to ORM tests
...
Luckily they passed :phew:
2022-02-28 16:38:40 +01:00
Rasmus Wriedt Larsen
d7ff00e615
Python: Add change-note
2022-02-28 16:38:40 +01:00
Rasmus Wriedt Larsen
ed36ff1570
Python: ORM: Handle <Model>.objects.[<QuerySet>].update()
2022-02-28 16:38:40 +01:00
Rasmus Wriedt Larsen
fea46b642d
Python: ORM: Handle <Model>.objects.create and friends
2022-02-28 16:38:40 +01:00
Rasmus Wriedt Larsen
9b458b54aa
Python: ORM: Add flow to collection/dict queries
2022-02-28 16:38:40 +01:00
Rasmus Wriedt Larsen
9cff4cbd1c
Python: ORM: Add a few more tests
...
There were a few methods I had overlooked
2022-02-28 16:38:40 +01:00
Rasmus Wriedt Larsen
ae057c74cc
Python: ORM: Store step for constructor
2022-02-28 16:38:40 +01:00
Rasmus Wriedt Larsen
f8a51bb994
Python: ORM: Add data-flow steps for Django ORM
...
Added dummy-whitespace to `orm_security_tests.py` so it would be
possible to see what the reflected XSS results are in the diff
2022-02-28 16:38:40 +01:00
Rasmus Wriedt Larsen
ef39968a56
Python: ORM: Add data-flow plumbing for ORM modeling
...
The idea is that we will do `save ==> synthetic`
and `synthetic ==> load`, so we don't need to do CP between save/load.
This setup with synthetic node in the middle, also allows for a limited
amount of the field-flow we can do with real flow-summary support.
2022-02-28 16:38:40 +01:00
Rasmus Wriedt Larsen
d3f07cdc10
Python: ORM: Add qltests
...
Which shows that there is no flow yet, which is not really a surprise :D
2022-02-28 16:38:40 +01:00
Rasmus Wriedt Larsen
c78fed6594
Python: ORM: Add raw python test files
...
no ql test files yet though, will come in next commit.
2022-02-28 16:38:40 +01:00
Rasmus Wriedt Larsen
f89fb50eb5
Python: ORM: Add boilerplate django project
...
By doing
```
django-admin startproject testproj
django-admin startapp testapp
```
2022-02-28 16:38:40 +01:00
Erik Krogh Kristensen
5130929358
remove comment suggesting that the receiver is parameter -1
2022-02-28 15:25:34 +01:00
Erik Krogh Kristensen
843ed8fca5
rename pw to aw
...
Co-authored-by: yoff <lerchedahl@gmail.com >
2022-02-28 15:25:25 +01:00
Ahmed Farid
c207294dfc
Update zipslip_good.py
2022-02-26 18:31:22 +01:00
Ahmed Farid
d0d14be693
Update ZipSlip.qhelp
2022-02-26 18:25:13 +01:00
luchua-bc
88d9694628
Query to detect insecure WebResourceResponse implementation
2022-02-26 02:03:35 +00:00
Erik Krogh Kristensen
4fba5e4dfb
step through parentheses in barrier functions
2022-02-25 17:47:12 +01:00
ihsinme
a9a2ca3850
Add files via upload
2022-02-25 11:09:25 +03:00
ihsinme
025701170e
Add files via upload
2022-02-25 11:07:48 +03:00
Erik Krogh Kristensen
ad3399733b
recognize more module exports from the factory pattern
2022-02-23 21:29:45 +01:00
Dave Bartolomeo
02bf008610
Fix formatting
2022-02-23 12:18:27 -05:00
Dave Bartolomeo
b11c55ff23
Fix mismatched results between semantic and AST range analysis
2022-02-22 18:19:38 -05:00
Erik Krogh Kristensen
cd4685c4c5
cache RegExpCreationNode::getAReference
2022-02-21 15:04:00 +01:00
Dave Bartolomeo
ac9e2d0c6d
Parallel semantic modulus analysis
2022-02-18 17:43:27 -05:00
Dave Bartolomeo
e2e2c0e540
Fix a few bugs to make results of semantic sign analysis match the original AST analysis
2022-02-18 17:03:10 -05:00
Dave Bartolomeo
99f24e5a9e
Fix up sign analysis and create diff query
2022-02-18 13:03:26 -05:00
Dave Bartolomeo
5bd5f39ad8
Try parallel versions of sign analysis, AST vs. semantic
2022-02-18 12:28:36 -05:00
root
5ed5e0b105
Add query to detect ZipSlip
2022-02-13 16:44:27 -05:00
Erik Krogh Kristensen
5e23da813f
rename named-parameters to keyword-parameters
2022-02-03 23:10:39 +01:00
Erik Krogh Kristensen
e434f075fa
introduce, and use, API::APICallNode
2022-02-03 23:10:39 +01:00
Erik Krogh Kristensen
3801a158a8
remove module exporst nodes from API graphs
2022-02-03 23:10:39 +01:00
Erik Krogh Kristensen
c3f4a851f0
remove some TODOs I won't do
2022-02-03 23:10:39 +01:00
Erik Krogh Kristensen
3be3da2eb6
add recursive API-graph test
2022-02-03 23:10:38 +01:00
Erik Krogh Kristensen
ef5818e243
support import * in ApiGraphs
2022-02-03 23:10:38 +01:00
Erik Krogh Kristensen
16774ba285
add support for named parameters in API graphs
2022-02-03 23:10:38 +01:00
Erik Krogh Kristensen
095c73f1fe
redo the ApiGraph testing framework
2022-02-03 23:10:38 +01:00
Erik Krogh Kristensen
66fd43fc3b
add def edge for function returns
2022-02-03 23:10:38 +01:00
Erik Krogh Kristensen
d8eea7ba4c
property writes are def nodes
2022-02-03 23:10:38 +01:00
Erik Krogh Kristensen
a908b219e9
more backtracking of def nodes, and lots of tests
2022-02-03 23:10:38 +01:00
Erik Krogh Kristensen
038b032a43
get basic module exports to work in API-graphs
2022-02-03 23:10:38 +01:00
Erik Krogh Kristensen
df9efbe778
get mimimal def nodes to work in python
2022-02-03 23:10:38 +01:00
Erik Krogh Kristensen
52ca0d168b
move API-graph tests out of the experimental test folder
2022-02-03 23:10:37 +01:00
Erik Krogh Kristensen
89786d9ce2
rename pr to ref in memberFromRef
2022-02-03 23:10:37 +01:00
Rasmus Wriedt Larsen
3e71d7f9bb
Python: Add note about / for Django upload_to
...
I did a test locally, something like
import requests
req = requests.Request(
"POST",
"http://127.0.0.1:8000/app/upload-test/ ",
data={"name": "foo"},
files={"upload" : ("wat/haha|!#$%^&", open("foo.txt", "rb"))},
)
# print(req.prepare().body.decode('ascii'))
requests.session().send(req.prepare())
and the `wat/` part was stripped from the filename
2022-01-28 12:17:46 +01:00
Rasmus Wriedt Larsen
f962d8e72c
Python: Move test to correct location
2022-01-28 11:33:21 +01:00
Rasmus Wriedt Larsen
4338c06b0d
Python: Support Django FileField.upload_to
2022-01-27 17:20:16 +01:00
jorgectf
840cded9b0
Avoid using Str_ in CookieHeader
2021-11-16 19:18:00 +01:00
jorgectf
a4204cc04f
Avoid using Str_ internal class
2021-11-16 19:00:04 +01:00
jorgectf
6ecb6d1a1b
Adapt Django and Flask to their main modelings
2021-11-16 14:59:41 +01:00
jorgectf
e7d649f36d
Make Cookie concept extend HTTP::Server::CookieWrite
2021-11-16 13:54:25 +01:00
jorgectf
83e3de1fed
Polish documentation.
2021-11-05 21:05:33 +01:00
jorgectf
ed74bd6800
Merge remote-tracking branch 'origin/main' into jorgectf/python/insecure-cookie
2021-11-05 20:14:06 +01:00
jorgectf
86aac7c215
Add/Update .expected files.
2021-11-05 20:13:12 +01:00
jorgectf
a420e6e18d
Add CookieInjection.qlref
2021-11-05 20:12:56 +01:00
jorgectf
cf47e8eb9c
Fix endpoints' naming
2021-11-05 20:12:35 +01:00
jorgectf
b3258ce20f
Add CookieInjection sample and .qhelp
2021-11-05 20:12:05 +01:00
jorgectf
d7a79469e6
Improve tests
2021-11-05 20:08:52 +01:00
jorgectf
4cb78ac654
Fix typo
2021-11-05 20:08:37 +01:00
jorgectf
cf9e9f9dd4
Add cookie injection query missing proper tests
2021-10-28 10:28:45 +02:00
jorgectf
129edd605e
Update .expected
2021-10-28 09:25:56 +02:00
jorgectf
5dc1ad6f8a
Polish .ql
2021-10-28 09:25:47 +02:00
jorgectf
0f2b81e0d2
Polish tests
2021-10-28 09:24:47 +02:00
jorgectf
48c3c3d8a8
Broaden scope
2021-10-27 21:00:50 +02:00
jorgectf
28ec8c9dee
Merge remote-tracking branch 'origin/main' into jorgectf/python/insecure-cookie
2021-10-27 19:00:55 +02:00
Erik Krogh Kristensen
a082ed917c
track flow through string replace calls that just replace single chars
2021-09-22 19:43:48 +02:00
jorgectf
54ed25a925
Change False and None scopes
2021-07-25 18:21:16 +02:00
jorgectf
c8a7f48d6e
Add .expected
2021-07-25 18:18:38 +02:00
jorgectf
983465963a
Polish CookieWrite
2021-07-25 18:18:29 +02:00
jorgectf
65044293dd
Add CookieWrite concept
2021-07-25 17:53:58 +02:00
jorgectf
66fdd530e3
Merge branch 'jorgectf/python/headerInjection' into jorgectf/python/insecure-cookie
2021-07-25 04:35:51 +02:00
jorgectf
4f68a1777c
Write documentation and example
2021-07-25 04:07:05 +02:00
jorgectf
c8983be947
Add query
2021-07-25 04:06:44 +02:00
jorgectf
8a3e4f14d1
Add tests and .qlref
2021-07-25 04:06:02 +02:00
jorgectf
0aaa9c13bd
Merge remote-tracking branch 'origin/jorgectf/python/headerInjection' into jorgectf/python/insecure-cookie
2021-07-25 03:22:16 +02:00