Compare commits

...

4189 Commits

Author SHA1 Message Date
Calum Grant
6c1337791e Add security-severity tags 2021-04-20 21:57:47 +01:00
yoff
ef0ea247c4 Merge pull request #5679 from tausbn/python-fix-bad-points-to-joins
Python: Fix bad points-to joins
2021-04-20 21:19:32 +02:00
Tom Hvitved
3eba5b0aac Merge pull request #5676 from hvitved/csharp/dispatch/get-a-viable-overrider-perf
C#: Speedup `DispatchMethodOrAccessorCall::getAViableOverrider()`
2021-04-20 19:57:59 +02:00
yo-h
00137f2905 Merge pull request #5721 from github/yo-h/java-diagnostic-queries
Java: add extractor `diagnostic` queries
2021-04-20 13:36:49 -04:00
Chris Smowton
a5cfdd2cfe Merge pull request #5467 from p0wn4j/groovy-execute
[Java] CWE-094: Query to detect Groovy Code Injections
2021-04-20 14:49:56 +01:00
Jonas Jensen
f02c86cb22 Merge pull request #5726 from MathiasVP/fix-false-positive-in-return-stack-allocated-memory-2
C++: Fix false positive in return stack allocated memory (second attempt)
2021-04-20 15:05:11 +02:00
Chris Smowton
9bfb0d93ca Autoformat QL 2021-04-20 13:59:09 +01:00
Rasmus Wriedt Larsen
897105de02 Merge pull request #5717 from tausbn/python-use-api-graphs-in-django
Python: Use API graphs in Django model
2021-04-20 14:57:55 +02:00
Taus
76700d17d6 Merge pull request #5684 from RasmusWL/flask-more-taint-tests
Python: Add taint tests for .get() in flask
2021-04-20 14:08:08 +02:00
Mathias Vorreiter Pedersen
93e55e2631 C++: Fix FP in cpp/return-stack-allocated-memory. 2021-04-20 13:58:12 +02:00
Mathias Vorreiter Pedersen
1797b6c7f9 C++: Add FP test from the work on smart pointers in dataflow. 2021-04-20 13:54:57 +02:00
Chris Smowton
0ec3ee29e4 Style last use of SecureASTCustomizer 2021-04-20 12:44:49 +01:00
Hayk Andriasyan
bb58a50503 Update GroovyInjection.qhelp 2021-04-20 15:41:58 +04:00
p0wn4j
f2de440886 [Java] CWE-094: Query to detect Groovy Code Injections 2021-04-20 19:18:24 +04:00
Jonas Jensen
d4fdd50e2c Merge pull request #5723 from MathiasVP/cleanup-smart-ptr-model
C++: Simplify smart pointer model
2021-04-20 13:25:02 +02:00
Tom Hvitved
1f9239089f Merge pull request #5695 from hvitved/csharp/dispose-not-called-on-exc-perf
C#: Improve performance of `DisposeNotCalledOnException.ql`
2021-04-20 11:52:18 +02:00
Tom Hvitved
b2a7a3ed30 Merge pull request #5674 from hvitved/csharp/ssa/call-graph-perf
C#: Improve performance of `SsaImpl::CallGraph::SimpleDelegateAnalysis`
2021-04-20 11:51:52 +02:00
Geoffrey White
2b7e599dc4 Merge pull request #5703 from MathiasVP/improve-access-of-memory-location-after-end-of-buffer-using-strncat
C++: Improve cpp/access-memory-location-after-end-buffer-strncat
2021-04-20 10:44:24 +01:00
Mathias Vorreiter Pedersen
61d4d17225 C++: Simplify smart pointer model and accept test changes. 2021-04-20 09:57:58 +02:00
yo-h
87cd72496c Java: add extractor diagnostic queries 2021-04-19 15:34:16 -04:00
yo-h
cb524b6c19 Merge pull request #5611 from github/yo-h/java16
Java: adjust test `options` for JDK 16 upgrade
2021-04-19 15:12:23 -04:00
Taus
bc6685aa3f Python: Fix typo
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-04-19 19:57:35 +02:00
Anders Schack-Mulligen
5458c02cc2 Merge pull request #5456 from aschackmull/java/adopt-flow-summary
Java: Use shared flow summary library for CSV models.
2021-04-19 16:21:10 +02:00
Anders Schack-Mulligen
33db0c13cd Merge pull request #5689 from github/aeisenberg/rework-staleness
Actions: Change staleness calculation
2021-04-19 15:57:41 +02:00
Anders Schack-Mulligen
80eb0a2df6 Apply suggestions from code review
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-19 15:45:58 +02:00
CodeQL CI
437bba1e3c Merge pull request #5716 from erik-krogh/vscodeRegress
Approved by esbena
2021-04-19 06:30:02 -07:00
Anders Schack-Mulligen
7d84cfacef Java: Add MapKeyContent and MapValueContent. 2021-04-19 14:06:27 +02:00
Anders Schack-Mulligen
39862740e0 Java: Convert support for fluent interfaces. 2021-04-19 14:06:27 +02:00
Anders Schack-Mulligen
579c955892 Java: Adjust some tests. 2021-04-19 14:06:27 +02:00
Anders Schack-Mulligen
175c71221a Java: Adjust some test output with more edges/nodes. 2021-04-19 14:06:27 +02:00
Anders Schack-Mulligen
60965b0d8c Java: Adjust some csv models. 2021-04-19 14:02:19 +02:00
Anders Schack-Mulligen
a27dac029f Java: Use shared flow summary library for csv models. 2021-04-19 14:02:19 +02:00
Chris Smowton
36abf8733e Merge pull request #5714 from aschackmull/java/add-misc-qltests
Java: Add a few qltests
2021-04-19 13:00:10 +01:00
Taus
9acc71a7cb Python: Get rid of all _attr methods in Django.qll 2021-04-19 11:54:10 +00:00
Erik Krogh Kristensen
9e6f28e335 fix bad join order in Xss.qll 2021-04-19 13:17:49 +02:00
Anders Schack-Mulligen
29aec0d770 Java: Adjust expected output. 2021-04-19 13:16:46 +02:00
Anders Schack-Mulligen
c5193cf03f Apply suggestions from code review 2021-04-19 13:14:56 +02:00
Anders Schack-Mulligen
06514159be Java: Add XXE tests. 2021-04-19 10:58:21 +02:00
Anders Schack-Mulligen
daad62c4e0 Java: Add TaintedPath test. 2021-04-19 10:07:03 +02:00
Jonas Jensen
1ab75eb6f4 Merge pull request #5708 from github/fix-id-in-JsonpInjection-1
Java: Fix id in experimental JsonpInjection.ql query
2021-04-19 08:23:34 +02:00
yoff
118840dad4 Merge pull request #5690 from tausbn/python-disallow-post-update-nodes-as-local-source-nodes
Python: Disallow `PostUpdateNode` as `LocalSourceNode`
2021-04-19 06:56:11 +02:00
Mathias Vorreiter Pedersen
e36b42a03f Java: Fix invalid id in experimental query
The invalid id broke CI here: https://github.com/github/codeql/pull/5703 (see https://github.slack.com/archives/CPSEA0G22/p1618602834224600)
2021-04-17 09:47:15 +02:00
Taus
f3661c34ee Python: Clean up Django models using API graphs
First sweep. Takes care of most of the models.
2021-04-16 19:53:36 +00:00
Mathias Vorreiter Pedersen
95742aec69 C++: Accept test changes for the other experimental query in the directory. This is only a change in line numbers. 2021-04-16 21:29:17 +02:00
Mathias Vorreiter Pedersen
64f8316a6d C++: Tidy up the ql file and accept test changes. 2021-04-16 21:22:13 +02:00
Mathias Vorreiter Pedersen
1e327289b2 C++: Add false negative test. 2021-04-16 18:38:51 +02:00
Mathias Vorreiter Pedersen
50abb6e3a1 C++: Cleanup test.c 2021-04-16 17:32:44 +02:00
Shati Patel
5c2bf68a05 Merge pull request #5692 from tamasvajk/feature/doc-cs9
Update supported C#/.NET versions
2021-04-16 16:22:06 +01:00
Tom Hvitved
40b74167e0 C#: Improve performance of DisposeNotCalledOnException.ql 2021-04-16 14:34:16 +02:00
Rasmus Wriedt Larsen
3c8ea167c4 Merge pull request #5668 from tausbn/python-use-api-graphs-in-fabric
Python: Use API graphs in Fabric model
2021-04-16 14:27:55 +02:00
Rasmus Wriedt Larsen
6ed1016bb8 Merge pull request #5669 from tausbn/python-use-api-graphs-for-invoke
Python: Use API graphs for Invoke
2021-04-16 14:27:19 +02:00
Taus
92b4eb7f02 Python: Cleanup and more explanation
Goes into some detail about the intended semantics of local source nodes
and `flowsTo`.
2021-04-16 11:54:20 +00:00
Geoffrey White
e1028a2765 Merge pull request #5667 from MathiasVP/use-range-analysis-in-overflow
C++: Use range analysis in Overflow.qll
2021-04-16 12:00:28 +01:00
Taus
5c79ad2412 Python: Apply suggestions from code review
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-04-16 11:38:29 +02:00
Taus
af0c32c01d Python: Apply suggestions from code review
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-04-16 11:35:12 +02:00
Anders Schack-Mulligen
605f28f741 Merge pull request #5686 from smowton/haby0/JsonHijacking
Java: JSONP Injection w/cleanups
2021-04-16 11:09:17 +02:00
Tom Hvitved
946fcf1c82 C#: Speedup DispatchMethodOrAccessorCall::getAViableOverrider()
In addition to improved performance, the analysis no longer applies a closed-world
assumption to type parameters. That is, if the type of a receiver is a type parameter,
then the call may target any method of a compatible receiver type, not just the
types that actually instantiate the type parameter.
2021-04-16 10:43:17 +02:00
Tamas Vajk
b0975bb3ea Update supported C#/.NET versions 2021-04-16 09:15:43 +02:00
Taus
451d36dc97 Python: Allow _some_ PostUpdateNodes
Specifically, allow the ones arising from calls, but not reads or
writes. This should fix the tests.
2021-04-15 21:26:12 +00:00
Taus
c9c8259ed0 Python: Disallow PostUpdateNode as LocalSourceNode
Previously, in cases like

```python
def foo(x):
    x.bar()
    x.baz()
    x.quux()
```

we would have flow from the first `x` to each use _and_ flow from the
post-update node for each method call to each subsequent use, and all
of these would be `LocalSourceNode`s. For large functions with the above
pattern, this would lead to a quadratic blowup in `hasLocalSource`.

With this commit, only the first of these will count as a
`LocalSourceNode`, and the blowup disappears.
2021-04-15 17:56:14 +00:00
Andrew Eisenberg
5d827b6fc8 Actions: Change staleness calculation
Calculate staleness on issues that have the
`Stale` label. Leave all other issues untouched.
2021-04-15 10:14:13 -07:00
Chris Smowton
c37994089c Revert changes to unrelated query 2021-04-15 16:24:29 +01:00
Chris Smowton
254de76078 Remove unnecessary stubs 2021-04-15 16:20:27 +01:00
haby0
dedf765542 Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjectionLib.qll
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-15 22:59:22 +08:00
Rasmus Wriedt Larsen
b359205d17 Python: Add taint tests for .get() in flask 2021-04-15 14:53:44 +02:00
CodeQL CI
578ce1e512 Merge pull request #5683 from asgerf/js/typescript-template-literal-type-crash
Approved by erik-krogh
2021-04-15 05:11:11 -07:00
Mathias Vorreiter Pedersen
7fbc62358e C++: Accept test changes after making the exprMightOverFlow predicates more sound. 2021-04-15 13:57:44 +02:00
haby0
0e183ab4a4 Finish comment 2021-04-15 19:49:06 +08:00
Chris Smowton
fa36ba901a Merge pull request #5471 from artem-smotrakov/el-injection
Java: Query for detecting Jakarta Expression Language injections
2021-04-15 12:39:34 +01:00
haby0
d269a7e717 CWE-598 reduction 2021-04-15 19:33:15 +08:00
haby0
216f204438 delete FilterClass 2021-04-15 19:28:25 +08:00
haby0
583d0889e2 delete tomcat-embed-core stub, update the ServletGetMethod class 2021-04-15 17:40:51 +08:00
haby0
5d05e4d224 Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjectionLib.qll
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-15 17:28:53 +08:00
Tom Hvitved
0f24db8759 C#: Improve performance of SsaImpl::CallGraph::SimpleDelegateAnalysis 2021-04-15 11:25:27 +02:00
Asger Feldthaus
f8570bb293 JS: Update TRAP 2021-04-15 10:16:46 +01:00
Asger Feldthaus
cb736c8c82 JS: Change note 2021-04-15 09:37:57 +01:00
Tom Hvitved
972cc47f67 Merge pull request #5673 from hvitved/csharp/customizations
C#: Add `Customizations.qll`
2021-04-15 10:24:29 +02:00
Asger Feldthaus
b4a2a9db25 JS: Fix extraction of non-substitution template literal types 2021-04-15 09:23:45 +01:00
haby0
b3bdf89fc2 rm VerificationMethodFlowConfig, use springframework-5.2.3 stub 2021-04-15 10:25:40 +08:00
CodeQL CI
4be183c7f6 Merge pull request #5675 from erik-krogh/libXss
Approved by esbena
2021-04-14 14:34:23 -07:00
Robert Marsh
fe57876fd8 Merge pull request #5643 from dbartol/smart-pointers/side-effect-refactor
C++: Refactor some side effect generation code
2021-04-14 09:59:41 -07:00
Taus
897d12420b Python: Prevent bad join in isinstanceEvaluatesTo
In some cases, we were joining the result of `val.getClass()` against
the first argument of `Types::improperSubclass` before filtering out the
vast majority of tuples by the call to `isinstance_call`.

To fix this, we let `isinstance_call` take care of figuring out the
class of the value being tested. As a bonus, this cleans up the only
other place where `isinstance_call` is used, where we _also_ want to
know the class of the value being tested in the `isinstance` call.
2021-04-14 16:49:12 +00:00
Artem Smotrakov
97186b3d30 Added comments for tests 2021-04-14 19:30:58 +03:00
Andrew Eisenberg
56ba0f080a Merge pull request #5659 from github/aeisenberg/mark-as-stale
Actions: Add workflow for marking stale questions
2021-04-14 08:37:55 -07:00
Taus
a7fcf52267 Python: Fix bad join in total_cost
The recent change to `appliesTo` lead to a perturbation in the join
order of this predicate, which resulted in a cartesian product between
`call` and `ctx` being created (before being filtered by `appliesTo`).

By splitting the intermediate result into its own helper predicate,
suitably marked to prevent inlining/magic, we prevent this from
happening again.
2021-04-14 15:36:01 +00:00
Andrew Eisenberg
392adf2a25 Workflows: Remove dry-run flag for labeller 2021-04-14 08:25:34 -07:00
Dave Bartolomeo
b29f35f564 Fix formatting 2021-04-14 11:15:16 -04:00
Geoffrey White
64fed4cb10 Merge pull request #5677 from MathiasVP/fix-duplicate-ids-in-experimental
C++: Fix duplicate names in experimental queries
2021-04-14 15:58:49 +01:00
Jonas Jensen
b4f01c9afa Merge pull request #5578 from MathiasVP/ast-flow-smart-pointers
C++: AST dataflow through smart pointers
2021-04-14 16:39:05 +02:00
Mathias Vorreiter Pedersen
53a320a810 C++: Fix duplicate names. 2021-04-14 16:33:18 +02:00
Mathias Vorreiter Pedersen
bb447d7174 C++: Make sure missingGuardAgainstOverflow (and underflow) holds when range analysis fails to deduce a bound. 2021-04-14 16:30:43 +02:00
yoff
447f339857 Merge pull request #5641 from tausbn/python-use-localsourcenode-in-typetrackers
Python: Use API graphs in PEP249 support
2021-04-14 15:39:49 +02:00
Mathias Vorreiter Pedersen
92508beb82 Merge pull request #5600 from ihsinme/ihsinme-patch-258
CPP: Add query for CWE-691 Insufficient Control Flow Management When Using Bit Operations
2021-04-14 14:55:30 +02:00
Anders Schack-Mulligen
f43d427875 Merge pull request #5645 from Marcono1234/marcono1234/primary-ql-class
Java: Override getAPrimaryQlClass() for more classes
2021-04-14 14:51:29 +02:00
Mathias Vorreiter Pedersen
bc7cc2f7ce C++: Remove rule that wasn't needed. 2021-04-14 14:50:27 +02:00
Mathias Vorreiter Pedersen
da36508714 Revert "C++: As response to the review comments this commit adds a reference-to-pointer state to AddressFlow. A call to an unwrapper function now adds a pointer -> reference-to-pointer transition, and a ReferenceDereference adds a reference-to-pointer -> pointer transition."
This reverts commit 5aeaab7c6d.
2021-04-14 14:41:22 +02:00
Chris Smowton
591ac38c31 Merge pull request #5591 from Marcono1234/marcono1234/member-nested-type
Java: Add MemberType
2021-04-14 12:29:54 +01:00
Taus
54c79bff74 Merge pull request #5666 from RasmusWL/django-refactor
Python: Refactoring and exposing of Django views/fields/forms
2021-04-14 13:07:20 +02:00
Mathias Vorreiter Pedersen
2e40d01397 Update cpp/ql/src/semmle/code/cpp/security/Overflow.qll
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2021-04-14 13:01:31 +02:00
Rasmus Wriedt Larsen
44d2bf42d7 Merge pull request #5671 from tausbn/python-use-api-graphs-in-werkzeug
Python: Use API graphs in Werkzeug
2021-04-14 12:57:58 +02:00
Erik Krogh Kristensen
fd23e0bdda use more API nodes in XmlParsers, and recognize more results from parsing XML 2021-04-14 11:48:31 +02:00
Anders Schack-Mulligen
3b6cd0f681 Merge pull request #5661 from smowton/smowton/cleanup/call-is-exprparent
Make Call a subclass of ExprParent.
2021-04-14 10:49:33 +02:00
Rasmus Wriedt Larsen
9de8085571 Merge pull request #5665 from tausbn/python-use-api-graphs-in-tornado
Python: Tornado cleanup using API graphs
2021-04-14 10:22:21 +02:00
Rasmus Wriedt Larsen
2d0c9b6bf2 Merge pull request #5670 from tausbn/python-use-api-graphs-in-dill
Python: Use API graphs in Dill model
2021-04-14 10:08:02 +02:00
Rasmus Wriedt Larsen
55723618a9 Python: Apply suggestions from code review
Co-authored-by: Taus <tausbn@github.com>
2021-04-14 10:05:50 +02:00
Chris Smowton
2965a1f204 Use Thread$State as an inner-class example
Map<>$Entry currently has odd generic notation that may be about to change.
2021-04-14 08:43:05 +01:00
Chris Smowton
5158e7964e Add change note 2021-04-14 08:25:12 +01:00
Tom Hvitved
36fe72246b C#: Add change note 2021-04-14 09:22:16 +02:00
Tom Hvitved
4810308b16 C#: Add Customizations.qll 2021-04-14 09:16:31 +02:00
haby0
77208bcc91 Fix the error that there is no VerificationMethodToIfFlowConfig 2021-04-14 13:14:43 +08:00
haby0
e2ed0d02b0 Delete existsFilterVerificationMethod and existsServletVerificationMethod, add from get handler to filter 2021-04-14 12:34:52 +08:00
haby0
37dae67a0d Fix RequestResponseFlowConfig.isSink error 2021-04-14 09:55:24 +08:00
Robert Marsh
419d25cbcf Merge pull request #5325 from ihsinme/ihsinme-patch-245
CPP: Add query for CWE-783 Operator Precedence Logic Error When Use Bool Type
2021-04-13 13:24:39 -07:00
Taus
981c5deb57 Merge pull request #5639 from tausbn/python-api-graphs-missing-builtins
Python: Add missing builtins to `API::builtin`
2021-04-13 21:27:52 +02:00
Marcono1234
d853f0c400 Java: Add MemberType 2021-04-13 18:55:20 +02:00
Taus
a6bb9ebb9f Python: Re-introduce abstract toString
This seems like the easier solution in the short run.
2021-04-13 16:08:41 +00:00
Taus
079c7e089d Python: Autoformat 2021-04-13 16:05:45 +00:00
Taus
273e8ce4ef Python: Add change note 2021-04-13 16:04:07 +00:00
haby0
00235ed3b3 Update java/ql/src/semmle/code/java/frameworks/Servlets.qll
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-13 23:58:52 +08:00
haby0
25b012db48 Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjection.ql
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-13 23:58:28 +08:00
Taus
5f7d3d0d36 Python: Use API graphs in Werkzeug 2021-04-13 15:57:21 +00:00
haby0
7be45e7c5e Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjection.ql
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-13 23:56:17 +08:00
haby0
6e73d13670 Update java/ql/src/semmle/code/java/frameworks/Servlets.qll
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-13 23:48:45 +08:00
Taus
2890fe6d61 Python: Use API graphs in Dill model
If only all rewrites were this smooth...
2021-04-13 15:26:54 +00:00
Taus
7ed09904b4 Python: Use API graphs for Invoke
A few stragglers remain, as they are modelling the use of decorators.

They will be dealt with at a later date.
2021-04-13 15:21:19 +00:00
Mathias Vorreiter Pedersen
aa52585120 C++: Add change-note. 2021-04-13 17:17:05 +02:00
Marcono1234
89a5acf6e8 Java: Revert overriding XMLFile.getAPrimaryQlClass()
Library file has to be kept in sync with the other languages, however except
cpp none of them have the getAPrimaryQlClass() predicate declared in a
superclass. Therefore for simplicity revert the change for Java.
2021-04-13 17:09:15 +02:00
Taus
7f131c1f35 Python: Get rid of _attr predicates 2021-04-13 14:55:44 +00:00
Taus
1008411594 Python: Use API graphs in Fabric model 2021-04-13 14:49:44 +00:00
Mathias Vorreiter Pedersen
d1457995dd C++: Use range analysis in Overflow.qll 2021-04-13 16:39:28 +02:00
Taus
a404faa302 Python: Use American English in change note
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com>
2021-04-13 15:05:44 +02:00
Taus
7825a2cdfc Python: Add change note 2021-04-13 12:48:45 +00:00
Taus
1a4845f417 Python: Restrict types a bit
The `CallCfgNode` restrictions are familiar and useful.

Restricting `InstanceSource` to extend `LocalSourceNode` is novel, but I
think it makes sense. It will act as a good reminder to anyone extending
`InstanceSource` that the node in question is a `LocalSourceNode`, which
will be enforced by the return type of the internal type tracker anyway.
2021-04-13 12:28:38 +00:00
Taus
f93b68d4dc Python: Get rid of _attr methods 2021-04-13 12:25:38 +00:00
Taus
98d936d8b3 Python: Tornado cleanup using API graphs
I wasn't able to roll out API graphs as widely in Tornado as I had
hoped, since we're lacking the "def" part. This means most of the
`InstanceSource` machinery will have to stay.
2021-04-13 12:25:38 +00:00
CodeQL CI
f341d5010d Merge pull request #5662 from asgerf/js/simpler-json-api
Approved by erik-krogh
2021-04-13 04:37:56 -07:00
Tom Hvitved
9b0ef2fe21 Merge pull request #5654 from hvitved/csharp/autobuilder/pwsh
C#: First try `pwsh` and then `powershell` when calling `dotnet-install.ps1`
2021-04-13 13:15:01 +02:00
Chris Smowton
58d198261e Merge pull request #5663 from smowton/luchua/java/sensitive-cookie-not-httponly
Java: CWE-1004 Query to check sensitive cookies without the HttpOnly flag set w/minor corrections
2021-04-13 12:08:53 +01:00
CodeQL CI
646639bc73 Merge pull request #5460 from erik-krogh/forgery-2
Approved by asgerf
2021-04-13 03:57:04 -07:00
Chris Smowton
f22b11881e Minimise stubs
By removing all business logic from the stubs, we better test that our analysis treats them as opaque and does not rely on their internal structure
2021-04-13 10:36:28 +01:00
Chris Smowton
45e1a61d7b Mark test as bad-but-missed
This test ought ideally to be caught, but isn't by the current version of the query.
2021-04-13 10:36:27 +01:00
Asger Feldthaus
e77117f902 JS: Autoformat 2021-04-13 10:29:14 +01:00
Asger Feldthaus
929d9da4b4 JS: Migrate to new JSON API 2021-04-13 10:29:13 +01:00
Asger Feldthaus
7c13163413 JS: Lift JSON accessors to JSONValue 2021-04-13 10:29:13 +01:00
Tom Hvitved
15c103e42d C#: Remove code duplication in BuildScripts.cs 2021-04-13 10:57:15 +02:00
Chris Smowton
dee974ff2d Make Call a subclass of ExprParent. All of its subclasses are in any case (via Expr or Stmt) 2021-04-13 09:13:47 +01:00
Marcono1234
c37dbb2e68 Java: Override getAPrimaryQlClass() for more classes 2021-04-13 08:46:01 +01:00
Mathias Vorreiter Pedersen
3cfd30ef6f Merge pull request #5629 from hvitved/cpp/remove-unique
C++: Remove `unique` wrapper from `DataFlow::Node::getEnclosingCallable`
2021-04-13 09:42:34 +02:00
haby0
be39883166 Change the class name and comment,Use .(CompileTimeConstantExpr).getStringValue() 2021-04-13 14:10:10 +08:00
Dave Bartolomeo
afd2f58f9f C++: Fix PR feedback 2021-04-12 18:21:05 -04:00
Dave Bartolomeo
697b2dcde8 C++: Add missing store step for single-field struct use
We have special code to handle field flow for single-field structs, but that special case was too specific. Some `Store`s to single-field structs have no `Chi` instruction, which is the case that we handled already. However, it is possible for the `Store` to have a `Chi` instruction (e.g. for `{AllAliased}`), but still have a use of the result of the `Store` directly. We now add a `PostUpdateNode` for the result of the `Store` itself in those cases, just like we already did if the `Store` had no `Chi`.
2021-04-12 18:11:41 -04:00
Robert Marsh
0102d68f38 Merge pull request #5658 from MathiasVP/fix-partial-def-diff-test
C++: Fix performance in test
2021-04-12 13:08:30 -07:00
Andrew Eisenberg
e0fcb15739 Actions: Add workflow for marking stale questions
This PR adds a workflow for marking and closing issues as stale. Issues must be labeled as _question_. PRs are never marked as stale.
2021-04-12 13:05:53 -07:00
Artem Smotrakov
b96b665262 Renaming in java/ql/src/experimental/Security/CWE/CWE-094 2021-04-12 21:40:49 +03:00
Mathias Vorreiter Pedersen
037e6369ce C++: Ensure all values are bound in both disjunctions. 2021-04-12 18:27:21 +02:00
luchua-bc
d7f26dfc18 Update stub classes and qldoc 2021-04-12 16:19:23 +00:00
Taus
fda750ef26 Merge pull request #5642 from tausbn/python-use-api-graphs-in-stdlib
Python: Use API graphs in `Stdlib.qll`
2021-04-12 18:05:38 +02:00
Chris Smowton
423ff32d04 Merge pull request #5384 from luchua-bc/java/insecure-spring-actuator-config
Java: CWE-016 Query to detect insecure configuration of Spring Boot Actuator
2021-04-12 17:04:47 +01:00
Taus
6d4ddc0329 Merge pull request #5614 from tausbn/python-allow-absolute-imports-from-source-directory
Python: Allow absolute imports from source directory
2021-04-12 18:02:00 +02:00
CodeQL CI
bc56d16c18 Merge pull request #5485 from RasmusWL/django-queryset-chains
Approved by tausbn
2021-04-12 08:49:31 -07:00
Tom Hvitved
dfc91b8331 C#: Simplify dotnet-install.ps1 invocation
Using the pattern from https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script.
2021-04-12 17:33:33 +02:00
Chris Smowton
bb23866cec Add missing doc comments 2021-04-12 16:33:01 +01:00
Tom Hvitved
d35a501121 Merge pull request #5583 from lcartey/cs/restrict-jump-to-def
C#: Exclude jump-to-def information for elements with too many locations
2021-04-12 16:52:20 +02:00
ihsinme
a43698802f Update InsufficientControlFlowManagementWhenUsingBitOperations.ql 2021-04-12 17:36:50 +03:00
CodeQL CI
310a2c8bb3 Merge pull request #5655 from erik-krogh/cert
Approved by esbena
2021-04-12 07:31:04 -07:00
Chris Smowton
2656a52880 Merge pull request #5538 from luchua-bc/java/credentials-in-properties
Java: CWE-555 Query to detect plaintext credentials in Java properties files
2021-04-12 15:22:21 +01:00
Chris Smowton
abeefcaced Merge pull request #4947 from porcupineyhairs/DexLoading
Java : add query to detect insecure loading of Dex File
2021-04-12 15:22:12 +01:00
Mathias Vorreiter Pedersen
5aeaab7c6d C++: As response to the review comments this commit adds a reference-to-pointer state to AddressFlow. A call to an unwrapper function now adds a pointer -> reference-to-pointer transition, and a ReferenceDereference adds a reference-to-pointer -> pointer transition. 2021-04-12 16:01:01 +02:00
Chris Smowton
11bf982728 Remove superfluous linebreaks in qhelp file 2021-04-12 14:36:42 +01:00
Erik Krogh Kristensen
32737a17fb add change note 2021-04-12 15:09:13 +02:00
Erik Krogh Kristensen
172d6139e2 support all ClientRequests in js/disabling-certificate-validation 2021-04-12 15:06:10 +02:00
luchua-bc
c281e54d22 Remove unused files and update qldoc 2021-04-12 13:05:01 +00:00
Tom Hvitved
57016ddbde C++: Remove unique wrapper from DataFlow::Node::getEnclosingCallable() 2021-04-12 14:41:52 +02:00
Tom Hvitved
7d2a60e910 Merge pull request #5640 from hvitved/dataflow/path-step-perf
Data flow: Prevent bad join-order in `pathStep`
2021-04-12 14:40:46 +02:00
Tom Hvitved
5446532e1d C#: Update auto-builder tests 2021-04-12 14:01:55 +02:00
Anders Schack-Mulligen
acd4cf2878 Merge pull request #5636 from aschackmull/java/shared-flow-summaries
Java: Adopt shared flow summaries
2021-04-12 13:35:31 +02:00
CodeQL CI
e8d835b422 Merge pull request #5638 from erik-krogh/smartInliner
Approved by esbena
2021-04-12 04:17:25 -07:00
Tom Hvitved
c7686b1838 C#: First try pwsh and then powershell when calling dotnet-install.ps1 2021-04-12 13:01:14 +02:00
Tom Hvitved
cf5f838b13 Data flow: Remove recommendation to use unique in Node::getEnclosingCallable() 2021-04-12 12:04:23 +02:00
Anders Schack-Mulligen
e003b04061 Merge pull request #5637 from Marcono1234/marcono1234/toString-method
Java: Add ToStringMethod
2021-04-12 11:43:55 +02:00
Max Schaefer
cd57e61f65 Rename MkHasUnderlyingType to MkTypeUse. 2021-04-12 11:30:15 +02:00
Erik Krogh Kristensen
91d28fb8b0 cleanup in API-graphs 2021-04-12 11:30:15 +02:00
CodeQL CI
63f087a8e9 Merge pull request #5653 from erik-krogh/givenCommand
Approved by asgerf
2021-04-12 02:01:32 -07:00
Rasmus Wriedt Larsen
364d48948f Merge pull request #3810 from dilanbhalla/syntaxpython
Python: Function/Class Naming Convention (Syntax)
2021-04-12 10:42:17 +02:00
Erik Krogh Kristensen
17c4bbbc4e allow parameters that end with "Command" in js/shell-command-constructed-from-input 2021-04-12 09:57:40 +02:00
haby0
1b948ac2e2 Combine two Configurations into one 2021-04-12 15:44:39 +08:00
yo-h
4f2060f96b Merge commit '2d618d6b928d8b76ac8033b3b63d9bde71caa325' into yo-h/java16 2021-04-11 23:55:33 -04:00
Taus
10be2735ec Python: Get rid of _attr predicates
Also changes all `CfgNode`s representing calls to `CallCfgNode`s.
2021-04-10 12:12:18 +00:00
haby0
d90527bead JsonpInjectionExpr updated to JsonpBuilderExpr 2021-04-10 10:33:21 +08:00
Marcono1234
9349e6922d Java: Add ToStringMethod 2021-04-10 04:00:44 +02:00
haby0
eeae91e620 Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjectionLib.qll
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-10 09:48:55 +08:00
haby0
046aeaa38c Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjectionLib.qll
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-10 09:37:29 +08:00
haby0
8b756d7f1b Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjection.ql
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-10 09:27:03 +08:00
haby0
650446f761 Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjectionLib.qll
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-10 09:26:32 +08:00
haby0
a5ebe8c600 Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjectionLib.qll
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-10 09:26:08 +08:00
porcupineyhairs
8687c5c145 Apply suggestions from code review
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-10 04:18:35 +05:30
haby0
8a7d28a2ed Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjectionLib.qll
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-10 04:29:49 +08:00
haby0
4c21980d4f Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjectionLib.qll
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-10 04:29:30 +08:00
haby0
9635a36044 Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjection.ql
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-10 04:29:06 +08:00
haby0
760231c004 Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjectionLib.qll
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-10 04:28:17 +08:00
haby0
c77c7b0a98 Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjectionLib.qll
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-10 04:27:16 +08:00
haby0
837f20108d Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjectionLib.qll
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-10 04:25:43 +08:00
haby0
157e4670fd Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjection.qhelp
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-10 04:25:11 +08:00
haby0
79c1374925 Update java/ql/src/semmle/code/java/frameworks/Servlets.qll
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-10 04:24:49 +08:00
haby0
1510048f7a Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjection.qhelp
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-10 04:23:13 +08:00
haby0
d8165145c7 Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjection.qhelp
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-10 04:22:44 +08:00
haby0
ebd38eaf3b Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjection.qhelp
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-10 04:22:08 +08:00
haby0
b8c11503f0 Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjection.qhelp
Co-authored-by: Chris Smowton <smowton@github.com>
2021-04-10 04:21:49 +08:00
Dave Bartolomeo
0a86642056 C++: Refactor some side effect generation code
This change was necessary for my upcoming changes to introduce side effect instructions for indirections of smart pointers. The code to decide which parameters have which side effects appeared in both the IPA constructor for `TTranslatedSideEffect` and in `TranslatedCall`. These two versions didn't quite agree, especially once the `SideEffectFunction` model provides its own side effects instead of the defaults.
The relevant code has now been factored out into `SideEffects.qll`. This queries the model if one exists, and provides default side effects if no model exists. This fixes at least one existing issue, where we were emitting a buffer read side effect for `*this` instead of an indirect read side effect. This accounts for all of the IR diffs in the tests.
2021-04-09 16:14:03 -04:00
luchua-bc
4e3791dc0d Remove LoadCredentialsConfiguration and update qldoc 2021-04-09 19:36:35 +00:00
Taus
720fbaf301 Python: Fix test error.
Somehow, having to type "Node" all day long made me turn "json" into
"node"...

Also removes some bits that weren't needed after all.
2021-04-09 19:04:49 +00:00
Mathias Vorreiter Pedersen
1510fe370d C++: Add cases for const pointer wrapper references to AddressFlow and FlowVar. 2021-04-09 20:58:05 +02:00
Mathias Vorreiter Pedersen
2329b31601 C++: Replace the new SmartPointerPartialDefinition with additional steps in AddressFlow.qll 2021-04-09 20:49:45 +02:00
Mathias Vorreiter Pedersen
a460e3ad3d Merge branch 'main' into ast-flow-smart-pointers 2021-04-09 19:41:10 +02:00
Taus
cc4827600b Python: Use API graphs in Stdlib.qll
Eliminates _almost_ all of the bespoke type trackers found here. The
ones that remain do not fit easily inside the framework of API graphs
(at least, not yet), and I did not see any easy ways to clean them up.
They have, however, been rewritten to use `LocalSourceNode` internally,
which was the primary goal of this exercise.

I'm sure we could also clean up many of the inner modules given the more
lean presentation we have now, but this can wait for a different PR.
2021-04-09 17:11:47 +00:00
luchua-bc
04b0682bbf Use isAdditionalTaintStep and make the query more readable 2021-04-09 16:14:51 +00:00
Tom Hvitved
fd8f745468 Java: Adopt shared flow summary library and refactor data-flow nodes. 2021-04-09 16:57:03 +02:00
Shati Patel
2d618d6b92 Merge pull request #5625 from shati-patel/docs/cli-manual
Docs: Link to CodeQL CLI manual from the sidebar
2021-04-09 15:30:24 +01:00
Tom Hvitved
f130616369 Data flow: Make getLocalCc private again 2021-04-09 16:22:58 +02:00
Taus
d2b874f217 Python: Use API graphs in PEP249 support
Because the replacement extension point now extends `API::Node`, I
modified the `toString` method of the latter to have an empty body.
The alternative would be to require everyone to provide a `toString`
predicate for their extensions, but seeing as these will usually be
pointing to already existing API graph nodes, this seems silly.

(This may be the reason why the equivalent method in the JS libs has
such an implementation.)
2021-04-09 14:19:00 +00:00
Jonas Jensen
e1d0bbb021 Merge pull request #5607 from MathiasVP/smart-pointer-ast-read-store-steps
C++: read and store steps for smart pointers in AST dataflow
2021-04-09 16:11:48 +02:00
CodeQL CI
6fd4a8afff Merge pull request #5567 from asgerf/js/sql-models
Approved by esbena
2021-04-09 07:11:10 -07:00
CodeQL CI
be2fe6e171 Merge pull request #5630 from erik-krogh/urlStep
Approved by esbena
2021-04-09 07:05:43 -07:00
CodeQL CI
8d2768b2ce Merge pull request #5634 from erik-krogh/fileSource
Approved by asgerf
2021-04-09 07:04:42 -07:00
Anders Schack-Mulligen
701e815368 Merge pull request #5628 from hvitved/java/remove-unique
Java: Remove `unique` wrapper from `DataFlow::Node::getEnclosingCallable()`
2021-04-09 15:21:26 +02:00
Mathias Vorreiter Pedersen
cd310eb9d5 C++: Remove unused import. 2021-04-09 15:08:48 +02:00
Tamás Vajk
992a4df12f Merge pull request #5619 from tamasvajk/feature/fix-default-argument-value-extraction
C# Improve default argument value extraction
2021-04-09 14:58:35 +02:00
Mathias Vorreiter Pedersen
996cda9b97 C++: Fix incorrect test annotation. 2021-04-09 14:46:46 +02:00
Tom Hvitved
6874b8d4b3 Data flow: Prevent bad join-order in pathStep 2021-04-09 14:24:47 +02:00
Mathias Vorreiter Pedersen
80d5b17900 C++: Remove the dataflow rule for smart_ptr -> *smart_ptr. 2021-04-09 14:20:51 +02:00
Mathias Vorreiter Pedersen
cae0060a89 C++: Replace the new rules in DataFlowUtil with a dataflow model for pointer wrapper classes. 2021-04-09 14:06:58 +02:00
Taus
affdedd840 Python: Add missing builtins to API::builtin
We were missing out on `None`, `True`, and `False` as these do not
appear as actual attributes of the `builtins` module in Python 3
(because they are elevated to the status of keywords there)

The simple solution, then, is to just always include them directly.
2021-04-09 12:02:07 +00:00
Tamas Vajk
46197e6e69 Address review comments 2021-04-09 13:39:37 +02:00
Erik Krogh Kristensen
595bdedb22 rename predicate to getStem, and update regexp 2021-04-09 13:07:54 +02:00
Mathias Vorreiter Pedersen
0a6aef71a2 C++: Respond to review comments. 2021-04-09 12:29:13 +02:00
CodeQL CI
652e8b4872 Merge pull request #5586 from asgerf/js/tsconfig-file-inclusion-handling
Approved by esbena
2021-04-09 02:50:51 -07:00
Tom Hvitved
c9c4c067b6 Merge pull request #5633 from hvitved/csharp/get-a-source-type-perf
C#: Improve performance of `Dispatch::SimpleTypeDataFlow::getASourceType()`
2021-04-09 11:42:34 +02:00
Tamás Vajk
a335bb0115 Merge pull request #5609 from tamasvajk/feature/dapper
C#: Dapper support
2021-04-09 10:52:17 +02:00
CodeQL CI
ad267404c9 Merge pull request #5137 from asgerf/js/redux-less
Approved by erik-krogh
2021-04-09 01:24:19 -07:00
Tamas Vajk
d7f0b9a7fa Add change note 2021-04-09 09:58:37 +02:00
Tamas Vajk
749db379ca Address code review findings 2021-04-09 09:55:37 +02:00
Tamas Vajk
dbb3d3dc17 Add change note 2021-04-09 09:50:55 +02:00
luchua-bc
11304b2ae1 Update qldoc and change the wrapper method implementation 2021-04-09 02:21:59 +00:00
Erik Krogh Kristensen
7f01586bf1 fix bad join order in getDocumentedParameter 2021-04-09 01:15:46 +02:00
Erik Krogh Kristensen
e5bce548de add nomagic on mayHaveStringValue 2021-04-09 00:08:51 +02:00
Erik Krogh Kristensen
956311457d fixed bad SourceNode X SourceNode join in HTTP model 2021-04-08 21:15:50 +02:00
ihsinme
9b3ccade43 Update test.c 2021-04-08 22:06:35 +03:00
ihsinme
02eb447a35 Update InsufficientControlFlowManagementWhenUsingBitOperations.expected 2021-04-08 22:04:08 +03:00
ihsinme
a6b486a448 Update InsufficientControlFlowManagementWhenUsingBitOperations.ql 2021-04-08 22:01:43 +03:00
Dilan
d73ba13b28 autoformat fix 2021-04-08 11:41:58 -07:00
Artem Smotrakov
b39a3ab12c Added setVariable() sink 2021-04-08 20:41:43 +03:00
Tamás Vajk
8adaee05b6 Merge pull request #5453 from tamasvajk/feature/use_codeql_stubs
C#: Adjust make_stubs.py to use codeql instead of odasa
2021-04-08 16:16:05 +02:00
Anders Schack-Mulligen
6109ef5e88 Merge pull request #5475 from Marcono1234/marcono1234/minus-literal
Java: Improve documentation regarding minus in front of numeric literals
2021-04-08 16:11:14 +02:00
Asger Feldthaus
7d300b53d7 JS: Autoformat 2021-04-08 15:06:48 +01:00
Anders Schack-Mulligen
d42a01cb3a qldoc fixup 2021-04-08 15:45:21 +02:00
Tamas Vajk
e5160929eb Remove ODASA reference from make_stubs.py 2021-04-08 15:04:02 +02:00
Erik Krogh Kristensen
30ba69d991 treat "files" in a package.json as main modules, if "main" is not present 2021-04-08 14:42:12 +02:00
Tom Hvitved
036e181bc1 C#: Improve performance of Dispatch::SimpleTypeDataFlow::getASourceType() 2021-04-08 14:27:28 +02:00
Tom Hvitved
716568ebd1 Merge pull request #5623 from hvitved/csharp/enclosing
C#: Compute enclosing callable as a transitive closure
2021-04-08 14:20:09 +02:00
Tom Hvitved
9820116734 Merge pull request #5603 from hvitved/csharp/dataflow/no-unique
C#: Remove `unique` wrappers from `DataFlow::Node::get(EnclosingCallable|ControlFlowNode)`
2021-04-08 14:19:34 +02:00
Asger Feldthaus
52a2260dc7 JS: Rename change note file 2021-04-08 12:52:23 +01:00
Rasmus Wriedt Larsen
c738f387b1 Merge pull request #5624 from tausbn/python-make-callcfgnode-a-localsourcenode
Python: Improve `CallCfgNode` interface
2021-04-08 13:38:24 +02:00
Taus
cf5f760ecd Merge pull request #5582 from RasmusWL/all-tuple
Python: Add support for `__all__` assigned to tuple
2021-04-08 13:03:27 +02:00
Rasmus Wriedt Larsen
83477439a1 Python: Make django views/fields/forms class modeling extensible
This also requires that we make this part of the modeling public, which I guess
is step we want to take eventually anyway!

I'm not quite sure whether the modules `Django::Views` and `Django::Forms` are
actually helpful, or whether we should just have their modules available as
`Django::View`, `Django::Form`, and `Django::Field`...
2021-04-08 12:45:37 +02:00
Rasmus Wriedt Larsen
b7483a5394 Python: Add modeledSubclassRef for Django views/fields/forms 2021-04-08 12:45:36 +02:00
Rasmus Wriedt Larsen
322bdcb703 Python: Port Django view modeling to API graphs 2021-04-08 12:45:35 +02:00
Rasmus Wriedt Larsen
8ce5c46e05 Python: Minor refactor
modName/clsName _is_ shorter, but also looks way worse :D
2021-04-08 12:45:34 +02:00
Tamas Vajk
a790eb8110 Fix for unconstrained generic types 2021-04-08 12:20:01 +02:00
Tamas Vajk
a8cbdc92b9 Add more test cases 2021-04-08 12:17:19 +02:00
Tamas Vajk
551a7ce9e5 Fix expression value of struct default argument values 2021-04-08 12:14:53 +02:00
Tamas Vajk
c069c3384e Fix tests 2021-04-08 12:07:36 +02:00
Tamas Vajk
cb9a9db356 C# Improve default argument value extraction 2021-04-08 12:07:22 +02:00
Tamas Vajk
2ac1e60406 C#: Add parameter default value tests 2021-04-08 12:04:18 +02:00
Jonas Jensen
51bab81f56 Merge pull request #5622 from MathiasVP/inline-is-before
C++: Inline Location::isBefore
2021-04-08 11:24:33 +02:00
Erik Krogh Kristensen
99dd5330c2 add taint-step for URL construction in js/request-forgery 2021-04-08 11:10:33 +02:00
CodeQL CI
a9527fd913 Merge pull request #5621 from erik-krogh/shellSink
Approved by esbena
2021-04-08 09:47:45 +01:00
Tom Hvitved
2faf52b6bd Java: Remove unique wrapper from DataFlow::Node::getEnclosingCallable()` 2021-04-08 10:07:19 +02:00
Dilan
675de07c3e autoformat ql 2021-04-07 15:04:18 -07:00
ihsinme
ed34c96357 Update InsufficientControlFlowManagementWhenUsingBitOperations.ql 2021-04-07 21:40:49 +03:00
ihsinme
eb9b41acab Apply suggestions from code review
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2021-04-07 21:31:12 +03:00
Artem Smotrakov
a764a79090 Always bind arguments in TaintPropagatingCall 2021-04-07 21:12:21 +03:00
Artem Smotrakov
c13ee0859a LambdaExpression should extend JakartaType 2021-04-07 21:02:21 +03:00
Shati Patel
4cf0b8e725 Merge pull request #5626 from shati-patel/docs/broken-links
Docs: Fix broken link to cached "RemoteFlowSource"
2021-04-07 19:01:33 +01:00
Artem Smotrakov
3d8e173c57 Removed a reference to Apache Commons EL 2021-04-07 20:59:07 +03:00
Artem Smotrakov
80ac2aff26 Fixed typos
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
2021-04-07 20:55:03 +03:00
Shati Patel
f372274857 Docs: Fix broken links 2021-04-07 18:02:29 +01:00
Shati Patel
2373bf2dfb Docs: Link to CodeQL CLI manual from the sidebar 2021-04-07 17:55:05 +01:00
Tom Hvitved
1cf30d2a9e C#: Compute enclosing callable as a transitive closure 2021-04-07 17:44:41 +02:00
Jonas Jensen
ab58cb3d44 Merge pull request #5604 from MathiasVP/fix-false-positive-in-assign-where-compare-meant
C++: Fix FP in cpp/assign-where-compare-meant
2021-04-07 16:54:45 +02:00
CodeQL CI
f0491af64c Merge pull request #5529 from erik-krogh/socketInput
Approved by esbena
2021-04-07 15:03:13 +01:00
Asger F
0c724a8427 Merge pull request #5304 from asgerf/js/non-alert-data
JS: Implement new metric queries for line counting
2021-04-07 14:52:51 +01:00
Mathias Vorreiter Pedersen
03b12dbc6d C++: Inline Location::isBefore. 2021-04-07 15:45:08 +02:00
Erik Krogh Kristensen
365b4d722d backtrack string-concatenations from shell-execution sinks 2021-04-07 15:34:54 +02:00
Taus
903f364dab Python: Improve CallCfgNode interface
Call nodes are always local sources (specifically sources of the return
value of the call), and so inheriting from `LocalSourceNode` will have
no effect on results, but _should_ make it a bit more smooth to use the
API.
2021-04-07 13:31:12 +00:00
CodeQL CI
073a43ce74 Merge pull request #5606 from erik-krogh/shellInput
Approved by esbena
2021-04-07 14:30:31 +01:00
Shati Patel
461d4e45af Merge pull request #5608 from shati-patel/docs/telemetry-settings
Docs: Mention telemetry in "customizing settings"
2021-04-07 13:44:32 +01:00
Erik Krogh Kristensen
c9f54ea1ad update expected output 2021-04-07 12:37:17 +00:00
Asger Feldthaus
ee13ff71d6 JS: Add another change note 2021-04-07 12:29:06 +01:00
Asger Feldthaus
26cddc7d04 JS: Update test output 2021-04-07 12:28:45 +01:00
Taus
6c69c1aeeb Python: Minor cleanup 2021-04-07 10:47:21 +00:00
Asger Feldthaus
69973d0fa2 JS: Autoformat 2021-04-07 11:24:11 +01:00
ihsinme
ed2a8db8c9 Add files via upload 2021-04-07 13:10:01 +03:00
ihsinme
9c3b7e81c7 Add files via upload 2021-04-07 13:10:00 +03:00
Erik Krogh Kristensen
a66083d685 change "Uncontrolled path" to "Path concatenation" 2021-04-07 08:23:07 +00:00
CodeQL CI
fd4e8f8282 Merge pull request #5526 from erik-krogh/quotedShell
Approved by esbena
2021-04-07 08:39:01 +01:00
CodeQL CI
61880ba90a Merge pull request #5530 from erik-krogh/moreFS
Approved by esbena
2021-04-07 08:37:23 +01:00
Robert Marsh
e22ec50dee Merge pull request #5613 from github/hmakholm/pr/fix-redos
Fix ReDOS in cpp/ql/src/Security/CWE/CWE-428/UnsafeCreateProcessCall.ql
2021-04-06 15:54:27 -07:00
Taus
a93132daae Merge branch 'python-allow-absolute-imports-from-source-directory' of https://github.com/tausbn/codeql into python-allow-absolute-imports-from-source-directory 2021-04-06 19:58:57 +00:00
Taus
43ae7462b4 Python: Only track modules that are imported
This greatly restricts the set of modules that have a new name under
this scheme.

One change to the tests was needed, which reflects the fact that the
two `main.py` files no longer have the name `main` (which makes sense,
since they're never imported under this name).
2021-04-06 21:56:12 +02:00
Taus
b44db460f6 Python: Only track modules that are imported 2021-04-06 19:55:43 +00:00
Henning Makholm
2d615ef503 Fix ReDOS in cpp/ql/src/Security/CWE/CWE-428/UnsafeCreateProcessCall.ql
The sub-regex `(\s|.)*` aims to capture arbitrary string content
(in contrast to `.*` which doesn't match newlines), but it is
unsafe, since non-newline whitespace can match both alternatives.

This caused an evaluator crash in the wild.

Replace with `[\s\S]*`, which matches everything in a safe way.
2021-04-06 20:10:57 +02:00
yo-h
cc63563a88 Merge remote-tracking branch 'upstream-public/main' into yo-h/java16 2021-04-06 13:16:02 -04:00
Taus Brock-Nannestad
8e11abca40 Revert "Merge pull request #5552 from RasmusWL/revert-import-change"
This reverts commit 49d1937dc4, reversing
changes made to d4877a9038.
2021-04-06 17:39:41 +02:00
Tamas Vajk
ffcb345916 C#: Add Dapper support to SQL injection queries 2021-04-06 17:06:20 +02:00
Shati Patel
9a41c80626 Merge pull request #5574 from github/smowton/admin/update-supported-go-version
Update supported Go version to 1.16
2021-04-06 14:54:36 +01:00
Shati Patel
695b02a94c Docs: Mention telemetry in "customizing settings" 2021-04-06 14:30:17 +01:00
Erik Krogh Kristensen
2c1cc9ead6 use local variable instead of module.exports in example
Co-authored-by: Esben Sparre Andreasen <esbena@github.com>
2021-04-06 15:17:31 +02:00
Tom Hvitved
f45916efda Merge pull request #5605 from hvitved/csharp/exclude-dependency-queries
C#: Remove mentions of `exclude-dependency-queries.yml`
2021-04-06 14:58:49 +02:00
Mathias Vorreiter Pedersen
8382e85901 C++: Add flow into the source of read step and out of the target of a store step for smart pointers in AST dataflow. 2021-04-06 14:05:55 +02:00
Mathias Vorreiter Pedersen
f07d844362 C++: Add a test containing missing read/store dataflow steps for smart pointers. 2021-04-06 13:59:27 +02:00
Tamas Vajk
98001c494f C#: Add Dapper stub and new SqlInjection test cases 2021-04-06 13:30:31 +02:00
Erik Krogh Kristensen
41b89669a9 add joined paths as a sink to js/shell-command-constructed-from-input 2021-04-06 12:14:00 +02:00
Rasmus Wriedt Larsen
bc49bc7095 Python: Add variable with underscore to __all__ tests 2021-04-06 11:54:25 +02:00
Tom Hvitved
e0e58b24ea C#: Remove mentions of exclude-dependency-queries.yml 2021-04-06 11:50:36 +02:00
Rasmus Wriedt Larsen
224d3790b5 Python: Highlight all_indirect.py is not super important
At least not in my mind
2021-04-06 11:50:04 +02:00
Rasmus Wriedt Larsen
b11703cc74 Python: all_dybamic2 => all_indirect 2021-04-06 11:49:55 +02:00
Mathias Vorreiter Pedersen
5eb1f8abbd C++: Add change-note. 2021-04-06 11:47:57 +02:00
Rasmus Wriedt Larsen
0ebb24ebeb Merge pull request #5398 from yoff/python-api-enhancements
Python: Add small api enhancements determined useful during documentation work
2021-04-06 11:44:51 +02:00
Tom Hvitved
667b26b5d9 Merge pull request #5540 from hvitved/csharp/ssa-impl-tweaks
C#: Performance tweaks in `SsaImplCommon.qll`
2021-04-06 11:43:08 +02:00
Mathias Vorreiter Pedersen
a5f4d43d61 C++: Fix false positive by adding another allow-list pattern in AssignWhereCompareMeant. 2021-04-06 11:01:38 +02:00
Mathias Vorreiter Pedersen
7045597139 C++: Add testcase with false positive from #5318. 2021-04-06 10:58:15 +02:00
Erik Krogh Kristensen
c194598d37 recognize headers/url from the HTTP request to a server WebSocket. 2021-04-06 10:11:27 +02:00
Tom Hvitved
e852540254 C#: Remove unique wrappers from DataFlow::Node::get(EnclosingCallable|ControlFlowNode) 2021-04-06 09:56:09 +02:00
Rasmus Lerchedahl Petersen
c777f1d8d7 Merge branch 'main' of github.com:github/codeql into python-api-enhancements 2021-04-06 09:31:26 +02:00
Mathias Vorreiter Pedersen
32a8b9a857 C++: Move copy constructor to its own line and accept test changes. 2021-04-06 08:56:14 +02:00
yoff
a23d8deb10 Merge pull request #5483 from RasmusWL/minor-fixup-django
Python: Better text for getSourceType in Django
2021-04-06 08:30:58 +02:00
Asger Feldthaus
32500c834d JS: Change note 2021-04-01 16:41:03 +01:00
Asger Feldthaus
acc28df785 JS: Bugfix in tsconfig file inclusion handling 2021-04-01 16:33:05 +01:00
Asger Feldthaus
564a6873f8 JS: Add baseUrl test 2021-04-01 16:33:05 +01:00
Asger Feldthaus
c4ab6fb7b4 JS: Add ImportGraph meta query 2021-04-01 16:33:05 +01:00
Asger Feldthaus
f07030ba97 JS: Update AdditionalFlowStep -> SharedFlowStep 2021-04-01 13:16:47 +01:00
Asger Feldthaus
a9566728b5 JS: Update an import of Unit type 2021-04-01 13:16:47 +01:00
Asger Feldthaus
7119eda009 JS: Add redux change note 2021-04-01 13:16:47 +01:00
Asger Feldthaus
86bc0eb853 JS: Autoformat 2021-04-01 13:16:47 +01:00
Asger Feldthaus
b43989e6a1 JS: Use API nodes to track dispatch/dispatched value sources 2021-04-01 13:16:47 +01:00
Asger Feldthaus
2850b8e952 JS: Fix RangeAnalysis after BasicBlock.dominates change 2021-04-01 13:16:47 +01:00
Asger Feldthaus
cbfa5ad303 JS: Change type of a parameter 2021-04-01 13:16:47 +01:00
Asger Feldthaus
cee1a12489 JS: Fix typo in qldoc 2021-04-01 13:16:47 +01:00
Asger Feldthaus
c926a47d50 JS: QLDoc and test for HeuristicConnectEntryPoint 2021-04-01 13:16:47 +01:00
Asger Feldthaus
cca38a64be JS: Add test for flow to a closure body under a type guard 2021-04-01 13:16:46 +01:00
Asger Feldthaus
53def60e4f JS: Add test for if-based type check 2021-04-01 13:16:46 +01:00
Asger Feldthaus
1ce7c3448f JS: Address some review comments 2021-04-01 13:16:46 +01:00
Asger Feldthaus
fd7cbd0c96 JS: Tweak BasicBlock.dominates and friends 2021-04-01 13:16:46 +01:00
Asger Feldthaus
8fa3fb0561 JS: Redux model 2021-04-01 13:16:46 +01:00
Asger Feldthaus
314839fc09 JS: Add @reduxjs/toolkit to composed functions 2021-04-01 13:16:46 +01:00
Asger Feldthaus
c1651ad30c JS: Factor out Unit type 2021-04-01 13:16:46 +01:00
Asger Feldthaus
125d1465c8 JS: Add DataFlow::functionForwardingStep 2021-04-01 13:16:46 +01:00
Asger Feldthaus
a3421e7ab2 JS: Add getALocalUse 2021-04-01 13:16:45 +01:00
CodeQL CI
20416ae034 Merge pull request #5585 from asgerf/js/more-metadata
Approved by esbena
2021-04-01 13:13:01 +01:00
Asger Feldthaus
c96ee8671e JS: Update more query metadata 2021-04-01 12:15:54 +01:00
Luke Cartey
480ce39618 C#: Exclude jump-to-def information for elements with too many locations
In databases which include multiple duplicated files, we can get an
explosion of definition locations that can cause this query to produce
too many results for the CodeQL toolchain. This commit restricts the
definitions.ql query to producing definition/uses for definitions with
fewer than 10 locations. This replicates the logic used in the C++
definitions.qll library which faces similar problems.
2021-04-01 11:23:31 +01:00
CodeQL CI
a1fab8ac52 Merge pull request #5581 from asgerf/js/dependency-info
Approved by esbena
2021-04-01 09:07:21 +01:00
Shati Patel
36bdee0e8b Merge pull request #5571 from github/docs/bug-fix
Docs: Typo fix
2021-03-31 21:59:43 +01:00
Mathias Vorreiter Pedersen
ecbce88ec7 C++: Fix comment. 2021-03-31 22:23:50 +02:00
Rasmus Wriedt Larsen
95ac2c8edd Python: Add another dynamic __all__ test 2021-03-31 17:31:55 +02:00
CodeQL CI
f08a0e5653 Merge pull request #5580 from asgerf/js/more-metadata-fix
Approved by esbena
2021-03-31 16:29:33 +01:00
Rasmus Wriedt Larsen
ab3edf37d7 Python: Handle __all__ assigned to a tuple
Examples where this is used in real code:

- 76c0b32f82/django/core/files/temp.py (L24)
- 76c0b32f82/django/contrib/gis/gdal/__init__.py (L44-L49)
2021-03-31 17:25:19 +02:00
Rasmus Wriedt Larsen
43306f4700 Python: Add tests for Module.declaredInAll 2021-03-31 17:24:17 +02:00
Asger Feldthaus
8c8e4e6a70 JS: Add test 2021-03-31 16:17:54 +01:00
Asger Feldthaus
068a9d88e7 JS: Ensure Dependency.info() exists even if version range could not be parsed 2021-03-31 16:08:08 +01:00
Asger Feldthaus
c541390c1b JS: Remove precision tag from ExternalDependencies.ql 2021-03-31 13:54:15 +01:00
Mathias Vorreiter Pedersen
9ff894bf83 C++: Add support for AST dataflow out of functions that take a smart pointer by value. 2021-03-31 13:54:32 +02:00
Mathias Vorreiter Pedersen
e9e93c0eea Merge pull request #5558 from geoffw0/replace-tostring
Replace toString use
2021-03-31 13:50:41 +02:00
Geoffrey White
85ecfe2723 Update cpp/ql/src/experimental/Security/CWE/CWE-570/WrongInDetectingAndHandlingMemoryAllocationErrors.ql
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2021-03-31 11:34:56 +01:00
Mathias Vorreiter Pedersen
8159098dc0 C++: Add test from issue #5190. 2021-03-31 11:32:01 +02:00
Calum Grant
49d1937dc4 Merge pull request #5552 from RasmusWL/revert-import-change
Python: Revert #5506 due to bad performance
2021-03-31 09:51:39 +01:00
Asger F
d4877a9038 Merge pull request #5572 from asgerf/js/remove-flow-summary-kinds
JS: Change kind of summary-extraction queries to table
2021-03-31 09:28:56 +01:00
Asger Feldthaus
57784dc746 JS: Update test output 2021-03-31 09:23:47 +01:00
Chris Smowton
4f9b6d1192 Update supported Go version to 1.16 2021-03-31 08:56:27 +01:00
Asger Feldthaus
bc5b477f79 JS: Change kind of summary-extraction queries to table 2021-03-30 21:26:58 +01:00
Dave Bartolomeo
0cc8eaf3b4 Merge pull request #5543 from MathiasVP/smart-ptr-like-class
C++: Add a class that models wrapped pointer types
2021-03-30 16:00:13 -04:00
Rasmus Wriedt Larsen
51c27de049 Merge branch 'main' into revert-import-change 2021-03-30 21:51:53 +02:00
Shati Patel
b9788eb53c Merge pull request #5568 from shati-patel/docs-binding-sets
Docs: Mention that binding sets are available for classes
2021-03-30 18:08:23 +01:00
Sarita Iyer
649286995a Merge pull request #5562 from saritai/saritai/cli-remove-1.23-references
Remove Enterprise 1.23 special instructions and replace references
2021-03-30 13:07:42 -04:00
Shati Patel
fb004bacc3 Describe predicates first 2021-03-30 17:31:20 +01:00
Shati Patel
67835ee273 Address review comments 2021-03-30 17:29:43 +01:00
Shati Patel
23df459c16 remove accidental punctuation 2021-03-30 17:23:33 +01:00
Mathias Vorreiter Pedersen
fe76b0849b Merge pull request #5569 from geoffw0/memoryfree
C++: Add a test of memory freed queries with strdup.
2021-03-30 17:22:18 +02:00
Mathias Vorreiter Pedersen
92839123ae Merge pull request #5570 from geoffw0/mutextest
C++: Add mutex test cases.
2021-03-30 17:16:19 +02:00
Geoffrey White
a8284d5b97 C++: Add mutex test case. 2021-03-30 15:39:21 +01:00
Sarah Edwards
e0a73ce797 Merge pull request #5560 from skedwards88/patch-1
download LGTM database from a project slug
2021-03-30 06:58:28 -07:00
Geoffrey White
244966e216 C++: Add a test with strdup. 2021-03-30 14:49:05 +01:00
Shati Patel
62de15cd22 Docs: Mention that binding sets are available for classes 2021-03-30 14:46:59 +01:00
Asger Feldthaus
f8bbda0cdc JS: Change note 2021-03-30 13:54:01 +01:00
Asger Feldthaus
9db235ac36 JS: Improve @google-cloud/spanner model 2021-03-30 13:54:00 +01:00
Asger Feldthaus
35f294f096 JS: Improve sequelize model 2021-03-30 13:54:00 +01:00
Mathias Vorreiter Pedersen
4b51e22bb4 Merge pull request #5565 from geoffw0/avrule79
C++: Test strdup with AV rule 79
2021-03-30 14:34:46 +02:00
Geoffrey White
ec952248a9 C++: Test strdup with AV Rule 79. 2021-03-30 12:58:04 +01:00
Geoffrey White
f27203cc43 C++: Test spacing. 2021-03-30 12:57:43 +01:00
luchua-bc
1349bf7b0b Create a .qll file to reuse the code and add check of Spring properties 2021-03-30 11:25:29 +00:00
Asger Feldthaus
93500bd95a JS: Improve mssql model 2021-03-30 11:34:01 +01:00
Asger Feldthaus
95937c9ac7 JS: Improve sqlite3 model 2021-03-30 11:34:01 +01:00
Asger Feldthaus
0b21b273ed JS: Improve pg model 2021-03-30 11:33:59 +01:00
Asger Feldthaus
937a620f4d JS: Improve mysql2 model 2021-03-30 11:33:42 +01:00
CodeQL CI
e8d7925084 Merge pull request #5555 from asgerf/js/misc-steps
Approved by esbena
2021-03-30 11:30:12 +01:00
CodeQL CI
25e26b9ac0 Merge pull request #5554 from asgerf/js/non-recursive-propref
Approved by esbena
2021-03-30 11:29:32 +01:00
CodeQL CI
6cceb73807 Merge pull request #5553 from asgerf/js/pg-promise
Approved by esbena
2021-03-30 11:28:24 +01:00
Geoffrey White
d2b991bcb5 Merge pull request #5541 from MathiasVP/definitions-for-unique_ptr
C++: Add shared_ptr and unique_ptr implementations
2021-03-30 09:47:56 +01:00
Mathias Vorreiter Pedersen
09ba25fe9b C++: Accept test changes. I'm actually not sure why we lose these results (and lose the field conflation, yay) It might be due to #3364. 2021-03-30 10:24:01 +02:00
Mathias Vorreiter Pedersen
8c95a9ae39 Merge branch 'main' into definitions-for-unique_ptr 2021-03-30 10:20:36 +02:00
Laura Coursen
2dadc752d6 Merge pull request #5563 from lecoursen/stronger-rec-to-use-lgtm.com-branch
Make stronger recommendations around the use of the lgtm.com branch
2021-03-29 14:29:24 -05:00
Laura Coursen
d57ec5d1ac Merge branch 'stronger-rec-to-use-lgtm.com-branch' of https://github.com/lecoursen/codeql into stronger-rec-to-use-lgtm.com-branch 2021-03-29 14:05:46 -05:00
Laura Coursen
e3b052199a Suggest lgtm.com branch first 2021-03-29 14:04:59 -05:00
Laura Coursen
eb01ffbdae Use correct terminology
Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com>
2021-03-29 14:03:30 -05:00
Ethan Palm
2f98212eca Merge pull request #5561 from ethanpalm/fix-broken-links
Fix broken links
2021-03-29 14:28:49 -04:00
Laura Coursen
8f1c7c57a8 Add 💅 2021-03-29 12:53:16 -05:00
Ethan P
909dc84bb6 Update broken link 2021-03-29 13:46:45 -04:00
Laura Coursen
a18cd74756 Fix typo 2021-03-29 12:42:09 -05:00
Laura Coursen
21576387f3 Add 💅 2021-03-29 12:41:48 -05:00
Laura Coursen
50523e0ac0 Clarify use cases for lgtm.com branch 2021-03-29 12:40:31 -05:00
Ethan P
d126c0a1d3 Fix broken links 2021-03-29 13:38:04 -04:00
Sarita Iyer
3db5dd4661 removed 1.23 instructions and replaced references
Removed special instructions for LGTM 1.23, and replaced leftover references to 1.23 with 1.27.
2021-03-29 13:37:55 -04:00
Sarah Edwards
108bcef104 download LGTM database from a project slug 2021-03-29 10:37:00 -07:00
Henry Mercer
0f710b1981 Merge pull request #5545 from github/henrymercer/ql-pack-version-doc-update
CodeQL CLI Docs: Mention that QL packs use SemVer versioning
2021-03-29 18:18:45 +01:00
Calum Grant
c26d05b1d5 Merge pull request #5532 from RasmusWL/python-cleanup
Python: Delete filter queries, code duplication library, and precision tag from metric queries
2021-03-29 17:16:43 +01:00
Mathias Vorreiter Pedersen
5a4efab742 C++: Add tests for shared_ptr. 2021-03-29 18:04:20 +02:00
Rasmus Wriedt Larsen
96a66fa4ee Python: Apply suggestions from code review 2021-03-29 17:02:56 +02:00
Asger Feldthaus
67ad6d9a0f JS: Update test output 2021-03-29 15:30:29 +01:00
Asger Feldthaus
faf07dac91 JS: Autoformat 2021-03-29 14:52:37 +01:00
Asger Feldthaus
3e26236648 JS: Add recursion guard test 2021-03-29 14:32:13 +01:00
Asger Feldthaus
2770a53d38 JS: More babel.transform steps 2021-03-29 13:00:23 +01:00
Asger Feldthaus
c103939c2d JS: Fix handling of createRequire 2021-03-29 12:47:23 +01:00
Asger Feldthaus
49ca88957c JS: Use types 2021-03-29 12:25:15 +01:00
Asger Feldthaus
603843e698 JS: Add task tests 2021-03-29 12:05:47 +01:00
CodeQL CI
3613ceb07f Merge pull request #5535 from tausbn/python-prevent-bad-TCs
Approved by yoff
2021-03-29 12:03:08 +01:00
Asger F
f1d0b50670 Update javascript/ql/src/semmle/javascript/frameworks/SQL.qll
Co-authored-by: Esben Sparre Andreasen <esbena@github.com>
2021-03-29 11:54:45 +01:00
Asger Feldthaus
f453fe26c6 JS: Autoformat 2021-03-29 11:28:46 +01:00
Asger Feldthaus
b381f4826c JS: Add change note 2021-03-29 11:25:28 +01:00
Asger Feldthaus
149af57eac JS: Add model of pg-promise 2021-03-29 11:25:28 +01:00
Asger Feldthaus
88fee2748e JS: Add change note 2021-03-29 11:21:03 +01:00
haby0
0775d35591 update VerificationMethodFlowConfig, add if test 2021-03-29 12:02:37 +08:00
ihsinme
3f215d0954 Update OperatorPrecedenceLogicErrorWhenUseBoolType.ql 2021-03-28 23:43:22 +03:00
ihsinme
093c63ea3b Update OperatorPrecedenceLogicErrorWhenUseBoolType.expected 2021-03-28 23:42:36 +03:00
luchua-bc
5ce3f9d6ff Update qldoc and enhance the query 2021-03-28 16:10:35 +00:00
Rasmus Wriedt Larsen
92e0e195a4 Revert "Merge pull request #5506 from tausbn/python-allow-absolute-imports-from-source-directory"
This reverts commit 8d15680af4, reversing
changes made to 63831cc62b.

This PR caused performance problems, so reverting now to clear up immediate
problems.
2021-03-27 18:08:20 +01:00
luchua-bc
a53cbc1631 Update qldoc and make the query more readable 2021-03-27 00:11:01 +00:00
Geoffrey White
c6e7b8d4fd C++: Repair test. 2021-03-26 19:12:09 +00:00
Geoffrey White
4100d68a71 C++: Test failures. 2021-03-26 18:21:05 +00:00
Geoffrey White
725122decc C++: Replace toString logic. 2021-03-26 17:29:05 +00:00
luchua-bc
a72b1340eb Add a comment on how to run the query 2021-03-26 16:51:43 +00:00
Taus Brock-Nannestad
f17bbd9982 Python: Fix another bad TC.
This one is a bit awkward, since the previous version was supposed to
improve indexing. Unfortunately this is vastly outweighed by the slow
convergence of the TC. Right now we pay the cost of inverting the
`hasFlowSource` relation, but this is still cheaper.
2021-03-26 16:38:13 +01:00
Henry Mercer
c83daa66e7 CodeQL CLI Docs: Mention that QL packs use SemVer versioning 2021-03-26 15:30:23 +00:00
Mathias Vorreiter Pedersen
b466f0515d C++: Respond to more review comments. (1) Use getClassAndName to ensure a good join order, and (2) unify the two abstract predicates on PointerWrapper. 2021-03-26 16:16:23 +01:00
Mathias Vorreiter Pedersen
0ce08617ba C++: Respond to review comments. 2021-03-26 13:42:18 +01:00
Tom Hvitved
e345064a53 C#: Performance tweaks in SsaImplCommon.qll 2021-03-26 13:24:34 +01:00
Jonas Jensen
7f16c52217 Merge pull request #3364 from github/rdmarsh/cpp/use-taint-configuration-dtt
C++: use TaintTracking::Configuration in DefaultTaintTracking
2021-03-26 12:39:25 +01:00
Tom Hvitved
1dbfe2369d Merge pull request #5542 from hvitved/csharp/update-suites
C#: Remove deleted queries from suites
2021-03-26 12:13:09 +01:00
CodeQL CI
f584ff9acf Merge pull request #5533 from asgerf/js/fix-query-metadata
Approved by esbena
2021-03-26 11:09:54 +00:00
Mathias Vorreiter Pedersen
8dc7b6403a C++: Add shared_ptr and unique_ptr implementations. Also add some very basic tests. 2021-03-26 12:03:59 +01:00
Mathias Vorreiter Pedersen
d20a0c9e82 C++: Add a class that models wrapped pointer types. 2021-03-26 11:50:06 +01:00
Asger Feldthaus
cc2a531684 JS: Cache PropRef.getBase 2021-03-26 10:48:25 +00:00
Tom Hvitved
9d1ef21d85 C#: Remove deleted queries from suites 2021-03-26 11:17:27 +01:00
Mathias Vorreiter Pedersen
c7c65736a9 C++: Accept test changes. These happened because of the incorrect usage of multiple configurations in 6c1ec6d96b. 2021-03-26 10:57:58 +01:00
Jonas Jensen
86755c6a98 Merge pull request #5515 from criemen/fix-query-metadata
C++: Fix query metadata warnings.
2021-03-26 10:19:46 +01:00
Anders Schack-Mulligen
506c95d098 Merge pull request #5372 from smowton/smowton/feature/commons-lang-models-to-csv
Java: Convert existing Commons Lang models to CSV
2021-03-26 10:18:23 +01:00
Tom Hvitved
d4ce42ac4f Merge pull request #5416 from hvitved/csharp/rework-summaries
C#: Rework flow summary implementation
2021-03-26 09:47:15 +01:00
Tom Hvitved
e93b72d563 Merge pull request #5459 from hvitved/csharp/update-nuget
C#: Update more nuget packages
2021-03-26 09:28:09 +01:00
Mathias Vorreiter Pedersen
983b64a05f Merge branch 'main' into rdmarsh/cpp/use-taint-configuration-dtt 2021-03-26 09:11:12 +01:00
Tom Hvitved
57fd2e3578 C#: Rename parameter in fieldOf() 2021-03-26 08:49:06 +01:00
luchua-bc
d33b04cd96 Query to detect plaintext credentials in Java properties files 2021-03-26 02:33:40 +00:00
Porcuiney Hairs
2ca95166d9 Java : add query to detect insecure loading of Dex File 2021-03-26 01:59:11 +05:30
yoff
208d5157fa Merge pull request #5500 from RasmusWL/django-forms
Python: Model RemoteFlowSources on Django forms/fields
2021-03-25 20:43:19 +01:00
Taus Brock-Nannestad
c2f112cb92 Python: Filter _before_ the cartesian product
It's always a sad thing to see a good plan go wrong:

86860032 ~0%      {4} r26 = JOIN r19 WITH DataFlowPublic::TupleElementContent#class#ff CARTESIAN PRODUCT OUTPUT Lhs.0 'nodeFrom', Lhs.1 'nodeTo', Rhs.0, Rhs.1
129256   ~3%      {4} r27 = SELECT r26 ON In.3 <= 7
129256   ~0%      {3} r28 = SCAN r27 OUTPUT In.0 'nodeFrom', In.2 'c', In.1 'nodeTo'

Happily, now it looks like this:

129256  ~0%      {3} r20 = JOIN r19 WITH DataFlowPrivate::small_tuple#f CARTESIAN PRODUCT OUTPUT Lhs.0 'nodeFrom', Rhs.0, Lhs.1 'nodeTo'
2021-03-25 19:06:05 +01:00
Erik Krogh Kristensen
5e59f6d558 Update javascript/ql/src/semmle/javascript/security/dataflow/ShellCommandInjectionFromEnvironmentCustomizations.qll
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com>
2021-03-25 19:03:37 +01:00
Taus Brock-Nannestad
8734df334b Python: Slight cleanup 2021-03-25 18:35:16 +01:00
Taus Brock-Nannestad
229250dc54 Python: Limit size of TupleElementContent
A more principled approach is possible here, but in the short term
this will prevent an explosion.

For reference, openstack/cinder has roughly 19000 `ForTarget`s and
tuples of size up to 5300, and we were calculating the cartesian
product of these.
2021-03-25 18:28:49 +01:00
yoff
716e0f1404 Merge pull request #5517 from tausbn/python-prevent-potentially-bad-join-order
Python: Prevent potentially bad join order
2021-03-25 18:14:47 +01:00
Tom Hvitved
f100c8a9c0 C++: Make Windows autobuilder tests pass again 2021-03-25 17:43:48 +01:00
Tom Hvitved
ed78acb1d4 C#: Update more nuget packages 2021-03-25 17:32:12 +01:00
Taus Brock-Nannestad
dbef36cbbb Python: Prevent bad TC and add a bit of caching
Using `simpleLocalFlowStep+` with the first argument specialised to
`CfgNode` was causing the compiler to turn this into a very slowly
converging manual TC computation.

Instead, we use `simpleLocalFlowStep*` (which is fast) and then join
that with a single step from any `CfgNode`. This should amount to the
same thing.

I also noticed that the charpred for `LocalSourceNode` was getting
recomputed a lot, so this is now cached. (The recomputation was
especially bad since it relied on `simpleLocalFlowStep+`, but anyway
it's a good idea not to recompute this.)
2021-03-25 17:28:37 +01:00
Chris Smowton
eaa2d4d831 Stop using wildcard Argument
All instances are replaced with a specific Argument or range.
2021-03-25 15:42:35 +00:00
Chris Smowton
2f34588770 Constructor models: use Argument[-1] for the result, not ReturnValue 2021-03-25 15:23:08 +00:00
Asger Feldthaus
a456458a38 JS: Add change note for code duplication library removal 2021-03-25 15:21:48 +00:00
Asger Feldthaus
446ad5ec9e JS: Remove code duplication library 2021-03-25 15:20:59 +00:00
Asger Feldthaus
c812bd948a JS: Add @problem.severity to an example query 2021-03-25 15:14:48 +00:00
Asger Feldthaus
7aae51c876 JS: Add change note for filter query removal 2021-03-25 15:13:51 +00:00
Anders Schack-Mulligen
28fb0edfbe Merge pull request #4920 from luchua-bc/java/hash-without-salt
Java: Query to detect hash without salt
2021-03-25 16:13:26 +01:00
Asger Feldthaus
6cab85712f JS: Delete filter queries 2021-03-25 15:12:35 +00:00
Asger Feldthaus
1c27ca610a JS: Remove precision atags from metric queries 2021-03-25 15:12:09 +00:00
Chris Smowton
a5220bf616 Convert StrBuilder models to CSV 2021-03-25 15:11:52 +00:00
Chris Smowton
25a0e09130 Convert StringUtils models to CSV 2021-03-25 15:11:52 +00:00
Chris Smowton
1beac06236 Translate ArrayUtils models to CSV 2021-03-25 15:11:51 +00:00
Chris Smowton
7fb5bd0cab Add tests for and slightly expand models of Commons Lang's ArrayUtils class 2021-03-25 15:11:51 +00:00
Rasmus Wriedt Larsen
9abe02f419 Python: Fix query metadata for old queries that have been ported
I'm not sure even I want to keep these around much longer. They seem to be
causing more problem than they are doing good.
2021-03-25 16:01:56 +01:00
Jonas Jensen
bc9682c22d Merge pull request #5528 from MathiasVP/fix-join-order-in-avrule-79
C++: Fix join order in AV rule 79
2021-03-25 15:45:41 +01:00
Rasmus Wriedt Larsen
ed2cb739c5 Merge pull request #5486 from yoff/python-document-api-import-node
Python, doc: Note ephemeral nature of import nodes
2021-03-25 15:45:10 +01:00
Anders Schack-Mulligen
344c2d3c3d Update java/ql/src/experimental/Security/CWE/CWE-759/HashWithoutSalt.ql 2021-03-25 15:42:57 +01:00
Tom Hvitved
90868a4788 Merge pull request #5524 from hvitved/csharp/cleanup
C#: Remove legacy queries and `@precision` tags from metric queries
2021-03-25 15:36:12 +01:00
Rasmus Wriedt Larsen
203b0e3d88 Python: Add change note 2021-03-25 15:34:09 +01:00
Tom Hvitved
cdd613358b C#: Sync SSA files 2021-03-25 15:33:06 +01:00
Tom Hvitved
7e20829f36 Merge remote-tracking branch 'upstream/main' into csharp/rework-summaries 2021-03-25 15:32:32 +01:00
Tom Hvitved
6a3859fc83 C#: Remove unnecessary pre call in FlowSummaryImpl.qll 2021-03-25 15:31:43 +01:00
Rasmus Wriedt Larsen
bd4934380a Python: Remove code duplication library 2021-03-25 15:27:55 +01:00
Tom Hvitved
33c990f6b0 Merge pull request #5440 from hvitved/csharp/cil/ssa
C#: Add CIL SSA library
2021-03-25 15:22:40 +01:00
Erik Krogh Kristensen
3d49b8cb91 consider quoted string concatenations as sanitizers for js/shell-command-injection-from-environment 2021-03-25 15:17:02 +01:00
yo-h
0fe4baec34 Merge pull request #5525 from aschackmull/java/cleanup
Java: Delete filter queries, code duplication library, and precision tag from metric queries.
2021-03-25 10:09:41 -04:00
Rasmus Wriedt Larsen
09fbf480db Python: Remove precision tag from metric queries 2021-03-25 15:06:47 +01:00
Rasmus Wriedt Larsen
e3b2e0a1de Python: Delete filter queries 2021-03-25 15:06:46 +01:00
Erik Krogh Kristensen
3b82452d76 detect fs modules that pass through a reduce call 2021-03-25 14:47:43 +01:00
Anders Schack-Mulligen
75afa011ff Java: Add metadata to several more experimental queries. 2021-03-25 13:09:26 +01:00
CodeQL CI
e90035a5a5 Merge pull request #5439 from erik-krogh/topPack
Approved by esbena
2021-03-25 11:49:03 +00:00
Mathias Vorreiter Pedersen
24360d3a4c C++: Fix join order in AV rule 79 by joining with GVN after the recursive call. 2021-03-25 12:00:49 +01:00
Erik Krogh Kristensen
77ba7b473d Merge branch 'main' into topPack 2021-03-25 11:52:58 +01:00
CodeQL CI
0511e72520 Merge pull request #5458 from erik-krogh/shellTrue
Approved by asgerf
2021-03-25 10:49:24 +00:00
luchua-bc
57bd3f3c14 Optimize the taint flow source 2021-03-25 10:44:26 +00:00
Tom Hvitved
6bfc49c069 C#: Address review comments 2021-03-25 11:43:25 +01:00
yoff
32b264bdee Apply suggestions from code review
Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com>
2021-03-25 10:48:59 +01:00
Anders Schack-Mulligen
d53c334488 Merge branch 'java/fix-experimental-query-metadata' into java/cleanup 2021-03-25 10:36:36 +01:00
Anders Schack-Mulligen
28ff3f412d Java: Add severity and precision metadata to experimental queries. 2021-03-25 10:29:47 +01:00
Cornelius Riemenschneider
867471b122 C++: Delete old queries. 2021-03-25 10:23:17 +01:00
CodeQL CI
9d52db3ca7 Merge pull request #5507 from erik-krogh/joins
Approved by asgerf
2021-03-25 09:18:26 +00:00
Anders Schack-Mulligen
5b905cfe18 Java: Add change note for code duplication library removal. 2021-03-25 10:12:58 +01:00
Anders Schack-Mulligen
1564aee57a Java: Add change note for filter query removal. 2021-03-25 10:11:30 +01:00
Anders Schack-Mulligen
c82b5eb040 Java: Remove code duplication library. 2021-03-25 10:06:10 +01:00
Asger Feldthaus
dbc6cf63c2 JS: Fix bad join order in PropertyProjection 2021-03-25 09:00:10 +00:00
Asger Feldthaus
bd3f6d1234 JS: Add o[o.length] = y taint step 2021-03-25 09:00:10 +00:00
Asger Feldthaus
51f489211b JS: Support react-native-base64 2021-03-25 09:00:10 +00:00
Asger Feldthaus
5d9778c64d JS: Step through babel.transform 2021-03-25 09:00:10 +00:00
Asger Feldthaus
3e67ebacb0 JS: Support lodash-es 2021-03-25 09:00:10 +00:00
Erik Krogh Kristensen
3b6b40489f Merge branch 'main' into topPack 2021-03-25 09:58:15 +01:00
Anders Schack-Mulligen
4b7440d4d5 Java: Remove precision tag from metric queries. 2021-03-25 09:52:05 +01:00
Tom Hvitved
419fbe77ab C#: Remove @precision tags from metric queries 2021-03-25 09:50:24 +01:00
Tom Hvitved
b83da2255c C#: Add change note 2021-03-25 09:50:24 +01:00
Tom Hvitved
b94c189946 C#: Remove VulnerablePackage.ql query 2021-03-25 09:50:24 +01:00
Tom Hvitved
7e33b571c9 C#: Add change note 2021-03-25 09:50:24 +01:00
Tom Hvitved
eeb8c74666 C#: Remove filter and external queries
These are legacy queries that are no longer used.
2021-03-25 09:50:01 +01:00
Anders Schack-Mulligen
70824b3f0b Java: Delete filter queries. 2021-03-25 09:47:31 +01:00
Esben Sparre Andreasen
801eb538db Merge pull request #5514 from github/aibaars/fix-javascript-metadata
Javascript: remove bad QLDoc tag
2021-03-25 08:56:08 +01:00
luchua-bc
fe0e7f5eac Change method check to taint flow 2021-03-25 01:45:13 +00:00
luchua-bc
08c3bf26d5 Update the query to accommodate more cases 2021-03-24 23:32:27 +00:00
Taus Brock-Nannestad
0ae8b69102 Python: Prevent joining on scope in PointsToContext::appliesTo
One of those cases where I _wish_ `pragma[inline]` also meant "don't
join on the stuff inside this predicate -- it's inlined for a reason".

Unsurprisingly, joining on the scope first works poorly.
2021-03-24 23:12:48 +01:00
Taus Brock-Nannestad
28d6cad3d0 Python: Prevent joining on name as the first thing
Many instances of `lookup` are restricted by the presence of
`attributeRequired`, but this does not work well if we join on
`name`. A few instances of `only_bind_into` prevents this.
2021-03-24 23:11:09 +01:00
yo-h
72ae902e0d Merge pull request #5371 from aschackmull/java/framework-coverage
Java: Add query for CSV framework coverage.
2021-03-24 17:36:13 -04:00
Erik Krogh Kristensen
c146b27c1a Merge branch 'main' into shellTrue 2021-03-24 20:09:23 +01:00
CodeQL CI
8ff9c98d26 Merge pull request #5449 from erik-krogh/asExec
Approved by esbena
2021-03-24 19:04:30 +00:00
Aditya Sharad
32dc894d54 Merge pull request #5516 from github/adityasharad/actions/remove-docs-review-workflow
Actions: Remove docs-review workflow
2021-03-24 11:48:03 -07:00
Aditya Sharad
a0465d20cb Actions: Remove docs-review workflow
Being replaced by internal automation that polls the repo for open labelled PRs, since this workflow currently cannot tag the docs team in a comment.
2021-03-24 11:26:00 -07:00
Taus Brock-Nannestad
ed8ffab356 Python: Prevent potentially bad join order
This has no effect on the current compilation (indeed,
`ssa_filter_definition_bool` is not currently inlined), but will
prevent this from ever occurring, should the heuristics for inlining
ever change...
2021-03-24 19:20:19 +01:00
Cornelius Riemenschneider
47530d7526 C++: Fix query metadata warnings. 2021-03-24 18:01:21 +01:00
Arthur Baars
b25dc03dac Javascript: remove bad QLDoc tag 2021-03-24 16:47:27 +01:00
Asger Feldthaus
e13a9c9716 JS: Avoid recursion through SourceNode::Range, again 2021-03-24 15:26:50 +00:00
Anders Schack-Mulligen
d3485cac34 Merge pull request #5512 from aschackmull/java/csv-argument-ranges
Java: Support argument and parameter ranges in CSV models.
2021-03-24 15:03:22 +01:00
yoff
8d15680af4 Merge pull request #5506 from tausbn/python-allow-absolute-imports-from-source-directory
Python: Allow absolute imports in directories with scripts
2021-03-24 14:42:14 +01:00
Anders Schack-Mulligen
4955f95f64 Apply suggestions from code review
Clarify documentation.

Co-authored-by: Chris Smowton <smowton@github.com>
2021-03-24 14:32:18 +01:00
Anders Schack-Mulligen
63831cc62b Merge pull request #5099 from porcupineyhairs/javaLogInjection
Java : Add Log Injection Vulnerability
2021-03-24 14:30:34 +01:00
yoff
b023d73016 Merge pull request #5504 from RasmusWL/type-tracking-first-predicate-private
Python: Ensure first type-tracking predicate is private
2021-03-24 14:23:27 +01:00
Rasmus Wriedt Larsen
1473778bb8 Merge pull request #5493 from yoff/python-add-experimental-structure
Python: Add stub structure to `experimental` for external contributions
2021-03-24 14:11:13 +01:00
Rasmus Wriedt Larsen
70974ea197 Python: Fix grammar in QLDoc
Co-authored-by: yoff <lerchedahl@gmail.com>
2021-03-24 14:06:06 +01:00
Taus Brock-Nannestad
47686a6e4c Python: Disregard all files matching .py% 2021-03-24 14:03:00 +01:00
Taus Brock-Nannestad
8d30ee5c3c Python: Include unmarked Python file in snapshot
Sadly, it seems we're not interpreting this as Python code, even if we
explicitly ask to have it included.
2021-03-24 14:01:13 +01:00
Anders Schack-Mulligen
a1ccbcdaf1 Merge pull request #5260 from artem-smotrakov/spring-http-invoker
Java: Query for detecting unsafe deserialization with Spring exporters
2021-03-24 13:57:17 +01:00
Asger Feldthaus
de879c0707 JS: Make PropRef.getBase non-recursive 2021-03-24 12:57:16 +00:00
Asger Feldthaus
2f2d72f282 JS: Improve react-router support 2021-03-24 12:53:26 +00:00
Asger Feldthaus
88932a495c JS: Handle redux-form HOCs 2021-03-24 12:53:26 +00:00
Rasmus Wriedt Larsen
59200386a7 Python: Fix mistake in refactor 2021-03-24 13:51:29 +01:00
Tom Hvitved
f2fb26df37 C#: Document input/output stack restrictions 2021-03-24 13:48:32 +01:00
CodeQL CI
e3ab94fc6b Merge pull request #5498 from asgerf/js/flow-through-accessors
Approved by erik-krogh, max-schaefer
2021-03-24 12:46:05 +00:00
Anders Schack-Mulligen
41168e2b36 Java: Support argument and parameter ranges. 2021-03-24 13:32:30 +01:00
Anders Schack-Mulligen
234f62fd05 Java: Merge packages that likely belong to the same framework. 2021-03-24 13:17:04 +01:00
Taus Brock-Nannestad
6d86239929 Python: Test all cases
Note that the test in `no_py_extension` isn't complete, since we're
not extracting the `main` file there.
2021-03-24 13:15:59 +01:00
Erik Krogh Kristensen
9610ed163a remove SourceNode type to preserve behavior 2021-03-24 11:59:56 +01:00
CodeQL CI
12a6410a0a Merge pull request #5478 from asgerf/js/shared-flow-step
Approved by erik-krogh
2021-03-24 10:58:30 +00:00
Tom Hvitved
c5c80204d5 C#: Rework flow summary implementation 2021-03-24 11:27:01 +01:00
Tom Hvitved
c96b8301ed C#: Add change note 2021-03-24 09:58:44 +01:00
haby0
3df23eecb6 Merge remote-tracking branch 'upstream/main' into JsonHijacking 2021-03-24 15:52:01 +08:00
Anders Schack-Mulligen
02a5c0875e Merge pull request #5502 from smowton/smowton/fix/less-fluent-method-inferred-edges
Java: partial revert: only introduce inferred taint edges from callsite-crossing value edges if an original taint edge targets the *start* of the value edge.
2021-03-24 08:41:51 +01:00
Rasmus Lerchedahl Petersen
a9af135d7e Python: Remove getALocalTaintSource
and `taintFlowsTo` for now..
2021-03-24 01:22:21 +01:00
yoff
ac0430883a Update docs/codeql/codeql-language-guides/using-api-graphs-in-python.rst
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-03-24 01:08:12 +01:00
yoff
61cff8faed Update python/ql/src/experimental/semmle/python/Concepts.qll
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-03-24 01:06:03 +01:00
Erik Krogh Kristensen
b8bfdcc719 improve performance in ServiceDefinitions by inlining, and refactoring away a SourceNode 2021-03-23 19:13:40 +01:00
Erik Krogh Kristensen
93bcc3724a use pragma to improve 2 join-orders in TaintTracking 2021-03-23 19:12:33 +01:00
Taus Brock-Nannestad
17d1768259 Python: Allow absolute imports in directories with scripts
Fixes the import logic to account for absolute imports.

We do this by classifying which files and folders may serve as the
entry point for execution, based on a few simple heuristics. If the
file `module.py` is in the same folder as a file `main.py` that may be
executed directly, then we allow `module` to be a valid name for
`module.py` so that `import module` will work as expected.
2021-03-23 18:32:17 +01:00
Taus Brock-Nannestad
4289e358bf Python: Add module import test case
This one will require some explanation...

First, the file structure. This commit adds a test consisting
representing a few different kinds of imports.

- Absolute imports, from `module.py` to `main.py` when the latter is
  executed directly.
- A package (contained in the `package` folder)
- A namespace package (contained in the `namespace_package` folder)

All of these are inside a folder called `code` for reasons I will
detail later.

The file `main.py` is identified as a script, by the presence of the
`!#` comment in its first line.

The files themselves are executable, and `python3 main.py` will print
out all modules in the order they are imported.

The test itself is very simple. It simply lists all modules and their
corresponding names. As is plainly visible, without modification we
only pick up `package` and its component modules as having names. This
is the bit that needs to be fixed.

Convincing the test runner to extract this test in a way that mimics
reality is, unfortunately, a bit complicated. By default, the test
runner itself includes any Python files in the test directory as
modules in the invocation of the extractor, and so we must hide
everything in the `code` subdirectory.

Secondly, a `--path` argument (set to the test directory) is
automatically added, and this would also interfere with extraction,
and hence we must prevent this. Luckily, if we supply our own `--path`
argument -- even if it doesn't make any sense -- then the other
argument is left out.

Finally, we must actually tell the extractor to extract the files (or
it would just happily pass the test with zero files extracted), so the
`-R .` argument ensures that we recurse over the files in the test
directory after all.
2021-03-23 18:21:58 +01:00
Tom Hvitved
6d6150d051 C#: Change some data-flow toString()s 2021-03-23 16:42:58 +01:00
Rasmus Wriedt Larsen
deefbefffc Python: Minor refactor to use CallCfgNode 2021-03-23 16:42:41 +01:00
Rasmus Wriedt Larsen
1f5e52e822 Python: Cleanup "first" type-tracking predicate to be private
Since it's exposed nicely in the version that doesn't have a
`DataFlow::TypeTracker` parameter, these should be private.

Also found one instance where I had accidentially used DataFlow::Node instead of
LocalSourceNode
2021-03-23 16:40:56 +01:00
Asger Feldthaus
98cee7d339 JS: Update Collection step test and its output 2021-03-23 14:53:15 +00:00
Asger Feldthaus
c067d519d9 JS: Inline some public predicates in GlobalAccessPaths 2021-03-23 14:53:15 +00:00
Asger Feldthaus
61e89d4841 JS: Cache StepSummary and PropertyName 2021-03-23 14:53:14 +00:00
Asger Feldthaus
0056c39bdd JS: Deprecate AdditionalFlowStep 2021-03-23 14:53:14 +00:00
Asger Feldthaus
9e6aac8ef4 JS: Deprecate CollectionFlowStep 2021-03-23 14:53:14 +00:00
Asger Feldthaus
f8f3770a58 JS: BadRandomness can just use type-tracking now 2021-03-23 14:53:14 +00:00
Asger Feldthaus
52c2e37aca JS: Update CollectionStep usage in HTTP 2021-03-23 14:53:14 +00:00
Asger Feldthaus
2759d53f42 JS: SetKeys 2021-03-23 14:53:14 +00:00
Asger Feldthaus
c5ddd40dc3 JS: MapAndSetValues 2021-03-23 14:53:14 +00:00
Asger Feldthaus
9abaad65c6 JS: MapSet 2021-03-23 14:53:14 +00:00
Asger Feldthaus
530be38b84 JS: MapGet 2021-03-23 14:53:14 +00:00
Asger Feldthaus
4a45731c85 JS: SetMapForEach 2021-03-23 14:53:14 +00:00
Asger Feldthaus
c9c99464cf JS: ForOfStep (unify with Arrays version) 2021-03-23 14:53:13 +00:00
Asger Feldthaus
1a5eede39f JS: SetConstructor 2021-03-23 14:53:13 +00:00
Asger Feldthaus
5c9a239776 JS: SetAdd 2021-03-23 14:53:13 +00:00
Asger Feldthaus
98398a9efd JS: add two-prop version of loadStoreStep and infer pseudo properties
Initial step towards migrating CollectionFlowStep to PreCallGraphStep
2021-03-23 14:53:13 +00:00
Asger Feldthaus
67ec5d325c JS: Stop caching AdditionalFlowStep 2021-03-23 14:53:13 +00:00
Asger Feldthaus
adaf3234ec JS: IteratorExceptionStep 2021-03-23 14:53:13 +00:00
Asger Feldthaus
7021be05c5 JS: FlowStepThroughImport 2021-03-23 14:53:13 +00:00
Asger Feldthaus
52279d4bea JS: Rename some test predicates to reflect reality 2021-03-23 14:53:13 +00:00
Asger Feldthaus
fae907df65 JS: Update some uses in tests 2021-03-23 14:53:13 +00:00
Asger Feldthaus
bda074835e JS: Replace uses in ExternalApiUsedWithUntrustedData 2021-03-23 14:53:12 +00:00
Asger Feldthaus
2012e97842 JS: NextJSStaticReactComponentPropsStep 2021-03-23 14:53:12 +00:00
Asger Feldthaus
64c7d4e597 JS: NextJSStaticPropsStep 2021-03-23 14:53:12 +00:00
Asger Feldthaus
0035defd72 JS: ExceptionStep 2021-03-23 14:53:12 +00:00
Asger Feldthaus
5051f10586 JS: ImmutableConstructionStep 2021-03-23 14:53:12 +00:00
Asger Feldthaus
3e54136086 JS: Rename EventEmitterFlowStep to reflect reality 2021-03-23 14:53:12 +00:00
Asger Feldthaus
5fe3c1a0a9 JS: EventEmitterTaintStep 2021-03-23 14:53:12 +00:00
Asger Feldthaus
3a2f87f0a7 JS: AdditionalTypeTrackingStep -> SharedTypeTrackingStep 2021-03-23 14:53:12 +00:00
Asger Feldthaus
b8049f19e2 JS: SharedFlowStepFromPreCallGraph 2021-03-23 14:53:12 +00:00
Asger Feldthaus
8f750d4ad3 JS: UrlSearchParamsTaintStep 2021-03-23 14:53:12 +00:00
Asger Feldthaus
f84a05526d JS: ArraySliceStep 2021-03-23 14:53:11 +00:00
Asger Feldthaus
633152940c JS: ArrayConcatStep 2021-03-23 14:53:11 +00:00
Asger Feldthaus
17d1e6d614 JS: ArraySpliceStep 2021-03-23 14:53:11 +00:00
Asger Feldthaus
5d6c6b4b9b JS: ArrayCreationStep 2021-03-23 14:53:11 +00:00
Asger Feldthaus
5bfd2ad07f JS: ArrayPopStep 2021-03-23 14:53:11 +00:00
Asger Feldthaus
36a8134490 JS: ArrayIndexingAccess 2021-03-23 14:53:11 +00:00
Asger Feldthaus
b7ae62c3a3 JS: ArrayAppendStep 2021-03-23 14:53:11 +00:00
Asger Feldthaus
1c815f12da JS: ArrayCopySpread 2021-03-23 14:53:11 +00:00
Asger Feldthaus
151420fd0f JS: ArrayFrom 2021-03-23 14:53:11 +00:00
Asger Feldthaus
e42f8439de JS: Replace uses of AdditionalFlowStep with SharedFlowStep 2021-03-23 14:53:10 +00:00
Asger Feldthaus
24539dc0ee JS: Remove unneeded default case in loadStoreStep 2021-03-23 14:53:10 +00:00
CodeQL CI
a43bb1fb6d Merge pull request #5499 from asgerf/js/non-recursive-sourcenode
Approved by erik-krogh
2021-03-23 14:52:10 +00:00
Asger Feldthaus
23d2f11840 JS: Handle inheritance 2021-03-23 14:39:37 +00:00
Chris Smowton
fa90655dd0 Partial revert: only introduce inferred taint edges from callsite-crossing value edges if an original taint edge targets the *start* of the value edge.
Previously we would also take a taint edge targeting a result and a value-preserving edge propagating another argument to the result to imply a taint edge targeting that argument.
2021-03-23 14:35:03 +00:00
Asger Feldthaus
3d94ccf5dd JS: Support accessor-calls in object literals via local flow 2021-03-23 14:16:06 +00:00
Mathias Vorreiter Pedersen
ce638096de Merge pull request #5492 from geoffw0/samateissue
C++: Test taint regression
2021-03-23 14:01:03 +01:00
Rasmus Wriedt Larsen
f2bc413318 Python: remove single commented out line of code 2021-03-23 14:00:38 +01:00
Tom Hvitved
3c26779f40 Merge pull request #5415 from tamasvajk/feature/async-flow
C#: add store step for return statements inside async methods
2021-03-23 13:59:19 +01:00
Rasmus Wriedt Larsen
a4924856a2 Python: Model known form/field subclasses in Django
I used some ad-hoc QL queries to help me find all these extra instances, but not
quite ready to share that code yet :P
2021-03-23 13:57:39 +01:00
Rasmus Wriedt Larsen
8d0f6086af Python: Model django forms/fields
I'm not feeling 100% confident about `SelfRefMixin`, but since I needed it for
both DjangoViewClass and DjangoFormClass, I wanted to avoid copy-pasting this
code around. However, I'm not so opitimistic about it that I want to add it to a
sharable utility qll file :D
2021-03-23 13:57:38 +01:00
Anders Schack-Mulligen
27408fefe2 Merge pull request #5008 from torque59/cwe-346
Java: Queries to detect remote source flow origins to CORS header.
2021-03-23 13:54:00 +01:00
Anders Schack-Mulligen
9a56601dd3 Merge pull request #5164 from luchua-bc/java/insecure-ldap-endpoint
Java: CWE-297 Query to detect insecure LDAP endpoint configuration
2021-03-23 13:53:51 +01:00
Asger Feldthaus
b5be9d07aa JS: Add change note 2021-03-23 12:51:14 +00:00
Geoffrey White
b38a9d51e6 C++: Effect of 'Don't override getParameterSizeIndex in the model for Accept'... 2021-03-23 12:26:59 +00:00
Geoffrey White
13eb9e0833 C++: Fix the test. 2021-03-23 12:26:58 +00:00
Geoffrey White
30e1b88b7f C++: Extend test. 2021-03-23 12:26:58 +00:00
Asger Feldthaus
6c8b4a82c1 JS: Autoformat 2021-03-23 11:55:37 +00:00
Geoffrey White
da08c6e63e Merge pull request #5496 from MathiasVP/accept-model-getParameterSizeIndex-should-be-none
C++: Don't override getParameterSizeIndex in Accept
2021-03-23 11:42:50 +00:00
Asger Feldthaus
98143b071d JS: Autoformat 2021-03-23 11:26:29 +00:00
Anders Schack-Mulligen
1e6b5391d6 Merge pull request #4994 from haby0/main
Java: CWE-652: Improper Neutralization of Data within XQuery Expressions ('XQuery Injection')
2021-03-23 12:05:53 +01:00
Taus
b46a3616d8 Merge pull request #5490 from RasmusWL/private-imports
Python: Make import private for better auto-complete
2021-03-23 12:00:35 +01:00
Mathias Vorreiter Pedersen
585606a933 C++: Respond to review comments. 2021-03-23 11:14:29 +01:00
Mathias Vorreiter Pedersen
0b4650a4c9 C++: Accept test changes. 2021-03-23 10:27:19 +01:00
Tom Hvitved
20aa05b090 C#: Add CIL SSA library 2021-03-23 10:07:36 +01:00
Mathias Vorreiter Pedersen
7d0cfc69f1 C++: Don't override getParameterSizeIndex in the model for Accept. This fixes IR construction of calls to accept. 2021-03-23 09:53:09 +01:00
Mathias Vorreiter Pedersen
0ff7cc845c C++: Add reduced testcase that broke IR construction in #5492. 2021-03-23 09:53:04 +01:00
yoff
921b560e89 Merge pull request #5489 from tausbn/python-make-getacall-return-a-callcfgnode
Python: Make `API::Node::getACall` return a `CallCfgNode`
2021-03-23 09:31:38 +01:00
Rasmus Lerchedahl Petersen
198a4ca79b Python: Add files to experimental 2021-03-22 21:42:06 +01:00
Marcono1234
993999f64f Java: Add test for negative numeric literals 2021-03-22 17:43:34 +01:00
Asger Feldthaus
6b19e69d30 JS: Fix some join orders 2021-03-22 16:17:19 +00:00
Rasmus Wriedt Larsen
1890e63d4c Python: Make import private for better auto-complete
With the non-private imports, auto-completing on `API::` gave ALL results
available from `import python`, as well as the ones specified in the `API`
module.

The non-private import in Attributes.qll did the same for `DataFlow::`.
2021-03-22 16:45:44 +01:00
Taus Brock-Nannestad
4a6589d0ae Python: Make API::Node::getACall return a CallCfgNode
This should eliminate the need for explicit casting to
`CallCfgNode` (which does not appear in our code as far as I can see,
but was observed in an external contribution).
2021-03-22 16:37:24 +01:00
Asger Feldthaus
42e6c7eb2e JS: Remove field from InvokeNode 2021-03-22 15:19:31 +00:00
Asger Feldthaus
c03e9d6c75 JS: Address review comments 2021-03-22 15:19:31 +00:00
Asger Feldthaus
5bfdca895b JS: Remove recursive def of SourceNode::Range 2021-03-22 15:07:38 +00:00
Asger Feldthaus
230b9cf5d3 JS: Avoid recursion in SourceNode::Range 2021-03-22 15:07:38 +00:00
Shati Patel
34e25624e0 Merge pull request #5488 from github/rc/3.1
Merge release candidate branch back into main
2021-03-22 14:28:25 +00:00
Rasmus Lerchedahl Petersen
c1e3ccfb6c Python, doc: Note ephemeral nature of import nodes 2021-03-22 15:07:51 +01:00
Shati Patel
c7a79a51fe Merge pull request #5479 from github/shati-patel/docs-bump-version
Docs: Prepare supported languages/frameworks for 1.27 release
2021-03-22 13:50:53 +00:00
Rasmus Wriedt Larsen
c8a6e837b5 Python: Model QuerySet chains in django 2021-03-22 14:38:54 +01:00
CodeQL CI
119872d8a4 Merge pull request #5461 from erik-krogh/moreOutDir
Approved by asgerf
2021-03-22 13:27:14 +00:00
Mathias Vorreiter Pedersen
257fc7459d Update categories for new the C++ libraries. 2021-03-22 13:28:48 +01:00
yo-h
b495e1efab Merge pull request #5411 from aschackmull/java/dataflow-lambda-dispatch
Java: Bugfix dispatch to lambda in call context.
2021-03-22 08:25:21 -04:00
Jonas Jensen
0bfeba5251 Merge pull request #5414 from criemen/diagnostic-queries
C++: Extractor/database diagnostic errors
2021-03-22 13:23:24 +01:00
Anders Schack-Mulligen
f681d584bd Merge pull request #5474 from Marcono1234/marcono1234/string-building-type
Java: Add StringBuildingType
2021-03-22 13:16:54 +01:00
Shati Patel
0f83722767 Revert JS changes and add another Java entry 2021-03-22 12:01:08 +00:00
Anders Schack-Mulligen
58fe81db2e Merge pull request #5455 from hvitved/dataflow/lambda-doc
Data flow: Add section on lambda flow to `dataflow.md`
2021-03-22 12:54:46 +01:00
Shati Patel
c5ef57c408 Update docs/codeql/support/reusables/frameworks.rst
Co-authored-by: Chris Smowton <smowton@github.com>
2021-03-22 11:40:13 +00:00
Tamas Vajk
7a0bfd1a69 Skip through any stub preamble 2021-03-22 12:29:13 +01:00
Asger Feldthaus
54a91c73b0 JS: Tweak summarizedHigherOrderCall 2021-03-22 10:56:03 +00:00
CodeQL CI
a889316003 Merge pull request #5428 from asgerf/js/cheat-sheet-tweak
Approved by esbena
2021-03-22 10:51:26 +00:00
Shati Patel
343f4e442f Add "TODO"s 2021-03-22 10:46:29 +00:00
Shati Patel
9e84b756f7 Update supported frameworks 2021-03-22 10:40:17 +00:00
Mathias Vorreiter Pedersen
d09458a486 C++: Add another taint tracking copy to identical-files.json 2021-03-22 11:35:59 +01:00
Mathias Vorreiter Pedersen
7ec86b5e7f C++: AdjustedConfiguration should not extend the same dataflow configuration as FromGlobalVarTaintTrackingCfg as this causes multiple configurations to be in scope for dataflow. 2021-03-22 11:35:29 +01:00
Cornelius Riemenschneider
668841cefa C++: Rename diagnostic queries. 2021-03-22 11:13:49 +01:00
Shati Patel
b422a972bf Update conf.py 2021-03-22 10:00:18 +00:00
haby0
fe046ec71e Merge remote-tracking branch 'upstream/main' into main 2021-03-22 17:25:37 +08:00
Rasmus Wriedt Larsen
3a83ecf067 Python: Add test for taint in django forms/fields 2021-03-22 10:03:32 +01:00
Tom Hvitved
98558c7c59 Update docs/ql-libraries/dataflow/dataflow.md
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com>
2021-03-22 09:42:27 +01:00
Anders Schack-Mulligen
36962b8438 Merge pull request #5468 from Marcono1234/marcono1234/floating-point-literal-value
Java: Add value predicates for float and double literals; improve tests
2021-03-22 09:02:31 +01:00
Rasmus Wriedt Larsen
f800bf243f Python: Better text for getSourceType in Django 2021-03-22 01:39:19 +01:00
Rasmus Wriedt Larsen
701b935564 Python: Add example of QuerySet chain (django) 2021-03-22 00:57:43 +01:00
Marcono1234
1534b387bb Java: Improve documentation regarding minus in front of numeric literals 2021-03-22 00:54:14 +01:00
Marcono1234
cd059eb965 Java: Add StringBuildingType 2021-03-22 00:19:23 +01:00
Artem Smotrakov
6c24699403 Cover both javax.el and jakarta.el packages 2021-03-21 21:19:39 +03:00
Artem Smotrakov
adb1ed380a Added tests for Jakarta expression injection 2021-03-21 21:19:39 +03:00
Artem Smotrakov
73e940de74 Added query for Jakarta EL injections
- Added JakartaExpressionInjection.ql
- Added a qhelp file with examples
2021-03-21 21:19:39 +03:00
Marcono1234
fa98443bb7 Java: Add value predicates for float and double literals; improve tests 2021-03-21 18:07:55 +01:00
yo-h
0200aedc2e Java 16: adjust test options 2021-03-21 12:55:25 -04:00
ihsinme
26bac9f425 Apply suggestions from code review
Co-authored-by: Robert Marsh <rdmarsh2@gmail.com>
2021-03-21 15:25:29 +03:00
Asger Feldthaus
a54e810804 JS: Include accessor-calls in CallGraph.ql 2021-03-20 13:59:38 +00:00
Asger Feldthaus
f4a476ea4e JS: Change type ValueNode -> Node 2021-03-20 09:05:04 +00:00
Dilan
1385b22642 pr fixes, typo in qhelp file and helper method for queries 2021-03-19 16:43:29 -07:00
Erik Krogh Kristensen
b565e3de91 expand outDir support in tsconfig files 2021-03-19 23:13:51 +01:00
Erik Krogh Kristensen
07ca09ef90 Merge pull request #5425 from yoff/tausbn-python-document-api-graphs
Python: document api graphs
2021-03-19 22:15:07 +01:00
CodeQL CI
3415b64229 Merge pull request #5423 from erik-krogh/koa
Approved by asgerf, esbena
2021-03-19 17:05:58 +00:00
Asger Feldthaus
405c1f3fc7 JS: Update test suite 2021-03-19 16:45:31 +00:00
Asger Feldthaus
fa2ae1420a JS: Rename Diagnostics folder to Summary 2021-03-19 16:43:23 +00:00
Asger Feldthaus
347cbe422d JS: Remove the other summary queries 2021-03-19 16:42:43 +00:00
Asger Feldthaus
0c0556bb38 JS: Update LinesOfCode.ql to match the style from C++ 2021-03-19 16:42:05 +00:00
Asger Feldthaus
6ca425f033 JS: Implement new metric queries for line counting 2021-03-19 16:34:29 +00:00
Erik Krogh Kristensen
84e9229386 Merge branch 'main' into koa 2021-03-19 16:56:15 +01:00
yoff
eae7bccaad Apply suggestions from code review
Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com>
2021-03-19 16:50:48 +01:00
Asger Feldthaus
ea8c8df653 JS: Fix bad join orders in summarizedHigherOrderCall 2021-03-19 15:30:49 +00:00
yoff
c6a69e1d6e Merge pull request #5457 from RasmusWL/framework-tests-non-experimental
Python: Move framework tests out of experimental
2021-03-19 16:29:50 +01:00
Tom Hvitved
6e1ee07e90 Address review comment 2021-03-19 16:25:48 +01:00
Mathias Vorreiter Pedersen
6c1ec6d96b C++: Accept test changes. 2021-03-19 16:09:05 +01:00
Erik Krogh Kristensen
8949b9eb0a add shell interpreted arrays as sinks for js/shell-command-constructed-from-input 2021-03-19 15:59:06 +01:00
Rasmus Wriedt Larsen
d9079e34e3 Python: Move framework tests out of experimental
Since they are not experimental anymore 😄
2021-03-19 15:51:54 +01:00
Erik Krogh Kristensen
79feb3b689 Merge pull request #5454 from asgerf/js/fix-untrusted-checkout-id
JS: Fix query ID for UntrustedCheckout
2021-03-19 14:32:52 +01:00
Tom Hvitved
18ac2596d0 Data flow: Add section on lambda flow to dataflow.md 2021-03-19 13:58:21 +01:00
CodeQL CI
3b117f5218 Merge pull request #5419 from erik-krogh/forgery
Approved by asgerf
2021-03-19 12:56:53 +00:00
Asger Feldthaus
42c4b22ea1 JS: Fix query ID for UntrustedCheckout 2021-03-19 12:41:34 +00:00
Jonas Jensen
98c1aa5298 Merge pull request #5271 from github/files-query
C++: Summary metrics queries
2021-03-19 12:56:19 +01:00
Asger Feldthaus
01fd00de56 JS: Fix join order in argumentPassing 2021-03-19 11:49:06 +00:00
Asger F
2f3d516413 JS: Track flow into ES accessors 2021-03-19 11:11:25 +00:00
Tamás Vajk
0732f200e8 Merge pull request #5421 from tamasvajk/feature/codequalityfixes
C#: Fix code quality issues reported by code scanning
2021-03-19 12:09:18 +01:00
Tamás Vajk
752c911a22 Merge pull request #5394 from tamasvajk/feature/upgrade-nuget-packages
C#: Upgrade nuget packages
2021-03-19 12:09:00 +01:00
Asger F
4f46908224 JS: Add test with ES getters/setters 2021-03-19 11:07:15 +00:00
CodeQL CI
e8498b85e3 Merge pull request #5430 from RasmusWL/improve-path-docs
Approved by shati-patel, yoff
2021-03-19 04:01:22 -07:00
Tom Hvitved
09a49e4580 Merge pull request #5311 from hvitved/dataflow/lambda
Data flow: Move C# lambda flow logic into shared library
2021-03-19 11:44:15 +01:00
Cornelius Riemenschneider
e482d21949 C++: Make QLdoc check happy. 2021-03-19 11:40:20 +01:00
Cornelius Riemenschneider
63e560e3b4 Fix QL doc. 2021-03-19 11:27:51 +01:00
Cornelius Riemenschneider
39a7d3decc C++: Address review comments. 2021-03-19 11:23:47 +01:00
yoff
37036b5e76 Merge pull request #5437 from RasmusWL/small-pyyaml-improvements
Python: Small PyYAML improvements
2021-03-19 11:15:49 +01:00
Tamas Vajk
79d6731ed8 C#: Adjust make_stubs.py to use codeql instead of odasa 2021-03-19 11:01:28 +01:00
Cornelius Riemenschneider
783a63a8a8 Update cpp/ql/src/Summary/LinesOfCode.ql
Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com>
2021-03-19 10:54:41 +01:00
Erik Krogh Kristensen
36b0ab1de5 Apply suggestions from code review
Co-authored-by: Esben Sparre Andreasen <esbena@github.com>
2021-03-19 10:29:38 +01:00
CodeQL CI
fc7f19f900 Merge pull request #5433 from erik-krogh/clientSocket
Approved by esbena
2021-03-19 02:12:19 -07:00
Erik Krogh Kristensen
a28a36ab29 add change-note 2021-03-19 10:10:56 +01:00
Erik Krogh Kristensen
e90fb1a225 reuse classes modelling standard library functions 2021-03-19 10:09:33 +01:00
Rasmus Wriedt Larsen
7543f10593 Python: Reorganize PyYAML tests a bit 2021-03-19 09:53:25 +01:00
Tamas Vajk
20f0b3329a C#: Fix code quality issues reported by code scanning 2021-03-19 09:18:57 +01:00
Erik Krogh Kristensen
d489d63b8e recognize object transformations in module.exports when looking for library inputs 2021-03-18 20:54:33 +01:00
yoff
746e9948b0 Merge pull request #5075 from RasmusWL/crypto
Python: Port py/weak-crypto-key to use type-tracking
2021-03-18 20:53:28 +01:00
Erik Krogh Kristensen
28ad667578 add model for async-execute 2021-03-18 19:40:46 +01:00
Erik Krogh Kristensen
58617c5c59 recognize client websockets as ClientRequests 2021-03-18 19:08:39 +01:00
Aditya Sharad
f4dc5b963b Merge pull request #5335 from Marcono1234/patch-1
Add name to check-change-note.yml workflow
2021-03-18 10:44:53 -07:00
Erik Krogh Kristensen
ed8e0fb593 remove CannonicalName API nodes 2021-03-18 15:34:17 +01:00
Erik Krogh Kristensen
7180a1ed52 add Type to MkHasUnderlyingType 2021-03-18 15:16:31 +01:00
Erik Krogh Kristensen
af5a61782c also look for main modules in a lib folder 2021-03-18 14:51:11 +01:00
Erik Krogh Kristensen
6bab41ce8b Merge pull request #5350 from JarLob/actions
github actions queries
2021-03-18 14:46:25 +01:00
Erik Krogh Kristensen
f94f82a0dc use getAChainedMethodCall 2021-03-18 14:35:10 +01:00
Erik Krogh Kristensen
38a9c71380 Apply suggestions from code review
Co-authored-by: Asger F <asgerf@github.com>
2021-03-18 14:33:13 +01:00
Erik Krogh Kristensen
0e98ea0c10 remove spurious import of PackageExports 2021-03-18 14:09:08 +01:00
Erik Krogh Kristensen
67a5831ac0 update expected output 2021-03-18 13:59:44 +01:00
Erik Krogh Kristensen
c0bb169342 recognize a src/index.js file as a main module for a package 2021-03-18 13:41:36 +01:00
Erik Krogh Kristensen
add0c88530 loosen the requirement that the package.json file must be the top-most package.json 2021-03-18 13:39:12 +01:00
Erik Krogh Kristensen
d998d06b94 add link to source in alert-message for js/shell-command-constructed-from-input 2021-03-18 13:37:18 +01:00
Mathias Vorreiter Pedersen
c0e1df47a6 Merge pull request #5431 from MathiasVP/av-rule-79-use-gvn
C++: Use GVN in AV Rule 79
2021-03-18 12:35:26 +01:00
CodeQL CI
3b34bfd1c6 Merge pull request #5432 from asgerf/js/more-string-steps
Approved by erik-krogh
2021-03-18 04:16:07 -07:00
Rasmus Wriedt Larsen
42b2c3ed52 Python: Model C-based loaders for PyYAML
Not really that important. But easy to do while I was working on this library.
2021-03-18 11:55:01 +01:00
Rasmus Wriedt Larsen
54e6f51512 Python: Add example of C-based PyYAML loaders
```
In [6]: yaml.load("!!python/object/new:os.system [echo EXPLOIT!]", yaml.CLoader)
EXPLOIT!
Out[6]: 0
```
2021-03-18 11:50:59 +01:00
Rasmus Wriedt Larsen
25b15d7470 Python: Move PyYAML modeling classes within module
For now, this is how we're trying to structure things -- all in all it doesn't
matter too much, since everything is still marked as private.
2021-03-18 11:48:30 +01:00
Rasmus Wriedt Larsen
5ec8511d50 Python: Port PyYAML model to API graphs 2021-03-18 11:47:46 +01:00
Porcuiney Hairs
a88c3682ff remove sanitiserGuards 2021-03-18 16:12:00 +05:30
Porcuiney Hairs
84c9137152 Include suggestions from review 2021-03-18 16:12:00 +05:30
porcupineyhairs
f27d2bdf6d Update java/ql/src/experimental/semmle/code/java/Logging.qll
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
2021-03-18 16:12:00 +05:30
Porcuiney Hairs
d0c82d3756 Add flogger and android logging support 2021-03-18 16:12:00 +05:30
Porcuiney Hairs
17d7ba8049 Add Log Injection Vulnerability 2021-03-18 16:12:00 +05:30
Rasmus Wriedt Larsen
14e9bda5de Python: Refactor PyYAML tests a bit 2021-03-18 11:39:47 +01:00
Rasmus Wriedt Larsen
45a1fc6a96 Python: Add link to better PyYAML docs
I found this randomly
2021-03-18 11:20:22 +01:00
Asger Feldthaus
e30fa89405 JS: Update more test expectations 2021-03-18 10:04:39 +00:00
Erik Krogh Kristensen
8b931626ce add edge from root type MkHasUnderlyingType 2021-03-18 11:04:08 +01:00
Rasmus Wriedt Larsen
7b92012edf Python: Apply suggestions from code review
Co-authored-by: yoff <lerchedahl@gmail.com>
2021-03-18 10:58:49 +01:00
Jaroslav Lobačevski
a9ed3317bf Fix regex per suggestion 2021-03-18 11:54:55 +02:00
Erik Krogh Kristensen
40ec23cf13 refactor MkHasUnderlyingType to use Label::instance() 2021-03-18 10:47:38 +01:00
Mathias Vorreiter Pedersen
2abf4c068f C++: Use getAnExpr. Also extend the other recursive case similarly. 2021-03-18 08:42:10 +01:00
Erik Krogh Kristensen
b2d6982318 add change note 2021-03-17 19:17:23 +01:00
Erik Krogh Kristensen
3995ff322d add models for koa-route and koa-router 2021-03-17 19:17:20 +01:00
Jaroslav Lobačevski
7b6773c96a Update javascript/ql/src/experimental/semmle/javascript/Actions.qll
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2021-03-17 19:49:03 +02:00
CodeQL CI
1d9f8c2d37 Merge pull request #5427 from RasmusWL/use-new-builtin-modeling
Approved by yoff
2021-03-17 09:07:36 -07:00
Jaroslav Lobačevski
e3bf308952 Removed positive lookbehind 2021-03-17 17:32:10 +02:00
Mathias Vorreiter Pedersen
834e35f192 C++: Add change-note. 2021-03-17 16:26:15 +01:00
Asger Feldthaus
ae410aabd6 JS: Add change note 2021-03-17 15:24:10 +00:00
Asger Feldthaus
e4d891cab5 JS: Add tests for flow through replace 2021-03-17 15:20:40 +00:00
Asger Feldthaus
9cfbb90591 JS: Add test case for insufficient replace-sanitizer 2021-03-17 15:20:40 +00:00
Asger Feldthaus
198bdcab26 JS: Make XSS MetacharEscapeSanitizer more precise 2021-03-17 15:20:40 +00:00
Asger Feldthaus
effa52f9e1 JS: Step through string replace callbacks 2021-03-17 15:15:49 +00:00
CodeQL CI
7c20c4a664 Merge pull request #5396 from asgerf/js/shared-taint-step
Approved by erik-krogh, esbena
2021-03-17 08:07:20 -07:00
Mathias Vorreiter Pedersen
a3f806bb1d Use GVN in AV rule 79. 2021-03-17 16:01:49 +01:00
Rasmus Wriedt Larsen
d426f1efaf Docs: Highlight need for explicit import of DataFlow lib
at least in some langauges
2021-03-17 16:01:20 +01:00
yoff
514c9efcdd Merge pull request #5426 from RasmusWL/insecure-default-protocl-tests-are-also-py3
Python: Also test py/insecure-default-protocol on Python 3
2021-03-17 15:59:00 +01:00
Rasmus Wriedt Larsen
4f63584179 Docs: Highlight that Configuration is not DataFlow::Configuration
I made that mistake when just reading it over (DOH). I think that calling it
MyConfiguration makes it a bit more clear that this is a configuration class you
wrote yourself :D
2021-03-17 15:55:58 +01:00
Rasmus Wriedt Larsen
27032af2eb Python: Use API graphs for io.open 2021-03-17 15:50:02 +01:00
Rasmus Wriedt Larsen
d52d328587 Python: Use new API::builtin in stdlib modeling 2021-03-17 15:50:01 +01:00
Asger Feldthaus
bf5259096e JS: Update cheat sheet 2021-03-17 14:34:30 +00:00
Rasmus Lerchedahl Petersen
b3ff3f7ee7 PythonÆ adjust test expectations
I suspect it has to do with ParameterNode being a LocalSourceNode,
but I really have no idea...
2021-03-17 15:11:17 +01:00
Rasmus Lerchedahl Petersen
8f467003d2 Python: More review suggestions 2021-03-17 15:11:17 +01:00
yoff
63b732ce1f Apply suggestions from code review
Co-authored-by: Taus <tausbn@github.com>
2021-03-17 15:11:17 +01:00
Rasmus Lerchedahl Petersen
4d856d4461 Python: Add small api enhancements
determined useful during documentation work.
2021-03-17 15:11:17 +01:00
Rasmus Lerchedahl Petersen
f04ac87091 Python, doc: Include new section in toc 2021-03-17 15:04:07 +01:00
Rasmus Wriedt Larsen
315127d888 Python: Also test py/insecure-default-protocol on Python 3 2021-03-17 14:53:36 +01:00
Rasmus Lerchedahl Petersen
135a6713e8 Python, doc: References to section on API graphs. 2021-03-17 14:42:50 +01:00
CodeQL CI
d95b295e52 Merge pull request #5400 from erik-krogh/replaceCallbacks
Approved by asgerf
2021-03-17 06:42:34 -07:00
Rasmus Lerchedahl Petersen
7e9cf03f4d Merge branch 'python-document-api-graphs' of https://github.com/tausbn/codeql into tausbn-python-document-api-graphs 2021-03-17 14:36:16 +01:00
Tom Hvitved
5b2d5ee010 Merge pull request #4940 from hvitved/csharp/base-ssa-phi-input
C#: Take phi nodes into account in `Steps::getARead()`
2021-03-17 14:33:59 +01:00
Asger Feldthaus
ccc879dc5c JS: Autoformat 2021-03-17 13:29:17 +00:00
Asger Feldthaus
e1bfc6cd38 JS: Add qldoc to deprecated class member 2021-03-17 13:29:17 +00:00
Asger Feldthaus
ab1947a028 JS: Add comment explaining how to add new steps 2021-03-17 13:29:17 +00:00
Asger Feldthaus
c2764069b5 JS: Mention why we cache predicates outside the class 2021-03-17 13:29:17 +00:00
Asger Feldthaus
a97d3452a7 JS: Add DataFlow::SharedFlowStep to future-proof the tutorial 2021-03-17 13:29:17 +00:00
Asger Feldthaus
d74e84abd8 JS: Remove or update some mentions of AdditionalTaintStep 2021-03-17 13:29:17 +00:00
Asger Feldthaus
c0b5a9ad0c JS: Deprecate AdditionalTaintStep 2021-03-17 13:29:17 +00:00
Asger Feldthaus
332ee40984 JS: Autoformat 2021-03-17 13:29:17 +00:00
Asger Feldthaus
0675066ab9 JS: Fixup UriLibraries test 2021-03-17 13:29:17 +00:00
Asger Feldthaus
443b59e676 JS: Fixup bad merge in HeapTaintStep 2021-03-17 13:29:17 +00:00
Asger Feldthaus
80bc5d921b JS: Update Vue test 2021-03-17 13:29:16 +00:00
Asger Feldthaus
d52ff3e4f6 JS: Autoformat and add qldoc 2021-03-17 13:29:16 +00:00
Asger Feldthaus
96c6e4d8d8 JS: Update with new AdditionalTaintStep subclasses 2021-03-17 13:29:16 +00:00
Asger Feldthaus
561b9d09b3 JS: Put in same stage as RemoteFlowSource 2021-03-17 13:29:16 +00:00
Asger Feldthaus
e4a75b42e9 JS: Autoformat 2021-03-17 13:29:16 +00:00
Asger Feldthaus
8542c7172e JS: Fix promiseStep documentation 2021-03-17 13:29:16 +00:00
Asger Feldthaus
f95c799d6e JS: Cache taint steps in same stage 2021-03-17 13:29:16 +00:00
Asger Feldthaus
e847043307 JS: Move React steps into React library 2021-03-17 13:29:16 +00:00
Asger Feldthaus
6324c4f22a JS: Add arrayStep but ignore overlap with heapStep for now 2021-03-17 13:29:15 +00:00
Asger Feldthaus
0bdf67f8aa JS: Remove duplicate await step 2021-03-17 13:29:15 +00:00
Asger Feldthaus
4116c1ec66 JS: Add category for promise steps 2021-03-17 13:29:15 +00:00
Asger Feldthaus
f009a6121e JS: Refactor steps into subcategories 2021-03-17 13:29:13 +00:00
Asger Feldthaus
d823fd15af JS: Fix join orders and use SourceNode API in React model 2021-03-17 13:26:02 +00:00
Asger Feldthaus
255424cdc2 JS: Fix bad join order from use of getAType() = TTRegExp 2021-03-17 13:26:02 +00:00
Asger Feldthaus
b049136008 JS: Fix bad join order in Vue model 2021-03-17 13:26:02 +00:00
Asger Feldthaus
d9a52201ad JS: Use sharedTaintStep 2021-03-17 13:26:02 +00:00
Asger Feldthaus
42ddeadaca JS: Fixup comment in heuristics 2021-03-17 13:26:01 +00:00
Asger Feldthaus
5ad950e51e JS: ClosurePromiseStep 2021-03-17 13:26:01 +00:00
Asger Feldthaus
b9d918896b JS: PromiseStep 2021-03-17 13:26:01 +00:00
Asger Feldthaus
a39cb74b89 JS: Heuristics 2021-03-17 13:26:01 +00:00
Asger Feldthaus
58a34fc249 JS: VHtmlSourceWrite -> SharedTaintStep 2021-03-17 13:26:01 +00:00
Asger Feldthaus
bd5452f2cf JS: Move VHtmlSourceWrite step into Vue library (as its a shared step) 2021-03-17 13:26:01 +00:00
Asger Feldthaus
2dcb708022 JS: Base64 2021-03-17 13:26:01 +00:00
Asger Feldthaus
d9be660633 JS: Extend 2021-03-17 13:26:01 +00:00
Asger Feldthaus
d079cb5149 JS: ClosureLibrary 2021-03-17 13:26:01 +00:00
Asger Feldthaus
25d4ab78fe JS: ComposedFunctions 2021-03-17 13:26:01 +00:00
Asger Feldthaus
a2f7ecec66 JS: AsyncPackage 2021-03-17 13:26:01 +00:00
Asger Feldthaus
4746670ac6 JS: UriLibraryStep 2021-03-17 13:26:00 +00:00
Asger Feldthaus
dbb8aaeb0b JS: Remove a column from UriLibraryStep test case 2021-03-17 13:26:00 +00:00
Asger Feldthaus
ade75793dd JS: Typeahead 2021-03-17 13:26:00 +00:00
Asger Feldthaus
9ee81cb115 JS: Fix TaintedPath 2021-03-17 13:26:00 +00:00
Asger Feldthaus
ec19bed1fa JS: Fix regexp tracking 2021-03-17 13:26:00 +00:00
Asger Feldthaus
92d555166a JS: PropertyProjectionTest 2021-03-17 13:26:00 +00:00
Asger Feldthaus
a39086ab27 JS: Vue::InstanceHeapStep 2021-03-17 13:26:00 +00:00
Asger Feldthaus
957c406969 JS: BufferTaintStep 2021-03-17 13:26:00 +00:00
Asger Feldthaus
6bd2c2e476 JS: FsFlowStep 2021-03-17 13:26:00 +00:00
Asger Feldthaus
ee9841e7ec JS: PathFlowStep 2021-03-17 13:26:00 +00:00
Asger Feldthaus
8fe229fb08 JS: ArrayFunctionTaintStep 2021-03-17 13:26:00 +00:00
Asger Feldthaus
7275707115 JS: UtilInspectTaintStep 2021-03-17 13:25:59 +00:00
Asger Feldthaus
462e31c2b4 JS: ErrorConstructorTaintStep 2021-03-17 13:25:59 +00:00
Asger Feldthaus
fa9b3dfff4 JS: SortTaintStep 2021-03-17 13:25:59 +00:00
Asger Feldthaus
107569ef41 JS: JsonParserTaintStep 2021-03-17 13:25:59 +00:00
Asger Feldthaus
301b5e6556 JS: JsonStringifyTaintStep 2021-03-17 13:25:59 +00:00
Asger Feldthaus
0b41124b0f JS: StringMatchTaintStep 2021-03-17 13:25:59 +00:00
Asger Feldthaus
9f15b14df9 JS: StringFormattingStep 2021-03-17 13:25:59 +00:00
Asger Feldthaus
a00fdc9b25 JS: StringManipulationStep 2021-03-17 13:25:59 +00:00
Asger Feldthaus
7a5f9f6a69 JS: StringConcatStep 2021-03-17 13:25:59 +00:00
Asger Feldthaus
0fa66acdb8 JS: ReactPropStep 2021-03-17 13:25:59 +00:00
Asger Feldthaus
317a073b6e JS: DictionaryTaintStep 2021-03-17 13:25:58 +00:00
Asger Feldthaus
3398ddf783 JS: HeapTaintStep 2021-03-17 13:25:58 +00:00
Asger Feldthaus
c3e00181cb JS: Add SharedTaintStep 2021-03-17 13:25:58 +00:00
Rasmus Wriedt Larsen
1ecee2da0d Merge pull request #5357 from yoff/python-rework-documentation
Python: rework documentation
2021-03-17 14:25:23 +01:00
Anders Schack-Mulligen
05779ef7ee Merge pull request #5368 from joefarebrother/guava-convert-to-csv
Java: Convert existing Guava models to CSV format
2021-03-17 13:50:48 +01:00
CodeQL CI
efeff6fcf8 Merge pull request #5033 from asgerf/js/generalized-remote-flow-source
Approved by erik-krogh
2021-03-17 05:41:39 -07:00
Erik Krogh Kristensen
dab6a11978 add example code 2021-03-17 13:35:16 +01:00
Erik Krogh Kristensen
5898b48391 add missing polarity check 2021-03-17 13:35:07 +01:00
Erik Krogh Kristensen
1db5cb15f0 Update javascript/ql/src/semmle/javascript/security/IncompleteBlacklistSanitizer.qll
Co-authored-by: Asger F <asgerf@github.com>
2021-03-17 13:30:05 +01:00
yoff
0fc30997eb Update docs/codeql/codeql-language-guides/analyzing-data-flow-in-python.rst
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-03-17 13:00:09 +01:00
Cornelius Riemenschneider
5e0601fe1f C++: Address review comments. 2021-03-17 12:28:03 +01:00
Tamas Vajk
7019878775 Upgrade nuget package in Semmle.Autobuild.Cpp.csproj 2021-03-17 12:18:28 +01:00
Tamás Vajk
2e2a5d62c2 Merge pull request #5420 from tamasvajk/feature/fix-nullable-warning
C#: Fix nullable warning
2021-03-17 12:16:15 +01:00
Mathias Vorreiter Pedersen
3914a93504 C++: Remove commonTaintStep from DefaultTaintTracking. 2021-03-17 11:56:59 +01:00
Cornelius Riemenschneider
144dcf1b5e C++: Include empty message for SuccessfulExtractions.ql. 2021-03-17 11:18:40 +01:00
Cornelius Riemenschneider
5e4e853ffb C++: Add missing QLDoc. 2021-03-17 11:18:40 +01:00
Cornelius Riemenschneider
4c4fc05553 C++: Make toString deterministic for tests. 2021-03-17 11:18:40 +01:00
Cornelius Riemenschneider
9612426680 C++: Initial file-related metric queries.
This adds a library `FailedExtractions.qll` that classifies extractor errors
and provides a unified interface for both recoverable and irrecoverable
extractor errors.
This interface is then used by the new diagnostic queries to list
successfully extracted files, as well as files that encountered an
extraction error.
2021-03-17 11:18:34 +01:00
Asger Feldthaus
3a68eceaaa JS: Fix typo in change note 2021-03-17 10:17:56 +00:00
Erik Krogh Kristensen
d1602d538e add change note 2021-03-17 10:06:41 +01:00
Erik Krogh Kristensen
edb0f77177 add missing qldoc 2021-03-17 10:05:36 +01:00
Erik Krogh Kristensen
8975c3a7ce broaden which types are recognized by API-graphs 2021-03-17 10:03:55 +01:00
Erik Krogh Kristensen
2f3869f41b add model for puppeteer 2021-03-17 10:03:51 +01:00
haby0
c516d69b98 Merge remote-tracking branch 'upstream/main' into main 2021-03-17 16:42:48 +08:00
Tamas Vajk
78843882f9 C#: Upgrade nuget packages 2021-03-17 09:35:57 +01:00
Tamas Vajk
02cb383d3b C#: Fix nullable warning 2021-03-17 09:35:13 +01:00
Tamas Vajk
0b1705f302 C#: Adjust Callable::canReturn to handle Task-like async return types 2021-03-17 09:25:57 +01:00
haby0
15206fd2ce JsonpInjection.ql autoformatted 2021-03-17 15:52:05 +08:00
haby0
98204a15a6 Fix the problem 2021-03-17 15:28:04 +08:00
Rasmus Lerchedahl Petersen
acac519fef Python: Address review suggestions 2021-03-17 00:10:04 +01:00
Mathias Vorreiter Pedersen
43fbcc1c8a C++: Convert all the dataflow configurations to taint configurations. 2021-03-16 22:36:17 +01:00
Mathias Vorreiter Pedersen
dd6b27df24 C++: Fix test annotation. 2021-03-16 22:35:47 +01:00
Tamas Vajk
cd820917bc Remove duplicate yield return entries from global dataflow test 2021-03-16 21:28:58 +01:00
yoff
0ee7ccf6b9 Update docs/codeql/codeql-language-guides/analyzing-data-flow-in-python.rst
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-03-16 19:58:23 +01:00
Tamas Vajk
2541e9cb6a C#: Handle async data flow in expression bodied callables 2021-03-16 16:32:47 +01:00
Tamas Vajk
048c72a0f2 C#: Remove YieldReturnKind 2021-03-16 16:20:04 +01:00
Tamas Vajk
aa2abf76ba Make ReturnNodes disjoint (normal, yield, async) 2021-03-16 16:17:27 +01:00
Asger Feldthaus
97b8e35426 JS: Update test expectations 2021-03-16 15:09:01 +00:00
Joe Farebrother
f5e4b87d1e Remove redundant rows and add note on collection flow 2021-03-16 14:28:24 +00:00
Joe Farebrother
1e3c4d0eb1 Add stubs to fix broken test case 2021-03-16 14:24:49 +00:00
Joe Farebrother
980b2c1f4c Convert existing Guava models to CSV system 2021-03-16 14:24:49 +00:00
Tamas Vajk
732ef92830 C#: add store step for return statements inside async methods 2021-03-16 15:18:00 +01:00
Rasmus Wriedt Larsen
fbbec5d2b9 Merge pull request #5118 from yoff/python-port-stacktrace-exosure
Python: Port stack trace exposure
2021-03-16 14:52:44 +01:00
Tamas Vajk
c684b74b3d C#: Add async dataflow tests 2021-03-16 14:46:16 +01:00
Rasmus Wriedt Larsen
50978364a6 Merge pull request #5246 from yoff/python-port-insecure-default-protocol
Python: Port insecure default protocol
2021-03-16 14:30:19 +01:00
Asger Feldthaus
3922c73be7 JS: Add change note 2021-03-16 13:28:12 +00:00
Asger Feldthaus
a76be91481 JS: Remove deprected use of queryAccess 2021-03-16 13:28:12 +00:00
Asger Feldthaus
ff1326cc7b JS: Cache getReExportedModule 2021-03-16 13:28:12 +00:00
Asger Feldthaus
710cca5395 JS: Update expectations with new sources 2021-03-16 13:28:12 +00:00
Asger Feldthaus
a9383da2c3 JS: Autoformat 2021-03-16 13:28:12 +00:00
Asger Feldthaus
bc4c178648 JS: Cache together 2021-03-16 13:28:12 +00:00
Asger Feldthaus
7b7e87f177 JS: Fix bad join order in closure 2021-03-16 13:28:11 +00:00
Asger Feldthaus
aa1c8c041e JS: Exclude client-side sources from RegExpInjection 2021-03-16 13:28:11 +00:00
Asger Feldthaus
2e57a7d3e9 JS: Add ClientSideRemoteFlowSource 2021-03-16 13:28:09 +00:00
Anders Schack-Mulligen
aa360c0378 Merge pull request #5413 from smowton/smowton/feature/infer-fluent-method-taint-flow
Add taint-preserving edges where a call also has a value-preserving edge
2021-03-16 14:10:11 +01:00
Anders Schack-Mulligen
53c360479a Merge pull request #5329 from tamasvajk/feature/csv-taint-step
Java: migrate taint steps to CSV
2021-03-16 14:09:21 +01:00
Anders Schack-Mulligen
46bae88181 Merge pull request #5375 from aschackmull/dataflow/unbind
Dataflow: Switch from unbind to pragma[only_bind_into].
2021-03-16 14:03:54 +01:00
Tom Hvitved
88b7ad001f C#: Take phi nodes into account in Steps::getARead() 2021-03-16 13:55:30 +01:00
CodeQL CI
ae62fbc2c7 Merge pull request #5382 from erik-krogh/moreCache
Approved by asgerf
2021-03-16 05:53:03 -07:00
Tom Hvitved
cb8e2d451d C#: Add test for DeadStoreOfLocal.ql 2021-03-16 13:52:41 +01:00
Tom Hvitved
b11e15154f Data flow: Sync files and add stubs 2021-03-16 13:49:32 +01:00
Tom Hvitved
a373a523f6 Data flow: Move C# lambda flow logic into shared library 2021-03-16 13:49:32 +01:00
CodeQL CI
b37da7cc22 Merge pull request #5386 from erik-krogh/cachePrepend
Approved by asgerf
2021-03-16 05:49:24 -07:00
CodeQL CI
40acb95105 Merge pull request #5397 from erik-krogh/globalSanitizer
Approved by asgerf
2021-03-16 05:37:32 -07:00
Erik Krogh Kristensen
3640bbd466 add test for IncompleteHtmlAttributeSanitization 2021-03-16 13:25:27 +01:00
Erik Krogh Kristensen
1bf259beef support another String.prototype.replace pattern 2021-03-16 13:25:13 +01:00
Cornelius Riemenschneider
755fec466f Apply suggestions from code review
Co-authored-by: Jonas Jensen <jbj@github.com>
2021-03-16 13:21:57 +01:00
Tom Hvitved
e1e4016a5c C#: Fix missing delegate flow 2021-03-16 13:16:23 +01:00
Tom Hvitved
29c6d22163 C#: Add test exposing missing delegate flow 2021-03-16 13:16:23 +01:00
Tom Hvitved
25adcfc39d C#: Fix missing phi flow 2021-03-16 13:16:23 +01:00
Tom Hvitved
e092b31791 C#: Add test exposing missing phi flow 2021-03-16 13:16:23 +01:00
Tamas Vajk
d02fba8c37 Java: adjust wrapped constructor calls 2021-03-16 12:42:41 +01:00
Rasmus Lerchedahl Petersen
cf791e8164 Python: Describe Concepts and Attributes 2021-03-16 12:31:47 +01:00
Tamas Vajk
e3534d1635 Java: cover wrapped constructor taint flow 2021-03-16 12:10:28 +01:00
Tamas Vajk
af0dff8c6f Java: migrate constructor flow taint steps to CSV 2021-03-16 12:10:28 +01:00
Tamas Vajk
f9a207dd9f Java: migrate 'arg to arg' taint steps to CSV 2021-03-16 12:10:28 +01:00
Tamas Vajk
7e1534a6cd Java: migrate 'arg to return' taint steps to CSV 2021-03-16 12:10:28 +01:00
Tamas Vajk
5cdbde2686 Java: migrate 'qualifier to return' taint steps to CSV 2021-03-16 12:10:28 +01:00
Tamas Vajk
40126563ef Java: migrate 'qualifier to arg' taint steps to CSV 2021-03-16 12:10:28 +01:00
CodeQL CI
c08230ce1e Merge pull request #5378 from asgerf/js/meta-problem-queries
Approved by esbena
2021-03-16 03:58:12 -07:00
Cornelius Riemenschneider
2e8e04f73e C++: Move FailedExtractions.ql to FailedCompilations.ql. 2021-03-16 10:48:04 +00:00
Tamás Vajk
24140195d6 Merge pull request #5242 from tamasvajk/feature/tuple-df
C#: Add tuple dataflow
2021-03-16 11:45:11 +01:00
Tamás Vajk
8d6b8359eb Merge pull request #5316 from tamasvajk/feature/roslyn3.9
C#: Upgrade Roslyn dependencies to 3.9
2021-03-16 11:44:42 +01:00
Anders Schack-Mulligen
2d8d967060 Dataflow: Address review comment. 2021-03-16 11:07:33 +01:00
Cornelius Riemenschneider
fa3ac30894 C++: Update query to latest spec. 2021-03-16 09:56:38 +00:00
Chris Smowton
6d108c0fa7 Improve docstring for composedValueAndTaintModelStep
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2021-03-16 09:00:35 +00:00
Chris Smowton
915a19fb9d Improve naming; eliminate some harmless extra results
Adding `src != valueSource` should have no effect as the introduced edge would already exist, but could reduce workload downstream.
2021-03-16 08:57:14 +00:00
Chris Smowton
516122aa74 Add taint-preserving edges where a call also has a value-preserving edge
For example, for a fluent method that returns `this`, we take a tainting edge from argX to either `this` or the return value to also taint the other.
2021-03-16 08:45:24 +00:00
CodeQL CI
86b933a0e0 Merge pull request #5354 from yoff/doc-fix-typo-csharp-dataflow
Approved by hvitved
2021-03-15 23:52:38 -07:00
Jaroslav Lobačevski
8445ec6c17 Update javascript/ql/src/experimental/semmle/javascript/Actions.qll
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2021-03-15 19:15:10 +02:00
yoff
14dd708abc Apply suggestions from code review
Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com>
2021-03-15 17:56:50 +01:00
Jaroslav Lobačevski
87ea442a78 qhelp 2021-03-15 18:47:45 +02:00
Jaroslav Lobačevski
de6ed1dcb9 File rename 2021-03-15 18:34:10 +02:00
Jaroslav Lobačevski
a823baabfb Ranamed to CWE-094 2021-03-15 18:24:08 +02:00
Jaroslav Lobačevski
16ca2314e4 Apply suggestions from code review
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2021-03-15 18:14:20 +02:00
Anders Schack-Mulligen
45c9428668 Merge pull request #5337 from smowton/smowton/feature/commons-lang-random-sources
Java: Add support for Commons-Lang's RandomUtils
2021-03-15 16:21:01 +01:00
Anders Schack-Mulligen
d1f30d9164 Java: Autoformat. 2021-03-15 15:28:04 +01:00
Anders Schack-Mulligen
662e17ff85 Java: Bugfix dispatch to lambda in call context. 2021-03-15 15:09:03 +01:00
CodeQL CI
9268050eb8 Merge pull request #5369 from erik-krogh/tempObjInj
Approved by asgerf
2021-03-15 05:23:55 -07:00
CodeQL CI
a9c292e265 Merge pull request #5391 from erik-krogh/additionalXss
Approved by asgerf
2021-03-15 04:50:54 -07:00
Erik Krogh Kristensen
b039267b76 Apply suggestions from code review
Co-authored-by: Asger F <asgerf@github.com>
2021-03-15 12:39:56 +01:00
Cornelius Riemenschneider
f75b969ffc C++: Only include sum of LoC in the new non-alert summary queries for now. 2021-03-15 11:32:10 +00:00
Mathias Vorreiter Pedersen
0ffb80e3b1 Merge branch 'main' into rdmarsh/cpp/use-taint-configuration-dtt 2021-03-15 09:42:32 +01:00
Anders Schack-Mulligen
e37ba75599 Merge pull request #5401 from Marcono1234/patch-2
Add missing quote in documentation
2021-03-15 09:17:29 +01:00
Rasmus Lerchedahl Petersen
0d8f8d2cc5 Python, doc: subsection on local sources
also remove references to `parameterNode` which is not available yet.
2021-03-13 08:15:42 +01:00
Marcono1234
a457f5cc4a Add missing quote in documentation 2021-03-13 05:01:56 +01:00
yoff
a760ed8c55 Merge pull request #5388 from tausbn/python-api-graph-builtins
Python: Support built-ins in API graphs
2021-03-12 17:45:59 +01:00
Tamas Vajk
27048191c8 C#: Add dataflow test for tuple-positional pattern 2021-03-12 17:14:24 +01:00
Erik Krogh Kristensen
1dcfc3840d add test 2021-03-12 16:25:33 +01:00
Erik Krogh Kristensen
f357b73f94 require that the MetacharEscapeSanitizer is a global replace call 2021-03-12 16:18:47 +01:00
Tamas Vajk
9ff304ca6b Fix missing variable binding 2021-03-12 16:14:32 +01:00
Taus
dfc0e9b906 Merge pull request #5243 from RasmusWL/port-bind-to-all-interfaces
Python: Port py/bind-socket-all-network-interfaces query
2021-03-12 16:04:19 +01:00
Rasmus Lerchedahl Petersen
748749c32a Python, doc: Describe smoother syntax 2021-03-12 16:02:20 +01:00
Anders Schack-Mulligen
5aa9c2bd19 Dataflow: One more pragma. 2021-03-12 15:59:19 +01:00
CodeQL CI
cb6ee547ca Merge pull request #5379 from asgerf/js/d3
Approved by erik-krogh
2021-03-12 06:49:48 -08:00
Taus
c6d6d07720 Apply suggestions from code review 2021-03-12 14:28:59 +01:00
Taus
ffe5d30c2b Apply suggestions from code review
Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com>
2021-03-12 14:27:07 +01:00
Chris Smowton
92d61354d4 Remove abstract class RandomNumberGenerator 2021-03-12 13:04:31 +00:00
Asger Feldthaus
a2d1e88bb3 JS: Update more test expectations 2021-03-12 12:57:21 +00:00
luchua-bc
1a2e341b7c Refactor the business logic of the query into a separate predicate 2021-03-12 12:19:37 +00:00
Anders Schack-Mulligen
a8b84e430f Merge pull request #5390 from Marcono1234/patch-2
Java: Fix documentation mistake in Modules.qll
2021-03-12 12:51:24 +01:00
Anders Schack-Mulligen
c9786df760 Merge pull request #5344 from smowton/smowton/feature/commons-object-utils
Java: Add models for flow- and taint-preserving functions in Commons ObjectUtils
2021-03-12 12:46:31 +01:00
Anders Schack-Mulligen
195ed0173c Merge pull request #5393 from aschackmull/java/taint-not-value-step
Java: Remove value steps from taint steps.
2021-03-12 12:44:48 +01:00
Taus Brock-Nannestad
978200e2ad Python: Distinguish between Python 2 and 3
Also moves the filtering on `name` to before the big disjunction in
`MkModuleImport`.
2021-03-12 12:35:23 +01:00
Chris Smowton
58d5c2c32d Abbreviate redundant value-flow / taint-flow tests 2021-03-12 10:53:27 +00:00
Cornelius Riemenschneider
0274162c4d Merge pull request #5385 from github/igfoo/failed_extractions
C++: Add FailedExtractions.ql
2021-03-12 11:14:06 +01:00
Anders Schack-Mulligen
1d3ad0cb52 Java: Remove value steps from taint steps. 2021-03-12 11:09:53 +01:00
Jonas Jensen
2d4f624935 Merge pull request #5381 from MathiasVP/fix-link-in-CONTRIBUTING
Fix dead link in CONTRIBUTING.md
2021-03-12 10:27:45 +01:00
Asger Feldthaus
5d6a93332f JS: Autoformat 2021-03-12 08:28:32 +00:00
Erik Krogh Kristensen
d7b0f628a1 add test 2021-03-12 00:03:20 +01:00
Erik Krogh Kristensen
ae805eb939 don't filter away templated URLs in RemoteServerResponse 2021-03-11 23:52:24 +01:00
Marcono1234
edeb08480e Java: Fix documentation mistake in Modules.qll 2021-03-11 23:45:59 +01:00
Taus Brock-Nannestad
fe3824c202 Python: Document API graphs 2021-03-11 23:11:23 +01:00
Taus Brock-Nannestad
c7b2b719cf Python: Support builtins in API graphs 2021-03-11 23:03:18 +01:00
luchua-bc
c8b1bc3a89 Enhance the query 2021-03-11 21:41:34 +00:00
Mathias Vorreiter Pedersen
5667901a2a C++: Accept test changes after merge from main (which changed the path explanations). 2021-03-11 21:16:57 +01:00
Ian Lynagh
75ebb348a0 C++: Add name/description to FailedExtractions.ql 2021-03-11 18:44:24 +00:00
luchua-bc
0a35feef76 Exclude CSRF cookies to reduce FPs 2021-03-11 17:28:07 +00:00
luchua-bc
57953c523c Update qldoc 2021-03-11 17:16:36 +00:00
Mathias Vorreiter Pedersen
a2d75c4fed Merge branch 'main' into rdmarsh/cpp/use-taint-configuration-dtt 2021-03-11 18:06:37 +01:00
Asger Feldthaus
a03cb11257 JS: Include $().prop() source in XssThroughDom 2021-03-11 16:27:31 +00:00
Chris Smowton
82a000bcca Improve change note
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
2021-03-11 16:22:56 +00:00
Chris Smowton
6508a223c3 Remove useless =y value specification from inline test expectations 2021-03-11 16:22:56 +00:00
Chris Smowton
b5268def16 Add models for CONST_BYTE and CONST_SHORT 2021-03-11 16:22:56 +00:00
Chris Smowton
1c1ca70027 Add models for flow- and taint-preserving functions in Commons ObjectUtils.
These should all be value-preserving, but we don't support value-preserving varargs methods yet.
2021-03-11 16:22:54 +00:00
Asger Feldthaus
2f3a76c43b JS: Handle global variable d3 2021-03-11 16:17:27 +00:00
Asger Feldthaus
3b11958e33 JS: Expand D3 model a bit 2021-03-11 16:13:02 +00:00
Erik Krogh Kristensen
3005439a6a cache the BasicBlock charpred 2021-03-11 16:09:47 +01:00
Erik Krogh Kristensen
5afb7e05ee cache AccessPath::getAnInstanceIn 2021-03-11 16:09:24 +01:00
Erik Krogh Kristensen
24b0469d74 cache two more predicates in the SSA stage 2021-03-11 16:09:00 +01:00
Erik Krogh Kristensen
e5b13d9db4 cache hasLocationInfo and Node::toString in the dataflow stage 2021-03-11 16:08:45 +01:00
Rasmus Lerchedahl Petersen
f561c458a9 Python: One more change from code review 2021-03-11 15:58:47 +01:00
yoff
4d1b49a7dd Apply suggestions from code review
Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com>
2021-03-11 15:57:44 +01:00
Ian Lynagh
6ef8fb667f C++: Autoformat FailedExtractions.ql 2021-03-11 14:48:27 +00:00
Ian Lynagh
3c1e445a59 C++: Add a changenote for cpp/diagnostics/failed-extractions. 2021-03-11 14:33:04 +00:00
Ian Lynagh
2341c653f7 C++: Add FailedExtractions.ql 2021-03-11 14:08:55 +00:00
luchua-bc
eeac7e322a Query to detect insecure configuration of Spring Boot Actuator 2021-03-11 13:46:32 +00:00
Mathias Vorreiter Pedersen
0edae89425 Merge pull request #5380 from github/criemen/clang-cl
C++: Add clang-cl.exe to `compiledAsMicrosoft()`.
2021-03-11 13:56:25 +01:00
Cornelius Riemenschneider
97ab842010 C++: Update summary queries. 2021-03-11 12:44:30 +00:00
Mathias Vorreiter Pedersen
4977169cf5 Fix dead link in CONTRIBUTING.md 2021-03-11 13:36:19 +01:00
Cornelius Riemenschneider
288ee92d52 C++: Add clang-cl.exe to compiledAsMicrosoft(). 2021-03-11 12:15:27 +00:00
Erik Krogh Kristensen
fa2e7fd498 cache prepend 2021-03-11 11:59:54 +01:00
Artem Smotrakov
4b7c57c077 Added a comment for getBeanIdentifier()
Co-authored-by: Chris Smowton <smowton@github.com>
2021-03-11 11:52:07 +01:00
Asger Feldthaus
3fb810b540 JS: Add @kind problem meta queries 2021-03-11 10:46:18 +00:00
Asger Feldthaus
773cf0dcdd JS: Autoformat 2021-03-11 10:44:33 +00:00
Asger Feldthaus
0c6e161277 JS: Add source to XssThroughDom 2021-03-11 10:05:05 +00:00
Asger Feldthaus
18cfe72e99 JS: Add model of d3 2021-03-11 10:05:05 +00:00
Mathias Vorreiter Pedersen
01cc2f2c77 Merge pull request #5366 from MathiasVP/better-path-explanation-for-this-indirection
C++: Replace 'Argument -1 indirection' with 'This indirection'
2021-03-11 10:48:44 +01:00
Anders Schack-Mulligen
87e4dec86a Merge pull request #5300 from tamasvajk/feature/external-remote-flow-sources
Java: Convert remote flow sources to use new CSV format
2021-03-11 10:44:17 +01:00
CodeQL CI
25f4b76788 Merge pull request #5045 from erik-krogh/bindRoute
Approved by asgerf
2021-03-11 01:39:26 -08:00
CodeQL CI
ad665b765f Merge pull request #5323 from erik-krogh/staging
Approved by asgerf
2021-03-11 00:50:51 -08:00
Jonas Jensen
e1adf5e8b0 Merge pull request #5218 from MathiasVP/no-write-side-effects-for-const-pointer-params
C++: Don't generate write side effects for const parameter indirections
2021-03-11 09:48:05 +01:00
Mathias Vorreiter Pedersen
9439ed49c1 Merge branch 'main' into better-path-explanation-for-this-indirection 2021-03-11 09:39:18 +01:00
Mathias Vorreiter Pedersen
55da16c4a9 C++: Accept test changes. 2021-03-11 09:27:45 +01:00
Artem Smotrakov
0a5d58ed8a Cover more configurations in UnsafeSpringExporterInConfigurationClass.ql 2021-03-10 21:15:19 +03:00
luchua-bc
a0a1ddee86 Update class name 2021-03-10 17:07:31 +00:00
Anders Schack-Mulligen
674886a17d Dataflow: Sync. 2021-03-10 16:53:51 +01:00
Anders Schack-Mulligen
667dab28d4 Dataflow: Switch from unbind to pragma[only_bind_into]. 2021-03-10 16:52:45 +01:00
Mathias Vorreiter Pedersen
bc36e0db43 C++: Accept more test changes. 2021-03-10 16:51:13 +01:00
Rasmus Lerchedahl Petersen
ad35c01462 Python: purge old references 2021-03-10 16:38:00 +01:00
Erik Krogh Kristensen
ee9613fa79 import the Stages module from where it is used 2021-03-10 16:30:38 +01:00
Rasmus Lerchedahl Petersen
0ab4e3e041 Python: Fix old reference 2021-03-10 16:22:47 +01:00
Rasmus Lerchedahl Petersen
b865e88f59 Python, doc: Remove unused file 2021-03-10 16:09:52 +01:00
Mathias Vorreiter Pedersen
cc592b124b Merge branch 'main' into rdmarsh/cpp/use-taint-configuration-dtt 2021-03-10 15:59:48 +01:00
Rasmus Lerchedahl Petersen
fe975f25f9 Merge branch 'python-port-insecure-default-protocol' of github.com:yoff/codeql into python-port-insecure-default-protocol 2021-03-10 15:59:13 +01:00
Rasmus Lerchedahl Petersen
e726ff425c Python: simplify query code as suggested by review 2021-03-10 15:58:44 +01:00
Rasmus Lerchedahl Petersen
5c3d0c806d Python: remove unused file 2021-03-10 15:54:41 +01:00
Mathias Vorreiter Pedersen
0b6589c8be C++: Accept test changes. 2021-03-10 15:47:06 +01:00
Erik Krogh Kristensen
81efd726cb renamings - and simplifications of qldoc 2021-03-10 15:42:50 +01:00
Rasmus Lerchedahl Petersen
e4422fc939 Python, doc: Remove section on taint-tracking 2021-03-10 15:38:19 +01:00
Erik Krogh Kristensen
d3fca0a107 Apply suggestions from code review
Co-authored-by: Asger F <asgerf@github.com>
2021-03-10 15:24:05 +01:00
Erik Krogh Kristensen
c993f9a3a3 add instance methods in the same class to localFieldStep 2021-03-10 15:19:07 +01:00
Erik Krogh Kristensen
ea6d3bde9c Update javascript/ql/src/semmle/javascript/dataflow/internal/CallGraphs.qll
Co-authored-by: Asger F <asgerf@github.com>
2021-03-10 15:00:48 +01:00
CodeQL CI
2c4ba561bf Merge pull request #5360 from erik-krogh/regParse
Approved by asgerf
2021-03-10 05:57:19 -08:00
Geoffrey White
a2660e5996 Merge pull request #5326 from ihsinme/ihsinme-patch-244
CPP: Add query for CWE-20 Improper Input Validation
2021-03-10 13:53:26 +00:00
Tom Hvitved
fc5158c41c Merge pull request #5338 from hvitved/dataflow/performance-tweaks
Data flow: Performance tweaks
2021-03-10 13:56:57 +01:00
luchua-bc
f0ddfc9283 Minor qldoc changes 2021-03-10 12:18:55 +00:00
luchua-bc
72f28513eb Move test check to the sink 2021-03-10 12:12:27 +00:00
Asger Feldthaus
fbca06f4e1 JS: Move TaintMetrics.qll into internal folder 2021-03-10 11:53:44 +00:00
Cornelius Riemenschneider
16a3dfa30a C++: Update summary metrics query format. 2021-03-10 11:15:55 +00:00
Anders Schack-Mulligen
4941d9b7bf Java: Add query for CSV framework coverage. 2021-03-10 12:03:44 +01:00
Mathias Vorreiter Pedersen
0f6c56ad74 C++: Use names that better match the AST dataflow library. 2021-03-10 11:44:19 +01:00
Erik Krogh Kristensen
49b1bfc41b add a step for referencing instance/static methods on classes 2021-03-10 10:57:28 +01:00
Rasmus Lerchedahl Petersen
76e936c64d Python, doc: Add links to runs on LGTM.com 2021-03-10 10:52:22 +01:00
Anders Schack-Mulligen
ed250d5017 Merge pull request #5339 from smowton/smowton/feature/commons-regex-utils
Java: Add models for Commons-Lang's RegExUtils class
2021-03-10 10:23:37 +01:00
Chris Smowton
410f21cd55 Fix comment describing two-arg nextInt/nextLong
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
2021-03-10 08:43:37 +00:00
Artem Smotrakov
df60268023 Split qhelp files 2021-03-10 10:49:47 +03:00
luchua-bc
48975fa7d2 Replace sanitizers 2021-03-10 00:17:26 +00:00
Rasmus Lerchedahl Petersen
91c0066b8b Python: Make the documentation not lie 2021-03-09 18:17:51 +01:00
yoff
dfdf0344de Update python/ql/src/Security/CWE-327/InsecureDefaultProtocol.qhelp
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2021-03-09 16:44:08 +01:00
Chris Smowton
fa51af5be1 NBSP -> original-flavour space 2021-03-09 15:40:45 +00:00
Erik Krogh Kristensen
518bfa4d41 move getAnInstanceMemberAccess to ClassNode 2021-03-09 16:37:36 +01:00
Erik Krogh Kristensen
e8afafca7a add another route-handler test 2021-03-09 16:37:36 +01:00
ihsinme
c281820f0f Update LateCheckOfFunctionArgument.ql 2021-03-09 18:22:11 +03:00
ihsinme
07769c7322 Update LateCheckOfFunctionArgument.expected 2021-03-09 18:21:08 +03:00
Erik Krogh Kristensen
c95a8e6776 add change note 2021-03-09 16:17:33 +01:00
Erik Krogh Kristensen
11793800ad support subrouters, and engine registrations with file extensions 2021-03-09 16:17:33 +01:00
Erik Krogh Kristensen
70b8cdee9b add qhelp 2021-03-09 16:17:33 +01:00
Erik Krogh Kristensen
28951e98c4 add engine filter to js/template-object-injection 2021-03-09 16:17:33 +01:00
Erik Krogh Kristensen
b30484dd69 behaviour preserving refactorization into modules 2021-03-09 16:17:29 +01:00
Aditya Sharad
b1d0b9afbb Merge pull request #5363 from github/adityasharad/actions/docs-review-fix
Actions: Fix comment that tags the Docs team
2021-03-09 07:17:24 -08:00
Chris Smowton
189b2215c5 Remove useless value from inline test expectations 2021-03-09 15:11:39 +00:00
Chris Smowton
e8f81c4f30 Improve change note 2021-03-09 15:11:13 +00:00
Chris Smowton
074d73e325 Add change note 2021-03-09 15:11:13 +00:00
Chris Smowton
9163893879 Add models for Commons-Lang's RegExUtils class 2021-03-09 15:11:13 +00:00
Tom Hvitved
fe6efde449 Address review comments 2021-03-09 14:30:12 +01:00
Rasmus Lerchedahl Petersen
8b25806a2c Python: Attempt to clarify help 2021-03-09 13:29:33 +01:00
Rasmus Lerchedahl Petersen
a16de26799 Python: add linebreak to qhelp file
hopefully this will generate better markdown
2021-03-09 13:27:44 +01:00
yoff
fd5ac13828 Update python/ql/src/Security/CWE-327/InsecureDefaultProtocol.ql
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2021-03-09 13:23:44 +01:00
yoff
88784fbd31 Update python/ql/src/Security/CWE-327/InsecureDefaultProtocol.qhelp
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2021-03-09 13:23:35 +01:00
yoff
b6257edc9e Update python/ql/src/Security/CWE-327/InsecureDefaultProtocol.qhelp
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2021-03-09 13:20:19 +01:00
yoff
d5b304ce75 Update python/change-notes/2021-02-23-port-insecure-default-protocol.md
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2021-03-09 13:19:48 +01:00
Taus
19b74e6e01 Merge pull request #5367 from tausbn/mergeback-rc/3.1-to-main
Merge rc/3.1 into main
2021-03-09 12:46:24 +01:00
Mathias Vorreiter Pedersen
19d08d7b40 Merge branch 'main' into rdmarsh/cpp/use-taint-configuration-dtt 2021-03-09 12:35:44 +01:00
Tamas Vajk
5480a31b68 Java: Remove MultipartFile.getSize/isEmpty from remote flow sources 2021-03-09 12:23:47 +01:00
Tamas Vajk
0d405c293a Java: Convert PlayRequestGetMethod to CSV based flow source 2021-03-09 12:20:35 +01:00
Joe Farebrother
7a4ce83169 Merge pull request #5310 from joefarebrother/guava-io
Java: Add modelling for Guava IO utilities
2021-03-09 11:19:44 +00:00
Joe Farebrother
bd4a414abd Remove CSV data from query
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2021-03-09 10:50:15 +00:00
Tamas Vajk
e0b1a86038 Java: Convert WebSocketMessageParameterSource to CSV based flow source 2021-03-09 11:49:59 +01:00
Tamas Vajk
193458eb3d Java: Convert SpringRestTemplateResponseEntityMethod to CSV based flow source 2021-03-09 11:49:59 +01:00
Tamas Vajk
e0c51b510f Java: Convert WebViewGetUrlMethod to CSV based flow source 2021-03-09 11:42:40 +01:00
Tamas Vajk
8ba820cae1 Java: Convert android XML get* methods to CSV based flow source 2021-03-09 11:42:13 +01:00
Tamas Vajk
09b0d824b4 Java: Convert org.apache.http.Http*.get* methods to CSV based flow source 2021-03-09 11:41:33 +01:00
Tamas Vajk
3c8ac5c789 Java: Convert Cookie.get* methods to CSV based flow source 2021-03-09 11:41:33 +01:00
Tamas Vajk
86cf143029 Java: Convert ServletRequestGetBodyMethod to CSV based flow source 2021-03-09 11:41:32 +01:00
Tamas Vajk
b05a9043b5 Java: Convert SpringWebRequestGetMethod to CSV based flow source 2021-03-09 11:41:32 +01:00
Tamas Vajk
09bcf878f7 Java: Convert HttpServletRequest.get* methods to CSV based flow source 2021-03-09 11:40:59 +01:00
Tamas Vajk
f2448cc921 Java: Convert SpringMultipartFileSource to CSV based flow source 2021-03-09 11:40:18 +01:00
Tamas Vajk
80b4d63d4b Java: Convert SpringMultipartRequestSource to CSV based flow source 2021-03-09 11:39:47 +01:00
Tamas Vajk
06fdd64dab Java: Remove already modelled BeanValidationSource 2021-03-09 11:35:42 +01:00
Tamas Vajk
3dfc236bbe Java: Remove already modelled RemoteTaintedMethods 2021-03-09 11:35:42 +01:00
Erik Krogh Kristensen
caf1dbdc46 move TemplateObjectInjection out of experimental 2021-03-09 11:29:45 +01:00
Tamas Vajk
ba05bf3ae0 Fix code review findings 2021-03-09 11:17:57 +01:00
Mathias Vorreiter Pedersen
d14b993aba C++: Replace 'Argument -1 indirection' with 'This indirection'. 2021-03-09 10:22:21 +01:00
Jonas Jensen
2a9f7a966c Merge pull request #5361 from MathiasVP/arguments-in-path-explanations
C++: Show arguments in path explanations
2021-03-09 09:35:03 +01:00
Tom Hvitved
d4e0c7efae Merge pull request #5340 from hvitved/csharp/null-checks
C#: Use `is [not] null` throughout in the extractor
2021-03-09 09:30:54 +01:00
Tamas Vajk
0defad77dd C#: Add tuple data flow in patterns 2021-03-09 09:14:24 +01:00
Tom Hvitved
80a7b52f38 C#: Convert data-flow test queries to path-problems 2021-03-09 09:14:24 +01:00
Tom Hvitved
0698bdd907 C#: Restrict tuple read/store steps to tuple deconstructions/constructions 2021-03-09 09:14:24 +01:00
Tamas Vajk
6d409a0050 Fix failing tests 2021-03-09 09:14:24 +01:00
Tamas Vajk
ccf68ffd16 Add change note for tuple data flow improvements 2021-03-09 09:14:24 +01:00
Tamas Vajk
fcc4758eb8 Remove old taint tracking for tuples 2021-03-09 09:14:24 +01:00
Tamas Vajk
d05a733109 Add more test cases 2021-03-09 09:14:23 +01:00
Tamas Vajk
b05199dccf Tuple data flow: take cfg reachability into account 2021-03-09 09:14:23 +01:00
Tamas Vajk
0ca4bf4267 C#: WIP: Add tuple data flow 2021-03-09 09:14:23 +01:00
Tamas Vajk
4709442ef3 Extract tuple types from patterns and variable declarations 2021-03-09 09:14:23 +01:00
Tamas Vajk
1d70bfd011 Extract non-named tuple types 2021-03-09 09:06:35 +01:00
Tamas Vajk
7e1eee5fe2 Add tests that show tuple types 2021-03-09 09:06:35 +01:00
Taus Brock-Nannestad
3d0d280972 Merge remote-tracking branch 'upstream/rc/3.1' into mergeback-rc/3.1-to-main 2021-03-08 22:15:10 +01:00
Artem Smotrakov
a78f2115f2 Split SpringExporterUnsafeDeserialization.ql 2021-03-09 00:06:38 +03:00
Erik Krogh Kristensen
25ef3edb20 combine stages by introducing extended stages 2021-03-08 20:48:15 +01:00
Aditya Sharad
318ce47982 Actions: Fix comment that tags the Docs team 2021-03-08 09:17:19 -08:00
Mathias Vorreiter Pedersen
7207a17f6f C++: Accept more tests. 2021-03-08 16:50:12 +01:00
Anders Schack-Mulligen
aeb13146d2 Merge pull request #5275 from Marcono1234/marcono1234/included-qhelp-files
Use `.inc.qhelp` extension for included help files
2021-03-08 16:26:32 +01:00
Chris Smowton
f9f143d62c Merge pull request #5347 from Marcono1234/marcono1234/simplify-tests
Java: Simplify tests using InlineExpectationsTest
2021-03-08 14:47:28 +00:00
Joe Farebrother
ed228cbcef Add sinks for URL Open Stream query 2021-03-08 14:07:53 +00:00
Marcono1234
95aeb7b53f Fix .qhelp file name mismatch 2021-03-08 14:27:35 +01:00
Erik Krogh Kristensen
29ae737475 update expected output for MalformedRegExp 2021-03-08 13:50:58 +01:00
Anders Schack-Mulligen
e63f81171c Merge pull request #5349 from p0wn4j/fix-nashorn-engine-1
Java: Fix NashornScriptEngine detection in ScriptEngine query
2021-03-08 13:23:36 +01:00
Erik Krogh Kristensen
b3ee70f4f7 update expected output for trap test 2021-03-08 13:06:17 +01:00
Chris Smowton
6cf15f49bb Replace hasTaintFlow=y with hasTaintFlow everywhere 2021-03-08 11:57:35 +00:00
Marcono1234
b7353f0bb0 Java: Simplify tests using InlineExpectationsTest 2021-03-08 11:49:52 +00:00
Mathias Vorreiter Pedersen
e2c0bf3cc0 C++: Show arguments in path explanations and accept test changes. 2021-03-08 12:44:05 +01:00
ihsinme
921c41d710 Apply suggestions from code review
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2021-03-08 14:23:42 +03:00
Erik Krogh Kristensen
bff59a1aaa fix parse error in regular expressions 2021-03-08 12:04:11 +01:00
Chris Smowton
790fb7829a Improve comment and change-note accuracy 2021-03-08 11:00:05 +00:00
Chris Smowton
4a4f4b01a1 Add support for java.util.concurrent.ThreadLocalRandom 2021-03-08 10:59:53 +00:00
Mathias Vorreiter Pedersen
84554af7f5 Merge pull request #5356 from yoff/tests-amend-qldoc
InlineExpectationTest: clarify the need for an empty `.expected` file
2021-03-08 11:53:55 +01:00
Rasmus Lerchedahl Petersen
2bccb67be4 Python, doc: Make first batch of examples runnable
python queries.
2021-03-08 10:57:02 +01:00
Mathias Vorreiter Pedersen
bb53780ba9 C++: Add flow through unary instructions and pointer/indirection conflation for parameters. These rules are copy/pasted from DefaultTaintTracking. The conflation rules will hopefully be removed as part of #5089. 2021-03-08 09:42:47 +01:00
Rasmus Lerchedahl Petersen
cc9a938054 InlineExpectationTest: clarify the nedd for an
empty `.expected` file
2021-03-08 09:18:47 +01:00
Rasmus Lerchedahl Petersen
4a9023b989 Python: add comment with ref 2021-03-08 08:17:23 +01:00
Rasmus Lerchedahl Petersen
7142ddcb25 Python: add taint step for __traceback__ 2021-03-08 08:13:07 +01:00
Rasmus Lerchedahl Petersen
b36e0d0be7 Python: target SSA variable rather than Cfg node
also add "INTERNAL: Do not use."
also give test functions different names
2021-03-08 08:04:42 +01:00
Rasmus Lerchedahl Petersen
296297915c Python: add test for __traceback__ 2021-03-07 17:50:28 +01:00
ihsinme
2b1b94835e Update LateCheckOfFunctionArgument.ql 2021-03-07 16:10:32 +03:00
Rasmus Lerchedahl Petersen
aaaf90902f Python: File for dataflow section
Initilally a copy of the one from C#
2021-03-07 14:02:55 +01:00
Rasmus Lerchedahl Petersen
24e406d21a Documentation: Fix typo
in dataflow documentation for C#
2021-03-07 09:48:20 +01:00
luchua-bc
0ef3eee4ed Revamp the source and the sink of the query 2021-03-06 22:41:54 +00:00
Artem Smotrakov
891b975899 Use correct file names in SpringExporterUnsafeDeserialization.qhelp 2021-03-06 22:07:43 +01:00
Artem Smotrakov
bda223771b Added another example for SpringExporterUnsafeDeserialization.ql 2021-03-06 22:05:00 +01:00
Artem Smotrakov
82cb4a8d68 Renamed SpringHttpInvokerUnsafeDeserialization.ql 2021-03-06 21:48:35 +01:00
Artem Smotrakov
dcabce679a Cover beans from XML configs in SpringHttpInvokerUnsafeDeserialization.ql 2021-03-06 21:40:35 +01:00
p0wn4j
6841f5f7c4 Java: Add NashornScriptEngine detection in ScriptEngine query
Java: Add NashornScriptEngine detection in ScriptEngine query

Java: Add NashornScriptEngine detection in ScriptEngine query

Java: Add NashornScriptEngine detection in ScriptEngine query
2021-03-06 16:19:07 +04:00
Jaroslav Lobačevski
673e64909a github actions queries 2021-03-06 10:27:11 +02:00
luchua-bc
31eaa80f5b Revamp the source 2021-03-06 00:56:15 +00:00
Dave Bartolomeo
863497c695 C++: Update naming of queries and paths to use "summary" instead of "metrics" 2021-03-05 14:36:26 -05:00
Shati Patel
c53ce00944 Merge pull request #5342 from shati-patel/docs-delete-unused-script
Docs: Remove unused script and workflow
2021-03-05 18:02:50 +00:00
Rasmus Wriedt Larsen
99c1b2039c Pyhton: Extract vulnerable hostnames into own predicate
Which makes the code a bit cleaner (and made testing out back-tracking easier).
2021-03-05 17:14:32 +01:00
Rasmus Wriedt Larsen
4804a0a9f8 Python: Minor refactor addressArg 2021-03-05 17:12:45 +01:00
Rasmus Wriedt Larsen
024a586a7d Python: Remove tags for old query copy
Co-authored-by: Taus <tausbn@github.com>
2021-03-05 17:08:55 +01:00
Rasmus Wriedt Larsen
66c9cfad85 Python: Apply suggestions from code review
Co-authored-by: Taus <tausbn@github.com>
2021-03-05 17:08:37 +01:00
Rasmus Wriedt Larsen
83539928e6 Python: Fix grammar
Co-authored-by: Taus <tausbn@github.com>
2021-03-05 17:08:20 +01:00
Shati Patel
85205a21de Docs: Remove query help script 2021-03-05 16:02:53 +00:00
Tom Hvitved
63686b5c4e C#: Use is [not] null throughout in the extractor 2021-03-05 16:28:12 +01:00
Tamás Vajk
23d994a4b4 Merge pull request #5197 from tamasvajk/feature/refactor-4
C#: Enable nullability in Extraction.CSharp
2021-03-05 16:24:19 +01:00
Anders Schack-Mulligen
cf4f55d9ab Merge pull request #5223 from smowton/smowton/feature/backward-dataflow-for-modelled-fluent-methods
Java: Add backward dataflow edges through modelled function invocations
2021-03-05 15:11:43 +01:00
Tom Hvitved
6e5af1a9f8 Data flow: Sync files 2021-03-05 14:56:40 +01:00
Tom Hvitved
d496503d5d Data flow: Restrict the size of getApNil() 2021-03-05 14:54:54 +01:00
Tom Hvitved
492add1f7a Data flow: Force join-order for Node::getEnclosingCallable() 2021-03-05 14:54:54 +01:00
Chris Smowton
012058a866 Apply review suggestions: use ArgumentNode.argumentOf, and change more uses of ValuePreservingCallable -> ValuePreservingMethod 2021-03-05 13:34:13 +00:00
Chris Smowton
eed357dc93 ValuePreservingCallable -> ValuePreservingMethod
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2021-03-05 13:28:35 +00:00
Chris Smowton
a37b98ca27 Value-preserving methods: handle generics in DataFlowUtil.qll
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2021-03-05 13:15:06 +00:00
Chris Smowton
ca86925a45 Update java/ql/src/semmle/code/java/dataflow/FlowSteps.qll
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2021-03-05 13:02:19 +00:00
Chris Smowton
45f3365d06 Apply suggestions from code review
Note value-preserving functions can't be constructors

Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2021-03-05 12:52:38 +00:00
Jonas Jensen
32f1da7455 Merge pull request #5327 from MathiasVP/less-field-to-obj-flow
C++: Remove more field-to-object flow
2021-03-05 13:16:21 +01:00
Tamas Vajk
c6b47647e1 Move the nullable disable warning region to the Type instead of the base CachedSymbol entity 2021-03-05 13:14:07 +01:00
Chris Smowton
e3cf5c235e Add support for Commons-Lang's RandomUtils
This is realised by somewhat generalising our interfaces for modelling RNGs. We also add tests for randomness-related queries that didn't have any, and addtest cases checking the Apache random-number generators are interchangeable with the stdlib ones.
2021-03-05 12:09:33 +00:00
Jonas Jensen
767d3141ad Merge pull request #5336 from MathiasVP/fix-join-order-in-memset-may-be-deleted
C++: Fix performance in cpp/memset-may-be-deleted.
2021-03-05 13:08:10 +01:00
Tamas Vajk
df9d54c994 Fix code review findings 2021-03-05 13:00:04 +01:00
Chris Smowton
990bdc20b0 Move value-preserving callable class into FlowSteps 2021-03-05 11:55:53 +00:00
Joe Farebrother
3f3640fcbd Model ByteArrayDataOutput 2021-03-05 11:19:55 +00:00
Joe Farebrother
470a2ca336 Add CopyTo 2021-03-05 11:19:55 +00:00
Joe Farebrother
61dcf3a275 Apply suggestions from code review
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
2021-03-05 11:19:55 +00:00
Joe Farebrother
f5564b1c3b Remove unnecassary import 2021-03-05 11:19:54 +00:00
Joe Farebrother
5278cc9e9e Fix change note file extension 2021-03-05 11:19:54 +00:00
Joe Farebrother
e916e04fe1 Add change note 2021-03-05 11:19:54 +00:00
Joe Farebrother
d30d1a2ab2 Add unit tests and fix issues 2021-03-05 11:19:52 +00:00
Joe Farebrother
c12f8035c4 Add stubs for unit tests 2021-03-05 11:19:25 +00:00
Joe Farebrother
56e611faaa Switch existing test cases to inline expectations 2021-03-05 11:19:25 +00:00
Joe Farebrother
d67de88d34 Model Guava IO package 2021-03-05 11:19:25 +00:00
CodeQL CI
a55246c9f4 Merge pull request #5330 from RasmusWL/fix-flask-taint-prop-to-methods
Approved by yoff
2021-03-05 03:17:41 -08:00
Mathias Vorreiter Pedersen
2d7f15cc8a C++: Fix join-order in cpp/memset-may-be-deleted. 2021-03-05 11:38:15 +01:00
Anders Schack-Mulligen
0d7f6ced8f Merge pull request #5334 from Marcono1234/marcono1234/improve-constant-loop-condition
Java: Improve constant-loop-condition
2021-03-05 11:36:25 +01:00
CodeQL CI
d7b9251b0d Merge pull request #5262 from max-schaefer/event-handler-receiver-is-dom-element
Approved by asgerf
2021-03-05 02:04:59 -08:00
Anders Schack-Mulligen
00983c8967 Merge pull request #4965 from artem-smotrakov/jexl-injection
Java: Query for detecting JEXL injections
2021-03-05 10:52:36 +01:00
Anders Schack-Mulligen
20ccb52912 Merge pull request #4299 from torque59/play-framework
Initial support for Java - Play Framework > 2.6.x
2021-03-05 10:51:53 +01:00
Anders Schack-Mulligen
8d292070a4 Merge pull request #5272 from Marcono1234/marcono1234/simplify-own-member-access-checks
Java: Simplify own member access checks
2021-03-05 10:22:17 +01:00
Anders Schack-Mulligen
3565ba51b3 Merge pull request #5209 from smowton/smowton/feature/commons-misc-text
Java: add models for miscellaneous text-processing utilities from Commons Lang
2021-03-05 10:21:58 +01:00
yoff
d17246ce2b Merge pull request #5255 from RasmusWL/port-flask-debug
Python: port py/flask-debug query
2021-03-05 09:39:14 +01:00
Mathias Vorreiter Pedersen
c86fc223b9 C++: Fix comment and prevent false positives on chiOnlyPartiallyUpdatesLocation when Alias::getEndBitOffset doesn't have known value. 2021-03-05 08:53:24 +01:00
Mathias Vorreiter Pedersen
bd842403c8 C++: Add testcase 2021-03-05 08:06:22 +01:00
haby0
ecdadd1826 move the query to experimental folder 2021-03-05 14:38:04 +08:00
luchua-bc
a93aabab40 Add the toString() method 2021-03-05 03:05:49 +00:00
luchua-bc
919c6b4b0a Optimize flow steps 2021-03-05 02:50:54 +00:00
Francis Alexander
abdebc29f9 Move to experimental and review feedback 2021-03-05 07:26:29 +05:30
Francis Alexander
a35f6d030c Test fixes and change notes 2021-03-05 06:50:57 +05:30
Marcono1234
879dbba8f0 Add name to check-change-note.yml workflow 2021-03-05 00:34:42 +01:00
Marcono1234
e9e9634306 Java: Improve constant-loop-condition 2021-03-04 23:33:29 +01:00
Taus
d2ed216670 Merge pull request #5280 from RasmusWL/highlight-tornado-uri
Python: Highlight how request.uri works in Tornado
2021-03-04 23:31:02 +01:00
Taus
0b446258f5 Merge pull request #5279 from RasmusWL/ensure-old-queries-not-used
Python: Ensure old dataflow queries are not used
2021-03-04 23:29:35 +01:00
Marcono1234
c8315577fe Java: Simplify own member access checks 2021-03-04 22:45:52 +01:00
Marcono1234
5a8ffa5a85 Use .inc.qhelp extension for included help files 2021-03-04 22:04:48 +01:00
Artem Smotrakov
7d52b53c24 Merge branch 'jexl-injection' of github.com:artem-smotrakov/ql into jexl-injection 2021-03-04 20:29:10 +01:00
Artem Smotrakov
0695b2a1fb Removed TaintedSpringRequestBody 2021-03-04 20:27:39 +01:00
Anders Schack-Mulligen
d685aff5e2 Merge pull request #5328 from owen-mc/correct-signature-in-comment
Java: Correct signature and package in comment
2021-03-04 17:03:35 +01:00
Mathias Vorreiter Pedersen
b399246d7f C++/C#: Sync identical files. 2021-03-04 16:34:35 +01:00
Mathias Vorreiter Pedersen
23876cb581 C++: Only allow taint to a FieldAddressInstruction if it's a union type. 2021-03-04 16:29:44 +01:00
Mathias Vorreiter Pedersen
31690dee58 Fix comment. 2021-03-04 16:11:47 +01:00
Owen Mansel-Chan
96eaf2119f Correct signature and package in comment
cf https://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletResponse.html#addCookie(javax.servlet.http.Cookie)
2021-03-04 15:10:02 +00:00
Mathias Vorreiter Pedersen
6c14288fa7 C++: Use new predicate and accept test changes. 2021-03-04 16:05:38 +01:00
CodeQL CI
ad4b9372bd Merge pull request #5302 from RasmusWL/expectation-tests-allow-str-prefix
Approved by MathiasVP, tausbn
2021-03-04 06:48:57 -08:00
Mathias Vorreiter Pedersen
8a4cc3b5c2 C++: Sync identical files. 2021-03-04 15:38:36 +01:00
Mathias Vorreiter Pedersen
200d94777a C++: Add isPartialUpdate member predicate to ChiInstructions. 2021-03-04 15:37:47 +01:00
ihsinme
cadb1d6554 Add files via upload 2021-03-04 16:21:34 +03:00
ihsinme
633fc92efc Add files via upload 2021-03-04 16:20:22 +03:00
ihsinme
10cc574289 Add files via upload 2021-03-04 16:15:26 +03:00
ihsinme
01c13c4703 Add files via upload 2021-03-04 16:14:11 +03:00
CodeQL CI
15049ca853 Merge pull request #5183 from erik-krogh/next
Approved by asgerf
2021-03-04 04:57:43 -08:00
Anders Schack-Mulligen
f9365dc9ac Merge pull request #5324 from aschackmull/java/merge-5226
Java: merge #5226
2021-03-04 13:47:59 +01:00
haby0
c5577cb09a Fix the problem 2021-03-04 19:54:49 +08:00
Tamas Vajk
3e0245a7fc Fix test case for RuntimeChecksBypass 2021-03-04 12:47:21 +01:00
Chris Smowton
da0a7f343a Move existing value-preserving methods to use ValuePreservingCallable 2021-03-04 11:45:45 +00:00
Chris Smowton
40b0f68d2a Add backward dataflow edges through modelled function invocations.
Also add convenience abstract classes for easily modelling new functions as fluent or value-preserving.
2021-03-04 11:45:19 +00:00
Chris Smowton
71cd329ded Directly import Lang from ExternalFlow's Frameworks module 2021-03-04 11:12:21 +00:00
Chris Smowton
563404120f Move calls to getSourceDeclaration 2021-03-04 11:11:56 +00:00
Chris Smowton
43b9436bb8 Convert Apache misc text models to CSV taint-flow specifications 2021-03-04 11:11:56 +00:00
Chris Smowton
0029d3b743 Java CSV flow summaries: allow specifying an unqualified typename to imply either the type itself or any generic specialisation.
It is still possible to specify a precise generic signature if need be.
2021-03-04 11:11:56 +00:00
Chris Smowton
224e537459 Add change note 2021-03-04 11:11:56 +00:00
Chris Smowton
b0ba0585a7 Add models for Apache Commons Lang and Text's Str[ing]Substitutor 2021-03-04 11:11:55 +00:00
Chris Smowton
f749c31136 Add models for commons lang/text's Str[ing]Lookup class 2021-03-04 11:11:55 +00:00
Chris Smowton
1580d23b2b Add models for WordUtils and StrTokenizer
Both of these have commons-text and commons-lang variants.
2021-03-04 11:11:55 +00:00
Tamas Vajk
90acd8c695 Explicitly enable nullability analysis in guards tests 2021-03-04 11:39:56 +01:00
Anders Schack-Mulligen
45f52289ea Merge branch 'main' into java/merge-5226 2021-03-04 11:36:16 +01:00
Anders Schack-Mulligen
fe07630e40 Merge pull request #5219 from smowton/smowton/feature/backward-dataflow-for-fluent-methods
Java: Add backward dataflow edges through fluent function invocations.
2021-03-04 11:13:32 +01:00
CodeQL CI
342c7abd74 Merge pull request #5301 from asgerf/js/ajv-model
Approved by erik-krogh
2021-03-04 01:27:38 -08:00
Rasmus Lerchedahl Petersen
9f8a028dfc Python: add .expected-file 2021-03-04 00:12:34 +01:00
Rasmus Wriedt Larsen
3dc0c2081e Python: Fix taint-propagation to methods
Before we would add a step from _any_ request instance to _any_ method (CP).
2021-03-03 21:55:33 +01:00
luchua-bc
1784c202a7 Clean up the query 2021-03-03 17:03:37 +00:00
Rasmus Lerchedahl Petersen
3dd34c9ba9 Python: rewrite comment 2021-03-03 17:41:20 +01:00
Owen Mansel-Chan
f9973d10ae Merge pull request #5245 from owen-mc/add-codeql-go-as-codeowner-of-shared-dataflow-library-files
Add @codeql-go as code owners for the shared data-flow library files
2021-03-03 16:36:05 +00:00
Taus
c1fd48468a Merge pull request #5286 from RasmusWL/share-crypto-algorithms
Python/JS: Share modeling of crypto algorithms
2021-03-03 17:00:01 +01:00
Tamas Vajk
cb4ed90c5c Fix failing tests 2021-03-03 16:58:48 +01:00
Rasmus Lerchedahl Petersen
dcf8c881ff Python: correct mistake in example 2021-03-03 16:54:36 +01:00
Rasmus Lerchedahl Petersen
fafc36a9cb Python: remove (do not introduce) unused import 2021-03-03 16:49:35 +01:00
Rasmus Lerchedahl Petersen
f02a19669f Python: Make exception info concept local 2021-03-03 16:47:31 +01:00
Anders Schack-Mulligen
f91c71c8f7 Merge pull request #5270 from Marcono1234/marcono1234/class-isPackageProtected
Java: Add Class and Interface.isPackageProtected()
2021-03-03 16:33:57 +01:00
Anders Schack-Mulligen
7ca57fd7a5 Merge pull request #5294 from Marcono1234/patch-1
Java: Fix wrong algorithm name matching
2021-03-03 16:33:13 +01:00
Tamás Vajk
f3885a8a05 Merge pull request #4627 from tamasvajk/feature/csharp9-covariant-return
C#: Add test for covariant return types
2021-03-03 16:12:13 +01:00
Marcono1234
d5d0439471 Java: Fix wrong algorithm name matching
The regex character class `[5|7]` matches `5`, `7` and `|`.
2021-03-03 15:44:23 +01:00
Marcono1234
b9c0193022 Sync .qhelp file renaming to other languages 2021-03-03 15:38:08 +01:00
luchua-bc
502cf38fcc Use concise API 2021-03-03 14:07:43 +00:00
Tamas Vajk
ed5d31a385 C#: Upgrade Roslyn dependencies to 3.9 2021-03-03 14:57:56 +01:00
luchua-bc
1b1c3f953b Remove localflow from the source 2021-03-03 13:54:26 +00:00
Tamas Vajk
a5a4329669 C#: Add tests for covariant return types 2021-03-03 14:52:10 +01:00
luchua-bc
b366ffa69e Revamp source of the query 2021-03-03 13:38:18 +00:00
Tamas Vajk
bd2b3e72f8 C#: Use covariant return for context overrides 2021-03-03 14:35:07 +01:00
Tamas Vajk
cfd8a87496 C#: Fix nullability warnings after .net 5 upgrade 2021-03-03 14:25:59 +01:00
Rasmus Wriedt Larsen
c3175ae7b1 Python/JS: Sync CryptoAlgorithms.qll 2021-03-03 14:18:33 +01:00
Tamas Vajk
828e1f81ae Share core analysis logic between standalone and normal analysis 2021-03-03 14:18:19 +01:00
Tamas Vajk
15e26e1a91 C#: Reduce disabled nullability regions by splitting 'Extractor' and 'Analyser' 2021-03-03 14:18:19 +01:00
Tamas Vajk
2697677239 Merge Extractor.Standalone and OutputPath 2021-03-03 14:18:19 +01:00
Tamas Vajk
10ab17a7e0 C#: Enable nullability in csharp extraction project v1 2021-03-03 14:18:19 +01:00
Rasmus Wriedt Larsen
dd75ea31df Python: Apply suggestions from code review
Co-authored-by: Taus <tausbn@github.com>
2021-03-03 14:17:22 +01:00
Anders Schack-Mulligen
3400c121d6 Merge pull request #5202 from joefarebrother/apache-http
Java: Add modelling for Apache HTTP Components
2021-03-03 13:41:41 +01:00
Anders Schack-Mulligen
220383b9fb Merge pull request #5313 from joefarebrother/guava-change-note
Java: Add change note for Guava
2021-03-03 13:03:54 +01:00
Anders Schack-Mulligen
663c72ab1d Update java/change-notes/2021-03-23-guava-collections-and-preconditions.md 2021-03-03 12:53:16 +01:00
Tamás Vajk
73ad417757 Merge pull request #5132 from tamasvajk/feature/dotnet502
C#: Upgrade projects to .net 5
2021-03-03 12:47:08 +01:00
CodeQL CI
8e2af077a7 Merge pull request #5237 from erik-krogh/moreInf
Approved by asgerf
2021-03-03 03:09:07 -08:00
Joe Farebrother
a77cf12596 Add change note for Guava 2021-03-03 10:56:12 +00:00
Artem Smotrakov
7cc7ec962e Updated recommendations for avoiding JEXL injections 2021-03-03 11:40:59 +01:00
Erik Krogh Kristensen
b9450c901a remove development comment 2021-03-03 11:18:09 +01:00
Mathias Vorreiter Pedersen
721ba5e2c5 Merge pull request #4825 from rdmarsh2/rdmarsh2/cpp/operand-reuse
C++: share `TOperand` across IR stages
2021-03-03 08:55:44 +01:00
yoff
078fbccc9a Apply suggestions from code review
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-03-02 22:32:45 +01:00
yoff
4196dc2291 Update python/change-notes/2021-02-25-port-stactrace-exposure-query.md
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-03-02 22:23:29 +01:00
Robert Marsh
312ead44c5 Merge pull request #5309 from github/aeisenberg/from-source-docs
Documentation: Update C/C++ Element::fromSource() docs
2021-03-02 12:51:41 -08:00
Artem Smotrakov
617ba65ef5 Improved docs for SpringHttpInvokerUnsafeDeserialization.ql 2021-03-02 21:36:14 +01:00
Artem Smotrakov
c243f2f042 Improved JexlInjection.qhelp 2021-03-02 21:25:26 +01:00
Artem Smotrakov
6b66323ac3 Simplified JexlInjectionLib.qll and removed LocalUserInput 2021-03-02 21:22:46 +01:00
Robert Marsh
dbd8432884 C++: autoformat 2021-03-02 12:11:12 -08:00
Andrew Eisenberg
9982112b61 Documentation: Update C/C++ Element::fromSource() docs
The previous documentation was not correct. This
documentation is adapted from File::fromSource().
2021-03-02 08:57:17 -08:00
Aditya Sharad
648910e974 Merge pull request #5285 from adityasharad/actions/docs-review
Actions: Add workflow to request docs review
2021-03-02 08:52:32 -08:00
Joe Farebrother
81ff76814f Remove incorrect expectaton 2021-03-02 16:35:34 +00:00
Francis Alexander
173c4b7f2f More Play stubs improvements 2021-03-02 20:39:25 +05:30
Mathias Vorreiter Pedersen
eb4f1e1ba0 C++: Restore some of the lost test results by doing operand -> instruction taint steps in IR TaintTracking. 2021-03-02 15:45:40 +01:00
Erik Krogh Kristensen
95a1edcabc refactor FunctionStyleClass to get a better join-order 2021-03-02 15:22:38 +01:00
Anders Schack-Mulligen
0eb2c06e20 Merge pull request #3945 from porcupineyhairs/structsDevMode
Java: Add query to detect Apache Struts enabled Devmode
2021-03-02 15:22:20 +01:00
Erik Krogh Kristensen
4d33407f6c optimize getACalleeValue 2021-03-02 15:21:36 +01:00
Tamas Vajk
714e1dc686 Add change note 2021-03-02 15:08:07 +01:00
Asger F
919ee38049 Update javascript/ql/src/semmle/javascript/security/dataflow/DeepObjectResourceExhaustionCustomizations.qll
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2021-03-02 14:02:35 +00:00
Asger F
6c884f86d2 Apply suggestions from code review
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2021-03-02 14:01:59 +00:00
Asger Feldthaus
6e0322dc60 JS: Add DeepResourceExhaustion test 2021-03-02 13:56:43 +00:00
Asger Feldthaus
88e5348da9 JS: Move RemotePropertyInjection test into subfolder 2021-03-02 13:56:39 +00:00
Asger Feldthaus
5d27cd934d JS: Move Source def into customizations lib 2021-03-02 13:52:33 +00:00
Asger Feldthaus
d916118ea4 JS: Move ExceptionXss source into Xss.qll 2021-03-02 13:16:10 +00:00
Erik Krogh Kristensen
47f4faa4e2 use local dataflow instead of type-inference for mayHaveBooleanValue 2021-03-02 14:06:38 +01:00
Erik Krogh Kristensen
ae56285331 use callgraph instead of type-inference for array taint-steps 2021-03-02 14:06:09 +01:00
Erik Krogh Kristensen
b20ce8bfca use callgraph instead of TypeInference in Testing.qll 2021-03-02 14:04:23 +01:00
Porcuiney Hairs
beb15e27eb remove tests 2021-03-02 18:13:33 +05:30
Mathias Vorreiter Pedersen
23d3109071 C++: Use taintedWithPath in more tests. This is the predicate that's currently hooked up to the new IR taint tracking library. 2021-03-02 13:40:39 +01:00
Asger Feldthaus
fd9604c5ef JS: Update expected output for poly ReDoS 2021-03-02 12:39:05 +00:00
Asger Feldthaus
31721b5fe3 JS: Fix missing qldoc 2021-03-02 12:39:05 +00:00
Asger Feldthaus
05594f2936 JS: Change note 2021-03-02 12:39:05 +00:00
Asger Feldthaus
0bd60c1989 JS: Autoformat 2021-03-02 12:39:05 +00:00
Asger Feldthaus
12079cd1e4 JS: Recognize RegExps in JSON schemas 2021-03-02 12:39:04 +00:00
Asger Feldthaus
7afa755597 JS: Add ajv error as source of ExceptionXss 2021-03-02 12:39:04 +00:00
Asger Feldthaus
24199a5499 JS: Add query for resource exhaustion from deep object handling 2021-03-02 12:39:04 +00:00
Asger Feldthaus
b978359803 JS: Add schema validation as TaintedObject sanitizer 2021-03-02 12:39:04 +00:00
Tamas Vajk
fa2f345611 Revert "Simplify MissingCallTarget for calli"
This reverts commit 3b82abd7c7.
2021-03-02 12:58:42 +01:00
Erik Krogh Kristensen
55985c969b add change note 2021-03-02 12:25:50 +01:00
Erik Krogh Kristensen
ecccb8a409 only flag React elements in ClientSideUrlRedirect if it's a HTML element, or known link class 2021-03-02 12:25:50 +01:00
Erik Krogh Kristensen
36049f05f8 update Next.js xss example such that the attack is viable 2021-03-02 12:25:50 +01:00
Erik Krogh Kristensen
1f02594ccc rename and move getAPropertyNameInterpretedAsJavaScriptUrl 2021-03-02 12:25:50 +01:00
Erik Krogh Kristensen
5b5baced9a add support for replace in Next.js router 2021-03-02 12:25:49 +01:00
Erik Krogh Kristensen
97032f8627 add ClientSideUrlRedirect sink for Next.js routers 2021-03-02 12:25:49 +01:00
Erik Krogh Kristensen
a79c30a818 support NextJS API endpoints 2021-03-02 12:25:49 +01:00
Erik Krogh Kristensen
0e7e3e6178 support Next.js pages that export React components 2021-03-02 12:25:49 +01:00
Erik Krogh Kristensen
1fdbbb682d support Next.js page request/response objects 2021-03-02 12:25:49 +01:00
Erik Krogh Kristensen
a5cf024c9f add support for getServerSideProps in Next.js 2021-03-02 12:25:49 +01:00
Erik Krogh Kristensen
af262a035d add support for getInitialProps in Next.js 2021-03-02 12:25:49 +01:00
Erik Krogh Kristensen
d63fcaf7f1 add step from getStaticProps to the component render function 2021-03-02 12:25:49 +01:00
Erik Krogh Kristensen
9d7bb57d8a add parameter values from Next as a RemoteFlowSource 2021-03-02 12:25:49 +01:00
Erik Krogh Kristensen
41a0c0b55e support React links in js/client-side-unvalidated-url-redirection 2021-03-02 12:25:49 +01:00
Francis Alexander
4384f78595 Play stubs improvements, cleanup and return values 2021-03-02 16:50:16 +05:30
CodeQL CI
79839d2304 Merge pull request #5267 from erik-krogh/httpProxy
Approved by asgerf
2021-03-02 02:46:50 -08:00
Owen Mansel-Chan
6460ce3f83 Add @codeql-go as code owners for the shared data-flow library files 2021-03-02 10:39:47 +00:00
Anders Schack-Mulligen
b0fa8dfeae Merge pull request #4214 from porcupineyhairs/springViewManipulation
[Java] Add QL for detecting Spring View Manipulation Vulnerabilities.
2021-03-02 11:31:42 +01:00
Mathias Vorreiter Pedersen
6ba35f4aac C++: Fix function renaming and accept test change. 2021-03-02 11:31:24 +01:00
Mathias Vorreiter Pedersen
9f02c144a8 C++: Remove files that were incorrectly added when resolving merge conflicts. 2021-03-02 11:14:49 +01:00
CodeQL CI
2957131853 Merge pull request #5258 from erik-krogh/nextPerf
Approved by asgerf
2021-03-02 02:04:20 -08:00
CodeQL CI
9ea8f8201c Merge pull request #5265 from erik-krogh/cacheRemote
Approved by asgerf
2021-03-02 02:03:09 -08:00
Mathias Vorreiter Pedersen
ffc6af73b7 C++: Accept test changes. 2021-03-02 11:00:43 +01:00
Mathias Vorreiter Pedersen
748f5344ff Merge branch 'main' into rdmarsh/cpp/use-taint-configuration-dtt 2021-03-02 10:43:37 +01:00
Anders Schack-Mulligen
394c82d564 Apply suggestions from code review
Adjust qldoc.
2021-03-02 10:17:07 +01:00
Tamas Vajk
faf69d65da Fix merge error 2021-03-02 09:23:15 +01:00
Tamas Vajk
3b82abd7c7 Simplify MissingCallTarget for calli 2021-03-02 09:21:24 +01:00
Tamas Vajk
7ae640ce16 Fix OS specific tests 2021-03-02 09:21:24 +01:00
Tamas Vajk
f2e667173c C#: Add calli IL opcode extraction 2021-03-02 09:21:24 +01:00
Tamas Vajk
17109a36ce Fix extraction error due to missing DLL 2021-03-02 09:21:24 +01:00
Tamas Vajk
6205ec233c Fix more failing tests 2021-03-02 09:21:24 +01:00
Tamas Vajk
2b1c6faefd Fix failing test 2021-03-02 09:21:24 +01:00
Tamas Vajk
4f383be13b Fix new (nullability) compiler warnings 2021-03-02 09:21:24 +01:00
Tamas Vajk
71f095d6d4 Upgrade projects to .net 5 2021-03-02 09:20:31 +01:00
Aditya Sharad
dbed4a1a8b Actions: Add workflow to request docs review
When a PR is labelled with 'ready-for-docs-review',
this workflow comments on the PR to notify the GitHub CodeQL docs team.
Runs on `pull_request_target` events so it can write comments to the PR.
Since this runs in the context of the base repo, it must not check out the PR
or use untrusted data from the event payload.

Only runs when the PR base is github/codeql, to prevent notifications from forks.
2021-03-01 17:15:03 -08:00
luchua-bc
95d1994196 Query to check sensitive cookies without the HttpOnly flag set 2021-03-01 22:06:52 +00:00
Robert Marsh
2b382d588a C++: autoformat Operand.qll 2021-03-01 11:13:04 -08:00
Calum Grant
cee96775b8 Merge pull request #5305 from asgerf/js/tuple-type-rest-index-stats
JS: Regenerate stats for tuple_type_rest_index
2021-03-01 17:43:55 +00:00
Porcuiney Hairs
5151a528ac Include suggestions from review 2021-03-01 22:59:30 +05:30
Chris Smowton
5d2f3421d8 Add change notes 2021-03-01 16:59:20 +00:00
Chris Smowton
cdccc1a064 Remove needless typecasts 2021-03-01 16:47:34 +00:00
yoff
92128babef Apply suggestions from code review
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-03-01 17:39:17 +01:00
Asger Feldthaus
26924a3378 JS: Regenerate stats for tuple_type_rest_index 2021-03-01 16:30:09 +00:00
Rasmus Lerchedahl Petersen
38748f9e23 Python: restrict attention to ss.wrap_socket 2021-03-01 16:35:21 +01:00
Tamás Vajk
2ac94255b7 Merge pull request #5299 from tamasvajk/feature/limit-codescanning-csharp2
C#: Fix codeql analysis workflow
2021-03-01 16:20:03 +01:00
Porcuiney Hairs
14ec148272 refactor to meet experimental guidelines. 2021-03-01 18:46:33 +05:30
Rasmus Wriedt Larsen
0874712c97 C++/Java/Python: Allow Python string prefix in InlineExpectationsTest
I've been writing tests for crypto libraries in Python, and have wanted to write
code along the lines of

```py
md5.hash(b"some message") # $ HashInput=b"some message"
```

which didn't work before this commit, forcing me to store my text in a variable
like below. This turned out to be really annoying when dealing with more complex
examples, so therefore I'm adding this new functionality to allow this behavior.

```py
msg = b"some message"
md5.hash(msg) # $ HashInput=msg
```
2021-03-01 13:44:28 +01:00
Chris Smowton
aab9deceef Remove package from test Java file 2021-03-01 10:32:44 +00:00
Chris Smowton
c32514bf66 Sync dataflow library files 2021-03-01 10:27:28 +00:00
Chris Smowton
e6b1fe9b5f Fluent interface dataflow: support argument-output flow directly declared by the simpleLocalFlowStep relation
This means we will treat fluent interfaces that are modelled the same as those where we determine an argument flows to an output by inspection of the function body.
2021-03-01 10:23:38 +00:00
Chris Smowton
54caf501e7 Switch fluent-methods test to use a plain DataFlow::Configuration
No taint edges are involved, so TaintTracking was unnecessary.
2021-03-01 10:16:02 +00:00
Chris Smowton
fadbb32bd6 Add backward dataflow edges through fluent function invocations.
This means that much as obj.getA().setB(...) already has a side-effect on `obj`, all three setters in obj.setA(...).setB(...).setC(...) will have a side-effect on `obj`.
2021-03-01 10:11:28 +00:00
Tamas Vajk
1ecbbf6af3 C#: Fix codeql analysis workflow 2021-03-01 09:18:05 +01:00
Anders Schack-Mulligen
37baf77b93 Merge pull request #5273 from intrigus-lgtm/java/unify-main-method-check
Java: Remove duplicate code.
2021-03-01 09:05:28 +01:00
Tamás Vajk
3b56e3520c Merge pull request #5277 from tamasvajk/feature/fix-name-resolution
Fix method name resolution issue with nullable suppression
2021-03-01 08:47:21 +01:00
Jonas Jensen
208a374c58 Merge pull request #5256 from MathiasVP/promote-insecure-memset-query
C++: Promote insecure removal of memset query
2021-03-01 08:30:16 +01:00
Artem Smotrakov
15a43ffe36 Simplified returnsRemoteInvocationSerializingExporter() 2021-02-27 13:41:20 +01:00
Rasmus Wriedt Larsen
443780f27e Python/JS: Share modeling of cryptographic algorithms
I didn't quite know where to place it for JS, so I tried my best :)

The canonical Python version might be changed in the future, but I wanted to
keep this change small.
2021-02-27 11:39:35 +01:00
Rasmus Wriedt Larsen
010488c899 Python/JS: Update QLDoc for crypto algorithms before sharing 2021-02-27 11:38:45 +01:00
Rasmus Wriedt Larsen
646ea55944 Python/JS: Update Python copy of crypto algorithm modeling
Now to be shared accross both languages, with sync-identical-files
2021-02-27 11:38:45 +01:00
haby0
f795d5e0d3 update JSONP Injection ql 2021-02-27 16:25:17 +08:00
Rasmus Lerchedahl Petersen
8b68912c40 Python: Update help and add example 2021-02-26 20:19:31 +01:00
Rasmus Lerchedahl Petersen
9533c92fcc Python: Clean up tests and add comment 2021-02-26 19:28:44 +01:00
Mathias Vorreiter Pedersen
d4f7fab7df Update cpp/change-notes/2021-02-24-memset-may-be-deleted.md
Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com>
2021-02-26 19:17:13 +01:00
Mathias Vorreiter Pedersen
0f7256752a Update cpp/ql/src/Security/CWE/CWE-014/MemsetMayBeDeleted.qhelp
Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com>
2021-02-26 19:16:28 +01:00
yoff
1670fa0d0e Update python/change-notes/2021-02-23-port-insecure-default-protocol.md 2021-02-26 18:39:49 +01:00
yoff
9a9bda17ed Update python/change-notes/2021-02-23-port-insecure-default-protocol.md
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-02-26 18:38:35 +01:00
Erik Krogh Kristensen
af7a188bbd add change note 2021-02-26 17:18:30 +01:00
Erik Krogh Kristensen
214aa072b9 support host for http-proxy client requests 2021-02-26 17:18:29 +01:00
Erik Krogh Kristensen
cc48172fd8 add support for events in http-proxy 2021-02-26 17:17:47 +01:00
Erik Krogh Kristensen
ede1a40a02 add ClientRequst models for http-proxy 2021-02-26 17:17:46 +01:00
CodeQL CI
b7c0d18c4a Merge pull request #5278 from erik-krogh/formData
Approved by asgerf
2021-02-26 08:13:41 -08:00
Rasmus Wriedt Larsen
a387496832 Python: Highlight how request.uri works in Tornado 2021-02-26 16:23:21 +01:00
Erik Krogh Kristensen
ae051af9d8 remove redundant code 2021-02-26 14:15:30 +01:00
CodeQL CI
0e70b58a41 Merge pull request #5205 from erik-krogh/ts42
Approved by asgerf
2021-02-26 05:06:40 -08:00
Porcupiney Hairs
42a84a18b0 JAVA : Add query to detect Apache Structs enabled DEvmode
This query detects cases where the development mode is enabled for a
struts configuration. I can't find a CVE per se but, at present, [Github's fuzzy search](https://github.com/search?q=%3Cconstant+name%3D%22struts.devMode%22+value%3D%22true%22+%2F%3E+language%3Axml&type=Code) returns more
than 44000 results. Some of them look like they are classroom projects,
so they may be ineligible for a CVE. But we should be flagging them
anyways as setting the development on in a production system is a very
bad practice and can often lead to remote code execution.
So these should be fixed anyways.
2021-02-26 16:30:04 +05:30
Porcupiney Hairs
602f63ad45 [Java] Add QL for detecting Spring View Manipulation Vulnerabilities. 2021-02-26 16:29:18 +05:30
Tom Hvitved
ac67c67ad7 Merge pull request #4998 from hvitved/csharp/shared-base-pre-ssa
C#: Use shared SSA implementation for `{Pre,Base}Ssa`
2021-02-26 11:29:07 +01:00
Rasmus Wriedt Larsen
b43533ce8d Python: Ensure old dataflow queries are not used
There seems to have been some cases where the old ones have been picked up
instead of the new ones. At least I spotted _one_ case where this happened, in
an internal actions run.

I'm not sure how to actual debug this, so just removing all the tags that could
make these queries to become picked up :|
2021-02-26 11:22:23 +01:00
yoff
7f7320ae4c Update python/ql/src/Security/CWE-327/InsecureDefaultProtocol.ql
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-02-26 10:56:48 +01:00
Erik Krogh Kristensen
c59e6fef80 add model for form-data 2021-02-26 10:54:46 +01:00
Erik Krogh Kristensen
00cfc77fc0 Revert "fix file lookup for exclude patterns"
This reverts commit 74630b0fd8.
2021-02-26 10:28:20 +01:00
Erik Krogh Kristensen
4ec3289ecc update relation name in .stats file 2021-02-26 10:26:08 +01:00
Erik Krogh Kristensen
bd19d5a93c remove is_abstract_signature.ql 2021-02-26 10:24:40 +01:00
Erik Krogh Kristensen
1cac692b1d Update javascript/ql/src/semmle/javascript/TypeScript.qll
Co-authored-by: Asger F <asgerf@github.com>
2021-02-26 10:23:01 +01:00
Mathias Vorreiter Pedersen
42d2a673c7 C++: Respond to review comments. 2021-02-26 10:06:05 +01:00
Tamas Vajk
b3d6d0c12b Fix method name resolution issue with nullable suppression 2021-02-26 09:48:37 +01:00
Mathias Vorreiter Pedersen
4e4ffbd790 Update cpp/change-notes/2021-02-24-memset-may-be-deleted.md
Co-authored-by: Jonas Jensen <jbj@github.com>
2021-02-26 09:48:21 +01:00
Rasmus Lerchedahl Petersen
311149ab4f Python: fix spelling 2021-02-26 09:44:24 +01:00
Mathias Vorreiter Pedersen
72daf2eef9 C++: Make the tests more realistic by actually using the local variable for something. Otherwise it looks like a zero-initialization of a buffer, which the query now tries to exclude. 2021-02-26 09:19:05 +01:00
yoff
a067adbaf3 Update python/ql/test/query-tests/Security/CWE-327-py2/options
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-02-26 08:53:20 +01:00
Tamás Vajk
ce69e3ae66 Merge pull request #5263 from tamasvajk/feature/fix-file-move
C#: Fix potentially concurrent file moves
2021-02-26 08:27:42 +01:00
Tamás Vajk
8241a9c2f1 Merge pull request #5264 from tamasvajk/feature/more-known-enums
C#: Add more well-known enum underlying types
2021-02-26 08:20:14 +01:00
Marcono1234
53dc2ce9b6 Java: Use .inc.qhelp extension for included help files 2021-02-26 00:43:51 +01:00
Marcono1234
e21cbe82a9 Update Java documentation links to Java 11
Where possible update Java documentation links to Java 11.
Additionally update some other links to use HTTPS.
2021-02-26 00:43:51 +01:00
yoff
e3b3825ab0 Merge pull request #5151 from RasmusWL/django-get-redirect-url
Python: Model get_redirect_url in django
2021-02-25 23:07:33 +01:00
Robert Marsh
290b1c624e C++: cache the IR stage Operand class 2021-02-25 13:10:39 -08:00
intrigus
141f057f7b Java: Remove duplicate code. 2021-02-25 21:29:26 +01:00
Mathias Vorreiter Pedersen
faadcd913e C++: Exclude memsets that clear a variable that has no other uses. 2021-02-25 21:27:12 +01:00
Geoffrey White
0c4a5f5e2a Merge pull request #5266 from geoffw0/isis
JS: Fix 'is, is' and 'is is'.
2021-02-25 18:55:41 +00:00
Mathias Vorreiter Pedersen
2777ca445e Update cpp/ql/src/Security/CWE/CWE-014/MemsetMayBeDeleted.ql
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com>
2021-02-25 19:49:58 +01:00
Dave Bartolomeo
2e02625f22 C++: Summary metrics queries
This is a first attempt at implementing, for C++, the set of summary queries that we expect all languages to implement to help diagnose extraction failures and build configuration problems. See the spec in [this document](https://docs.google.com/document/d/1V3zpkj0OGh8GEUVwACRx7fiafE5zklujAftZaYUyf9s/edit?usp=sharing). The five queries are:

- Total number of source files (including .c/.cpp and header files)
- Total number of lines of text across all text files
- Total number of lines of code across all text files
- Number of lines of text in each source file
- Number of lines of code in each source file

I've added some simple unit tests that cover all five of these.
2021-02-25 12:53:39 -05:00
Mathias Vorreiter Pedersen
9e7c9d0ea0 C++: Respond to review comments. Relax the escaping requirements on the local variable being used in memset. 2021-02-25 18:22:48 +01:00
Marcono1234
fa189ded9d Java: Add Class and Interface.isPackageProtected() 2021-02-25 18:21:18 +01:00
CodeQL CI
1bd12e6fdf Merge pull request #5199 from asgerf/js/vue-router
Approved by erik-krogh
2021-02-25 07:32:57 -08:00
Tamás Vajk
505d04b13e Merge pull request #5102 from luchua-bc/java/main-method-in-servlet
Java: CWE-489 Query to detect main() method in servlets
2021-02-25 16:05:06 +01:00
Mathias Vorreiter Pedersen
3f26b2940d Update cpp/ql/src/Security/CWE/CWE-014/MemsetMayBeDeleted.ql
Co-authored-by: Jonas Jensen <jbj@github.com>
2021-02-25 15:48:48 +01:00
Geoffrey White
0e071b7b79 JS: Fix 'is, is' and 'is is'. 2021-02-25 14:16:25 +00:00
Tamas Vajk
3e651f14fd C#: Add more well-known enum underlying types 2021-02-25 14:57:23 +01:00
Rasmus Wriedt Larsen
81b29316e1 Merge pull request #4737 from yoff/python-dataflow-add-cast-nodes
Python: Force read- and store steps to add nodes.
2021-02-25 14:28:54 +01:00
Tamás Vajk
9ae22cbebd Merge pull request #5189 from tamasvajk/feature/refactor-3
C#: Split 'Context' class between CIL and source extraction
2021-02-25 14:28:25 +01:00
Bas van Schaik
5ecd2317b0 Merge pull request #5212 from github/sj-patch-1
Include @xcorail (GHSL) in code reviews for `experimental` queries
2021-02-25 12:58:12 +00:00
Taus
d326d40d71 Merge pull request #5252 from RasmusWL/test-cleanup
Python: Minor cleanup of test setup
2021-02-25 13:33:10 +01:00
Mathias Vorreiter Pedersen
d33209388d C++: Fix test annotations. Also exclude static locals from the query and add a testcase for this. 2021-02-25 13:25:11 +01:00
Taus
01d581ecf3 Merge pull request #5250 from tausbn/python-port-re-security-queries
Python: Port URL sanitisation queries to API graphs
2021-02-25 13:13:55 +01:00
Joe Farebrother
41b7db144d Allow for array types in model signatures 2021-02-25 11:40:48 +00:00
Max Schaefer
f93937f40a Add change note. 2021-02-25 10:51:01 +00:00
Rasmus Lerchedahl Petersen
64c0eaf305 Python: Update test expectations 2021-02-25 11:49:57 +01:00
yoff
f15084254b Add comment explaining tacky nature of code 2021-02-25 11:49:57 +01:00
Rasmus Lerchedahl Petersen
5b51a3461d Python: Force read- and store steps to add nodes.
This gives muche nicer path explanations on some snapshots.
It is achieved by making stepped-to nodes `CastNode`s.
This seems somewhat reasonable as types then to change, when we move
between content and container.
We could probably refine it, though.
2021-02-25 11:49:57 +01:00
Max Schaefer
3fe249f25c Address review comments. 2021-02-25 10:48:23 +00:00
Erik Krogh Kristensen
de6b604930 cache RemoteFlowSource 2021-02-25 11:41:08 +01:00
Erik Krogh Kristensen
86bc7d3e1a avoid a ValueNode x TypeTracker join in Hapi::RouteSetup::getARouteHandler 2021-02-25 11:41:08 +01:00
Erik Krogh Kristensen
d35ea7fb15 always get a good join-order in getAnAliasedSourceNode 2021-02-25 11:41:08 +01:00
Rasmus Wriedt Larsen
472ff97561 Docs: Add crypto to supported Python frameworks 2021-02-25 11:31:03 +01:00
Rasmus Wriedt Larsen
4610b1b392 Pyhton: Use type back-tracking for keysize on key-generation
Internal evaluation showed that this didn't perform better than normal (forward)
type-tracking, but it feels more like the right approach.
2021-02-25 11:31:00 +01:00
Rasmus Wriedt Larsen
c195c64982 Python: Use type-tracking for integer literal tracking
Like we've done for pretty much everything else. An experiment to see what this
means for query performance.
2021-02-25 11:30:56 +01:00
Rasmus Wriedt Larsen
27987717dc Merge branch 'main' into crypto 2021-02-25 11:30:32 +01:00
Asger Feldthaus
55a1ab5714 JS: Autoformat 2021-02-25 10:20:13 +00:00
Tamas Vajk
a5543c689e C#: Fix potentially concurrent file moves 2021-02-25 10:35:49 +01:00
Max Schaefer
2e252ba3e4 JavaScript: Learn that receivers of DOM event handlers are themselves DOM nodes. 2021-02-25 09:06:58 +00:00
Max Schaefer
ae2a5da63f JavaScript: Add new tests for recognising receiver of event handler as DOM element. 2021-02-25 09:04:46 +00:00
haby0
0521ef87da Merge remote-tracking branch 'upstream/main' into JsonHijacking 2021-02-25 16:31:14 +08:00
Jonas Jensen
2b54c33904 Merge pull request #5257 from MathiasVP/doh-its-2021-mathias
C++: Turns out we're in 2021 and not 2020.
2021-02-25 09:30:08 +01:00
Rasmus Lerchedahl Petersen
aba22689fa Python: Add change note 2021-02-25 09:25:17 +01:00
Rasmus Lerchedahl Petersen
86cec40286 Python: update test 2021-02-25 09:22:57 +01:00
Anders Schack-Mulligen
f0d3841369 Merge pull request #5105 from JLLeitschuh/feat/JLL/depricated_bintray_usage
CWE-1104: Maven POM dependence upon Bintray/JCenter
2021-02-25 09:08:31 +01:00
Rasmus Lerchedahl Petersen
780a6a96f8 Python: Add concept tests 2021-02-25 08:54:42 +01:00
Rasmus Lerchedahl Petersen
41743b6afa Python: restrict to caught exceptions
also modernise code
2021-02-25 07:53:35 +01:00
Rasmus Lerchedahl Petersen
24b51e8851 Merge branch 'main' of github.com:github/codeql into python-port-stacktrace-exosure 2021-02-25 07:24:41 +01:00
Rasmus Lerchedahl Petersen
76f080978a Python: Add missing QLDoc 2021-02-24 23:35:44 +01:00
Rasmus Lerchedahl Petersen
192988077e Python: Move <ul> outside of <p> 2021-02-24 23:28:13 +01:00
Artem Smotrakov
e02b51f42b Improved SpringHttpInvokerUnsafeDeserialization.qhelp 2021-02-24 22:35:20 +01:00
Artem Smotrakov
aac0c27dcd Added tests for SpringHttpInvokerUnsafeDeserialization.ql 2021-02-24 22:35:20 +01:00
Artem Smotrakov
95284ad71d Added SpringHttpInvokerUnsafeDeserialization.qhelp and example 2021-02-24 22:35:20 +01:00
Artem Smotrakov
476309af6d Added SpringHttpInvokerUnsafeDeserialization.ql 2021-02-24 22:35:20 +01:00
Artem Smotrakov
34b6ed0a05 Removed commented code from JexlUberspect 2021-02-24 22:31:03 +01:00
Rasmus Lerchedahl Petersen
bf3e5fceea Python: Rearrange directories 2021-02-24 22:07:27 +01:00
Rasmus Lerchedahl Petersen
10657160bc Python: Improve qlhelp according to review 2021-02-24 22:02:16 +01:00
yoff
89d0724fb4 Update python/change-notes/2021-02-23-port-insecure-default-protocol.md
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2021-02-24 19:57:49 +01:00
Bas van Schaik
4ede277c7c Update CODEOWNERS 2021-02-24 18:30:22 +00:00
luchua-bc
e34a203731 Refactor the check of a main method in a test program to improve maintainability 2021-02-24 17:15:08 +00:00
Erik Krogh Kristensen
ea17de6225 prevent join between getAValue() and DefiniteAbstractValue in AMD.qll 2021-02-24 18:12:55 +01:00
Erik Krogh Kristensen
be26a48a16 use pragma[only_bind_into] to prevent bad join in Ssa::hasLocationInfo 2021-02-24 18:05:57 +01:00
Erik Krogh Kristensen
ccd706ea10 and pragmas to prevent bad join in RemoteFlowSource 2021-02-24 18:05:10 +01:00
Erik Krogh Kristensen
674b9ad4fe use getALocalSource instead of smallstep in JQuery::legacyObjectSource 2021-02-24 18:04:50 +01:00
Mathias Vorreiter Pedersen
70a953b633 C++: Add change-note. 2021-02-24 18:02:16 +01:00
Mathias Vorreiter Pedersen
ef8b734863 C++: Move tests out of experimental and merge with old existing tests from the other memset PRs. 2021-02-24 18:02:16 +01:00
Mathias Vorreiter Pedersen
c44fbaaf3c C++: Promote memset query out of experimental. 2021-02-24 18:01:41 +01:00
Erik Krogh Kristensen
69348b1914 remove redundant hasLocationInfo 2021-02-24 18:01:35 +01:00
Erik Krogh Kristensen
8443b8e421 cache Module::getAnExportedValue 2021-02-24 18:01:16 +01:00
Erik Krogh Kristensen
fd9d738d53 use Expr instead of mising DataFlow-nodes and Exprs in charpred 2021-02-24 18:00:55 +01:00
Joe Farebrother
caa6f00292 Switch to CSV based modelling 2021-02-24 16:59:49 +00:00
Erik Krogh Kristensen
8c19f7810d replace forex with unique in DOM.qll 2021-02-24 17:59:38 +01:00
Jonathan Leitschuh
237fefbcf1 Add release notes 2021-02-24 11:19:20 -05:00
Mathias Vorreiter Pedersen
fc4162ba1a C++: Turns out we're in 2021 and not 2020. 2021-02-24 17:15:51 +01:00
Cornelius Riemenschneider
cea1049745 Merge pull request #5249 from geoffw0/cleanupstr
C++: QLDoc Pure.qll
2021-02-24 16:42:41 +01:00
Tamas Vajk
4711856c2b Remove commented code 2021-02-24 16:21:19 +01:00
Tamas Vajk
841ef9a4ae Make derived 'Context' classes internal and adjust visibility of members in base 'Context' 2021-02-24 16:21:19 +01:00
Tamas Vajk
539fdf952a Extend base context in CIL project 2021-02-24 16:21:19 +01:00
Tamas Vajk
5fca946678 C#: Split 'Context' class between CIL and source extraction 2021-02-24 16:21:19 +01:00
Bas van Schaik
4b884bd5d2 Merge branch 'main' into sj-patch-1 2021-02-24 15:10:26 +00:00
CodeQL CI
bf66bdbb95 Merge pull request #5253 from RasmusWL/no-getAnArg
Approved by tausbn
2021-02-24 06:34:31 -08:00
Rasmus Wriedt Larsen
d05a8b8c46 Python: Remove getAnArg in DataFlow::CallCfgNode
Until we've had further discussion on what is the right approach to
naming (internal discussion in https://github.com/github/codeql-python-team/issues/95)
2021-02-24 14:58:48 +01:00
haby0
6fe8bafc7d *)update 2021-02-24 20:59:51 +08:00
Felicity Chapman
a05904f812 Merge pull request #5216 from github/felicitymay-update-process
Remove personal assignment to writers
2021-02-24 12:59:08 +00:00
haby0
872a000a33 *)update to JSONP injection 2021-02-24 20:36:12 +08:00
Tamás Vajk
fd4eca6039 Merge pull request #5254 from tamasvajk/feature/fix-merge
C#: Fix merge conflict (with + refactoring)
2021-02-24 12:07:34 +01:00
Rasmus Wriedt Larsen
a6e5ec2e09 Python: Port py/flask-debug 2021-02-24 11:37:25 +01:00
Rasmus Wriedt Larsen
0cad5ce5ca Python: Expand py/flask-debug tests a bit 2021-02-24 11:35:17 +01:00
CodeQL CI
d2816b33e2 Merge pull request #5240 from erik-krogh/vsPerf
Approved by asgerf
2021-02-24 02:26:16 -08:00
Taus Brock-Nannestad
404649d5f1 Python: Get rid of superfluous options file 2021-02-24 11:24:43 +01:00
Rasmus Wriedt Larsen
5c6989cf02 Revert "Python: Accept RequestWithoutValidation expected output change"
Apparently CI is able to produce the ../ path, I have absolutely no clue what is
goign on...
2021-02-24 11:14:18 +01:00
Erik Krogh Kristensen
055275b971 change stats file 2021-02-24 11:12:31 +01:00
Anders Schack-Mulligen
add960bc4d Merge pull request #4880 from luchua-bc/java/sensitive-query-with-get
Java: Sensitive GET Query
2021-02-24 11:08:47 +01:00
Asger Feldthaus
bb858d38c4 JS: Tweak ExprNode 2021-02-24 10:03:45 +00:00
Tamas Vajk
380058a4bd C#: Fix merge conflict (with + refactoring) 2021-02-24 10:50:51 +01:00
yoff
8262f0343b Merge pull request #5208 from RasmusWL/flask-clean-models
Python: Cleanup Flask models now that we have API graphs
2021-02-24 10:36:30 +01:00
Erik Krogh Kristensen
16150a6419 update printAst expected output 2021-02-24 10:29:29 +01:00
Erik Krogh Kristensen
ed47697c09 update expected output 2021-02-24 10:29:12 +01:00
Geoffrey White
358a8fee7d C++: 'side-effect free'. 2021-02-24 09:25:11 +00:00
Taus Brock-Nannestad
af644a0adb Python: Decrease import depth in regex tests
These were increased because of the indirection needed to get to the
regex flags, but as we no longer rely on this, we can make do with a
smaller import depth.
2021-02-24 10:23:01 +01:00
Rasmus Wriedt Larsen
5bb4a1a45a Python: Use explicit argument specification instead of getAnArg
I've seen quite a few places where `getAnArg` leads to wrong behavior, and I
generally just don't like it.
2021-02-24 10:19:34 +01:00
Taus Brock-Nannestad
e77c1059a3 Python: Use source nodes and prevent bad join order 2021-02-24 10:18:54 +01:00
Taus Brock-Nannestad
cac6c4acc9 Python: Add deprecation notice to mode_from_mode_object 2021-02-24 10:18:21 +01:00
Rasmus Wriedt Larsen
0b9a65d234 Python: Accept RequestWithoutValidation expected output change
I have no clue why this changed, but since it's only the `..` part, I guess
we'll live with it
2021-02-24 10:13:25 +01:00
Rasmus Wriedt Larsen
cef37d19ce Python: Split CWE-295 tests
Mostly just because it's nice. But now we can avoid having the same `options`
files for the tests.
2021-02-24 10:12:45 +01:00
Rasmus Wriedt Larsen
0ffc801f9b Python: Remove options for InsecureTemporaryFile tests 2021-02-24 09:57:51 +01:00
Erik Krogh Kristensen
5091bb652f bump extractor version 2021-02-24 09:39:09 +01:00
Erik Krogh Kristensen
971ce83f8e add change note 2021-02-24 09:34:54 +01:00
Erik Krogh Kristensen
bcb3d5aec2 add tests for nested type unions through aliases 2021-02-24 09:34:54 +01:00
Erik Krogh Kristensen
85ed402b1a add test for union types 2021-02-24 09:34:53 +01:00
Erik Krogh Kristensen
5ae3c5952c support abstract signatures 2021-02-24 09:34:53 +01:00
Erik Krogh Kristensen
f385c55f2c add support for rest types elements in the middle of a tuple 2021-02-24 09:34:53 +01:00
Erik Krogh Kristensen
74630b0fd8 fix file lookup for exclude patterns 2021-02-24 09:34:53 +01:00
Erik Krogh Kristensen
8cf28c6186 update TypeScript to 4.2 2021-02-24 09:34:47 +01:00
yoff
c3d2001e85 Merge pull request #5251 from tausbn/python-port-missing-host-key-validation-query
Python: Port missing host key validation query
2021-02-24 08:43:52 +01:00
yo-h
1d654febfd Merge pull request #5195 from aschackmull/java/cwe-548-test
Java: Add empty file to test.
2021-02-23 21:12:40 -05:00
Taus Brock-Nannestad
2942a11a69 Python: Import API graphs privately 2021-02-23 22:45:39 +01:00
Taus Brock-Nannestad
f241dbabab Python: Clean up query a bit 2021-02-23 22:33:18 +01:00
Taus Brock-Nannestad
002d0fe565 Python: Port missing host key query 2021-02-23 22:26:03 +01:00
Taus Brock-Nannestad
e812eb777d Python: Port URL sanitisation queries to API graphs
Really, this boils down to "Port `re` library model to use API graphs
instead of points-to", which is what this PR actually does.

Instead of using points-to to track flags, we use a type tracker. To
handle multiple flags at the same time, we add additional flow from

`x` to `x | y` and `y | x`

and, as an added bonus, the above with `+` instead of `|`, neatly
fixing https://github.com/github/codeql/issues/4707

I had to modify the `Qualified.ql` test slightly, as it now had a
result stemming from the standard library (in `warnings.py`) that
points-to previously ignored.

It might be possible to implement this as a type tracker on
`LocalSourceNode`s, but with the added steps for the above operations,
this was not obvious to me, and so I opted for the simpler
"`smallstep`" variant.
2021-02-23 22:02:35 +01:00
Rasmus Wriedt Larsen
358ade67e5 Merge pull request #5248 from tausbn/python-port-insecure-temporary-file
Python: Port `py/insecure-temporary-file`
2021-02-23 21:37:59 +01:00
Tamás Vajk
91928fa098 Merge pull request #5220 from tamasvajk/feature/limit-codescanning-csharp
Limit C# codeql analysis to the csharp folder
2021-02-23 21:05:38 +01:00
Tamás Vajk
e6532cbd75 Merge pull request #4695 from tamasvajk/feature/csharp9-with-expr
C#: Extract 'with' expressions
2021-02-23 21:04:51 +01:00
Geoffrey White
431a004127 C++: QLDoc. 2021-02-23 19:10:03 +00:00
Taus Brock-Nannestad
b8ce5e969e Python: Port py/insecure-temporary-file 2021-02-23 20:02:22 +01:00
yoff
9eed17f647 Merge pull request #5152 from RasmusWL/improve-pyyaml-support
Python: Improve pyyaml support
2021-02-23 19:58:04 +01:00
Rasmus Lerchedahl Petersen
6abbb5040c Python: add change note 2021-02-23 19:54:09 +01:00
Rasmus Lerchedahl Petersen
b28544da9c Python: Port insecure default protocol
- use API graphs
- update .qlhelp-file
- limit to versions below 3.4
- move tests to its own directory to only test on old version
2021-02-23 19:41:36 +01:00
Joe Farebrother
e13c779f0f Add additional unit tests 2021-02-23 16:17:13 +00:00
CodeQL CI
c5ae8d2c53 Merge pull request #5210 from erik-krogh/barrierPerf
Approved by asgerf
2021-02-23 07:29:27 -08:00
luchua-bc
56e3b301e9 Resolve ambiguous method access 2021-02-23 15:18:07 +00:00
Rasmus Wriedt Larsen
a09f8c4b4a Python: Port bind-to-all-interfaces to type-tracking 2021-02-23 16:01:24 +01:00
Rasmus Wriedt Larsen
4026d54095 Python: Expand bind-to-all-interfaces tests slightly 2021-02-23 15:53:47 +01:00
luchua-bc
45f9125bfa Update test program 2021-02-23 14:41:44 +00:00
luchua-bc
9eb8ec7da5 Create a separate file for EJB check 2021-02-23 14:38:15 +00:00
Joe Farebrother
ee651da23f Remove TODO comment 2021-02-23 14:27:11 +00:00
Joe Farebrother
459c0afc55 Add change note 2021-02-23 14:26:12 +00:00
Joe Farebrother
a3b8d4ab2d Switch to inline test expectations; fix failing test outputs 2021-02-23 14:26:12 +00:00
Joe Farebrother
7b5961769a Add unit tests for version 5.x 2021-02-23 14:26:12 +00:00
Joe Farebrother
cf58a90d74 Add unit tests for utility methods 2021-02-23 14:26:12 +00:00
Joe Farebrother
e5d624d1e8 Add open redirect sinks 2021-02-23 14:26:12 +00:00
Joe Farebrother
e3fe635004 Add support for httpcomponents 5.x 2021-02-23 14:26:11 +00:00
Joe Farebrother
5bba7f6df7 Add unit tests 2021-02-23 14:26:11 +00:00
Joe Farebrother
da6e9492a0 Model XSS sinks and utility methods 2021-02-23 14:26:11 +00:00
Joe Farebrother
561679611e Java: Model flow source for apache http requests,
Model flow steps for associated getters

Fix rebase conflict
2021-02-23 14:26:11 +00:00
Joe Farebrother
4184ebd091 Java: Add HttpRequestHandler as a remote flow source 2021-02-23 14:26:11 +00:00
Rasmus Wriedt Larsen
fd18fd8403 Python: Apply suggestions from code review
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2021-02-23 15:24:52 +01:00
Rasmus Wriedt Larsen
6e2445cce6 Python: Apply suggestions from code review
Co-authored-by: yoff <lerchedahl@gmail.com>
2021-02-23 15:19:29 +01:00
Rasmus Wriedt Larsen
42de872bfa Python: Add INTERNAL annotation to Response::InstanceSource
Since we need to reserve the flexibility to change this setup within the next
few months, we don't want to commit to keeping this extension point around for
the 12 months that the normal API deprecation cycle requires.
2021-02-23 15:10:58 +01:00
Rasmus Wriedt Larsen
8ebedf26d2 Python: Add comment for MethodView being known subclass 2021-02-23 15:08:07 +01:00
Anders Schack-Mulligen
b1bed2731d Merge pull request #5172 from smowton/smowton/feature/commons-strbuilder
Java: Add support for commons-lang's StrBuilder class
2021-02-23 14:39:11 +01:00
Asger Feldthaus
c58947d3e6 JS: Refactor Vue::Instance to lead to better join orders 2021-02-23 13:13:59 +00:00
Tom Hvitved
bed66203c1 C#: Use shared SSA implementation for BaseSsa 2021-02-23 14:06:27 +01:00
Tom Hvitved
b0ee508f10 C#: Use shared SSA implementation for PreSsa 2021-02-23 14:06:27 +01:00
Tom Hvitved
d8792f2f7f C#: Fix bug in BaseSSA::reachesEndOf/3 2021-02-23 14:06:27 +01:00
Taus
53711dc82f Merge pull request #5238 from RasmusWL/no-flow-default-value
Python: Highlight missing flow from default value in functions
2021-02-23 13:27:41 +01:00
CodeQL CI
3f7f963ed5 Merge pull request #5227 from erik-krogh/infTest
Approved by asgerf
2021-02-23 04:03:18 -08:00
Erik Krogh Kristensen
539ef49b11 change join order for SystemCommandExecutors - and use ApiGraphs::getACall 2021-02-23 12:49:25 +01:00
Erik Krogh Kristensen
56405f40b0 change join order for summarizedHigherOrderCall 2021-02-23 12:48:24 +01:00
Erik Krogh Kristensen
b3aa358177 outline callee computation - to avoid many joins on getACall 2021-02-23 12:48:20 +01:00
CodeQL CI
2551aace89 Merge pull request #5236 from asgerf/js/html-invalid-attr-name
Approved by erik-krogh
2021-02-23 02:03:29 -08:00
Erik Krogh Kristensen
aa6cde2fe0 remove magic from inGuard 2021-02-23 10:03:21 +01:00
Erik Krogh Kristensen
69d6df7834 make globalVarRef non recursive 2021-02-23 10:03:17 +01:00
Erik Krogh Kristensen
06091e5312 cache AstNode::getParent 2021-02-23 09:52:58 +01:00
Erik Krogh Kristensen
b4e6f92505 rearange ArrayIndexingStep to avoid #shared predicate 2021-02-23 09:52:50 +01:00
yo-h
6213c20bc3 Merge pull request #5136 from aschackmull/java/csv-models
Java: Add support for framework modelling through csv data.
2021-02-22 19:00:41 -05:00
Robert Marsh
0b2daf7679 C++: filter operands of removed IR instructions 2021-02-22 14:41:21 -08:00
CodeQL CI
73e7b54bf1 Merge pull request #5214 from tausbn/actions-add-change-note-checker
Approved by adityasharad
2021-02-22 11:24:51 -08:00
Geoffrey White
362c12caea Merge pull request #5217 from MathiasVP/model-bsd-sockets-part-3
C++: Implement models for poll, accept and select
2021-02-22 18:34:59 +00:00
Jonathan Leitschuh
ad99aa2d76 Fix typo in test output 2021-02-22 13:26:51 -05:00
Owen Mansel-Chan
110f4072fd Merge pull request #5222 from owen-mc/update-go-supported-frameworks
Update supported go frameworks
2021-02-22 15:49:54 +00:00
Owen Mansel-Chan
31d6dbb9da Update supported go frameworks 2021-02-22 15:38:56 +00:00
Rasmus Wriedt Larsen
e160c855ad Merge pull request #5233 from yoff/python-for-tuple-iteration
Python: `for`-iteration of tuples
2021-02-22 15:28:13 +01:00
luchua-bc
40df01d2cd Update qldoc and method name 2021-02-22 14:15:41 +00:00
Rasmus Wriedt Larsen
127e778970 Merge pull request #5215 from github/RasmusWL/fix-acronym-style
Style Guide: Fix two-letter acronym
2021-02-22 15:05:26 +01:00
Rasmus Wriedt Larsen
5249b54a9b Python: Highlight missing flow from default value in functions
Although it is becoming non-trivial to get an overview of what tests we have and
don't have, I didn't find any that highlighted this one

I used all 3 variants of parameters, just to be sure :)
2021-02-22 14:52:51 +01:00
CodeQL CI
0a0bdcca4d Merge pull request #5204 from erik-krogh/inGuard
Approved by asgerf
2021-02-22 02:52:11 -08:00
Asger F
b8e1987cad Update javascript/ql/test/query-tests/DOM/HTML/DuplicateAttributes.html
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2021-02-22 10:08:56 +00:00
Taus Brock-Nannestad
439f9f1d90 Actions: More cleanup
Removes the checkout action, as this is no longer needed, and folds
the `grep` into `jq`.
2021-02-22 11:05:54 +01:00
Asger Feldthaus
e964771e9c JS: Add test 2021-02-22 09:47:21 +00:00
Mathias Vorreiter Pedersen
f908d2f1de C++: Remove hasTaintFlow from poll and select functions. 2021-02-22 08:54:43 +01:00
Taus Brock-Nannestad
4680b25f23 Actions: Remove dependence on external actions 2021-02-21 15:14:33 +01:00
Rasmus Lerchedahl Petersen
d23a8ad016 Python: elide test output 2021-02-21 13:12:54 +01:00
Rasmus Lerchedahl Petersen
46faba69ff Python: Fix for-iteration of tuples 2021-02-21 12:41:16 +01:00
Rasmus Lerchedahl Petersen
0aecf33fe6 Python: test iteration through overflow parameters
These are in a tuple, so the for-step does not fire
2021-02-21 12:33:04 +01:00
Francis Alexander
45bdb22db8 Switch from sanitizer to tainttracking, formatting and qldoc changes 2021-02-21 16:45:48 +05:30
Artem Smotrakov
43a07bb13a Better sink in SandboxedJexlFlowConfig 2021-02-20 11:17:51 +01:00
luchua-bc
dc799019d0 Add query for Struts and Spring actions 2021-02-20 03:36:21 +00:00
luchua-bc
3d9ac0d094 Add query for enterprise beans 2021-02-20 02:00:42 +00:00
Asger Feldthaus
e9c0f170a1 JS: Restrict names of extracted HTML attributes 2021-02-19 23:28:28 +00:00
Erik Krogh Kristensen
e6009ea8e0 cache getType 2021-02-19 21:25:48 +01:00
Erik Krogh Kristensen
772e78e386 change TypeInference related join-order in module-import predicates 2021-02-19 21:25:44 +01:00
Mathias Vorreiter Pedersen
576a872316 C++: Address review comments. 2021-02-19 20:24:02 +01:00
Mathias Vorreiter Pedersen
f65843a273 Merge pull request #5221 from geoffw0/cwe676
C++: Add CWE-676 tag.
2021-02-19 17:51:54 +01:00
Taus Brock-Nannestad
ca48e57e30 Actions: Peg external actions to specific SHAs 2021-02-19 16:50:08 +01:00
Asger Feldthaus
5264d24f34 JS: Model vue-router 2021-02-19 15:37:24 +00:00
Tamas Vajk
e1b90912de Limit C# codeql analysis to the csharp folder 2021-02-19 16:13:22 +01:00
Mathias Vorreiter Pedersen
299f371715 C++: Accept more test changes. 2021-02-19 16:01:31 +01:00
Geoffrey White
79338052ad C++: Add CWE-676 tag. 2021-02-19 14:55:31 +00:00
Rasmus Wriedt Larsen
40c592ab85 Python: Introduce DataFlowOnlyInternalUse to avoid re-evaluation 2021-02-19 15:29:23 +01:00
Mathias Vorreiter Pedersen
4f23c3546f C++: Don't generate WriteSideEffect instructions for const parameter indirections. 2021-02-19 15:15:51 +01:00
Rasmus Wriedt Larsen
d084261a79 Python: Ignore weak key-sizes from test-code in weak-crypto-key
From looking at old results on LGTM.com, this was quite common (and those alerts
doesn't really provide value).
2021-02-19 15:04:41 +01:00
Rasmus Wriedt Larsen
bfc8ead667 Python: Add example of test-code with weak crypto key 2021-02-19 15:04:14 +01:00
Rasmus Wriedt Larsen
dfa223ac6a Python: Better IntegerLiteral tracking for weak crypto key 2021-02-19 15:03:50 +01:00
Rasmus Wriedt Larsen
a6583345ba Python: Add weak crypto key example through function call
We used to handle this, but no more :(

Adding this example was inspired by looking at results differences
2021-02-19 15:03:49 +01:00
Rasmus Wriedt Larsen
37f0d5a28a Python: Make KeyGeneration range member overrides final
This was the result of an internal dicussion we had about this some time ago.
2021-02-19 15:03:49 +01:00
Rasmus Wriedt Larsen
2a8f720bc6 Python: Port cryptodome models to use API graphs 2021-02-19 15:03:48 +01:00
Rasmus Wriedt Larsen
1eabfbd0e4 Python: Port cryptography models to use API graphs (mostly) 2021-02-19 15:03:47 +01:00
Rasmus Wriedt Larsen
bfbaa85272 Python: Add test of public_key method with cryptodome
Added in 3.10 release https://github.com/Legrandin/pycryptodome/blob/master/Changelog.rst#3100-6-february-2021
2021-02-19 15:03:47 +01:00
Rasmus Wriedt Larsen
8d3170bcb4 Python: Fix bad join in crypto models 2021-02-19 15:03:46 +01:00
Rasmus Wriedt Larsen
32d0790500 Python: Use camelCase for RSA/DSA/ECC
after asking around, this seems to be the right approach
2021-02-19 15:03:45 +01:00
Rasmus Wriedt Larsen
0e9a54e9a9 Python: Rename WeakCrypto to WeakCryptoKey
Since WeakCrypto always makes me think that it's about all weak crypto (like
using MD5, or completely broken ciphers such as ARC4 ro DES) and not just about
weak key generation.
2021-02-19 15:03:44 +01:00
Rasmus Wriedt Larsen
46ad611d57 Python: Port py/weak-crypto-key to use type-tracking
instead of points-to.

Looking at query results also made me realize I didn't supply a very good
"origin" for ECC in cryptography package, so I improved that 👍 -- maybe that
sohuld have been split into multiple commits... too late :(
2021-02-19 15:03:43 +01:00
Shati Patel
d490bea9a9 Merge pull request #5211 from shati-patel/docs-telemetry
Docs (CodeQL for VS Code): Move info about telemetry into codeql.github.com
2021-02-19 13:59:18 +00:00
Shati Patel
97eb98e9eb Emphasize that telemetry is disabled by default 2021-02-19 13:42:47 +00:00
Mathias Vorreiter Pedersen
fef824c37a C++: Implement models for poll, accept and select. 2021-02-19 14:03:54 +01:00
Rasmus Wriedt Larsen
2429c6c450 Python: Rewrite py/weak-crypto-key tests
* Removed backend arugment that is not required
* Added DSA constants (they are just accidentially the same as RSA right now)
* Removed FakeWeakEllipticCurve and used a real weak elliptic curve instead
2021-02-19 13:59:19 +01:00
Rasmus Wriedt Larsen
d5ff477644 Python: Add modeling for pycryptodome PyPI package 2021-02-19 13:59:18 +01:00
Rasmus Wriedt Larsen
6e4c627209 Python: Add modeling for pycryptodomex PyPI package 2021-02-19 13:59:17 +01:00
Rasmus Wriedt Larsen
bd40965afe Python: Add modeling for cryptography PyPI package 2021-02-19 13:59:17 +01:00
Rasmus Wriedt Larsen
1bf9f7d135 Python: Add missing annotations to new crypto tests 2021-02-19 13:59:16 +01:00
Rasmus Wriedt Larsen
11cd0dbbc0 Python: Add concepts for public-key generation
I did spend some time to figure out how to best write `minimumSecureKeySize`
predicate. I wanted to write once and for all the recommended sizes for each
cryptosystem.

I considered making the predicate such as

```codeql
int minimumSecureKeySize() {
    this.getName() = "RSA" and result = 2048
    or
    this.getName() = "DSA" and result = 2048
    or
    this.getName() = "ECC" and result = 244
}
```

but then it would be impossible to add a new model without also being able to
modify the body of this predicate -- which seems like a bad way to start off a
brand new way of modeling things.

So I considered if we could add it to the non-range class, such as

```codeql
class RSAKeyGeneration extends KeyGeneration {
  RSAKeyGeneration() { this.getName() = "RSA" }

  override int minimumSecureKeySize() { result = 2048 }
}
```

This has the major problem that when you're writing the models for a new
API (and therefore extending KeyGeneration::Range), there is no way for you to
see that you need to take this extra step :| (also problem about how we should
define `minimumSecureKeySize` on `KeyGeneration` class then, since if we make it
abstract, we effectively disable the ability to refine `KeyGeneration` since any
subclass must provide an implementation.)

So, therefore I ended up with this solution ;)
2021-02-19 13:59:16 +01:00
Taus Brock-Nannestad
6095138acc Actions: Address comments on change note CI check
- Fail the CI check if change note is missing.
- Disregards changes outside of `*/ql/src`.
- Runs the workflow on label changes, and upon moving the PR out of
  draft mode.
- Only fails the CI check if the PR is out of draft.
- Changes label to `no-change-note-required`.
2021-02-19 13:55:35 +01:00
Rasmus Wriedt Larsen
4ab61bb088 Python: Add a few tests for crypto frameworks
Tests working can be verified by running

```
ls ql/python/ql/test/experimental/library-tests/frameworks/crypto*/*.py | xargs -L1 sh -c 'python $0 || exit 255'
```
2021-02-19 13:26:45 +01:00
Felicity Chapman
f9ff1f2c9c Remove personal assignment
This is part of the work to revise the process for requesting docs content team reviews on pull requests.
2021-02-19 11:38:15 +00:00
Rasmus Wriedt Larsen
a19da54c9e Python: Exclude flask.request imports as RemoteFlowSource
When I changed the taint modeling in 19b7ea8d85, that obviously also means that
some of the related locations for alerts will change. So that's why all the
examples needs to be updated.

Besides this, I had to fix a minor problem with having too many alerts. If
running a query agaisnt code like in the example below, there would be 3 alerts,
2 of them originating from the import.

```
from flask import Flask, request
app = Flask(__name__)
@app.route("/route")
def route():
    SINK(request.args.get['input'])
```

The 2 import sources where:

- ControlFlowNode for ImportMember
- GSSA Variable request

I removed these from being a RemoteFlowSource, as seen in the diff.

I considered restricting `FlaskRequestSource` so it only extends
`DataFlow::CfgNode` (and make the logic a bit simpler), but I wasn't actually
sure if that was safe to do or not... If you know, please let me know :)
2021-02-19 12:22:05 +01:00
Rasmus Wriedt Larsen
9798e60d0f Merge pull request #5203 from tausbn/python-add-typebacktrackers
Python: Add `TypeBackTracker`
2021-02-19 12:02:53 +01:00
Rasmus Wriedt Larsen
6ad3ce19d7 Style Guide: Fix two-letter acronym
The old text was based on what was in the [Dart guideline](https://dart.dev/guides/language/effective-dart/style#do-capitalize-acronyms-and-abbreviations-longer-than-two-letters-like-words) and was not adjusted in the PR when we changed our inspiration to be the [.NET guideline](https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/capitalization-conventions) -- (it was only changed in the examples in our internal discussion)
2021-02-19 11:51:45 +01:00
Anders Schack-Mulligen
9721182523 Merge pull request #5080 from github/RasmusWL/naming-for-acronyms
Update CodeQL Style guide to mention acronyms
2021-02-19 11:38:25 +01:00
Taus Brock-Nannestad
03d3f2c8e8 Actions: Add change note checker 2021-02-19 10:16:50 +01:00
Anders Schack-Mulligen
dae65f687a Merge pull request #5150 from Marcono1234/marcono1234/conditional-expr-branch
Java: Add ConditionalExpr.getBranchExpr(boolean)
2021-02-19 10:12:43 +01:00
Bas van Schaik
8f8b8be1e9 Include @xcorail in code reviews for experimental queries 2021-02-18 18:07:09 +00:00
Rasmus Wriedt Larsen
779a464dad Update ql-style-guide.md to not mention abbreviation
This rule is only really intended for acronyms, and not abbreviations in general (like `Stmt` instead of `Statement`).
2021-02-18 17:54:59 +01:00
Rasmus Wriedt Larsen
12511440fe Update ql-style-guide.md
Replacing the HTTP example with a SSA variable example. I didn't want to keep both, to not bloat this section.
2021-02-18 17:52:24 +01:00
Geoffrey White
c4cca83019 Merge pull request #5196 from MathiasVP/fix-dataflow-regression-const-member-function
C++: Fix missing dataflow "out of" const member functions
2021-02-18 16:43:38 +00:00
Shati Patel
4dd1be5ba1 Polish headings and formatting 2021-02-18 15:45:17 +00:00
Shati Patel
28848ecf32 Link to new article 2021-02-18 15:44:17 +00:00
Erik Krogh Kristensen
814b5577f5 improve join-order for Configuration::barrierGuardBlocksEdge 2021-02-18 16:43:43 +01:00
Erik Krogh Kristensen
33f310b91e use manual recursion in Refinements::inGuard 2021-02-18 16:42:40 +01:00
CodeQL CI
f81860c402 Merge pull request #5200 from erik-krogh/apiJoin
Approved by max-schaefer
2021-02-18 07:40:38 -08:00
CodeQL CI
3062f4160a Merge pull request #5207 from github/RasmusWL/js-backtrack-grammar
Approved by erik-krogh
2021-02-18 07:11:23 -08:00
Rasmus Wriedt Larsen
cc72fc82f0 Merge branch 'main' into flask-clean-models 2021-02-18 16:08:18 +01:00
Rasmus Wriedt Larsen
9a42f2fb26 Python: Add missing QLdoc for FlaskMethodViewClass 2021-02-18 16:07:47 +01:00
Taus Brock-Nannestad
880451f659 Python: Add change note 2021-02-18 15:59:34 +01:00
Chris Smowton
321df82851 Apply review feedback: comment style, bracketing, and use proper MISSING test annotations 2021-02-18 14:56:52 +00:00
Taus
e9cbdc4ad3 Update python/ql/src/semmle/python/dataflow/new/TypeTracker.qll
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-02-18 15:53:15 +01:00
Rasmus Wriedt Larsen
bb2613b02b Python: Flask model now ready to be publicly exposed
With a single call-out for a member-predicate that is only for internal use.
2021-02-18 15:36:30 +01:00
Rasmus Wriedt Larsen
35876f1939 Python: Re-introduce Response::instance() in flask model
We don't actually need it for anything right now, but I have plans for the
future where would need it.

Although it would be nice to have it as an `API::Node`, and we could re-write
implementations so we could provide it in this instance, I'm not convinced we
can do that in general right now.

For example, if <n'th> parameter of a function has to be modeled as belonging to
a certain type, I don't see any way to specify that as an API::Node.

For me, that's ok. Until we _can_ specify things like this as API::Nodes in the
future, I would like to keep things consistent, and use `DataFlow::Node` as the
result type.
2021-02-18 15:22:16 +01:00
Rasmus Wriedt Larsen
141e2665ea Python: Align ViewClass naming with django
Just as part of tyding up
2021-02-18 15:10:21 +01:00
Shati Patel
48ace064cc Copy telemetry doc
No changes except for rst formatting
2021-02-18 14:09:36 +00:00
Rasmus Wriedt Larsen
19b7ea8d85 Python: Align flask taint modeling with rest of code
This was a good time to do this, so we don't have 2 different ways of doing the
same thing.

I needed to do this to figure out if we should expose
`API::moduleImport("flask").getMember("request")` in a helper predicate or
not. I think I ended up using more refenreces to this in the end. Although it's
not unreasonable to let someone do this themselves, I also think it's reasonable
that we provide a helper predicate for this.
2021-02-18 15:04:07 +01:00
Tamás Vajk
f3814c6468 Merge pull request #5144 from tamasvajk/feature/refactor-2
C# Share entity base classes between CIL and source extraction
2021-02-18 13:52:52 +01:00
Tamás Vajk
8e7a823b9a Merge pull request #5083 from raulgarciamsft/master
Adding queries related to the Solorigate campaign
2021-02-18 13:50:45 +01:00
Anders Schack-Mulligen
954e0b9496 Java: Add empty file to test. 2021-02-18 13:10:29 +01:00
Rasmus Wriedt Larsen
ba61099172 Python: flask.make_response as InstanceSource of flask.Response 2021-02-18 12:52:59 +01:00
Rasmus Wriedt Larsen
e3d530dbbc Python: Flask: Remove more type-tracking helper predicates 2021-02-18 12:13:47 +01:00
Rasmus Wriedt Larsen
e4ea5f25dc Python: Flask: Moderize app and blueprint 2021-02-18 12:09:37 +01:00
Rasmus Wriedt Larsen
7de488b987 Python: Flask: Moderize views 2021-02-18 12:05:56 +01:00
Rasmus Wriedt Larsen
ffd3c6b016 JS: Minor grammar cleanup of type back-tracking 2021-02-18 11:31:30 +01:00
Anders Schack-Mulligen
74d35f4f37 Java: Add support for value-preserving steps. 2021-02-18 11:26:15 +01:00
Anders Schack-Mulligen
04eeeda2c9 Java: Add documentation for the final column. 2021-02-18 11:23:49 +01:00
Anders Schack-Mulligen
6f583baa90 Java: More documentation and support for field writes. 2021-02-18 11:18:31 +01:00
CodeQL CI
d94f20ff2f Merge pull request #5194 from RasmusWL/type-tracking-snippets
Approved by tausbn
2021-02-18 02:13:21 -08:00
haby0
8119fd2ad1 *)add JsonHijacking ql query 2021-02-18 18:11:10 +08:00
Mathias Vorreiter Pedersen
88263cb89e Merge pull request #5114 from geoffw0/codeqltestdoc
Documentation: Make our policy for copied example code clear and visible.
2021-02-18 10:43:17 +01:00
Erik Krogh Kristensen
6f384630f1 Apply suggestions from code review
Co-authored-by: Max Schaefer <54907921+max-schaefer@users.noreply.github.com>
2021-02-18 10:36:49 +01:00
Mathias Vorreiter Pedersen
3082d70345 Merge branch 'main' into fix-dataflow-regression-const-member-function 2021-02-18 09:34:51 +01:00
luchua-bc
e916ce8b9b Exclude test directories of typical build tools 2021-02-18 00:50:38 +00:00
Taus Brock-Nannestad
23e9785efd Python: Add missing QLDoc 2021-02-17 21:38:48 +01:00
Erik Krogh Kristensen
f4e6f49ae7 change join order for API::Impl::trackDefNode 2021-02-17 21:23:11 +01:00
Erik Krogh Kristensen
dcef6cb974 change join order for API::InvokeNode::getParameter 2021-02-17 21:23:11 +01:00
Erik Krogh Kristensen
c80365c48a change join order for API::Impl::useStep 2021-02-17 21:23:11 +01:00
Taus Brock-Nannestad
99f3a61f61 Python: Add TypeBackTracker
This is a fairly straight port of the JS equivalent. Also adds
`Node::getALocalSourceNode` which seems like it might come in handy.
2021-02-17 21:14:20 +01:00
CodeQL CI
8716cbd7ee Merge pull request #5140 from erik-krogh/mark
Approved by asgerf
2021-02-17 11:50:11 -08:00
Raul Garcia (MSFT)
cba9f421ad Changes to the Readme file 2021-02-17 10:05:22 -08:00
luchua-bc
5e36eedcb6 Add check for test packages 2021-02-17 18:04:55 +00:00
Erik Krogh Kristensen
4df85b44de Update javascript/change-notes/2021-02-10-markdown.md
Co-authored-by: Asger F <asgerf@github.com>
2021-02-17 18:30:31 +01:00
Cornelius Riemenschneider
ebcecca9f1 Merge pull request #5157 from geoffw0/modelsbsl2
C++: Improve Iterator models
2021-02-17 18:04:07 +01:00
Jonathan Leitschuh
c43765917f Fix formatting of MavenPom.qll 2021-02-17 11:55:10 -05:00
CodeQL CI
a81592dbd1 Merge pull request #5111 from asgerf/js/angular-framework-note
Approved by erik-krogh
2021-02-17 08:48:00 -08:00
Taus
593a96ffbb Merge pull request #5182 from RasmusWL/update-supported-python-frameworks-docs
Docs: Update list of support frameworks in Python
2021-02-17 17:44:18 +01:00
CodeQL CI
3e1d2c3f81 Merge pull request #5198 from RasmusWL/revert-structure-change
Approved by tausbn
2021-02-17 08:36:04 -08:00
Rasmus Wriedt Larsen
4880350420 Python: Add a single missing QLDoc 2021-02-17 16:33:12 +01:00
Rasmus Wriedt Larsen
7afe3972d8 Revert "Merge pull request #5171 from RasmusWL/restructure-queries"
This reverts commit 8caafb3710, reversing
changes made to ec79094957.
2021-02-17 16:32:53 +01:00
Erik Krogh Kristensen
bc4ff813f3 Merge pull request #5193 from erik-krogh/aceLog
JS: avoid cartesian product in isFilteredPropertyName
2021-02-17 16:27:33 +01:00
Rasmus Wriedt Larsen
63a09fccdd Python: Use this = <...>.getACall() for DataFlow::CallCfgNode
I think this reads a bit cleaner
2021-02-17 14:43:48 +01:00
Mathias Vorreiter Pedersen
908f24d23f C++: Fix missing AST flow. 2021-02-17 14:33:58 +01:00
Francis Alexander
2baf2aa5c1 Apply suggestions from code review - improved sanitizer checks.
Co-authored-by: Alvaro Muñoz <pwntester@github.com>
2021-02-17 18:58:32 +05:30
Francis Alexander
40f4e71b86 Merge branch 'main' into cwe-346 2021-02-17 18:55:31 +05:30
Anders Schack-Mulligen
862c41632e Java: Add empty file to test. 2021-02-17 13:23:18 +01:00
Taus
ce1d8ded22 Merge pull request #5192 from RasmusWL/framework-for-routed-params
Python: Expose framework identifier for route-setup and request handler
2021-02-17 13:19:43 +01:00
Rasmus Wriedt Larsen
0cdb5c48cf Python: Remove type-tracking snippets for framework modeling
We won't need these anymore, since we can now use API graphs
2021-02-17 13:14:23 +01:00
Rasmus Wriedt Larsen
a4de88d39c Python: Update type-tracking snippet
based on what I learned in https://github.com/github/codeql/pull/5184
2021-02-17 13:13:25 +01:00
Erik Krogh Kristensen
a03507a544 avoid cartesian product in isFilteredPropertyName 2021-02-17 13:12:35 +01:00
Mathias Vorreiter Pedersen
e0dca2be20 Merge pull request #5185 from MathiasVP/block-integral-types-in-cgixss-query
C++: Add isBarrier to cpp/cgi-xss
2021-02-17 12:44:45 +01:00
Rasmus Wriedt Larsen
eee49cde85 Merge pull request #5184 from tausbn/python-move-type-tracker-tests-to-source-nodes
Python: Use `LocalSourceNode` in type tracker tests
2021-02-17 12:13:47 +01:00
Taus
8caafb3710 Merge pull request #5171 from RasmusWL/restructure-queries
Python: Restructure query file layout
2021-02-17 12:09:32 +01:00
Geoffrey White
ec79094957 Merge pull request #5191 from MathiasVP/regression-test-const-member-function
C++: Add test for missing flow due to const specifier
2021-02-17 10:59:20 +00:00
Mathias Vorreiter Pedersen
25beadcb05 Update cpp/ql/test/query-tests/Security/CWE/CWE-079/semmle/CgiXss/search.c
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2021-02-17 11:54:24 +01:00
Geoffrey White
c07a60818c C++: Simplify IteratorAssignArithmeticOperator. 2021-02-17 10:49:28 +00:00
Mathias Vorreiter Pedersen
e1c4406fd4 Merge pull request #5187 from geoffw0/modelsbsl5
C++: Support BSL in Allocation.qll, Deallocation.qll.
2021-02-17 11:48:53 +01:00
Mathias Vorreiter Pedersen
6db75df943 Merge pull request #5186 from geoffw0/modelsbsl4
C++: More models work
2021-02-17 11:46:23 +01:00
Francis Alexander
58971f9f4e Switch qualified name to available CollectionType 2021-02-17 16:01:27 +05:30
Rasmus Wriedt Larsen
cf9ad0cdc5 Python: Move ExternalAPI queries back under Security
This was raised as a question at review, and I don't really have a good enough
argument for moving it under POI. At the end of the day, they are _security_
related enough I guess :)
2021-02-17 11:29:33 +01:00
Rasmus Wriedt Larsen
dec026a820 Python: Fix security qlref to have single empty line 2021-02-17 11:26:02 +01:00
Rasmus Wriedt Larsen
1adb510578 Python: Add a single missing QLDoc 2021-02-17 11:24:11 +01:00
Mathias Vorreiter Pedersen
1b148c4c90 C++: Add reduced testcase demonstrating the problem in codeql-c-analysis-team/issues/231. 2021-02-17 11:20:00 +01:00
Rasmus Wriedt Larsen
2927d888cf Python: Fix location of PathInjection tests 2021-02-17 11:20:00 +01:00
Mathias Vorreiter Pedersen
f5d5460dde C++: Fix testcase. 2021-02-17 10:53:31 +01:00
Chris Smowton
c700d004e0 Commons Lang/Text StrBuilder: propagate taint from constructors 2021-02-17 09:51:28 +00:00
Chris Smowton
c243e03133 Lang3 StrBuilder: fix typo and coding style 2021-02-17 09:50:56 +00:00
Erik Krogh Kristensen
408ac2729d Merge pull request #5066 from CaptainFreak/express-hbs-lfr
JS: add query for Express-HBS LFR
2021-02-17 10:41:38 +01:00
Chris Smowton
10112c50ab Add support for StrBuilder and TextStringBuilder in commons-text
These are identical to the current deprecated StrBuilder in commons-lang3.
2021-02-17 09:36:28 +00:00
Chris Smowton
714611f803 Address review feedback 2021-02-17 09:36:21 +00:00
Chris Smowton
a63f18e49d Add models for Commons-Lang's StrBuilder class. These exclude its fluent methods for the time being, which will be added in a forthcoming PR. 2021-02-17 09:36:20 +00:00
Anders Schack-Mulligen
5188ad1444 Merge pull request #5126 from smowton/smowton/feature/commons-stringutils
Java: Add support for Apache Commons Lang StringUtils
2021-02-17 09:48:22 +01:00
Francis Alexander
520ba47293 Sanitizer improvements from code review 2021-02-17 08:35:50 +05:30
Robert Marsh
6aeec5872d Merge branch 'main' into rdmarsh2/cpp/operand-reuse 2021-02-16 15:42:58 -08:00
Rasmus Wriedt Larsen
d98aae9fc1 Python: Expose framework identifier for route-setup and req handler
This makes collecting metrics on framework coverage a bit simpler (specifically
giving the RoutedParameter class a more descriptive result for getSourceType).

I guess it can also help a bit when trying to get an overview of a new DB, but
making metrics collection easier is my main motivation for this.
2021-02-16 23:44:03 +01:00
Geoffrey White
3323683ab2 C++: Support BSL in Allocation.qll, Deallocation.qll. 2021-02-16 19:19:06 +00:00
Sauyon Lee
8db234f5f3 Merge pull request #5092 from github/sauyon-patch-1
Add GoKit to Go supported library list
2021-02-16 11:04:43 -08:00
Geoffrey White
d068ede65b Merge pull request #5180 from criemen/bsl-stdcontainer
C++: Refactor StdContainer.qll.
2021-02-16 18:53:08 +00:00
Geoffrey White
58230d6d0a C++: Model BSL in Fread.qll. 2021-02-16 18:00:51 +00:00
Mathias Vorreiter Pedersen
fa44cedd38 C++: Add isBarrier to CgiXss.ql. 2021-02-16 18:58:28 +01:00
Geoffrey White
e17d539883 C++: Model BSL in Getenv.qll. 2021-02-16 17:56:48 +00:00
Taus
36be72972d Merge pull request #2663 from tausbn/python-type-annotation-reuse-fp
Python: Add false positive test example for issue #2652.
2021-02-16 18:46:15 +01:00
Taus Brock-Nannestad
04eb0c774c Python: Use LocalSourceNode in type tracker tests
One minor change to the tests results needed: there is no longer local
flow going into the `ModuleVariableNode` for `attr_ref` in the
`moduleattr.ql` test, but I think this is reasonable.
2021-02-16 18:25:54 +01:00
Geoffrey White
735e014b43 C++: Model BSL in Gets.qll. 2021-02-16 17:22:59 +00:00
Cornelius Riemenschneider
f7f8dd49c6 Merge pull request #5156 from geoffw0/modelsbsl
C++: Improve StdSet and StdPair models
2021-02-16 18:00:23 +01:00
Cornelius Riemenschneider
3fb42194a5 Apply suggestions from code review
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2021-02-16 17:58:45 +01:00
Geoffrey White
92df1f7a3d Merge pull request #5165 from criemen/bsl-model-identity
C++: Refactor IdentityFunction.qll.
2021-02-16 16:32:57 +00:00
Taus
9499edf761 Merge pull request #5078 from RasmusWL/flask-blueprints
Python: Add modeling of Flask blueprints
2021-02-16 17:22:13 +01:00
Geoffrey White
c32e54e902 Merge pull request #5176 from criemen/bsl-smartptr
BSL support for smart pointers and other std classes.
2021-02-16 16:21:50 +00:00
Jonathan Leitschuh
a8167c6c9c Add docstring for DeclaredRepository.getUrl 2021-02-16 11:21:19 -05:00
Cornelius Riemenschneider
173b16ae21 Merge pull request #5169 from criemen/bsl-pure
C++: Model bsl functions in Pure.qll.
2021-02-16 17:19:11 +01:00
Cornelius Riemenschneider
80eaf0b67a Merge pull request #5174 from criemen/bsl-str
Model bsl functions in Str*.qll
2021-02-16 17:18:40 +01:00
Cornelius Riemenschneider
f087ff3e49 Merge pull request #5167 from criemen/bsl-memset
C++: Refactor Mem*.qll and include bsl model.
2021-02-16 17:18:29 +01:00
Cornelius Riemenschneider
a04883cafc C++: Fix compilation. 2021-02-16 16:17:59 +00:00
Cornelius Riemenschneider
552f0a7c5e C++: Address review. 2021-02-16 15:55:41 +00:00
Chris Smowton
a2eeffa9c0 Add support for Apache Commons Lang StringUtils 2021-02-16 14:48:39 +00:00
Chris Smowton
bf03c0f419 Port InlineExpectationsTest for the Java analysis 2021-02-16 14:48:39 +00:00
Rasmus Wriedt Larsen
bc8e61366b Python: Clarify comment about flask blueprint URL prefixes 2021-02-16 15:29:25 +01:00
Rasmus Wriedt Larsen
1e1cb87436 Python: Model flask blueprints 2021-02-16 15:26:51 +01:00
luchua-bc
e698ee77f7 Update qldoc and test method 2021-02-16 14:11:39 +00:00
Rasmus Wriedt Larsen
b7ea469e26 Python: Add tests for flask blueprints 2021-02-16 15:03:00 +01:00
Rasmus Wriedt Larsen
bf401c7498 Merge pull request #5103 from tausbn/python-port-flask-to-api-graphs
Python: Port Flask models to use API graphs
2021-02-16 15:00:46 +01:00
Rasmus Wriedt Larsen
4b9e37f62d Docs: Update list of support frameworks in Python
So it follows what is we actually support with 6eafa9d396/python/ql/src/semmle/python/Frameworks.qll
2021-02-16 14:37:11 +01:00
Rasmus Wriedt Larsen
8494fcf45f Python: Move query tests to reflect new file layout 2021-02-16 13:15:01 +01:00
Anders Schack-Mulligen
6eafa9d396 Merge pull request #5133 from pwntester/fix_SnakeYaml
Remove sanitizing condition which does not prevent vulnerability.
2021-02-16 12:58:47 +01:00
Cornelius Riemenschneider
434a5f04ed Merge branch 'bsl-memcpy' into bsl-memset 2021-02-16 11:56:40 +00:00
Cornelius Riemenschneider
3f17171f13 C++: Address review. 2021-02-16 11:55:03 +00:00
Cornelius Riemenschneider
30659f3ecf C++: Address review. 2021-02-16 11:54:21 +00:00
Cornelius Riemenschneider
a42700f09e C++: Address review. 2021-02-16 11:52:39 +00:00
Cornelius Riemenschneider
5dc57e9cc2 C++: Address review. 2021-02-16 11:49:44 +00:00
Cornelius Riemenschneider
b25f1fd44a C++: Address review. 2021-02-16 11:37:43 +00:00
Geoffrey White
b309b711ab Merge pull request #5173 from criemen/bsl-swap
C++: Model bsl functions in Swap.qll.
2021-02-16 11:20:41 +00:00
Cornelius Riemenschneider
86268d49ed C++: Refactor StdContainer.qll. 2021-02-16 11:10:57 +00:00
Rasmus Wriedt Larsen
1d6f9bee08 Python: Update qlrefs 2021-02-16 11:48:36 +01:00
Francis Alexander
8e83de1c05 formatting and grammar corrections from code review
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2021-02-16 16:13:21 +05:30
Rasmus Wriedt Larsen
3a18881660 Python: Restructure query file location
Since I can never remember the CWE numbers
2021-02-16 11:36:10 +01:00
Francis Alexander
0f7f465675 Apply suggestions from code review
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2021-02-16 15:48:00 +05:30
haby0
2c96e6cf96 Merge remote-tracking branch 'upstream/main' into main 2021-02-16 17:54:01 +08:00
Geoffrey White
04f15ad43a C++: BSL support in StdPairConstructor. 2021-02-16 09:49:09 +00:00
Tamas Vajk
a75b952333 Fix Type.GetQualifiedName() 2021-02-16 09:13:13 +01:00
Tamas Vajk
199e937e9e C#: Rename CachedEntity.symbol to Symbol 2021-02-16 09:13:12 +01:00
Tamas Vajk
67289a498f Share entity base classes between CIL and source extraction 2021-02-16 09:10:24 +01:00
Tamas Vajk
e7853cc3a0 Simplify TypeContainer class 2021-02-16 09:10:24 +01:00
Tamas Vajk
67caf3cad0 Remove redundant IEntity implemented interface declaration and explit interface member implemenration 2021-02-16 09:10:24 +01:00
Tamas Vajk
61e952766c Convert CIL.GenericContext to interface 2021-02-16 09:10:24 +01:00
Tamas Vajk
3e2a6fca21 C#: Simplify CIL.GenericContext contract 2021-02-16 09:10:24 +01:00
Tamás Vajk
1c2b9f9a82 Merge pull request #4669 from tamasvajk/feature/csharp9-global-stmt
C#: Extract global statements
2021-02-16 09:07:48 +01:00
luchua-bc
5ce3af0591 Enhance the query and update qldoc 2021-02-15 21:38:54 +00:00
Tamas Vajk
9c2ca93986 Use 'Declaration::hasQualifiedName/2' in 'MainMethod' 2021-02-15 21:38:02 +01:00
Tamas Vajk
9bb501c595 Fix failing tests 2021-02-15 21:30:56 +01:00
Francis Alexander
dae6771a19 test file name changes 2021-02-15 23:17:08 +05:30
Francis Alexander
c45be91d6f more filename changes 2021-02-15 23:09:11 +05:30
Francis Alexander
0004efc2ac filename changes 2021-02-15 22:43:39 +05:30
Mathias Vorreiter Pedersen
eb8309a17d Merge pull request #5175 from github/igfoo/thethe 2021-02-15 18:09:32 +01:00
Francis Alexander
f32c77c266 Qldoc and formatting changes 2021-02-15 22:35:58 +05:30
luchua-bc
2f17943abc Update qldoc 2021-02-15 16:58:09 +00:00
Tamas Vajk
4967664d09 Rework global statement extraction without DB scheme change 2021-02-15 17:47:33 +01:00
Tamas Vajk
a14db7a04f Fix code review findings 2021-02-15 17:47:33 +01:00
Tamas Vajk
423fee3069 Fix argument location of top level statement entry point 2021-02-15 17:47:32 +01:00
Tamas Vajk
b79d5ab44b Fix labeled stmt factory method parameter types 2021-02-15 17:44:44 +01:00
Tamas Vajk
6a4b54ec89 C#: Extract global statements 2021-02-15 17:44:44 +01:00
Cornelius Riemenschneider
4a07912006 C++: Small code improvement. 2021-02-15 16:36:49 +00:00
Cornelius Riemenschneider
595bb025f9 C++: Model bsl functions in StdMap.qll. 2021-02-15 16:34:07 +00:00
Tamas Vajk
8c4563b7e3 Code quality improvements 2021-02-15 17:27:33 +01:00
Marcono1234
9e2812cbd5 Sync ConditionalExpr changes with csharp 2021-02-15 17:24:56 +01:00
Tamás Vajk
d1fe542280 Merge pull request #5131 from tamasvajk/feature/refactor
C# Cleanup and refactoring
2021-02-15 17:24:25 +01:00
Cornelius Riemenschneider
b6b90b59eb C++: Model bsl functions in SmartPointer.qll. 2021-02-15 16:22:52 +00:00
Cornelius Riemenschneider
d9c6f7bc35 C++: Model bsl functions in Scanf.qll. 2021-02-15 16:12:46 +00:00
Cornelius Riemenschneider
b670e5b04b C++: Model bsl functions in Printf.qll. 2021-02-15 16:12:35 +00:00
haby0
92c00cb741 Update java/ql/src/Security/CWE/CWE-652/XQueryInjection.ql
Co-authored-by: Chris Smowton <smowton@github.com>
2021-02-16 00:09:21 +08:00
Ian Lynagh
ba6e6337f3 C++: Fix TopLevelFunction's qldoc 2021-02-15 16:08:03 +00:00
haby0
f1e44bce4a Update java/ql/src/Security/CWE/CWE-652/XQueryInjection.ql
Co-authored-by: Chris Smowton <smowton@github.com>
2021-02-16 00:07:44 +08:00
Cornelius Riemenschneider
fd2e0292c3 C++: Model bsl functions in Strtok.qll. 2021-02-15 16:00:37 +00:00
Tom Hvitved
bb95b8a0cc Merge pull request #5120 from rvermeulen/rvermeulen/redirect-sink
C#: Add Asp.Net Core redirect sinks
2021-02-15 16:52:32 +01:00
Jonathan Leitschuh
d82e8216ed Merge branch 'main' into feat/JLL/depricated_bintray_usage 2021-02-15 10:48:28 -05:00
Cornelius Riemenschneider
fd91a972a5 C++: Model bsl functions in Strcpy.qll. 2021-02-15 15:43:31 +00:00
Cornelius Riemenschneider
9d19752d9a C++: Model bsl functions in Strcat.qll. 2021-02-15 15:42:34 +00:00
Cornelius Riemenschneider
3afe934a05 C++: Model bsl functions in Swap.qll. 2021-02-15 15:40:17 +00:00
Cornelius Riemenschneider
28d5ef919c Merge pull request #5158 from geoffw0/modelsbsl3
C++: StdString BSL support
2021-02-15 16:32:30 +01:00
Jonathan Leitschuh
73fba3a3c0 Apply suggestions from code review
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2021-02-15 10:01:03 -05:00
Tamas Vajk
f878453f14 Fix performance issue with RecordCloneCallable 2021-02-15 15:49:06 +01:00
luchua-bc
a03e6faf37 Optimize the query and update qldoc 2021-02-15 14:10:17 +00:00
Anders Schack-Mulligen
8f5fe14e52 Merge pull request #5170 from pwntester/ArrayUtils_changeNote
add change note for new ArrayUtils support
2021-02-15 15:00:15 +01:00
Alvaro Muñoz
3d3f4ba797 add change note 2021-02-15 14:53:16 +01:00
Alvaro Muñoz
923e1c5e9b add change note for new ArrayUtils support 2021-02-15 14:41:18 +01:00
Rasmus Wriedt Larsen
1961ec6e8d Merge pull request #5159 from tausbn/python-unknown-argument-in-format-string-fp
Python: Add FP test for unknown argument in string format
2021-02-15 14:39:10 +01:00
Rasmus Wriedt Larsen
69e081e897 Python: Apply code-review suggestion
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2021-02-15 14:38:20 +01:00
Taus
2ca12aa612 Update python/ql/src/semmle/python/dataflow/new/internal/DataFlowPublic.qll
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-02-15 14:21:12 +01:00
Taus Brock-Nannestad
27c479a8ba Python: Limit RequestInputAccess to immediate uses
This fixes some spurious results that occurred when we considered
_any_ use of `request.something` to be a source, even ones we had
tracked into other functions. To prevent this, using
`getAnImmediateUse` better captures the fact that we want the source
to be just the actual attribute access.
2021-02-15 13:51:29 +01:00
Anders Schack-Mulligen
b9a479dd31 Merge pull request #5134 from pwntester/ArrayUtils
Add support for Apache Commons Lang ArrayUtils
2021-02-15 13:50:01 +01:00
Mathias Vorreiter Pedersen
1c91d3dbe0 Merge pull request #5168 from MathiasVP/model-bsd-sockets-part-2
C++: Model vector versions of BSD-style reads and writes.
2021-02-15 13:39:08 +01:00
Cornelius Riemenschneider
c9af97b742 C++: Model bsl functions in Pure.qll. 2021-02-15 12:31:16 +00:00
CodeQL CI
b5143dbdb4 Merge pull request #5117 from erik-krogh/parseForm
Approved by asgerf
2021-02-15 04:30:59 -08:00
Cornelius Riemenschneider
79e3bf80c3 C++: Simplify code. 2021-02-15 12:13:25 +00:00
Cornelius Riemenschneider
da38377e36 C++: Simplify code. 2021-02-15 12:12:29 +00:00
Cornelius Riemenschneider
2a3d20d9a9 C++: Refactor Memset.qll and include bsl model. 2021-02-15 12:36:18 +01:00
Erik Krogh Kristensen
74ce7369f8 Update javascript/change-notes/2021-02-09-form-parsers.md
Co-authored-by: Asger F <asgerf@github.com>
2021-02-15 12:35:16 +01:00
Cornelius Riemenschneider
a9071a62a0 C++: Refactor Memcpy.qll and include bsl model. 2021-02-15 12:15:17 +01:00
Mathias Vorreiter Pedersen
0f9b044814 C++: Model vector versions of BSD-style reads and writes. 2021-02-15 12:04:51 +01:00
Erik Krogh Kristensen
e5db0ef16b remove the RequestExpr requirement from FormParsers.qll, and use API graphs. 2021-02-15 11:58:26 +01:00
Cornelius Riemenschneider
f79b3144e3 C++: Refactor IdentityFunction.qll. 2021-02-15 11:31:31 +01:00
CodeQL CI
9b8d94d76e Merge pull request #5148 from erik-krogh/apollo
Approved by esbena
2021-02-15 02:23:52 -08:00
Alvaro Muñoz
00a0b12dad update expected results 2021-02-15 11:23:40 +01:00
Alvaro Muñoz
812884341b Merge branch 'ArrayUtils' of github.com:pwntester/codeql-1 into ArrayUtils 2021-02-15 10:59:49 +01:00
Alvaro Muñoz
504d119749 adjust max parameter number 2021-02-15 10:58:17 +01:00
Rasmus Wriedt Larsen
745148474a Python: Model get_redirect_url in django 2021-02-15 10:55:52 +01:00
Rasmus Wriedt Larsen
6934d5e642 Python: Add django test of RedirectView subclass 2021-02-15 10:55:51 +01:00
Rasmus Wriedt Larsen
79855157b3 Python: Move django response test to django v2/v3
That's really the django version I care about :P
2021-02-15 10:55:50 +01:00
Alvaro Muñoz
c7072aef16 update A.java test 2021-02-15 10:34:20 +01:00
Jonas Jensen
f0ce524c0d Merge pull request #5147 from MathiasVP/model-bsd-sockets-part-1
C++: Add models for BSD-style send and recv functions
2021-02-15 10:34:11 +01:00
Tamas Vajk
2de7fbe062 Fix build after rebase 2021-02-15 10:18:12 +01:00
Tamas Vajk
6cc858b9ef Move AstLineCounter to top level class 2021-02-15 10:17:08 +01:00
Tamas Vajk
4f693be33b Move location creation to instance method on context 2021-02-15 10:17:08 +01:00
Tamas Vajk
6f07230725 Relocate 'AstLineCounter' 2021-02-15 10:17:07 +01:00
Tamas Vajk
1cd7fd6cf7 Simplify 'AstLineCounter' 2021-02-15 10:17:07 +01:00
Tamas Vajk
e8fd6e1112 Move classes to seperate files 2021-02-15 10:17:07 +01:00
Tamas Vajk
5ce5a96cb6 Remove 'ContextExtensions' 2021-02-15 10:17:07 +01:00
Tamas Vajk
9ddeff80bf Remove useless 'IExtractor' interface 2021-02-15 10:17:07 +01:00
Tamas Vajk
6cdec2d30e C#: Remove 'extractor.CreateContext' factory method 2021-02-15 10:17:07 +01:00
Tamas Vajk
fc3e6526ce C#: Remove IExtractionScope.FromSource 2021-02-15 10:17:07 +01:00
Tamas Vajk
a75306acbd C#: Remove warnings from MdProvider 2021-02-15 10:17:07 +01:00
Tamas Vajk
1a4f370d15 C#: Fix formatting issues 2021-02-15 10:17:07 +01:00
Anders Schack-Mulligen
7e83a608a2 Merge pull request #4954 from aschackmull/java/member-hasqualifiedname
Java: Add Member.hasQualifiedName.
2021-02-15 10:02:13 +01:00
Erik Krogh Kristensen
91f277681a fix typo in ApolloClientRequest
Co-authored-by: Esben Sparre Andreasen <esbena@github.com>
2021-02-15 09:59:04 +01:00
Anders Schack-Mulligen
161e756c4b Merge pull request #5141 from github/yo-h/java-flow-check-fix
Java: prepare to enforce additional compiler checks in test code
2021-02-15 09:41:03 +01:00
Francis Alexander
409d95c522 Sanitizer checks to decrease FP 2021-02-15 14:01:14 +05:30
luchua-bc
23f620d255 Query to detect insecure LDAP endpoint configuration 2021-02-15 05:31:29 +00:00
yo-h
1d007b6e72 Java: delete two test cases as per code review 2021-02-14 21:42:58 -05:00
Rasmus Wriedt Larsen
2478a9f10e Python: Fix wording of change-note 2021-02-14 23:20:46 +01:00
luchua-bc
6a6727fc80 Reduce the scope of the query to reduce FPs 2021-02-14 15:01:06 +00:00
CodeQL CI
178c54e69b Merge pull request #5139 from RasmusWL/django-improvements
Approved by yoff
2021-02-14 02:16:52 -08:00
Tamas Vajk
4cc9bc9bf0 Add new .stats file 2021-02-13 16:21:45 +01:00
Raul Garcia (MSFT)
782f4bc3e2 Fixing shared .qhelp issue (renaming to .qhelp.inc)& addressing a fix 2021-02-12 13:38:55 -08:00
Marcono1234
7a6db061b5 Address review feedback 2021-02-12 20:15:10 +01:00
Tamas Vajk
cb9116028c Add change note for 'with' expression extraction 2021-02-12 20:04:22 +01:00
Tamas Vajk
10e99203e8 Add DB upgrade folder for 'with' expression 2021-02-12 19:59:14 +01:00
Tamas Vajk
7761774f88 Add record .ctor to property data flow summary 2021-02-12 19:54:52 +01:00
Tom Hvitved
6a6644b5c2 C#: Adjust data-flow for with expressions
In `x with { Foo = bar }`, instead of having a single data-flow step

`x => x with { Foo = bar }`

we now have two steps:

`x => { Foo = bar }`

and

`{ Foo = bar } => x with { Foo = bar }`

Moreover, `clearsContent` now targets the object initializer instead of the
whole `with` expression, which means that it will only apply to values carried
over from the old object and not those explicitly stored into the new object.
2021-02-12 19:54:52 +01:00
Tamas Vajk
dd9b1d52b5 C#: Initial data-flow for with expressions 2021-02-12 19:54:52 +01:00
Tamas Vajk
b2b4c9ecd6 C#: Extract 'with' expressions 2021-02-12 19:54:52 +01:00
Tamás Vajk
77af7edaa4 Merge pull request #4628 from tamasvajk/feature/csharp9-foreach
C#: Extract underlying methods of foreach statements
2021-02-12 19:53:26 +01:00
Taus Brock-Nannestad
2632422783 Python: Add FP test for unknown argument in string format
Reported in https://github.com/github/codeql/issues/2650

I found this during a bit of spring cleaning in my working
directory. As this doesn't have any immediate security implications, I
don't know when we'll get round to fixing it, but it can't hurt to
have the test case checked in.
2021-02-12 19:28:12 +01:00
Erik Krogh Kristensen
4fa33b151f Merge pull request #5146 from github/more-redos-tests
JS: add two non ReDoS regular expressions to the ReDoS test suite
2021-02-12 18:56:52 +01:00
Geoffrey White
6d452521f7 C++: Move StdBasicStringStream to a more logical location. 2021-02-12 17:42:33 +00:00
Geoffrey White
74f05d569b C++: BSL support. 2021-02-12 17:41:32 +00:00
CodeQL CI
179a7a89dd Merge pull request #5098 from erik-krogh/xml2js
Approved by asgerf
2021-02-12 09:22:40 -08:00
Chris Smowton
402f20c5e2 Merge pull request #5154 from smowton/smowton/admin/deprecate-old-maven-predicate-names
Java: Re-introduce deprecated versions of old Maven predicate names
2021-02-12 17:22:05 +00:00
Chris Smowton
80978c7c35 Merge pull request #5153 from smowton/smowton/admin/move-misplaced-experimental-query
Move misplaced experimental query into the conventional directory
2021-02-12 17:21:57 +00:00
Geoffrey White
d362b5aa65 C++: StdSet should be private as well. 2021-02-12 16:29:44 +00:00
Geoffrey White
df91b8182c C++: Deprecate StdPairClass properly. 2021-02-12 16:24:45 +00:00
Geoffrey White
1edfd04598 C++: BSL Support. 2021-02-12 15:56:47 +00:00
Geoffrey White
3cfb0a21fe C++: Fix Iterator.qll taint/data flows for operator+=. 2021-02-12 14:54:47 +00:00
Geoffrey White
61b0d6a0cd C++: Fix Iterator.qll non-member operator+= charpred. 2021-02-12 14:54:46 +00:00
Geoffrey White
da06b2a615 C++: Improve Iterator.qll layout and QLDoc. 2021-02-12 14:54:46 +00:00
Geoffrey White
90dbbbb0c2 C++: Update Iterator.qll. 2021-02-12 14:54:46 +00:00
Geoffrey White
7705fc4f98 C++: Add more test cases for iterator taint flow. 2021-02-12 14:54:45 +00:00
Alvaro Muñoz
7d294361dc Update java/ql/src/semmle/code/java/frameworks/apache/Lang.qll
Co-authored-by: Joe Farebrother <joefarebrother@github.com>
2021-02-12 15:40:44 +01:00
Alvaro Muñoz
6b80a42913 apply LSP formatter and add missing dot 2021-02-12 15:03:11 +01:00
Alvaro Muñoz
8606386c2c add bidirectional import 2021-02-12 14:59:28 +01:00
Alvaro Muñoz
49eda8ced6 apply LSP formatter 2021-02-12 14:56:10 +01:00
Anders Schack-Mulligen
085286ab58 Merge pull request #5135 from pwntester/guava_preconditions
Add support for the Preconditions Class in the Guava framework
2021-02-12 14:15:17 +01:00
Chris Smowton
655cfb3a47 Re-introduce deprecated versions of old Maven predicate names 2021-02-12 12:24:19 +00:00
Chris Smowton
97df60f9d6 Move misplaced experimental query into the conventional directory 2021-02-12 12:12:16 +00:00
Chris Smowton
942ae7ef47 Merge pull request #5142 from Marcono1234/marcono1234/maven-pom-improvements
Java: Improve MavenPom documentation, rename inconsistent predicates
2021-02-12 11:52:19 +00:00
Rasmus Wriedt Larsen
10fdc4bfb9 Python: Add support for more yaml loading functions 2021-02-12 12:30:00 +01:00
Rasmus Wriedt Larsen
2021cdbe33 Python: Add tests for more yaml loading functions 2021-02-12 12:30:00 +01:00
Rasmus Wriedt Larsen
f328e84bd2 Python: Mention yaml.safe_load in the qhelp 2021-02-12 12:29:55 +01:00
Rasmus Wriedt Larsen
1651f81ac8 Python: Refactor to avoid confusing name
After discussion with @yoff
2021-02-12 12:19:37 +01:00
Mathias Vorreiter Pedersen
729c7f2371 C++: Add deprecated alias to RemoteFlowSourceFunction and LocalFlowSourceFunction. 2021-02-12 10:53:34 +01:00
Mathias Vorreiter Pedersen
b1c7cb6396 C++: Address review comments. 2021-02-12 10:37:27 +01:00
Rasmus Wriedt Larsen
ed2dc5f6ad Python: Fix date for change-note 2021-02-12 10:26:31 +01:00
Tamas Vajk
0aded1549e Improve NestedLoopsSameVariable query performance 2021-02-12 09:33:33 +01:00
Rasmus Lerchedahl Petersen
cfa72af12c Python: Update test expectation to new format 2021-02-12 09:30:12 +01:00
Marcono1234
905648e452 Add ConditionalExpr.getBranchExpr(boolean) 2021-02-12 04:50:41 +01:00
haby0
6901cd4899 Merge branch 'main' of https://github.com/haby0/codeql into main 2021-02-12 11:18:33 +08:00
haby0
22e741c7a3 *)add XQExpression.executeCommand(0) sink 2021-02-12 11:17:42 +08:00
haby0
dbb3d458f5 *)add XQExpression.executeCommand(0) sink 2021-02-12 10:47:41 +08:00
Marcono1234
e89891fa1f Address review comments 2021-02-12 01:30:47 +01:00
Artem Smotrakov
042c0b005e Covered sandboxes for JEXL 2
- Updated SandboxedJexlFlowConfig to cover JEXL 2
- Added SandboxedJexl2 test
2021-02-11 22:57:26 +01:00
Raul Garcia (MSFT)
710ca21d19 Addressing comments we missed earlier 2021-02-11 11:52:58 -08:00
Artem Smotrakov
7543df60da Callable.call() should not be a sink in JexlInjection.ql 2021-02-11 20:37:23 +01:00
Geoffrey White
354f21f2c3 C++: BSL support. 2021-02-11 16:57:20 +00:00
Erik Krogh Kristensen
004147a22f add change note 2021-02-11 17:54:53 +01:00
Erik Krogh Kristensen
6f405635ef add ClientRequest model for apollo-client 2021-02-11 17:49:44 +01:00
Mathias Vorreiter Pedersen
91627cbd88 C++: Add models for BSD-style send and recv functions. 2021-02-11 17:21:32 +01:00
Geoffrey White
21b2999722 C++: Update StdSet.qll. 2021-02-11 16:01:55 +00:00
Geoffrey White
33b5802ff6 C++: Update StdPair.qll (just for consistency). 2021-02-11 16:01:44 +00:00
Erik Krogh Kristensen
fd46b7a7bc fix type in change-note
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com>
2021-02-11 16:17:26 +01:00
Erik Krogh Kristensen
69d8aa143c add taint step for the snarkdown libary 2021-02-11 16:16:46 +01:00
Taus Brock-Nannestad
4c66071f5f Python: Revert "Python: Support moduleImport("dotted.name") in API graphs"
This reverts commit 2c4a477a4e.

It's probably best _not_ to do this, as any `getMember` cycle in the
API graph will lead to nontermination.
2021-02-11 16:08:28 +01:00
Taus Brock-Nannestad
ea30598a08 Python: Split dotted names more efficiently 2021-02-11 16:07:39 +01:00
Jonathan Leitschuh
35e2ceba13 Update java/ql/src/semmle/code/xml/MavenPom.qll
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
2021-02-11 08:59:02 -05:00
Erik Krogh Kristensen
d14586de56 add two non ReDoS regular expressions to the ReDoS test suite
Adds the regular expression from #5145
2021-02-11 14:41:45 +01:00
Erik Krogh Kristensen
f12c38425f add change-note 2021-02-11 13:36:53 +01:00
Erik Krogh Kristensen
3ee0029cd8 Update javascript/change-notes/2021-02-08-xml-parser-taint.md
Co-authored-by: Asger F <asgerf@github.com>
2021-02-11 13:33:42 +01:00
CodeQL CI
02578cfff2 Merge pull request #5112 from erik-krogh/forms
Approved by asgerf
2021-02-11 04:32:14 -08:00
Erik Krogh Kristensen
044f80215e add change note 2021-02-11 09:34:04 +01:00
Erik Krogh Kristensen
010d580f8e add model for multiparty 2021-02-11 09:34:04 +01:00
Erik Krogh Kristensen
61b4ffec3d add remote flow from the Formidable library 2021-02-11 09:34:04 +01:00
Erik Krogh Kristensen
a03f4ed3cd add remote flow source for busboy 2021-02-11 09:34:02 +01:00
Erik Krogh Kristensen
e2fbf8a68c add files uploaded with multer as RemoteFlowSource 2021-02-11 09:33:15 +01:00
haby0
a6a0fa28c4 *)add XQExpression.executeQuery(0) sink 2021-02-11 16:05:48 +08:00
Marcono1234
2a1c11b517 Improve MavenPom documentation, rename inconsistent predicates 2021-02-10 23:56:45 +01:00
Raul Garcia (MSFT)
ef0d3720a1 Addressing a few comments 2021-02-10 13:39:24 -08:00
Raul Garcia
190164c182 Update csharp/ql/src/experimental/Security Features/campaign/Solorigate/Solorigate.qhelp
Co-authored-by: Bas van Schaik <5082246+sj@users.noreply.github.com>
2021-02-10 13:30:40 -08:00
Artem Smotrakov
af0f361ac8 Updated JexlInjection.ql to check for sandboxes
- Added a dataflow config to track setting a sandbox
  on JexlBuilder
- Added SandboxedJexl3.java test
2021-02-10 22:19:45 +01:00
Erik Krogh Kristensen
7cff1f441b add model for the unified and remark libraries 2021-02-10 18:13:01 +01:00
Rasmus Wriedt Larsen
c57a4df819 Python: Model taint of self.request on django view class 2021-02-10 17:48:48 +01:00
Rasmus Wriedt Larsen
9ca738d921 Python: Add taint test for self.request on django view class 2021-02-10 17:48:41 +01:00
Jonathan Leitschuh
3b92f97967 Refactor DeclaredRepository to library 2021-02-10 11:41:50 -05:00
Erik Krogh Kristensen
0d497e8b9a add model for the showdown library 2021-02-10 17:22:42 +01:00
Anders Schack-Mulligen
e9bfbb677d Java: Connect the external sources and steps to the defaults. 2021-02-10 17:06:21 +01:00
Anders Schack-Mulligen
5a391ab6c0 Java: Add qldoc. 2021-02-10 16:54:48 +01:00
Jonathan Leitschuh
21b6f35ddc Update java/ql/src/Security/CWE/CWE-1104/MavenPomDependsOnBintray.qhelp 2021-02-10 10:52:27 -05:00
Jonathan Leitschuh
49985a77e3 Apply suggestions from code review
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2021-02-10 10:51:37 -05:00
Rasmus Wriedt Larsen
ca0d345987 Django: Model any class used in django route setup as view class 2021-02-10 16:26:25 +01:00
Rasmus Wriedt Larsen
b428945bc2 Django: Fix DjangoRouteHandler char-pred
Before it the class would contain _all_ functions xD
2021-02-10 16:21:51 +01:00
Rasmus Wriedt Larsen
78a3206fce Python: Add test with unkown view class in django 2021-02-10 15:56:33 +01:00
Anders Schack-Mulligen
b74911204a Merge pull request #4945 from intrigus-lgtm/java/insecure-jxbrowser
Java: Insecure JXBrowser
2021-02-10 15:48:17 +01:00
Rasmus Wriedt Larsen
42eceb80bd Python: Handle view functions with decorators 2021-02-10 15:47:55 +01:00
Erik Krogh Kristensen
f76018c039 add taint step for the markdown-table library 2021-02-10 15:11:41 +01:00
Erik Krogh Kristensen
b4704f7016 add taint-step for the marked library 2021-02-10 14:51:08 +01:00
Erik Krogh Kristensen
91f7d33044 add change note 2021-02-10 14:17:49 +01:00
Erik Krogh Kristensen
101d4358a9 detect DOM nodes from event callbacks 2021-02-10 14:17:49 +01:00
Erik Krogh Kristensen
be9636491b add source for react-hook-form in xss-through-dom 2021-02-10 14:17:49 +01:00
Erik Krogh Kristensen
65d93c9061 detect for DOM elements from DOM events in React 2021-02-10 14:17:49 +01:00
Erik Krogh Kristensen
458dda9d25 add xss-through-dom source from react-final-form 2021-02-10 14:17:49 +01:00
Erik Krogh Kristensen
ff3950ce98 add model for formik 2021-02-10 14:17:49 +01:00
Erik Krogh Kristensen
d1087d4e41 move sources from XssThroughDom into a customizations file 2021-02-10 14:17:49 +01:00
Erik Krogh Kristensen
4969a1ef4f add change note 2021-02-10 14:16:31 +01:00
Erik Krogh Kristensen
0ca2310594 add model for htmlparser2 2021-02-10 14:16:31 +01:00
Erik Krogh Kristensen
e2a66bf3ed add model for xml-js 2021-02-10 14:16:31 +01:00
Erik Krogh Kristensen
73f7cd149f add model for sax 2021-02-10 14:16:31 +01:00
Erik Krogh Kristensen
c43025d7b3 add model for xml2js 2021-02-10 14:16:30 +01:00
Erik Krogh Kristensen
44ca2e26a6 add taint-step to XML parsers 2021-02-10 14:16:08 +01:00
intrigus
5c82ff83de Java: Fix qhelp, fix CWE reference 2021-02-10 13:57:51 +01:00
Anders Schack-Mulligen
3a6fa9d99b Java: Add support for framework modelling through csv data. 2021-02-10 13:25:03 +01:00
Alvaro Muñoz
645b021845 Add support for the Preconditions Class in the Guava framework 2021-02-10 13:20:29 +01:00
Alvaro Muñoz
0cf3a29429 Add support for Apache Commons Lang ArrayUtils 2021-02-10 13:09:57 +01:00
Shati Patel
18225fa254 Merge pull request #4997 from github/shati-patel/cwe-coverage-docs
Docs: Add outline for CWE coverage page
2021-02-10 11:45:09 +00:00
Alvaro Muñoz
3b4357792b Remove sanitizing condition which does not prevent
vulnerability.
2021-02-10 12:21:48 +01:00
Anders Schack-Mulligen
66d0bf6b5e Merge pull request #5128 from hvitved/dataflow/exploration-clears-content
Data flow: Take `clearsContent()` into account in flow exploration
2021-02-10 11:52:24 +01:00
yoff
9930d59aca Merge pull request #5124 from RasmusWL/typetracking-with-decorator
Python: Add test for type-tracking through decorators
2021-02-10 09:34:54 +01:00
Tom Hvitved
1f9b42f9ab Data flow: Sync files 2021-02-09 20:10:23 +01:00
Tom Hvitved
e5970f4c65 Data flow: Take clearsContent() into account in flow exploration 2021-02-09 20:09:24 +01:00
Geoffrey White
d475e55ec0 Update cpp/ql/test/README.md
Co-authored-by: hubwriter <hubwriter@github.com>
2021-02-09 15:20:03 +00:00
Geoffrey White
cc031118dd Update CONTRIBUTING.md
Co-authored-by: hubwriter <hubwriter@github.com>
2021-02-09 15:19:30 +00:00
yo-h
e5331a4735 Java: accept changes in expected output 2021-02-09 09:17:35 -05:00
yo-h
e194411cfa Java: fix javac errors in test code 2021-02-09 09:16:57 -05:00
luchua-bc
cb01613aa6 Exclude FP token patterns 2021-02-09 13:53:23 +00:00
Tamas Vajk
9854b95c30 Fix query performance 2021-02-09 14:45:22 +01:00
Alexander Eyers-Taylor
1c43505d30 Merge pull request #5121 from alexet/fix-js-jdoc
Javascript Extractor: Update <tt> tages to <code>
2021-02-09 13:07:19 +00:00
CodeQL CI
475d216f8e Merge pull request #5087 from erik-krogh/immutable
Approved by asgerf
2021-02-09 12:43:19 +00:00
Rasmus Wriedt Larsen
1d25184b32 Python: Add test for type-tracking through decorators
In general, if there is _some_ decorator on a function, it might not be safe to
track content out of it (since the decorator could do anything), but in this
case, we can see what the decorator does, so we should be able to handle it (but
we don't right now).

By my understanding of how type-tracking works, if we track content through
`my_decorator`, then we would also track content to the result of
`unrelated_func()`, which I wanted to make sure our tests would catch.

I found out the core of the problem seems to come from our lack of being able to
track to the inner scope, and added an explicit test for that.
2021-02-09 13:43:10 +01:00
Rasmus Wriedt Larsen
eb7e30d472 Python: Add test of django view handler with decorator
Which we currently don't handle :(

Also added a bit more explanatory comments
2021-02-09 13:25:12 +01:00
Geoffrey White
d1910a3f5c Update CONTRIBUTING.md
Co-authored-by: Jonas Jensen <jbj@github.com>
2021-02-09 12:12:24 +00:00
alexet
8dd5a7e7c7 Javascript Extractor: Update <tt> tages to <code> 2021-02-09 12:10:09 +00:00
Remco Vermeulen
3818971b79 Add redirect sinks
Both the familiy of `Accepted` and `Created` method set the location
header based on provided input. If this is untrusted input this can
result in an URL redirect attack.
2021-02-09 13:09:02 +01:00
Alexander Eyers-Taylor
bed10ad562 Merge pull request #5113 from github/alexet/fix-var-decls-spec
Update the language specification to allow empty var_decls
2021-02-09 11:08:23 +00:00
Rasmus Lerchedahl Petersen
e3002aa1bf Python: model for sys.exc_info
made _easy_ by API graphs :D
2021-02-09 11:39:44 +01:00
Rasmus Lerchedahl Petersen
0ea2f457a1 Python: type trackers for exceptions 2021-02-09 11:39:44 +01:00
Rasmus Lerchedahl Petersen
232d9b006a Python: Implement traceback module
Just functions, not the classes for now
2021-02-09 11:39:44 +01:00
Rasmus Lerchedahl Petersen
6a45f6e7e0 Python: Port StackTraceExposure query
using empty concept implementation
2021-02-09 11:12:44 +01:00
Rasmus Lerchedahl Petersen
77ae91c47d Python: Add concept ExceptionSource 2021-02-09 11:12:44 +01:00
CaptainFreak
503b339a1f remove hbs specific checks 2021-02-09 07:35:35 +05:30
Raul Garcia (MSFT)
f114ef1f06 Adding unit tests 2021-02-08 16:57:49 -08:00
Geoffrey White
8bf9fc6111 Consistent capitalisation. 2021-02-08 20:29:46 +00:00
Geoffrey White
07b263bb2f Typo. 2021-02-08 20:27:28 +00:00
Geoffrey White
bd255617d8 Three copies of a link is too much. 2021-02-08 20:25:35 +00:00
Geoffrey White
e1ca762bbc Fix layout. 2021-02-08 20:24:15 +00:00
Geoffrey White
65ea1a4631 Add hints / links about tests and documentation to CONTRIBUTING.md. 2021-02-08 20:04:10 +00:00
Geoffrey White
690b525192 Add a link to the C/C++ CodeQL Tests README.md from the Supported CodeQL queries and libraries doc. 2021-02-08 20:04:10 +00:00
Geoffrey White
74178a5e86 Call out the copied code issue for qhelp files again (more generally) in the Supported CodeQL queries and libraries doc. 2021-02-08 20:04:09 +00:00
Geoffrey White
cb16c64540 Call out the issue of copied code for C/C++ example code in the C/C++ CodeQL Tests README.md (where we talk about it for tests). 2021-02-08 19:58:36 +00:00
Alexander Eyers-Taylor
7583904046 Update the language specification to allow empty var_decls
This is a degenerate form that is accepted in the compiler even if they don't make much sense. 

Fixes #5060
2021-02-08 18:54:13 +00:00
Taus Brock-Nannestad
c59b5c98cb Python: Replace use of AttrNode with getMember 2021-02-08 19:14:11 +01:00
Taus Brock-Nannestad
72a699e099 Python: Add CallCfgNode class and rewrite using that class
I prefer this name to `CfgCallNode` as the latter will make
autocomplete more difficult.
2021-02-08 16:55:18 +01:00
Asger Feldthaus
b278233a94 JS: Mention all versions of Angular are supported 2021-02-08 15:45:46 +00:00
Taus Brock-Nannestad
46eb3fd10a Python: Even more API::Node pushing. 2021-02-08 14:22:42 +01:00
Taus
c0c2aa69b3 Merge branch 'main' into python-port-flask-to-api-graphs 2021-02-08 14:17:25 +01:00
Taus Brock-Nannestad
2c4a477a4e Python: Support moduleImport("dotted.name") in API graphs 2021-02-08 14:08:34 +01:00
Taus
738d1bc3d4 Python: More use of API::Node
Co-authored-by: yoff <lerchedahl@gmail.com>
2021-02-08 14:08:16 +01:00
haby0
97690b4eb7 Update java/ql/src/Security/CWE/CWE-652/XQueryInjection.qhelp
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2021-02-08 19:15:28 +08:00
Tamas Vajk
bd50ed975f Fix doc comment 2021-02-08 11:18:37 +01:00
CodeQL CI
8a2e063af7 Merge pull request #5107 from asgerf/js/json-in-script-tag
Approved by erik-krogh
2021-02-08 09:52:53 +00:00
Erik Krogh Kristensen
504db8739d fix typo in execa change-note file name 2021-02-08 10:00:26 +01:00
Erik Krogh Kristensen
8ca75e41d2 add change note 2021-02-08 09:59:45 +01:00
intrigus
2e30f2d9ce Java: Fix QHelp & accept test output
Accept test output for changed alert message.
2021-02-08 00:05:02 +01:00
Tamas Vajk
ef55ca179b Improve file read exception logging 2021-02-07 09:06:11 +01:00
Tamas Vajk
6d908876e0 Add new .stats file 2021-02-07 09:06:11 +01:00
Tamas Vajk
96248f8845 Add DB upgrade folder 2021-02-07 09:06:11 +01:00
Tamas Vajk
63b0fe10e4 Rework foreach_stmt_info extraction 2021-02-07 09:06:11 +01:00
Tamas Vajk
7c506f445c C#: Extract underlying methods of foreach statements 2021-02-07 09:06:11 +01:00
Jonas Jensen
7859c5234a Merge pull request #5085 from geoffw0/msprintf2
C++: Fix FormattingFunction regression.
2021-02-06 16:06:35 +01:00
yoff
f1a0ec2dec Merge pull request #4981 from RasmusWL/port-url-redirect-query
Python: Port url redirect query
2021-02-06 00:39:10 +01:00
yoff
ddd362bc16 Update python/ql/src/semmle/python/frameworks/Django.qll
Co-authored-by: Rasmus Wriedt Larsen <rasmuswl@github.com>
2021-02-05 23:31:20 +01:00
Raul Garcia (MSFT)
d775528069 Fixes on multiple files. 2021-02-05 14:09:26 -08:00
Asger Feldthaus
0ceb8aa638 JS: Bump extractor version 2021-02-05 21:55:43 +00:00
Asger Feldthaus
236b7c5887 JS: Tolerate JSON in script tags 2021-02-05 21:54:50 +00:00
Taus
d3a79ecff1 Update python/ql/src/semmle/python/frameworks/Flask.qll
Co-authored-by: yoff <lerchedahl@gmail.com>
2021-02-05 22:54:27 +01:00
Jonathan Leitschuh
f00b0baaea Update java/ql/src/Security/CWE/CWE-1104/MavenPomDependsOnBintray.qhelp
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com>
2021-02-05 16:31:37 -05:00
Taus Brock-Nannestad
3d2548ed28 Python: Get rid of remaining type trackers in Flask model
At this point, we may want to reconsider whether we really want the
deeply-nested module structure we had before (and which made the type
trackers somewhat bearable).

There's also a question of how we can make this a bit more
smooth. I think we need to consider exactly how we would like the
interface to this to work.
2021-02-05 21:58:08 +01:00
Taus Brock-Nannestad
5bfde2c0f2 Python: Fix overly broad class attribute node class
This is not strictly necessary, but it was bothering me that this
simply covered _all_ nodes that were both definitions and names at the
same time. Now it actually encompasses what the documentation claims
it does.
2021-02-05 21:56:57 +01:00
Taus Brock-Nannestad
7f3c6acd08 Python: Handle class attribute references in API graph
This is slightly dubious, and should really be in the currently
unimplemented "def" counterpart to the "use" bits we already have.

However, it seems to work correctly, and in the spirit of moving
things along, this seemed like the easier solution. We can always
replace the implementation with the "proper" approach at a later point.
2021-02-05 21:54:35 +01:00
Alexander Eyers-Taylor
9af99f195e Merge pull request #5095 from alexet/imporve-js-perf
Javascript: Improve performance of ExplicitInvokeNode::getArgument
2021-02-05 18:49:03 +00:00
Jonathan Leitschuh
bfa9324266 CWE-1104: Maven POM dependence upon Bintray/JCenter 2021-02-05 13:05:51 -05:00
Raul Garcia (MSFT)
d48a713f30 Fixing cutom edges predicate 2021-02-05 09:27:08 -08:00
Raul Garcia (MSFT)
681e6a9303 Adding Solorigate context for the generic backdoor queries. 2021-02-05 09:02:59 -08:00
Taus Brock-Nannestad
ef600575ca Python: Add API graph support for subclasses 2021-02-05 16:52:58 +01:00
Taus Brock-Nannestad
b39cbf82c6 Python: Port Flask models to use API graphs
Most of the type trackers in this model were easily replaceable with
uses of the API graph, but the ones for tracking subclasses are
problematic, as these take us out of the API graph.
2021-02-05 14:41:42 +01:00
yoff
7fef1a8817 Merge pull request #5069 from tausbn/python-api-graphs
Python: Add support for API graphs
2021-02-05 13:17:09 +01:00
Shati Patel
6a46be2379 Install sphinx extension for building markdown tables 2021-02-05 12:07:06 +00:00
Shati Patel
5f17fa8366 Docs: Add outline for CWE coverage page 2021-02-05 12:06:57 +00:00
Taus Brock-Nannestad
78cb53449d Python: Slight cleanup of Cached::call
Makes it more similar to the other functions in this module.
2021-02-05 12:47:26 +01:00
Taus
6c8dfb253d Python: Use flowsTo instead of hasLocalSource
Co-authored-by: yoff <lerchedahl@gmail.com>
2021-02-05 12:42:41 +01:00
Tamás Vajk
d7505e41db Merge pull request #5091 from tamasvajk/feature/cleanup-nullable
C#: Fix nullable warnings and some code quality issues
2021-02-05 12:07:42 +01:00
Jonas Jensen
6e5d56cbcb Merge pull request #5097 from geoffw0/qldoceg11
C++: QLDoc Improvements
2021-02-05 12:00:35 +01:00
Shati Patel
474ddc9bc8 Merge pull request #5090 from RasmusWL/docs-fix-direct-query-link
Docs: Use /blob/ instead of /tree/ for direct query link
2021-02-05 10:50:40 +00:00
Jonas Jensen
c945ece80d Merge pull request #5100 from MathiasVP/fix-changenote-unsigned-difference-expression-compared-zero
C++: Add query author and link to original PR in change-note
2021-02-05 11:21:48 +01:00
Geoffrey White
55b0dbd7b8 C++: Autoformat. 2021-02-05 10:02:31 +00:00
Taus
a66743192e Python: Fix typo in docs
Co-authored-by: yoff <lerchedahl@gmail.com>
2021-02-05 10:58:47 +01:00
Mathias Vorreiter Pedersen
a416a089b4 Update cpp/change-notes/2020-02-04-unsigned-difference-expression-compared-zero.md
Co-authored-by: Jonas Jensen <jbj@github.com>
2021-02-05 09:48:54 +01:00
Tamás Vajk
87ba9d55b6 Merge pull request #4687 from tamasvajk/feature/csharp9-records
C#: Extract record declarations
2021-02-05 08:56:24 +01:00
luchua-bc
a183b00166 Query to detect main method in servlets 2021-02-05 03:53:01 +00:00
Raul Garcia (MSFT)
3dc1b81d65 Changing ProcessNameToHash query to path-problem. Any additional feedback will be welcomed 2021-02-04 17:54:35 -08:00
Raul Garcia (MSFT)
9ef4aef28e Changing location for NonCryptographicHash qll
Changing the TimeBomb query to path-problem (any suggestions to improve it would be welcomed, no previous experience iwth path-problem queries)
2021-02-04 16:59:38 -08:00
Robert Marsh
649bd03db6 Merge pull request #5101 from NateD-MSFT/patch-1
Add KeGetCurrentProcessorNumberEx to CWE-457 whitelist
2021-02-04 16:59:07 -08:00
Raul Garcia (MSFT)
d5c9db42de Fixing format 2021-02-04 14:26:03 -08:00
NateD-MSFT
9470a99092 Add KeGetCurrentProcessorNumberEx to CQE-457 whitelist
Windows driver developers may call KeGetCurrentProcessorNumberEx in their driver.  This function optionally may initialize a provided structure, but this initialization always occurs.  The return value is the current processor being run on.  As such, this query incorrectly marks calls to KeGetCurrentProcessorNumberEx that initialize a structure that is later used as risky, even though in reality the initialization always succeeds.

See https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddk/nf-ntddk-kegetcurrentprocessornumberex
2021-02-04 13:32:09 -08:00
Raul Garcia (MSFT)
1d8f8286a5 Fixes to address some of the comments during PR 2021-02-04 13:25:43 -08:00
Raul Garcia (MSFT)
8e85145df4 Updated Readme file 2021-02-04 12:51:31 -08:00
Tamas Vajk
83f0fad014 Fix expected test AST 2021-02-04 21:08:01 +01:00
Tamas Vajk
f555c0642e Add change note 2021-02-04 21:08:01 +01:00
Tamas Vajk
f0b0845f9f Add 'record' QL class 2021-02-04 21:08:01 +01:00
Tamas Vajk
9ffc38f5b1 Fix deterministic ordering of class members in PrintAst 2021-02-04 21:08:01 +01:00
Tamas Vajk
a6fd7a3203 C#: Extract record declarations 2021-02-04 21:08:01 +01:00
Mathias Vorreiter Pedersen
993abd4499 C++: Add query author and link to original PR in change-note. 2021-02-04 20:23:27 +01:00
Raul Garcia (MSFT)
979fdd2c6a Addressing multiple comments 2021-02-04 10:23:01 -08:00
Taus
f0d5a91d59 Merge pull request #5093 from RasmusWL/fix-query-names-with-dunder
Python: Fix query names with dunder (__)
2021-02-04 18:47:45 +01:00
Taus Brock-Nannestad
d035937083 Python: Add change note 2021-02-04 18:43:44 +01:00
Taus Brock-Nannestad
a505eb6922 Python: Adhere to QLDoc style guide 2021-02-04 18:34:06 +01:00
Taus Brock-Nannestad
3c7d9c3c4b Python: Fix typo 2021-02-04 18:33:50 +01:00
Geoffrey White
2160edc789 C++: Clean up bits I didn't finish. 2021-02-04 17:16:45 +00:00
Geoffrey White
1f928c2910 CPP: Examples Element.qll. 2021-02-04 17:08:29 +00:00
Geoffrey White
8ae01789b1 CPP: Examples Specifier.qll. 2021-02-04 17:08:29 +00:00
Geoffrey White
500097ca76 CPP: Examples Preprocessor.qll. 2021-02-04 17:08:29 +00:00
Geoffrey White
4b9532c6f7 CPP: Examples Namespace.qll. 2021-02-04 17:08:29 +00:00
Taus Brock-Nannestad
f6e1ea5b2a Python: Fix missing global variable source nodes
In lieu of removing the offending flow (which would likely have
consequences for a lot of other tests), I opted to simply _include_
the relevant nodes directly.
2021-02-04 18:07:13 +01:00
Taus Brock-Nannestad
2524f23a46 Python: Add more test cases
There is now a bit of redundancy in the tests, but I thought it useful
to actually include some of the cases called out explicitly in the
documentation, so as to make it easy to see that the code actually
does what we expect (in these cases, anyway).
2021-02-04 18:05:33 +01:00
Taus Brock-Nannestad
aa7e9f0b56 Python: Add big explanatory comment about prefixes. 2021-02-04 18:03:34 +01:00
Francis Alexander
683233333c test case return statements and feedback 2021-02-04 22:28:10 +05:30
Geoffrey White
69c7c83bc2 Merge pull request #5094 from MathiasVP/promote-UnsignedDifferenceExpressionComparedZero
Promote cpp/unsigned-difference-expression-compared-zero out of experimental
2021-02-04 16:54:45 +00:00
Mathias Vorreiter Pedersen
cf0e464ab9 Merge branch 'promote-UnsignedDifferenceExpressionComparedZero' of github.com:MathiasVP/ql into promote-UnsignedDifferenceExpressionComparedZero 2021-02-04 17:24:59 +01:00
Mathias Vorreiter Pedersen
6a97d02247 C++: Address review comments. 2021-02-04 17:24:14 +01:00
alexet
9d06c75aed Javascript: improve performance of ExplicitInvokeNode::getArgument 2021-02-04 15:55:51 +00:00
Mathias Vorreiter Pedersen
161e5679a7 Apply suggestions from code review
Co-authored-by: hubwriter <hubwriter@github.com>
2021-02-04 16:47:45 +01:00
Taus Brock-Nannestad
305bfaba2d Python: Fix imports/2 2021-02-04 16:46:22 +01:00
Mathias Vorreiter Pedersen
d9d82fc56a C++: Update change-notes 2021-02-04 16:24:56 +01:00
Geoffrey White
7c54512859 Merge pull request #5010 from ihsinme/ihsinme-patch-220
CPP: Add query for CWE-570 detect and handle memory allocation errors.
2021-02-04 15:17:28 +00:00
Mathias Vorreiter Pedersen
707f532e10 C++: Fix bad join-order using a poor man's unbind operator. 2021-02-04 16:11:34 +01:00
Mathias Vorreiter Pedersen
fd596ebbbb C++: Move cpp/unsigned-difference-expression-compared-zero out of experimental. 2021-02-04 16:10:34 +01:00
Mathias Vorreiter Pedersen
c1c9f963b9 C++: Fix qhelp in cpp/unsigned-difference-expression-compared-zero. 2021-02-04 16:10:30 +01:00
Taus Brock-Nannestad
07ffa9f1ae Python: More documentation 2021-02-04 15:59:00 +01:00
Taus Brock-Nannestad
e54c925b70 Python: Greatly simplify imports/2 predicate 2021-02-04 15:58:15 +01:00
Rasmus Wriedt Larsen
b94658fd52 Python: Highlight that __slots__ query is only for Python 2 in qhelp
Since I was already editing this file, it was easy to just add this extra bit of
info.
2021-02-04 15:54:37 +01:00
Rasmus Wriedt Larsen
23d9e2646a Python: Fix name of class in example of __slots__ qhelp 2021-02-04 15:54:10 +01:00
Rasmus Wriedt Larsen
dcb185b659 Python: Fix trailing whitespace in a single qhelp file
Since I edited already, why not get this little bonus? :D
2021-02-04 15:53:23 +01:00
Rasmus Wriedt Larsen
32be53bf72 Python: Fix missing <code> in qhelp file 2021-02-04 15:53:04 +01:00
Rasmus Wriedt Larsen
3fe715abb6 Python: Fix query names that inclde __ (dunder)
Without backticks, the text UNDERSCORE UNDERSCORE eq UNDERSCORE UNDERSCORE would
be considered to make things bold in our markdown output, making the query info
look strange.

Example https://codeql.github.com/codeql-query-help/python/py-slots-in-old-style-class/
2021-02-04 15:49:37 +01:00
Sauyon Lee
5927ce5d69 Add GoKit to Go supported library list 2021-02-04 14:43:34 +00:00
Anders Schack-Mulligen
35e620a19c Merge pull request #4854 from luchua-bc/java/insecure-ldap-auth
Java: Insecure LDAP authentication
2021-02-04 14:56:38 +01:00
Tamas Vajk
ce27831b76 C#: Fix nullable warnings and some code quality issues 2021-02-04 14:43:51 +01:00
Rasmus Wriedt Larsen
4af7bc8090 Docs: Use /blob/ instead of /tree/ for direct query link
It doesn't have a huge impact, since there is a working redirect in place, but
still more correct to use /blob/ :)

For example,

https://github.com/github/codeql/tree/main/python/ql/src/Security/CWE-094/CodeInjection.ql

redirects to

https://github.com/github/codeql/blob/main/python/ql/src/Security/CWE-094/CodeInjection.ql
2021-02-04 14:30:56 +01:00
Mathias Vorreiter Pedersen
d3d56fb0af Merge pull request #5011 from ihsinme/ihsinme-patch-221
CPP: add query for CWE-788 Access of memory location after the end of a buffer using strlen.
2021-02-04 14:25:27 +01:00
Mathias Vorreiter Pedersen
9b39163411 Merge pull request #5076 from MathiasVP/improve-UnsignedDifferenceExpressionComparedZero
C++: Improve cpp/unsigned-difference-expression-compared-zero
2021-02-04 14:05:30 +01:00
ihsinme
43045c1f03 Update WrongInDetectingAndHandlingMemoryAllocationErrors.ql 2021-02-04 15:47:16 +03:00
ihsinme
a43167faf7 Update WrongInDetectingAndHandlingMemoryAllocationErrors.qhelp 2021-02-04 15:44:28 +03:00
ihsinme
2131f35801 Update WrongInDetectingAndHandlingMemoryAllocationErrors.ql 2021-02-04 15:41:40 +03:00
Mathias Vorreiter Pedersen
b55921a391 Update cpp/ql/src/experimental/Security/CWE/CWE-191/UnsignedDifferenceExpressionComparedZero.ql
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2021-02-04 13:25:02 +01:00
Taus Brock-Nannestad
d01d7eea82 Python: Add documentation from DataFlowUtil::importNode 2021-02-04 13:08:19 +01:00
Julian Tibble
a666a692f9 Merge pull request #5086 from github/update-codeql-workflow
Update CodeQL workflow
2021-02-04 12:02:53 +00:00
Taus
634041d2d7 Merge pull request #5047 from yoff/python-dataflow-unpacking-unifying-experiments
Python: dataflow, unify iterated unpacking
2021-02-04 12:57:43 +01:00
Taus
bc448fe067 Merge pull request #5088 from RasmusWL/fix-small-typo
Python: Fix small typo in test-output
2021-02-04 12:56:56 +01:00
Geoffrey White
d41ea6c799 Merge pull request #5081 from MathiasVP/indirection-in-dataflow-models
C++: Add more indirection flow in dataflow models
2021-02-04 11:55:34 +00:00
Julian Tibble
121ffbbfa8 Restrict triggers for CodeQL workflow
Analysing all branches on both 'push' and 'pull request' events causes
duplicate analysis. It is only necessary to analyse the _target_
branches of pull requests on push.
2021-02-04 11:49:15 +00:00
Julian Tibble
ecfad6b5c7 Update CodeQL workflow
Bring the CodeQL workflow up to date with the latest recommended
configuration, which analyses the merge commit of pull requests (not the
head of the PR branch).
2021-02-04 11:45:15 +00:00
Taus
4627799c93 Python: Fix more typos
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-02-04 12:41:17 +01:00
Rasmus Wriedt Larsen
1de3524bc5 Update docs/ql-style-guide.md
Co-authored-by: Jonas Jensen <jbj@github.com>
2021-02-04 12:27:38 +01:00
Taus
e5ec1e105c Python: Fix typos in test files
Co-authored-by: yoff <lerchedahl@gmail.com>
2021-02-04 12:18:07 +01:00
Rasmus Wriedt Larsen
ac0f2d37db Python: Fix small typo in test-output
Spotted by yoff in https://github.com/github/codeql/pull/5069#discussion_r570063207
2021-02-04 12:11:20 +01:00
Erik Krogh Kristensen
6cbf7b3267 add of Set, Stack and similar to the Immutable model 2021-02-04 12:05:44 +01:00
Erik Krogh Kristensen
b74df66463 implement Immutable merge 2021-02-04 12:05:44 +01:00
Erik Krogh Kristensen
c0de6a3af2 add support for Immutable Record 2021-02-04 12:05:44 +01:00
Erik Krogh Kristensen
609b16b1f7 implement Immutable OrderedMap 2021-02-04 12:05:44 +01:00
Erik Krogh Kristensen
2e7bf9b53c implement Immutable lists 2021-02-04 12:05:44 +01:00
Erik Krogh Kristensen
a5c9492c87 add support for fromJS in the Immutable model 2021-02-04 12:05:44 +01:00
Erik Krogh Kristensen
6cbe4caecc support toJS() by using plain property names instead of pseudoproperties. 2021-02-04 12:05:44 +01:00
Erik Krogh Kristensen
b1f092f052 add support for map.set in Immutable model 2021-02-04 12:05:44 +01:00
Erik Krogh Kristensen
b77dd54618 implement basic map get/set for immutable.js 2021-02-04 12:05:44 +01:00
Mathias Vorreiter Pedersen
55615586ee C++: Address review comments. 2021-02-04 11:30:44 +01:00
Tamás Vajk
26288ad391 Merge pull request #5082 from tamasvajk/feature/initial-db
C#: Add initial DB scheme
2021-02-04 11:23:42 +01:00
Tamás Vajk
ca992f2d3c Merge pull request #5005 from tamasvajk/feature/follow-line
C#: Follow line directives when getting element location
2021-02-04 11:22:55 +01:00
Mathias Vorreiter Pedersen
47ab9ba81b C++: emplace and emplace_back takes its arguments by universal references, so they should also specify flow as indirections. 2021-02-04 11:16:27 +01:00
Geoffrey White
7087904637 C++: Solution. 2021-02-04 09:00:35 +00:00
Tamás Vajk
1fd244923b Merge pull request #5052 from tamasvajk/feature/fnptr-df
C#: Add data flow 'getARuntimeTarget' predicate to 'FunctionPointerCall'
2021-02-04 08:51:03 +01:00
Tamas Vajk
543f5916c4 Fix expected test AST 2021-02-04 08:49:19 +01:00
Tamas Vajk
88d1539d43 Fix file read error log message 2021-02-04 08:42:39 +01:00
Tamas Vajk
7068a265a6 Fix XML comment processing 2021-02-04 08:42:39 +01:00
Tamas Vajk
d3244fe298 Add new .stats file 2021-02-04 08:42:39 +01:00
Tamas Vajk
dbe656fe6a Add DB upgrade folder for preprocessor directives 2021-02-04 08:42:39 +01:00
Tamas Vajk
fd09883bfe Add change notes for preprocessor directives 2021-02-04 08:42:39 +01:00
Tamas Vajk
899e52a68a Adjust getMappedLocation to not include line directives 2021-02-04 08:42:39 +01:00
Tamas Vajk
a1d227dbbb C#: Follow line directives when getting element location 2021-02-04 08:42:39 +01:00
Tamas Vajk
967765342e Assign preprocessor directives to compilation + make compilation cached 2021-02-04 08:42:39 +01:00
Tamas Vajk
1ab4af275d Rework if/elif/else/endif extraction 2021-02-04 08:42:39 +01:00
Tamas Vajk
72547b89e6 Rework endregion extraction 2021-02-04 08:42:39 +01:00
Tamas Vajk
a5dec5b4aa C#: Limit ancestor traversal for 'if' and 'elif' lookup 2021-02-04 08:42:38 +01:00
Tamas Vajk
2b7cc15757 Introduce base class for branching and conditional directives 2021-02-04 08:42:38 +01:00
Tamas Vajk
e450b61464 Fix code review findings in directives base class 2021-02-04 08:42:38 +01:00
Tamas Vajk
60b23dc505 Fix code review findings in 'endregion' directives 2021-02-04 08:42:38 +01:00
Tamas Vajk
6ef8e51bcf Fix code review findings in 'line' directives 2021-02-04 08:42:38 +01:00
Tamas Vajk
f7832adfb8 Fix code review findings in 'nullable' directives 2021-02-04 08:42:38 +01:00
Tamas Vajk
567516471c Fix code review findings in 'define' directives 2021-02-04 08:42:38 +01:00
Tamas Vajk
bd64dda4c3 Fix code review findings in pragma warning directives 2021-02-04 08:42:38 +01:00
Tamas Vajk
3900698b41 Add doc comments for preprocessor directive base class 2021-02-04 08:42:38 +01:00
Tamas Vajk
a896e1522d Extract active flag from directives, fix missing assembly location 2021-02-04 08:42:38 +01:00
Tamas Vajk
41fbce0ad0 Extract #if directives 2021-02-04 08:42:38 +01:00
Tamas Vajk
a5d18f9b68 Extract region directives 2021-02-04 08:42:38 +01:00
Tamas Vajk
fe0a494bab Extract line directives 2021-02-04 08:42:38 +01:00
Tamas Vajk
4bb8b6c992 Extract nullable directives 2021-02-04 08:42:38 +01:00
Tamas Vajk
15c611e22f Extract warning and error directives 2021-02-04 08:42:38 +01:00
Tamas Vajk
3740aba4a8 Extract undef directives 2021-02-04 08:42:38 +01:00
Tamas Vajk
9b405144ff Extract define directives 2021-02-04 08:42:38 +01:00
Tamas Vajk
94bf3467b7 Extract pragma checksum directives 2021-02-04 08:42:38 +01:00
Tamas Vajk
8b9c6712d1 Extract pragma warning directives 2021-02-04 08:42:38 +01:00
Tamas Vajk
40186db768 Rename CommentPopulator 2021-02-04 08:42:38 +01:00
Tamas Vajk
48d24b2264 Get line comments from trivia lines 2021-02-04 08:42:38 +01:00
Tamas Vajk
046a37b834 Simplify element access extraction 2021-02-04 08:42:38 +01:00
Tamas Vajk
c3ef6841d0 Add tests for trivia types 2021-02-04 08:42:38 +01:00
Tamas Vajk
3be229f097 C#: Separate visitors to dedicated files, rename and reorganize comment extraction related classes 2021-02-04 08:42:38 +01:00
Raul Garcia (MSFT)
53ab787efc Fixed format 2021-02-03 15:54:47 -08:00
Raul Garcia (MSFT)
86a2aa97ec Fixing incorrect file extension & adding suite 2021-02-03 15:48:16 -08:00
Raul Garcia (MSFT)
5e1e27c2b6 Adding queries related to the Solorigate campaign 2021-02-03 15:12:31 -08:00
Taus Brock-Nannestad
5974af661e Python: Update test file
Makes the `a.b.c.d` test more sensible.

Also adds a test that shows a case where we're currently _not_ getting
the right flow.
2021-02-03 22:43:21 +01:00
Taus Brock-Nannestad
ba98b08001 Python: Further elaboration of use/3 2021-02-03 22:31:33 +01:00
Taus Brock-Nannestad
ebfb1faf77 Python: Autoformat 2021-02-03 22:26:46 +01:00
Rasmus Lerchedahl Petersen
a7ca065411 Python: Fix ForTarget 2021-02-03 22:14:15 +01:00
yoff
b5633625b3 Update python/ql/src/semmle/python/dataflow/new/internal/DataFlowPrivate.qll
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-02-03 21:56:03 +01:00
Tamas Vajk
cccca879d9 C#: Add initial DB scheme 2021-02-03 21:52:00 +01:00
Taus
56515c5708 Python: Improve documentation for moduleImport
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-02-03 21:29:15 +01:00
Tom Hvitved
cf860f1dac Merge pull request #5071 from hvitved/csharp/ssa/uncertain-reads
C#: Move uncertain-read logic into shared SSA implementation
2021-02-03 20:27:45 +01:00
Taus Brock-Nannestad
05f290f734 Python: Better explanation in use/3 2021-02-03 19:52:40 +01:00
Taus Brock-Nannestad
c5d6792c1e Python: Make toString abstract 2021-02-03 19:52:40 +01:00
Taus Brock-Nannestad
6ce160c51c Python: Use call instead of invocation 2021-02-03 19:52:40 +01:00
luchua-bc
724c3e00e0 Update help file 2021-02-03 16:45:15 +00:00
Rasmus Wriedt Larsen
93f91d8746 Python: Apply suggestions from code review
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com>
2021-02-03 17:44:04 +01:00
Taus Brock-Nannestad
3fafb47b16 Python: Fix global flow
A slightly odd fix, but still morally okay, I think. The main issue
here was that global variables have their first occurrence in an inner
scope inside a so-called "scope entry definition", that then
subsequently flows to the first use of this variable. This meant that
that first use was _not_ a `LocalSourceNode` (since _something_ flowed
into it), and this blocked `trackUseNode` from type-tracking to it (as
it expects all nodes to be `LocalSourceNode`s).

The answer, then, is to say that a `LocalSourceNode` is simply one
that doesn't have flow to it from _any `CfgNode`_ (through one or more
steps). This disregards the flow from the scope entry definition, as
that is flow from an `EssaNode`.

Additionally, it makes sense to exclude `ModuleVariableNode`s. These
should never be considered local sources, since they always have flow
from (at least) the place where the corresponding global variable is
introduced.
2021-02-03 16:41:22 +01:00
Mathias Vorreiter Pedersen
8cf8b704c5 C++: Add more indirection flow in dataflow models. Also revert the additions to DataFlowUtil added in #5035 as they can add too much flow. 2021-02-03 16:16:48 +01:00
Anders Schack-Mulligen
40d02e7e32 Merge pull request #4926 from luchua-bc/java/insufficient-key-size
Java: Query to detect weak encryption: insufficient key size
2021-02-03 15:16:10 +01:00
Anders Schack-Mulligen
0df7e9fa4e Merge pull request #4989 from lcartey/lcartey/spring-inheritence-improvements
Java: Track taint through Spring Java bean getters on super types
2021-02-03 15:06:03 +01:00
Jonas Jensen
e3bdebf7a0 Merge pull request #5077 from jbj/revert-nested-fields
C++: Revert #4784
2021-02-03 14:07:28 +01:00
Rasmus Wriedt Larsen
2453a25833 Update docs/ql-style-guide.md
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2021-02-03 13:42:08 +01:00
Rasmus Wriedt Larsen
0ea7aa54f9 Update CodeQL Style guide to mention acronyms
Adding this after asking how to do this internally. Is based on https://dart.dev/guides/language/effective-dart/style#do-capitalize-acronyms-and-abbreviations-longer-than-two-letters-like-words
2021-02-03 13:31:26 +01:00
luchua-bc
2ace10fcdf Use PostUpdateNode for wrapper method calls 2021-02-03 12:21:31 +00:00
Erik Krogh Kristensen
d016ba2252 rename name dataflow configuration in js/template-object-injection 2021-02-03 12:29:23 +01:00
Erik Krogh Kristensen
a5bde53bfe use the TaintedObject library in js/template-object-injection 2021-02-03 12:26:37 +01:00
Erik Krogh Kristensen
c6a22844e2 add test for js/template-object-injection 2021-02-03 12:16:57 +01:00
Tom Hvitved
a45c415c5b Merge pull request #5067 from hvitved/csharp/cfg/patterns
C#: Adjust CFG for `{Recursive,Positional,Property}PatternExpr`
2021-02-03 12:09:39 +01:00
CaptainFreak
12ee497485 move query to src, rename and refactor 2021-02-03 15:48:02 +05:30
Mathias Vorreiter Pedersen
691a316460 C++: Add tests to cpp/unsigned-difference-expression-compared-zero and remove a couple of classes of FPs. 2021-02-03 11:10:57 +01:00
Jonas Jensen
064568c36d Revert "Merge pull request #4784 from MathiasVP/mathiasvp/reverse-read-take-3"
This reverts commit 1b3d69d617, reversing
changes made to 527c41520e.
2021-02-03 08:49:37 +01:00
CodeQL CI
653c900d62 Merge pull request #4987 from erik-krogh/defensiveFunctions
Approved by esbena
2021-02-02 14:47:23 -08:00
Erik Krogh Kristensen
c51e951d1e add change note 2021-02-02 22:51:03 +01:00
CodeQL CI
209fe8d7e5 Merge pull request #5049 from erik-krogh/singleQuote
Approved by esbena
2021-02-02 13:48:42 -08:00
Taus Brock-Nannestad
e4c3544a3f Python: Add support for from foo.bar import baz
This turned out to be fairly simple. Given an import such as
```python
from foo.bar.baz import quux
```
we create an API-graph node for each valid dotted prefix of
`foo.bar.baz`, i.e. `foo`, `foo.bar`, and `foo.bar.baz`. For these, we
then insert nodes in the API graph, such that `foo` steps to `foo.bar`
along an edge labeled `bar`, etc.

Finally, we only allow undotted names to hang off of the API-graph
root. Thus, `foo` will have a `moduleImport` edge off of the root, and
a `getMember` edge for `bar` (which in turn has a `getMember` edge for
`baz`).

Relative imports are explicitly ignored.

Finally, this commit also adds inline tests for a variety of ways of
importing modules, including a copy of the "import-helper" tests (with
a few modifications to allow a single annotation per line, as these
get rather long quickly!).
2021-02-02 21:59:33 +01:00
luchua-bc
3151aeff48 Enhance the query 2021-02-02 18:26:29 +00:00
Robert Marsh
631ee28cae C++: update comments about SSA sharing 2021-02-02 09:11:21 -08:00
Robert Marsh
50edf44e84 C++/C#: autoformat and sync files 2021-02-02 09:06:44 -08:00
Geoffrey White
047cd2b706 Merge pull request #5074 from MathiasVP/strnextc-model-implementation
C++: Implement a model for _strnextc and its variants
2021-02-02 16:45:16 +00:00
luchua-bc
5e3b6fa341 Update qldoc 2021-02-02 16:20:39 +00:00
Mathias Vorreiter Pedersen
ff58d5a7c0 C++: Address review comments. 2021-02-02 17:06:38 +01:00
Mathias Vorreiter Pedersen
9e75a4be34 C++: Implement a model for _strnextc and its variants. 2021-02-02 16:42:39 +01:00
Mathias Vorreiter Pedersen
98d73bf474 Merge pull request #5072 from MathiasVP/strcrement-model-implementation
C++: Implement model for _strinc and related functions
2021-02-02 16:22:13 +01:00
Mathias Vorreiter Pedersen
07a20752bc Fix spelling in qldoc.
Co-authored-by: Cornelius Riemenschneider <criemen@github.com>
2021-02-02 15:51:40 +01:00
luchua-bc
50be54385a Update qldoc 2021-02-02 14:49:50 +00:00
Jonas Jensen
aa9ab41e30 Merge pull request #5059 from geoffw0/mswprintf
C++: Exclude custom vprintf implementations from primitiveVariadicFormatter.
2021-02-02 15:13:25 +01:00
Geoffrey White
708d3870ee C++: Actually it's more appropriate to remove the implementation of vswprintf. 2021-02-02 13:42:27 +00:00
Tamas Vajk
64f0dfb174 Fix code review findings 2021-02-02 14:21:26 +01:00
Geoffrey White
4e904dd87d C++: Repair the test. 2021-02-02 13:08:46 +00:00
Rasmus Wriedt Larsen
e57e4e1916 Merge branch 'main' into port-url-redirect-query 2021-02-02 13:37:34 +01:00
Mathias Vorreiter Pedersen
b54f74a68a C++: Implement model for _strinc and related functions. 2021-02-02 12:20:02 +01:00
Rasmus Wriedt Larsen
d046e39a82 Python: Fix tornado inline expectations in tests
After merge commit
2021-02-02 12:04:24 +01:00
Mathias Vorreiter Pedersen
5db1984315 Merge pull request #5070 from MathiasVP/strsep-model-implementation
C++: Add strsep model implementation.
2021-02-02 12:00:26 +01:00
Geoffrey White
eed2aee17d C++: Effect on tests. 2021-02-02 10:59:14 +00:00
Geoffrey White
9f50f67e6d Merge pull request #5065 from MathiasVP/scanf-model
C++: Add sscanf and fscanf models
2021-02-02 10:30:19 +00:00
Tom Hvitved
b19fd7bb72 C#: Only cache TDefinition in the shared SSA implementation 2021-02-02 10:52:03 +01:00
Mathias Vorreiter Pedersen
0db54e08b8 C++: Address review comments. 2021-02-02 10:48:07 +01:00
Tom Hvitved
74fd2c1c38 C#: Move uncertain-read logic into shared SSA implementation 2021-02-02 10:43:13 +01:00
CodeQL CI
4fdbda3543 Merge pull request #5056 from erik-krogh/react
Approved by asgerf
2021-02-02 01:40:08 -08:00
Mathias Vorreiter Pedersen
6e71c68f33 C++: Add strsep model implementation. 2021-02-02 10:29:23 +01:00
Tom Hvitved
1ffa15ea96 C#: Update expected test output 2021-02-02 08:52:28 +01:00
Tom Hvitved
8abc37fba3 Merge pull request #5051 from hvitved/csharp/ssa/caching
C#: Reduce caching in `SsaImplCommon.qll`
2021-02-02 08:35:03 +01:00
Erik Krogh Kristensen
ca435763b0 separate message for double and single quotes 2021-02-01 23:54:12 +01:00
Taus Brock-Nannestad
cd7b013a0c Python: Add missing documentation 2021-02-01 18:57:25 +01:00
CodeQL CI
749dfe4358 Merge pull request #5068 from Marcono1234/patch-1
Approved by shati-patel
2021-02-01 08:47:55 -08:00
yoff
b92af8bcec Merge pull request #5042 from RasmusWL/django-more-view-classes
Python: Add full-path modeling of Django more view classes
2021-02-01 17:33:29 +01:00
Marcono1234
fa469587c1 Remove duplicate word in language specification 2021-02-01 17:32:53 +01:00
yoff
c0511ca9f9 Merge pull request #5053 from github/python-add-essavariable-locations
Python: Add locations for ESSA variables
2021-02-01 17:31:25 +01:00
Tamás Vajk
700a2dbb93 Merge pull request #5063 from tamasvajk/feature/remove-indexerproperty-ast
C#: Report IndexerProperty as Property in the PrintAST query
2021-02-01 17:25:25 +01:00
Mathias Vorreiter Pedersen
be9908df87 C++: Fix copy/paste error. 2021-02-01 16:45:07 +01:00
yoff
384d0212b1 Update python/ql/src/semmle/python/dataflow/new/internal/DataFlowPrivate.qll
Co-authored-by: Taus <tausbn@github.com>
2021-02-01 16:41:43 +01:00
Mathias Vorreiter Pedersen
71e1218ad5 Merge pull request #5061 from MathiasVP/more-memcpy-memset-strcpy-strcat-models
C++: Add more memcpy, memset, strcat and strcpy models
2021-02-01 16:25:01 +01:00
Mathias Vorreiter Pedersen
9db19613d6 C++: Reuse logic from commons/Scanf. 2021-02-01 16:10:28 +01:00
Taus Brock-Nannestad
fc01e5607f Python: Use getLocation directly on EssaNode 2021-02-01 14:55:18 +01:00
Taus Brock-Nannestad
b8194bd1f8 Python: Add support for API graphs
Currently only supports the "use" side of things.

For the most part, this follows the corresponding implementation for
JavaScript. Major differences include:

- No `MkImportUse` nodes -- we just move directly from
  `MkModuleImport` to its uses.

- Paths are no longer labelled by s-expressions, but rather by a
string that mirrors how you would access it in QL. This makes it very
easy to see how to access an API component -- simply look at its
`toString`!

This PR also extends `LocalSourceNode` to support looking up attribute
references and invocations of such nodes. This was again based on the
JavaScript equivalent (though without specific classes for
`InvokeNode` and the like, it's a bit more awkward to use).
2021-02-01 14:38:59 +01:00
CodeQL CI
2de230ea75 Merge pull request #5062 from esbena/js/test-for-html-concat-obfuscation
Approved by erik-krogh
2021-02-01 05:29:50 -08:00
Tom Hvitved
249e431e87 C#: Adjust CFG for {Recursive,Positional,Property}PatternExpr 2021-02-01 13:52:18 +01:00
Tamas Vajk
7d62e33feb C#: Rework function pointer/delegate call DF 2021-02-01 13:40:03 +01:00
Mathias Vorreiter Pedersen
27b41c2016 C++: Address review comments. 2021-02-01 13:32:46 +01:00
CaptainFreak
3363f5e6db JS: add query for Express-HBS LFR 2021-02-01 18:01:34 +05:30
Mathias Vorreiter Pedersen
c747914ef2 C++: Add sscanf and fscanf model implementations. 2021-02-01 12:54:59 +01:00
Taus
b8b42eaea3 Merge pull request #5064 from RasmusWL/fix-missing-override
Python: Add missing override annotation
2021-02-01 12:37:38 +01:00
Mathias Vorreiter Pedersen
61125b4bf2 C++: Address review comments. 2021-02-01 12:15:57 +01:00
Taus
3179546b8c Merge pull request #5058 from yoff/python-add-consistency-checks-to-all-dataflow-test-folders
Python: Add consistency checks to all data-flow test folders
2021-02-01 11:41:31 +01:00
Rasmus Wriedt Larsen
4ef9a6cf2a Python: Add missing override annotation 2021-02-01 11:28:41 +01:00
Rasmus Wriedt Larsen
2a9e66a667 Python: Fix problem after merge conflict 2021-02-01 11:17:04 +01:00
Rasmus Wriedt Larsen
4b6a59a126 Python: Apply code-review suggestion
Co-authored-by: yoff <lerchedahl@gmail.com>
2021-02-01 11:12:32 +01:00
Esben Sparre Andreasen
9678534f25 JS: add tests for some syntactic XSS vector obfuscations 2021-02-01 10:20:23 +01:00
Tamas Vajk
1b6cb340d3 C#: Report IndexerProperty as Property in the PrintAST query 2021-02-01 10:08:51 +01:00
Erik Krogh Kristensen
aae69c6537 update expected output 2021-02-01 09:33:52 +01:00
Tamás Vajk
aa35fcafeb Merge pull request #5018 from tamasvajk/feature/csharp9-binary-pattern-cfg
C#: Extract 'and' and 'or' patterns
2021-02-01 09:17:52 +01:00
Rasmus Lerchedahl Petersen
27fd46b855 Python: Update test expectation 2021-02-01 08:55:20 +01:00
Rasmus Lerchedahl Petersen
6730396ad6 Python: Remove tests from non-test directory 2021-02-01 08:52:00 +01:00
Mathias Vorreiter Pedersen
6c3f44bba8 C++: Add more memcpy, memset, strcat and strcpy models. Also refine which strcpy functions can live in the std namespace. 2021-02-01 08:44:10 +01:00
ihsinme
2b946aee5a Update WrongInDetectingAndHandlingMemoryAllocationErrors.ql 2021-01-31 15:21:54 +03:00
ihsinme
b7df18b97e Update AccessOfMemoryLocationAfterEndOfBufferUsingStrlen.ql 2021-01-31 15:16:40 +03:00
Geoffrey White
064d89735b Merge pull request #5046 from MathiasVP/model-more-pure-functions
C++: Model more pure functions
2021-01-29 22:05:48 +00:00
Geoffrey White
03922aa1f5 C++: Exclude custom vprintf implementations. 2021-01-29 21:20:36 +00:00
Rasmus Lerchedahl Petersen
f6fa1276a6 Python: Add consistency checks
to all data-flow test floders
2021-01-29 21:28:43 +01:00
Rasmus Lerchedahl Petersen
05a138694d Python: Fix crashing test 2021-01-29 21:12:44 +01:00
Rasmus Lerchedahl Petersen
7f1affa122 Python: UnpackingAssignment -> IterableUnpacking 2021-01-29 17:44:53 +01:00
Rasmus Lerchedahl Petersen
182d435dc6 Python: Replace comprehension read-step by for
read-step. Add a version targetting sequence nodes.
2021-01-29 17:31:59 +01:00
Tamas Vajk
7e9913a8a7 Fix failing pattern tests 2021-01-29 17:25:44 +01:00
Rasmus Wriedt Larsen
94e7980ca4 Merge branch 'main' into port-url-redirect-query 2021-01-29 16:22:50 +01:00
Rasmus Wriedt Larsen
ef831bb16f Python: Fix tornado redirect QLdoc 2021-01-29 16:21:39 +01:00
Rasmus Wriedt Larsen
9c01aa2304 Python: Add modeling for django.shortcuts.redirect 2021-01-29 15:41:00 +01:00
Rasmus Wriedt Larsen
ff2f2b5792 Python: Add django.shortcuts.redirect test 2021-01-29 15:37:20 +01:00
Tamas Vajk
a9c51e7300 Fix missing pattern matching completions 2021-01-29 15:16:30 +01:00
CodeQL CI
c9537f2639 Merge pull request #5029 from asgerf/js/silence-angular-template-fps
Approved by erik-krogh
2021-01-29 06:06:37 -08:00
Taus Brock-Nannestad
817a142abc Python: Add getLocation to EssaVariable.
This may be a slightly "bogus" location to provide for ESSA variables,
but it can be useful for debugging. For instance, where previously you
might just see

```
SSA variable x | ...
SSA variable x | ...
SSA variable x | ...
SSA variable x | ...
SSA variable x | ...
SSA variable x | ...
```

where each instance of `SSA variable x` was just a bare string, now
each occurrence will tell you (via its location) _where_ this variable
is being (re)defined.
2021-01-29 14:45:12 +01:00
Taus
cb195a0dc4 Merge pull request #4752 from yoff/python-dataflow-unpacking-assignment
Python: Dataflow, unpacking assignment
2021-01-29 14:15:28 +01:00
Taus
be5b7bb4c4 Merge pull request #5022 from yoff/python-split-lambdas
Python: Callable for lambdas
2021-01-29 14:12:26 +01:00
Mathias Vorreiter Pedersen
92a5a2a06a C++: Solve merge conflicts by merging the two test.c test files. 2021-01-29 13:34:19 +01:00
Mathias Vorreiter Pedersen
d5f1c19152 Merge branch 'main' into ihsinme-patch-221 2021-01-29 13:05:07 +01:00
Erik Krogh Kristensen
c9ec983cd8 add js/client-side-unvalidated-url-redirection test for script tags inside react code 2021-01-29 12:50:43 +01:00
Erik Krogh Kristensen
39591687ba add js/code-injection sink for script tags in React 2021-01-29 12:50:17 +01:00
Artem Smotrakov
59f48ecea3 Removed LocalUserInput in JexlInjectionLib.ql 2021-01-29 12:38:51 +01:00
Luke Cartey
76c9b6466e Reformat TaintTrackingUtil.qll with more recent CodeQL CLI 2021-01-29 11:27:30 +00:00
Tamas Vajk
91152d3a65 Add additional tests to delegate call data flow 2021-01-29 12:02:11 +01:00
Tamas Vajk
191962f64c C#: Add data flow 'getARuntimeTarget' predicate to 'FunctionPointerCall' 2021-01-29 12:01:38 +01:00
Tom Hvitved
bf5851f1c2 C#: Reduce caching in SsaImplCommon.qll 2021-01-29 11:42:52 +01:00
ihsinme
bdbf5a4fae Apply suggestions from code review
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2021-01-29 13:41:45 +03:00
Tom Hvitved
1a507ff497 C#: Remove Cached module from SsaImplCommon.qll 2021-01-29 10:52:42 +01:00
Geoffrey White
50f2557dd2 Merge pull request #5043 from MathiasVP/uniform-treatment-of-params-and-qualifiers-in-model-dataflow
C++: Uniform treatment of parameters and qualifiers in model dataflow
2021-01-29 09:48:07 +00:00
Erik Krogh Kristensen
3f1e81533c support html attribute concatenations with single quotes 2021-01-29 10:37:37 +01:00
ihsinme
c8eeb5f73e Update WrongInDetectingAndHandlingMemoryAllocationErrors.ql 2021-01-29 11:51:15 +03:00
luchua-bc
ff1ed3a012 Revamp the query to use three configurations to detect password hash without salt 2021-01-29 03:39:02 +00:00
Mathias Vorreiter Pedersen
339c4c6ce0 C++: Model more pure functions. 2021-01-28 19:37:53 +01:00
Geoffrey White
7d9ebaf9d8 Merge pull request #5040 from MathiasVP/strset-and-strtok-models
C++: Strset and strtok model implementations
2021-01-28 18:34:06 +00:00
Geoffrey White
768be9ec2c Merge pull request #5041 from ihsinme/ihsinme-patch-198
CPP: Improve cpp/memory-leak-on-failed-call-to-realloc
2021-01-28 18:29:24 +00:00
Mathias Vorreiter Pedersen
23eb4d2009 C++: Fix isParameterDeref typo. 2021-01-28 18:29:30 +01:00
Mathias Vorreiter Pedersen
75aa1e8a3b C++: Respond to review comments. 2021-01-28 16:39:11 +01:00
Geoffrey White
02d60a26eb Merge pull request #5037 from github/igfoo/decltype
C++: decltypes may have multiple expressions
2021-01-28 14:44:53 +00:00
Shati Patel
1c56c30eba Merge pull request #5028 from shati-patel/docs/update-footer
Docs: Update copyright date in footer
2021-01-28 13:11:43 +00:00
Tom Hvitved
59d87e2570 Merge pull request #4557 from hvitved/csharp/dataflow/parameters
C#: Simpler data-flow modelling of parameters
2021-01-28 14:02:42 +01:00
ihsinme
f94a7fc2f0 Update MemoryLeakOnFailedCallToRealloc.ql 2021-01-28 15:47:38 +03:00
Mathias Vorreiter Pedersen
5a420f2bae C++: Use the new predicates for uniform treatment of parameters and qualifiers in model dataflow. 2021-01-28 13:33:08 +01:00
ihsinme
8ed28157e1 Rename cpp/ql/test/experimental/query-tests/Security/CWE/CWE-788/semmle/tests/AccessOfMemoryLocationAfterEndOfBufferUsingStrlen.expected to cpp/ql/test/experimental/query-tests/Security/CWE/CWE-788/semmle/tests/AccessOfMemoryLocationAfterEndOfBufferUsingStrlen/AccessOfMemoryLocationAfterEndOfBufferUsingStrlen.expected 2021-01-28 15:28:52 +03:00
ihsinme
f65ec97ac2 Rename cpp/ql/test/experimental/query-tests/Security/CWE/CWE-788/semmle/tests/test.c to cpp/ql/test/experimental/query-tests/Security/CWE/CWE-788/semmle/tests/AccessOfMemoryLocationAfterEndOfBufferUsingStrlen/test.c 2021-01-28 15:28:34 +03:00
ihsinme
8880b38b1f Rename cpp/ql/test/experimental/query-tests/Security/CWE/CWE-788/semmle/tests/AccessOfMemoryLocationAfterEndOfBufferUsingStrlen.qlref to cpp/ql/test/experimental/query-tests/Security/CWE/CWE-788/semmle/tests/AccessOfMemoryLocationAfterEndOfBufferUsingStrlen/AccessOfMemoryLocationAfterEndOfBufferUsingStrlen.qlref 2021-01-28 15:28:15 +03:00
Rasmus Wriedt Larsen
b6007cf324 Merge pull request #5023 from yoff/python-unify-synthetic-post-update-nodes
Python: Only generate one post-update node, even if there are multiple reasons for doing so.
2021-01-28 13:11:50 +01:00
Rasmus Wriedt Larsen
173012578e Python: Add missing type-tracking step for django.views
Easy to overlook, and will onyl be caught by tests if they use `import
parent.thing` and not `from parent import thing`
2021-01-28 12:10:42 +01:00
Rasmus Wriedt Larsen
54725ccbb9 Python: Support full-path import of Django View class
requestHandler still MISSING :(
2021-01-28 12:10:40 +01:00
Rasmus Wriedt Larsen
61d69f2cc8 Python: Add test for full-path import of Django View class 2021-01-28 12:10:39 +01:00
ihsinme
2b4296feb1 Update MemoryLeakOnFailedCallToRealloc.ql 2021-01-28 13:38:26 +03:00
ihsinme
cf565970e3 Merge pull request #1 from github/main
update fork
2021-01-28 13:26:11 +03:00
yoff
1068edeb28 Merge pull request #5038 from RasmusWL/import-fix
Python: Fix too many results from DataFlow::importNode
2021-01-28 11:25:17 +01:00
Mathias Vorreiter Pedersen
2c70106d2d Merge pull request #5009 from ihsinme/ihsinme-patch-219
CPP: add query for CWE-788 Access of memory location after the end of a buffer using strncat.
2021-01-28 11:10:30 +01:00
Anders Schack-Mulligen
bbdd7c9b57 Merge pull request #4963 from joefarebrother/guava-collections
Java: Add flow steps for Guava collection utilities
2021-01-28 11:01:03 +01:00
Mathias Vorreiter Pedersen
7affbfc6cb C++: Add tests. 2021-01-28 10:57:39 +01:00
Mathias Vorreiter Pedersen
6255662114 C++: Add two new model implementation classes. 2021-01-28 10:57:30 +01:00
Tom Hvitved
e6f81bcf0b C#: Update expected test output 2021-01-28 10:34:50 +01:00
Tom Hvitved
6ee5cdf2b2 C#: Simpler data-flow modelling of parameters 2021-01-28 10:34:47 +01:00
Jonas Jensen
69ce24d4b8 Merge pull request #5035 from MathiasVP/implied-deref-flow
C++: Implied dataflow models
2021-01-28 09:35:58 +01:00
Tom Hvitved
65ea01e145 Merge pull request #4999 from hvitved/csharp/dataflow/phi-input
C#: Adjust flow into phi nodes
2021-01-28 09:07:01 +01:00
luchua-bc
ab7d257569 Add more cases and change EC to 256 bits 2021-01-28 04:06:27 +00:00
luchua-bc
2ac7b4bab4 Update qldoc 2021-01-28 04:06:27 +00:00
luchua-bc
058f3af4b2 Refactor the hasShortSymmetricKey method 2021-01-28 04:06:27 +00:00
luchua-bc
cbaee937d0 Optimize the query 2021-01-28 04:06:27 +00:00
luchua-bc
cfc950f803 Query for weak encryption: Insufficient key size 2021-01-28 03:25:15 +00:00
luchua-bc
6a93099b64 Simplify the query and update qldoc 2021-01-28 03:02:53 +00:00
Rasmus Lerchedahl Petersen
0e0b18c214 Python: Adjust comment based on review. 2021-01-28 01:09:03 +01:00
Robert Marsh
0addce5be4 Merge pull request #5036 from MathiasVP/memcpy-models
C++: Model aliasing of memcpy-like functions and include more functions
2021-01-27 14:38:08 -08:00
Rasmus Lerchedahl Petersen
ae2c122159 Python: Small refactor
- align synthetic pre-update nodes with synthetic post -update nodes
- move the classes into the modules
- rename modules after the new main class (eliding "needs")
2021-01-27 23:15:50 +01:00
Mathias Vorreiter Pedersen
24f76f9a17 C++: Accept test changes. 2021-01-27 21:57:12 +01:00
Rasmus Lerchedahl Petersen
2120868939 Python: format 2021-01-27 19:48:01 +01:00
yoff
2c5da85e3b Update python/ql/src/semmle/python/dataflow/new/internal/DataFlowPrivate.qll
Co-authored-by: Taus <tausbn@github.com>
2021-01-27 19:43:40 +01:00
Rasmus Wriedt Larsen
5646af56dd Python: Fix too many results from DataFlow::importNode 2021-01-27 19:11:55 +01:00
Rasmus Wriedt Larsen
0d42e546a0 Python: Add deep import chain to import-helper tests 2021-01-27 19:09:09 +01:00
Rasmus Wriedt Larsen
44bb41e84b Python: Add extra type-tracking test for "long" import chain
While trying to debug an other problem related to full import of django view, I
stumbled upon this oddity. (yikes)
2021-01-27 19:06:51 +01:00
Mathias Vorreiter Pedersen
c90dc62cc4 C++: Autoformat. 2021-01-27 18:57:09 +01:00
Mathias Vorreiter Pedersen
aec18e7123 C++: Add mempcpy to MemcpyFunction model class. 2021-01-27 18:12:32 +01:00
Mathias Vorreiter Pedersen
5aff5c3254 C++: Add AliasFunction model to MemcpyFunction. 2021-01-27 18:12:02 +01:00
Mathias Vorreiter Pedersen
066f83630d C++: bcopy can never be in the std namespace. 2021-01-27 18:07:14 +01:00
Ian Lynagh
3880b48736 C++: Add an upgrade script 2021-01-27 16:31:56 +00:00
Tamas Vajk
ca5e3b4489 Add new .stats file 2021-01-27 17:18:50 +01:00
Ian Lynagh
307bef0ec3 C++: decltypes may have multiple expressions 2021-01-27 16:06:42 +00:00
Mathias Vorreiter Pedersen
52e2a69db9 C++: Accept test changes. 2021-01-27 16:56:37 +01:00
Mathias Vorreiter Pedersen
32b5c7fe06 C++: Model implied dataflow 2021-01-27 16:53:21 +01:00
Tamas Vajk
034d0a7b10 Add DB upgrade folder for binary patterns 2021-01-27 16:47:15 +01:00
Tamas Vajk
552e11de19 Fix change note date 2021-01-27 16:42:03 +01:00
Tamas Vajk
669e207600 Fix sign analysis expected file 2021-01-27 16:40:56 +01:00
Geoffrey White
a4d7bfbb2b Merge pull request #5031 from MathiasVP/remove-linear-scan-of-functions-2
C++: Remove more linear scans
2021-01-27 14:29:27 +00:00
Tamas Vajk
d1cc2cc999 Remove code duplication 2021-01-27 13:52:12 +01:00
Tamas Vajk
5157236999 Fix doc comments 2021-01-27 13:49:13 +01:00
ihsinme
bdfdcbd673 Update WrongInDetectingAndHandlingMemoryAllocationErrors.ql 2021-01-27 15:48:18 +03:00
Tamas Vajk
10518744cf C#: Remove expressions inside attributes from CFG 2021-01-27 13:20:06 +01:00
Mathias Vorreiter Pedersen
c61dec1dff C++: Remove more linear scans. 2021-01-27 13:17:47 +01:00
ihsinme
16d058f498 Update WrongInDetectingAndHandlingMemoryAllocationErrors.ql 2021-01-27 15:06:57 +03:00
ihsinme
5d163b4c15 Update WrongInDetectingAndHandlingMemoryAllocationErrors.qhelp 2021-01-27 15:05:58 +03:00
ihsinme
25de82c78c Apply suggestions from code review
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2021-01-27 15:05:01 +03:00
ihsinme
bec0064396 Update test.cpp 2021-01-27 14:54:47 +03:00
CodeQL CI
6d952bda27 Merge pull request #5020 from asgerf/js/getaqlclass-test
Approved by esbena
2021-01-27 03:48:57 -08:00
ihsinme
8737c1442b Update WrongInDetectingAndHandlingMemoryAllocationErrors.cpp 2021-01-27 14:48:23 +03:00
haby0
81c56b9bed Update java/ql/src/Security/CWE/CWE-652/XQueryInjection.ql
Co-authored-by: Chris Smowton <smowton@github.com>
2021-01-27 19:47:12 +08:00
haby0
31deca016f Update java/ql/src/Security/CWE/CWE-652/XQueryInjection.ql
Co-authored-by: Chris Smowton <smowton@github.com>
2021-01-27 19:46:45 +08:00
haby0
ca2e6587fe Update java/ql/src/Security/CWE/CWE-652/XQueryInjection.qhelp
Co-authored-by: Chris Smowton <smowton@github.com>
2021-01-27 19:46:15 +08:00
CodeQL CI
bb423828de Merge pull request #5025 from asgerf/js/slow-xml-parent-upgrade-script
Approved by erik-krogh
2021-01-27 03:27:43 -08:00
yoff
f2241e04e5 Apply suggestions from code review
Co-authored-by: Taus <tausbn@github.com>
2021-01-27 12:15:35 +01:00
Geoffrey White
988c1bc044 Merge pull request #5026 from MathiasVP/remove-linear-scan-of-functions
C++: Remove linear scan of functions table
2021-01-27 11:15:02 +00:00
ihsinme
19b7d46099 Update test.c 2021-01-27 14:06:53 +03:00
Shati Patel
4ba9d10b9a Docs: Update copyright date in footer 2021-01-27 11:03:46 +00:00
Asger Feldthaus
1637b72092 JS: Ignore Angular templates in a few non-security queries 2021-01-27 11:02:19 +00:00
intrigus
d3e6e594b2 Java: Improve QLDoc 2021-01-27 11:57:32 +01:00
intrigus
bdba7e14fe Java: Switch to data flow 2021-01-27 11:54:40 +01:00
Tamas Vajk
e24e5b13f5 C#: Improve CFG to handle 'and' and 'or' patterns 2021-01-27 11:52:59 +01:00
Mathias Vorreiter Pedersen
3604557e62 C++: Remove linear scan in isSVariant. 2021-01-27 11:47:45 +01:00
Tamas Vajk
4685fc0a32 C#: Extract binary patterns 2021-01-27 11:27:52 +01:00
ihsinme
68eba11dbf Update AccessOfMemoryLocationAfterEndOfBufferUsingStrncat.ql 2021-01-27 13:16:56 +03:00
ihsinme
aebf7bdff4 Update test.c 2021-01-27 13:12:48 +03:00
Asger Feldthaus
5a89fa3f67 JS: Fix performance issue in upgrade script 2021-01-27 10:10:37 +00:00
ihsinme
885d26805f Update AccessOfMemoryLocationAfterEndOfBufferUsingStrlen.expected 2021-01-27 12:47:51 +03:00
ihsinme
9a85b761a1 Update test.c 2021-01-27 12:46:10 +03:00
Tom Hvitved
39977e9a43 Merge pull request #4724 from hvitved/csharp/cfg/not-pattern
C#: Implement CFG for `not` patterns
2021-01-27 10:12:31 +01:00
Anders Schack-Mulligen
0381190a30 Merge pull request #5021 from hmakholm/qlpack-test
Add "tests" fields to test qlpacks
2021-01-27 09:23:35 +01:00
Tom Hvitved
214505c4dc Merge pull request #5016 from hvitved/csharp/exception-dispatch-info
C#: Teach CFG about `ExceptionDispatchInfo::Throw`
2021-01-27 08:36:51 +01:00
Rasmus Lerchedahl Petersen
5d62a56ed8 Python: Remove debug function 2021-01-27 08:24:11 +01:00
haby0
b5ae417851 *)update CWE-652 qhelp references 2021-01-27 10:19:04 +08:00
haby0
b76854a384 *)add CWE-652 test case 2021-01-27 10:14:33 +08:00
Rasmus Lerchedahl Petersen
d18c1602cd Python: autoformat 2021-01-27 01:25:38 +01:00
Rasmus Lerchedahl Petersen
d29fdda779 Python: Only generate one post-update node,
even if there are multiple reasons for doing so.
Solves `uniqueNodeToString` inconsistencies
(and probably saves quite a lot of nodes).
2021-01-27 01:20:51 +01:00
Robert Marsh
8919e5546b C++ Use dontcare instead of one-use exists
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2021-01-26 14:12:49 -08:00
ihsinme
5d5cd4fde5 Update AccessOfMemoryLocationAfterEndOfBufferUsingStrncat.ql 2021-01-27 00:10:04 +03:00
ihsinme
f074564dc1 Apply suggestions from code review
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2021-01-27 00:00:18 +03:00
ihsinme
636fe73f40 Update AccessOfMemoryLocationAfterEndOfBufferUsingStrlen.ql 2021-01-26 23:52:18 +03:00
ihsinme
fc9d219057 Update AccessOfMemoryLocationAfterEndOfBufferUsingStrlen.ql 2021-01-26 23:50:54 +03:00
ihsinme
de0bbc8826 Apply suggestions from code review
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2021-01-26 23:47:07 +03:00
Rasmus Lerchedahl Petersen
9b13834d28 Python: small refactor 2021-01-26 21:17:59 +01:00
Rasmus Lerchedahl Petersen
d3e0e84c37 Python: Separate callable for lambdas
Since lambdas are split, but their children are not,
we use the Function as the callable.
2021-01-26 21:17:59 +01:00
Rasmus Lerchedahl Petersen
4526a1dd2f Python: test for split lambda 2021-01-26 21:17:59 +01:00
yoff
cd85cf1645 Update python/ql/src/semmle/python/dataflow/new/internal/DataFlowPrivate.qll 2021-01-26 19:16:54 +01:00
yoff
500ea12224 Apply suggestions from code review
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-01-26 19:14:46 +01:00
Henning Makholm
54f00de3e0 Add "tests" fields to test qlpacks
This will allow `codeql resolve tests --ignore-dubious-cases`
(and thus the VSCode extension) to recognize all `.ql` files in those
packs as test cases, even if they don't have accompanying `.expected`
files.

CLI versions prior to 2.1.0 will choke on this, but it's almost 10
months since that came out.
2021-01-26 18:15:22 +01:00
Mathias Vorreiter Pedersen
04a3c3d29c Merge pull request #4953 from ihsinme/ihsinme-patch-207
CPP: Add query for CWE-14 compiler removal of code to clear buffers.
2021-01-26 18:13:18 +01:00
Mathias Vorreiter Pedersen
416aa49d99 C++: Capitalize alert message. 2021-01-26 17:24:03 +01:00
Asger Feldthaus
c69a051292 JS: Add test that depends on getAQlClass 2021-01-26 15:16:27 +00:00
Mathias Vorreiter Pedersen
aec0e9808b Merge pull request #5017 from rvermeulen/patch-2
C++: Correct pointer to data member example
2021-01-26 14:56:57 +01:00
Rasmus Wriedt Larsen
902bade5ae Merge pull request #5015 from yoff/python-add-missing-postupdate-nodes
Python: add missing postupdate nodes
2021-01-26 14:39:29 +01:00
Remco Vermeulen
1834403148 Replace HTTP entity
The code formatting operator correctly translate to HTTP entities.
2021-01-26 14:14:42 +01:00
Remco Vermeulen
8c09032d1d Correct access specifier
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2021-01-26 13:23:43 +01:00
Remco Vermeulen
932ee968e0 Correct pointer to data member example
The class `PointerToMemberType` is preceded by an example that doesn't define the variable `c` used to access a data member.
2021-01-26 13:08:28 +01:00
CodeQL CI
76e1e4d668 Merge pull request #4712 from asgerf/js/api-graph-tweaks
Approved by max-schaefer
2021-01-26 04:04:05 -08:00
Francis Alexander
19872e9aed More Feedback integration 2021-01-26 17:24:17 +05:30
Taus
4c0f54f5d3 Merge pull request #5007 from yoff/python-disregard-comp-args 2021-01-26 12:53:33 +01:00
Rasmus Lerchedahl Petersen
e253855999 Python: Add comment about reverse reads. 2021-01-26 12:11:21 +01:00
CodeQL CI
0be0929693 Merge pull request #4958 from asgerf/js/angular2
Approved by erik-krogh
2021-01-26 02:53:33 -08:00
Rasmus Lerchedahl Petersen
e44f1813fa Python: Add TODO comment 2021-01-26 11:29:14 +01:00
Tamás Vajk
e4ed050c87 Merge pull request #4970 from tamasvajk/feature/extraction-errors
C#: Fix extraction errors
2021-01-26 11:28:39 +01:00
Rasmus Lerchedahl Petersen
2c58643fd1 Python: Test for parameters without nodes. 2021-01-26 11:28:31 +01:00
Tamás Vajk
3ece8c3a01 Merge pull request #4835 from tamasvajk/feature/cil-fnptr
C#: Extract function pointer types from CIL
2021-01-26 11:28:02 +01:00
Asger Feldthaus
e6d9cd1905 JS: Add clause to getReturn/getInstance 2021-01-26 10:14:12 +00:00
CodeQL CI
c1726ed868 Merge pull request #5014 from RasmusWL/typetracking-test-track-self
Approved by tausbn
2021-01-26 02:10:52 -08:00
Asger Feldthaus
d59ccb7687 JS: Remove unhelpful mat-table load step 2021-01-26 09:27:48 +00:00
Asger Feldthaus
89225e222c JS: Remove confusing comment 2021-01-26 09:25:12 +00:00
Tom Hvitved
71d25c1f8b C#: Fix join-orders in ControlFlowTree::last() 2021-01-26 09:58:01 +01:00
Rasmus Lerchedahl Petersen
7b9ca7171a Python: update test expectations 2021-01-26 09:47:48 +01:00
Rasmus Lerchedahl Petersen
dacc21d0b5 Python: update test expectation 2021-01-26 09:45:41 +01:00
Tom Hvitved
cd8155c201 C#: Teach CFG about ExceptionDispatchInfo::Throw 2021-01-26 09:16:53 +01:00
Tom Hvitved
07a96c3596 C#: Add CFG tests for ExceptionDispatchInfo::Throw 2021-01-26 09:01:06 +01:00
luchua-bc
fee0b94cd4 Use isRequestGetParamMethod as the source 2021-01-26 04:41:44 +00:00
Robert Marsh
44bc6d7fdb C++/C#: add NonPhiMemoryOperand union type
This fixes a performance issue where the whole MemoryOperand table was
scanned in some predicates that used only NonPhiMemoryOperand
2021-01-25 17:03:19 -08:00
yoff
09bb3001d6 Apply suggestions from code review
Co-authored-by: Taus <tausbn@github.com>
2021-01-25 21:58:20 +01:00
yoff
7ba0939239 Merge pull request #4995 from RasmusWL/tornado-model-http-sinks
Python: model HTTP sink in Tornado
2021-01-25 21:53:44 +01:00
Francis Alexander
985d3d469a PR feedback integration 2021-01-25 23:26:36 +05:30
Rasmus Wriedt Larsen
91caa13f48 Merge pull request #5004 from github/erik-krogh/ignore-venv
add .venv/ to .gitignore
2021-01-25 18:06:28 +01:00
Joe Farebrother
d69ecde5c1 Java: Add additional flow steps for guava collection methods and more unit tests 2021-01-25 16:37:40 +00:00
Joe Farebrother
7e11d8ed07 Java: Add modelling for guava Sets 2021-01-25 16:37:40 +00:00
Joe Farebrother
d1427fcd93 Java: Add modelling for Guava's collection classes 2021-01-25 16:37:40 +00:00
Rasmus Lerchedahl Petersen
96b7f75905 Python: add postupdate nodes for kwargs
drops remaining reverse read failures on saltstack.
2021-01-25 17:34:49 +01:00
Rasmus Wriedt Larsen
a8186be2fa Python: Add test of type-tracking self in methods 2021-01-25 17:20:11 +01:00
Rasmus Lerchedahl Petersen
ad39bfb2ff Python: Add postupdate nodes for subscripts.
This drops reverse read inconsistencies on saltstack from 14909 to 1353.
2021-01-25 17:01:25 +01:00
Rasmus Lerchedahl Petersen
361bee851a Python: Tests inspired by reverse read check 2021-01-25 17:01:25 +01:00
Rasmus Lerchedahl Petersen
4ff2c6d85a Python: fix test expectation
probably a copy-paste error..
2021-01-25 16:49:51 +01:00
Tom Hvitved
7c9a6064cf C#: Get rid of ReadKind 2021-01-25 16:20:14 +01:00
CodeQL CI
4601eb9c7c Merge pull request #4706 from max-schaefer/issue-247
Approved by asgerf
2021-01-25 07:11:35 -08:00
Tom Hvitved
6ffeaf8c2a C#: Adjust flow into phi nodes 2021-01-25 15:44:37 +01:00
Tom Hvitved
38b0f743cb C#: Add test that illustrates problem with flow through phi nodes 2021-01-25 14:20:27 +01:00
Artem Smotrakov
8d701e604a Simplified JexlInjectionLib.qll
- Merged multiple method definitions to DirectJexlEvaluationMethod
- Don't use TaintPropagatingJexlMethodCall field in JexlInjectionConfig
- Better variable names in JexlEvaluationSink
2021-01-25 14:17:51 +01:00
Tom Hvitved
36ad6b3432 Merge pull request #5001 from hvitved/csharp/ssa/read-kind
C#: Remove `ReadKind` from the shared SSA library
2021-01-25 14:11:54 +01:00
Tom Hvitved
221aebc833 C#: Fix bug in AssignOperationWithExpandedAssignment::last 2021-01-25 14:01:31 +01:00
alexet
355edcb136 Csharp: Reduce BDD usage. 2021-01-25 13:52:17 +01:00
Tom Hvitved
0543e34812 C#: Address review comment 2021-01-25 13:52:17 +01:00
Tom Hvitved
e0c7f32282 C#: Add relational pattern CFG test 2021-01-25 13:52:17 +01:00
Tom Hvitved
063733ad52 C#: Implement CFG for not patterns 2021-01-25 13:52:17 +01:00
Tom Hvitved
ab85b2c2d2 C#: Add is not null guards test 2021-01-25 13:52:17 +01:00
Tom Hvitved
0080357153 C#: Add unary pattern CFG tests 2021-01-25 13:52:17 +01:00
Erik Krogh Kristensen
0ba610f7db Merge pull request #5013 from erik-krogh/asmWhitespace
JS: remove benign result for js/whitespace-contradicts-precedence related to " | 0" expressions
2021-01-25 13:29:07 +01:00
haby0
42f55e1ebe Merge pull request #1 from smowton/smowton/admin/rewrite-xquery
Rewrite XQuery injection to use an additional taint step instead of multiple configurations
2021-01-25 19:49:20 +08:00
Chris Smowton
d34233b44f Rewrite XQuery injection to use an additional taint step instead of multiple configurations.
Also remove a needless barrier -- the method in question doesn't conduct taint by default, so excluding particular instances of that call is not necessary.
2021-01-25 11:18:45 +00:00
haby0
16308fe557 Update java/ql/src/Security/CWE/CWE-652/XQueryInjectionLib.qll
Co-authored-by: Chris Smowton <smowton@github.com>
2021-01-25 19:16:18 +08:00
haby0
14a23eed4f Update java/ql/src/Security/CWE/CWE-652/XQueryInjectionLib.qll
Co-authored-by: Chris Smowton <smowton@github.com>
2021-01-25 19:15:59 +08:00
Tom Hvitved
e7b43e50b6 C#: Remove ReadKind from the shared SSA library 2021-01-25 12:09:34 +01:00
Tamas Vajk
eac69c1674 Add DB upgrade folder for CIL fnptr support 2021-01-25 11:34:47 +01:00
Tamas Vajk
b434a0f395 Add change notes 2021-01-25 11:27:13 +01:00
Tom Hvitved
1c84455a6d Merge pull request #5003 from hvitved/csharp/remove-getaqlclass
C#: Remove uses of `getAQlClass()`
2021-01-25 10:57:04 +01:00
Erik Krogh Kristensen
d86705fe7a remove benign result for js/whitespace-contradicts-precedence related to " | 0" expressions 2021-01-25 10:43:39 +01:00
Jonas Jensen
1b3d69d617 Merge pull request #4784 from MathiasVP/mathiasvp/reverse-read-take-3
C++: Support longer access paths in IR field flow
2021-01-25 10:36:03 +01:00
Tom Hvitved
c235462f7d C++: Sync IRType.qll 2021-01-25 09:43:57 +01:00
ihsinme
b899229298 Add files via upload 2021-01-25 00:33:54 +03:00
ihsinme
9ae503a5a8 Add files via upload 2021-01-25 00:30:35 +03:00
ihsinme
20e19ec467 Add files via upload 2021-01-25 00:09:55 +03:00
ihsinme
9071ba2f99 Add files via upload 2021-01-25 00:06:19 +03:00
ihsinme
fcd532522d Add files via upload 2021-01-24 22:36:42 +03:00
ihsinme
20d1b24e9c Add files via upload 2021-01-24 22:35:11 +03:00
Francis Alexander
75b79039a1 Example fixes 2021-01-24 20:46:37 +05:30
Rasmus Lerchedahl Petersen
89e56707c3 Python: Omit all unresolved parameter nodes.
Drops the results further to 139.
2021-01-24 16:16:07 +01:00
Francis Alexander
81e372d078 Formatting changes 2021-01-24 20:44:21 +05:30
Rasmus Lerchedahl Petersen
baf0917524 On saltstack this drops the number of consistency errors
of type uniqueEnclosingCallable from 4026 to 614.
2021-01-24 15:30:59 +01:00
Francis Alexander
a64fc2b24e Java: Queries to detect remote source flow to CORS header 2021-01-24 18:58:39 +05:30
Artem Smotrakov
71e5cb45d3 Simplified method and class definitions for JEXL 2021-01-23 19:50:16 +01:00
Artem Smotrakov
03348b18b5 Simplified TaintPropagatingJexlMethodCall 2021-01-23 19:41:14 +01:00
Artem Smotrakov
a47147bc5e Simplify sinks in JexlInjectionLib.qll 2021-01-23 19:22:43 +01:00
Artem Smotrakov
28ebbee61d Added TaintPropagatingJexlMethodCall class 2021-01-23 17:42:04 +01:00
haby0
0b326aae20 *)update XQueryInjectionLib.qll 2021-01-23 18:27:38 +08:00
haby0
44d99f8cd4 *)update XQueryInjection.ql 2021-01-23 18:26:58 +08:00
haby0
ec4c155043 *)update XQueryInjection.qhelp 2021-01-23 18:26:15 +08:00
Rasmus Lerchedahl Petersen
0d20a4cb4a Python: Simplify modelling 2021-01-22 19:40:34 +01:00
Rasmus Lerchedahl Petersen
f948ef8f27 Merge branch 'main' of github.com:github/codeql into python-dataflow-unpacking-assignment 2021-01-22 16:26:48 +01:00
CodeQL CI
527c41520e Merge pull request #4951 from esbena/js/reintroduce-server-crash
Approved by erik-krogh
2021-01-22 06:37:50 -08:00
Tom Hvitved
6fc14976cf C#: Remove uses of getAQlClass() 2021-01-22 15:00:45 +01:00
Erik Krogh Kristensen
b3497191b1 add .venv/ to .gitignore 2021-01-22 14:44:18 +01:00
Mathias Vorreiter Pedersen
87b738d48c Merge pull request #5002 from MathiasVP/fix-PrivateCleartextWrite-format
C++: Fix path-problem format in cpp/private-cleartext-write
2021-01-22 14:28:03 +01:00
Mathias Vorreiter Pedersen
b4f9b1590d C++: Restore lost result on git/git. We lost the result in a00bd7ae02 because the added check for type T to type T* conversion didn't handle const qualifiers. 2021-01-22 14:20:18 +01:00
Esben Sparre Andreasen
3f3962f7a9 Update javascript/ql/src/Security/CWE-730/examples/server-crash.GOOD-B.js
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2021-01-22 14:03:21 +01:00
Mathias Vorreiter Pedersen
682b246441 C++: Fix path-problem format. 2021-01-22 13:40:44 +01:00
Esben Sparre Andreasen
718f6eb3fd JS: update and prettify examples 2021-01-22 13:17:38 +01:00
Asger Feldthaus
b36593a76b JS: Fix broken link tag 2021-01-22 10:11:16 +00:00
Asger Feldthaus
0ffa720d3b JS: Capitalize other enum constants 2021-01-22 09:48:11 +00:00
Asger Feldthaus
c257f6617f JS: Capitalize enum members in ScopeKind and TopLevelKind 2021-01-22 09:33:25 +00:00
Mathias Vorreiter Pedersen
7bc461aeb2 Merge pull request #4990 from geoffw0/cpp401b
C++: Further improvements to experimental query cpp/memory-leak-on-failed-call-to-realloc
2021-01-22 09:51:10 +01:00
CodeQL CI
0e059cea56 Merge pull request #5000 from erik-krogh/redosOnlyNonMin
Approved by esbena
2021-01-21 15:29:03 -08:00
Erik Krogh Kristensen
11f35a5193 Update javascript/ql/src/semmle/javascript/security/performance/ReDoSUtil.qll
Co-authored-by: Esben Sparre Andreasen <esbena@github.com>
2021-01-21 23:11:50 +01:00
Artem Smotrakov
73c8338e52 Use <code> tag in JexlInjection.qhelp 2021-01-21 22:49:36 +01:00
Artem Smotrakov
ee6d28b562 Use LocalUserInput when looking for JEXL injections 2021-01-21 22:46:18 +01:00
Erik Krogh Kristensen
62746bbbac skip analyzing regular expressions in minified files for ReDoS 2021-01-21 22:31:42 +01:00
CodeQL CI
d0b70d15f0 Merge pull request #4996 from esbena/js/nodejs-client-request-event-emitter
Approved by erik-krogh
2021-01-21 12:37:00 -08:00
Artem Smotrakov
8166e269ec Added examples of a sandbox for JEXL expressions 2021-01-21 20:53:15 +01:00
Esben Sparre Andreasen
cb25f2ab20 JS: add docstring with source examples 2021-01-21 20:46:34 +01:00
CodeQL CI
b83c949109 Merge pull request #4986 from erik-krogh/logInf
Approved by esbena
2021-01-21 06:02:50 -08:00
Asger Feldthaus
c29014f122 JS: Autoformat 2021-01-21 13:55:21 +00:00
ihsinme
9c53e39394 Update CompilerRemovalOfCodeToClearBuffers.ql 2021-01-21 16:52:00 +03:00
Esben Sparre Andreasen
1c100bbbc2 JS: recognize event emitters in nodejs client requests 2021-01-21 14:14:00 +01:00
Rasmus Wriedt Larsen
7a76a5134e Python: Add redirect modeling for Tornado
After making https://github.com/github/codeql/pull/4995, I realized how easy
this would be :D

Will need to do some manual merge-conflict handling, but it should be all good
:)
2021-01-21 14:04:11 +01:00
Rasmus Wriedt Larsen
2f86937e5a Python: Remove unused param in test code 2021-01-21 13:44:56 +01:00
Rasmus Wriedt Larsen
48083d657a Python: Apply code-review suggestion
Co-authored-by: yoff <lerchedahl@gmail.com>
2021-01-21 13:40:58 +01:00
Rasmus Wriedt Larsen
ee2d18afd8 Merge pull request #4665 from yoff/python-dataflow-modernize-tests
Python: Add new-style tests
2021-01-21 13:35:39 +01:00
Rasmus Wriedt Larsen
b55817a5b2 Python: Model HTTP responses in tornado
This is quite a simpel model, but ends up matching what we were able to do with
points-to.

I think this modeling excercise really shows that we need a bit of a different
way to model HTTP responses... but I'm not going to try to fix that in this PR.
2021-01-21 13:26:31 +01:00
Rasmus Wriedt Larsen
ac77a8b8a8 Python: Add proper HTTP response tests for Tornado 2021-01-21 13:22:31 +01:00
Asger Feldthaus
2f58683f2d JS: Remove PipeCallExpr 2021-01-21 12:12:17 +00:00
Asger Feldthaus
1d1149f4cd JS: Test and QLDoc for RxJS model 2021-01-21 12:08:22 +00:00
Rasmus Lerchedahl Petersen
e786be06ae Python: Fix broken references 2021-01-21 12:40:35 +01:00
Asger Feldthaus
144d04f3ce JS: Add test exposing source location of attribute after line break 2021-01-21 11:25:39 +00:00
haby0
a56dd60baa *)add CWE-652 XQueryInjection detection 2021-01-21 19:18:10 +08:00
Asger Feldthaus
7c6704a63f JS: Shift line numbers in test case 2021-01-21 11:09:36 +00:00
Asger F
34280f90b0 Update QLDoc for getATemplateArgument
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2021-01-21 10:51:46 +00:00
Erik Krogh Kristensen
a9a901d1e2 add change note 2021-01-21 11:08:39 +01:00
Erik Krogh Kristensen
dafec3ceaa rename to AnalyzedCompoundNumericAssignExpr 2021-01-21 11:06:46 +01:00
Rasmus Lerchedahl Petersen
88db8f562d Python: Elaborate comments for steps 2021-01-21 10:55:59 +01:00
Tom Hvitved
bc41c26354 Merge pull request #4959 from hvitved/csharp/ssa/split
C#: Split up SSA implementation
2021-01-21 10:52:49 +01:00
Rasmus Lerchedahl Petersen
bc1b50788a Python: Small refactor 2021-01-21 10:44:58 +01:00
Rasmus Lerchedahl Petersen
19918e2e57 Python: Have Node-postfix consistently 2021-01-21 10:43:15 +01:00
CodeQL CI
30015ee995 Merge pull request #4942 from esbena/js/reintroduce-resource-exhaustion
Approved by erik-krogh
2021-01-21 01:21:33 -08:00
CodeQL CI
9cfbe6feb7 Merge pull request #4980 from erik-krogh/defaultExport
Approved by esbena
2021-01-21 00:55:15 -08:00
Esben Sparre Andreasen
b90dd89746 JS: move js/resource-exhaustion to experimental 2021-01-21 09:09:01 +01:00
Esben Sparre Andreasen
5a6e692807 add js/server-crash to the security suite 2021-01-21 08:43:13 +01:00
Esben Sparre Andreasen
9e3cc3b1b2 JS: add qhelp and changenotes for js/server-crash 2021-01-21 08:43:13 +01:00
Tamas Vajk
eb8a52ba8d Add new .stats file 2021-01-20 21:21:03 +01:00
Rasmus Lerchedahl Petersen
419449fb8a Python: default value for argN 2021-01-20 20:33:04 +01:00
Artem Smotrakov
7df813354a Improved JexlInjectionLib.qll 2021-01-20 20:26:48 +01:00
Rasmus Lerchedahl Petersen
2409a7899b Python: Remove func tag in some situations.
Also make ArgumentNode public
2021-01-20 20:18:40 +01:00
Erik Krogh Kristensen
a44aefa6c9 add test for top-level closure modules - and simplify 2021-01-20 19:47:32 +01:00
Rasmus Lerchedahl Petersen
7a5d553dd2 Merge branch 'main' of github.com:github/codeql into python-dataflow-unpacking-assignment 2021-01-20 19:27:34 +01:00
Geoffrey White
d5d8b48218 C++: More accurate solution using Guards library. 2021-01-20 17:15:42 +00:00
Mathias Vorreiter Pedersen
3877f03a46 Merge pull request #4979 from geoffw0/cpp401
C++: Improvements to experimental query cpp/memory-leak-on-failed-call-to-realloc
2021-01-20 18:10:13 +01:00
Luke Cartey
5c6f5b7b33 Java: Track taint through Spring Java bean getters on super types 2021-01-20 16:53:03 +00:00
yoff
e072864948 Apply suggestions from code review
Co-authored-by: Taus <tausbn@github.com>
2021-01-20 17:38:34 +01:00
Geoffrey White
439fe41b0a C++: Add a couple more test cases. 2021-01-20 15:33:32 +00:00
yoff
3fc085ff38 Update python/ql/test/experimental/dataflow/TestUtil/RoutingTest.qll
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-01-20 16:11:40 +01:00
yoff
d0663e5c3a Merge pull request #4971 from RasmusWL/avoid-double-route-setup-django
Python: Avoid duplicated route-setup in django
2021-01-20 16:10:33 +01:00
Erik Krogh Kristensen
bf518f1c90 flag less overly general functions with js/unneeded-defensive-code 2021-01-20 15:48:12 +01:00
Mathias Vorreiter Pedersen
b0e255eb16 C++: Encapsulate skipSkippableInstructions in a module. 2021-01-20 15:45:37 +01:00
Tamas Vajk
ab8dc27b26 Add missing 'bindingset' 2021-01-20 15:44:05 +01:00
Tamas Vajk
727412b26b Store by-ref type annotation in trap and add tests 2021-01-20 15:44:05 +01:00
Tamas Vajk
2804f5cba9 Add by-ref, and fix pinned CIL extraction 2021-01-20 15:44:05 +01:00
Tamas Vajk
f99bf5755c Merge parameter extraction between methods and function pointers 2021-01-20 15:44:05 +01:00
Tamas Vajk
f986c15200 Add QL classes for CIL function pointers, and add test 2021-01-20 15:44:05 +01:00
Tamas Vajk
0c213d0926 C#: Extract function pointer types from CIL 2021-01-20 15:44:05 +01:00
Mathias Vorreiter Pedersen
f12ebe88e6 Revert "C++: Replace SkippableInstruction with local flow steps."
This reverts commit 258d04178f. This
change caused a ~20% performance regression.
2021-01-20 15:43:24 +01:00
Tamás Vajk
5fa0dd719c Merge pull request #4619 from tamasvajk/feature/csharp9-function-pointer
C#: Extract function pointers
2021-01-20 15:42:58 +01:00
Rasmus Wriedt Larsen
9a397b6faf Python: Apply code-review suggestion
Co-authored-by: yoff <lerchedahl@gmail.com>
2021-01-20 15:28:20 +01:00
Erik Krogh Kristensen
2e024c3c61 fix that type inference assumed every compound-assignment have type number 2021-01-20 15:26:39 +01:00
ihsinme
4c9de4574a Update CompilerRemovalOfCodeToClearBuffers.ql 2021-01-20 16:24:43 +03:00
CodeQL CI
2f459d9a72 Merge pull request #4977 from RasmusWL/missing-flask-class-view-handler-changenote
Approved by yoff
2021-01-20 02:38:30 -08:00
Rasmus Wriedt Larsen
526ccdd227 Python: Add safe example from qhelp to qltests 2021-01-20 11:35:48 +01:00
Rasmus Wriedt Larsen
37aa9b9d06 Python: Add prefix sanitizer on URL redirect query
This doesn't cover 100% of what we want to, but matches what we used to.
2021-01-20 11:35:47 +01:00
Rasmus Wriedt Larsen
d8bfa3565f Python: Simple port of URL redirect query
Still have not added sanitizer, but seems like old sanitizer was a bit too broad
(also covering %-formatting)
2021-01-20 11:35:44 +01:00
Tamas Vajk
70c302ffbe Add DB upgrade folder for function pointer 2021-01-20 11:20:55 +01:00
Shati Patel
bf0febd9d2 Merge pull request #4982 from github/update-sphix-readme
Update reference to new CodeQL site
2021-01-20 09:00:38 +00:00
Anders Schack-Mulligen
9b2f69ca94 Merge pull request #4978 from github/yo-h/struts-xml-change-note
Java: add change note for `struts.xml` extraction
2021-01-20 08:59:45 +01:00
Felicity Chapman
e96f942269 Update reference to new CodeQL site 2021-01-19 22:38:12 +00:00
Erik Krogh Kristensen
fbfbe70deb add support for unnamed/default exports in PackageExports.qll 2021-01-19 22:40:45 +01:00
Rasmus Lerchedahl Petersen
5a652ab3aa Python: Add missing test cases 2021-01-19 20:19:45 +01:00
Rasmus Lerchedahl Petersen
23d3343bfb Merge branch 'main' of github.com:github/codeql into python-dataflow-modernize-tests 2021-01-19 18:24:52 +01:00
Rasmus Lerchedahl Petersen
8e126603b3 Python: Remember that old style tests still needs
updated expectations.
2021-01-19 18:21:27 +01:00
Rasmus Lerchedahl Petersen
ae38bbe03b Python: Fearlessly adding another test
in the middle of the file.
2021-01-19 18:19:11 +01:00
Rasmus Lerchedahl Petersen
69913c053e Python: relative line numbers in
MISSING-annotations
2021-01-19 18:10:22 +01:00
Geoffrey White
d2dd19a293 C++: It turns out __assert_fail is special (see DefaultOptions.qll) so we don't need a body here. And the body was wrong. 2021-01-19 16:56:19 +00:00
Geoffrey White
fe4ae7e975 C++: General solution for functions that may exit. 2021-01-19 16:56:19 +00:00
Geoffrey White
8fa3ffe125 C++: Add a few more test cases that we don't recognize as OK. 2021-01-19 16:56:19 +00:00
CodeQL CI
bdfb81064d Merge pull request #4969 from asgerf/js/angular-dom-santizier-from-core
Approved by erik-krogh
2021-01-19 08:45:15 -08:00
Erik Krogh Kristensen
2a8a2832e2 Merge pull request #4946 from erik-krogh/libRedos
JS: Add library input as source for `js/polynomial-redos`
2021-01-19 17:30:20 +01:00
Tamas Vajk
d34992d36c Add .stats file 2021-01-19 17:26:31 +01:00
Tamas Vajk
35b955f694 Update change note date 2021-01-19 17:26:31 +01:00
Tamas Vajk
f7a0c98cb3 Code quality improvement 2021-01-19 17:26:31 +01:00
Tamas Vajk
613bf6dca6 Fix failing test 2021-01-19 17:26:31 +01:00
Tamas Vajk
1d9b3ec8b4 Allow annotating fnptr return types 2021-01-19 17:26:31 +01:00
Tamas Vajk
348fe8f2fc Address PR review comments 2021-01-19 17:26:31 +01:00
Tamas Vajk
a9986ca72d Fix expected printed AST 2021-01-19 17:26:31 +01:00
Tamas Vajk
fd27bde4b5 Add function pointer conversion tests 2021-01-19 17:26:31 +01:00
Tamas Vajk
15e88471be Adjust 'Cast.getTargetType()' to return the expression type instead of the type access type 2021-01-19 17:26:31 +01:00
Tamas Vajk
a11d852054 Fix address of unary operator extraction 2021-01-19 17:26:31 +01:00
Tamas Vajk
183926d9fd C#: Add QL classes for function pointer type/invocation, tests 2021-01-19 17:26:31 +01:00
Tamas Vajk
876123315d C#: Extract function pointers 2021-01-19 17:26:31 +01:00
Rasmus Lerchedahl Petersen
77da4b0106 Python: Remove absolute line numbers
- Use relative line numbers in flow test
- Elide line numbers in routing test (new concept)
2021-01-19 17:05:42 +01:00
yo-h
91fa12b1be Java: add change note for struts.xml extraction 2021-01-19 10:19:18 -05:00
Rasmus Wriedt Larsen
9d8925ae6a Python: Extend url-redirect tests
Specifically to show how it currently handles prefixing user-input with known
constant.

I changed test to be Python 3 only since I wanted to use f-string.
2021-01-19 15:37:41 +01:00
Rasmus Wriedt Larsen
830f8bfef6 Python: Add change-note for Flask class based view handlers
For https://github.com/github/codeql/pull/4944
2021-01-19 15:09:04 +01:00
Rasmus Wriedt Larsen
ab607b8030 Python: Add redirect modeling for Django 2021-01-19 14:45:41 +01:00
Rasmus Wriedt Larsen
aea974ee0c Python: Add redirect modeling for Flask 2021-01-19 14:44:50 +01:00
Rasmus Wriedt Larsen
501e510622 Python: Add redirect modeling tests (flask/django) 2021-01-19 14:43:25 +01:00
Rasmus Wriedt Larsen
efb872ad1e Python: Add HttpRedirectResponse concept 2021-01-19 14:35:19 +01:00
Jonas Jensen
24947f27b4 Merge pull request #4750 from geoffw0/modelclasses
C++: Model classes in StdString.qll.
2021-01-19 12:51:30 +01:00
CodeQL CI
fbab8f8539 Merge pull request #4972 from Marcono1234/marcono1234/qldoc-link-fixes
Approved by shati-patel
2021-01-19 03:07:41 -08:00
Shati Patel
47470e08c3 Add QLDoc link, suggested by @Marcono1234 2021-01-19 10:54:17 +00:00
Geoffrey White
cff56350e0 C++: Fix getClassAndName parameter name. 2021-01-19 10:34:25 +00:00
Tamás Vajk
e2af176727 Merge pull request #4974 from tamasvajk/feature/cleanup-db
C#: Remove leftover DB upgrade folder
2021-01-19 11:30:07 +01:00
Tom Hvitved
0674881ffd C#: Do not rely on BasicBlock member predicates from SsaImplSpecific 2021-01-19 10:52:50 +01:00
Tom Hvitved
2a8060102d C#: Split up SSA implementation 2021-01-19 10:52:50 +01:00
Tamás Vajk
b228b7d17b Merge pull request #4975 from tamasvajk/feature/fix-build-error
C#: Fix build error in RelationalPattern
2021-01-19 10:10:53 +01:00
Tamas Vajk
be7d458dc6 C#: Fix build error in RelationalPattern 2021-01-19 09:49:51 +01:00
Geoffrey White
b4a5346dc3 C++: It turns out .getTemplate() is not necessary. 2021-01-19 08:46:53 +00:00
Geoffrey White
f8a1fb1c35 C++: Apply the new pattern where it doesn't matter for performance as well, for consistency. 2021-01-19 08:46:53 +00:00
Geoffrey White
bfef1a200e C++: Apply the new pattern in other parts of StdString.qll where it matters. 2021-01-19 08:46:53 +00:00
Geoffrey White
b8e6ad8922 C++: Introduce new predicate for better performance in models. 2021-01-19 08:46:52 +00:00
Geoffrey White
a5632b272e C++: Fix performance issue in hasTaintFlow / hasDataFlow. 2021-01-19 08:46:52 +00:00
Tamas Vajk
6cafb281b5 C#: Remove leftover DB upgrade folder 2021-01-19 09:45:34 +01:00
Tamás Vajk
b775eb4cf7 Merge pull request #4789 from tamasvajk/feature/csharp9-relational-pattern2
C#: Relational patterns
2021-01-19 09:38:57 +01:00
Tom Hvitved
25095f919e Merge pull request #4962 from hvitved/csharp/nullability-extraction
C#: Improved extraction of type nullability
2021-01-19 09:34:38 +01:00
Rasmus Lerchedahl Petersen
42fa3bdb81 Python: Only consider the closest SOURCE
(in use-use flow) a source
2021-01-19 09:13:17 +01:00
Esben Sparre Andreasen
3015dcd310 JS: reformulate js/server-crash. Support promises and shorter paths. 2021-01-19 09:08:52 +01:00
Anders Schack-Mulligen
b620e02000 Merge pull request #4973 from Marcono1234/patch-1
Add ArrayInit.getSize(), improve documentation
2021-01-19 09:06:45 +01:00
Anders Schack-Mulligen
dde8d320f3 Apply suggestions from code review
Minor qldoc fixes.
2021-01-19 08:24:24 +01:00
Rasmus Lerchedahl Petersen
bd3de23c6e Python: Remove some unhelpful store steps 2021-01-19 00:05:10 +01:00
luchua-bc
b9809b071e Update the query to work with wrapper classes 2021-01-18 19:22:34 +00:00
Marcono1234
703336a77f Add ArrayInit.getSize(), improve documentation 2021-01-18 16:44:53 +01:00
Marcono1234
e9aa63b670 Fix broken links to QLDoc specification 2021-01-18 16:18:45 +01:00
Rasmus Wriedt Larsen
8e5557eca3 Python: Avoid duplicated route-setup in django
When using `django.conf.urls.url` with Django 2+
2021-01-18 16:18:29 +01:00
Tamas Vajk
d05d4e22ad C#: Fix namespace extraction of NoMetadataHandleType 2021-01-18 16:14:37 +01:00
Tamas Vajk
1b285ee792 C#: Hardcode well-known underlying enum types 2021-01-18 16:14:37 +01:00
Rasmus Lerchedahl Petersen
bfc6660795 Python: Remember to update test expectations 2021-01-18 15:00:06 +01:00
Erik Krogh Kristensen
01900d7ca2 remove false positive due to "\n" not being in the relevant relation 2021-01-18 14:47:29 +01:00
Asger Feldthaus
deca7f3cd6 JS: Add change note 2021-01-18 13:46:43 +00:00
CodeQL CI
fc2fe6cccb Merge pull request #4928 from esbena/js/rewrite-multi-sanitization
Approved by asgerf
2021-01-18 05:11:42 -08:00
Asger Feldthaus
fbb5d14263 JS: Update angular test output 2021-01-18 12:19:09 +00:00
Asger Feldthaus
bb6bd9168e JS: Update HTML TRAP tests output 2021-01-18 12:19:09 +00:00
Asger Feldthaus
2a7b4487f1 JS: More auto format 2021-01-18 12:19:09 +00:00
Asger Feldthaus
d8c9dba990 JS: Autoformat 2021-01-18 12:19:09 +00:00
Asger Feldthaus
5f4016be76 JS: Cache Import.getImportedModule 2021-01-18 12:19:09 +00:00
Asger Feldthaus
c5f2c04f16 JS: Add upgrade script 2021-01-18 12:19:09 +00:00
Asger Feldthaus
1b4a4ea2fa JS: Bump extractor version string 2021-01-18 12:19:09 +00:00
Asger Feldthaus
44c5d36e83 JS: Simple RxJS model 2021-01-18 12:19:09 +00:00
Asger Feldthaus
00cd0644f0 JS: Implement getAResponseDataNode 2021-01-18 12:19:09 +00:00
Asger Feldthaus
2f3cef177b JS: More steps in Angular2 model 2021-01-18 12:19:09 +00:00
Asger Feldthaus
c8901b62f5 JS: Add test for $any step 2021-01-18 12:19:08 +00:00
Asger Feldthaus
2ba98da107 JS: Only extract local vars in TemplateTopLevel
Angular template expressions cannot refer to global variables, any
unqualified identifier is a reference to a property provided by the
component.

We extract them as implicitly declared local variables which the
QL model can then connect with data flow steps.
2021-01-18 12:19:08 +00:00
Asger Feldthaus
faad466aa8 JS: Add ScopeKind enum 2021-01-18 12:19:08 +00:00
Asger Feldthaus
07cfceee19 JS: TRAP test for angular templates 2021-01-18 12:19:08 +00:00
Asger Feldthaus
3c0867125b JS: Remove FP in TargetBlank 2021-01-18 12:19:08 +00:00
Asger Feldthaus
97f7cb4dc1 JS: Track location information using SourceMaps 2021-01-18 12:19:08 +00:00
Asger Feldthaus
898d22d2f4 JS: Simplify HTML element access 2021-01-18 12:19:08 +00:00
Asger Feldthaus
f24af58a60 JS: Extract mapping from HTML node to parent Expression 2021-01-18 12:19:08 +00:00
Asger Feldthaus
3b666a5646 JS: Extract mapping from TopLevel to parent HTML node 2021-01-18 12:19:08 +00:00
Asger Feldthaus
8848ee2d10 JS: Extract HTML from inline templates 2021-01-18 12:19:08 +00:00
Asger Feldthaus
6bf9345258 JS: Add test for class with locally-unused field 2021-01-18 12:19:08 +00:00
Asger Feldthaus
cc952bd2a4 JS: Reorganize test a bit 2021-01-18 12:19:08 +00:00
Asger Feldthaus
1ab36dc81f JS: Flow through *ngFor loops 2021-01-18 12:19:08 +00:00
Asger Feldthaus
29dd8470d5 JS: Fix offset of *ngFor snippet 2021-01-18 12:18:27 +00:00
Asger Feldthaus
0da207a5f9 JS: Update test with pipes 2021-01-18 12:18:27 +00:00
Asger Feldthaus
d80313be4f JS: Model pipe classes 2021-01-18 12:18:27 +00:00
Asger Feldthaus
debb5691a1 JS: Make PipeRefExpr a SourceNode 2021-01-18 12:18:27 +00:00
Asger Feldthaus
fcb8124376 JS: Expose data flow node for field declaration 2021-01-18 12:18:26 +00:00
Asger Feldthaus
9ee893c9c1 JS: Add data flow steps in Angular2 model 2021-01-18 12:16:13 +00:00
Asger Feldthaus
77fcf3d8a2 JS: Support postfix "!" operator in templates 2021-01-18 12:16:13 +00:00
Asger Feldthaus
c08ba1416d JS: Add new SourceType for angular templates 2021-01-18 12:16:13 +00:00
Asger Feldthaus
b1d45a6773 JS: Mark angular pipe refs as incomplete 2021-01-18 12:16:13 +00:00
Asger Feldthaus
4b5a861ee6 JS: Add TopLevelKind enum 2021-01-18 12:16:13 +00:00
Asger Feldthaus
9b99f56d44 JS: isAngularTemplateAttributeName 2021-01-18 12:16:13 +00:00
Asger Feldthaus
ed27c8b13f JS: Add test and fix bug in pipe parser 2021-01-18 12:16:13 +00:00
Asger Feldthaus
16a2a60b9a JS: Add AngularPipeRef 2021-01-18 12:16:13 +00:00
Asger Feldthaus
928a382ad5 JS: Add parser for angular expressions 2021-01-18 12:16:13 +00:00
Asger Feldthaus
3db6069372 JS: Add test for new sink 2021-01-18 10:55:34 +00:00
Asger Feldthaus
2752b4ba64 JS: Shift line numbers in test 2021-01-18 10:54:39 +00:00
Asger Feldthaus
ff1d0cc4c7 JS: Recognize DomSanitizer from @angular/core 2021-01-18 10:54:27 +00:00
Rasmus Lerchedahl Petersen
66426bf0cc Python: Add tests for iterable unpacking
in for-iterations and comprehensions.
2021-01-18 09:36:13 +01:00
Tamas Vajk
8400a3862b Add DB upgrade folder 2021-01-18 09:19:27 +01:00
Tamas Vajk
ce58514453 Change release note date 2021-01-18 09:19:27 +01:00
Tamas Vajk
c0b31cbfe7 Add new stats file 2021-01-18 09:19:27 +01:00
Tamas Vajk
f235a28295 C# Add relational patterns extraction 2021-01-18 09:19:27 +01:00
Rasmus Lerchedahl Petersen
175e43d6f2 Python: Slight refactor 2021-01-18 09:12:05 +01:00
luchua-bc
048167d39a Revamp the query to reduce FPs introduced by wrapper calls 2021-01-18 04:23:30 +00:00
Artem Smotrakov
7d2d27394b Java: Added a source and a taint step for JexlInjectionConfig
- Added TaintedSpringRequestBody source
- Added returningTaintedDataFromBean() taint step
- Added tests
2021-01-17 22:28:42 +01:00
Artem Smotrakov
99401f6e84 Java: Query for detecting JEXL injections 2021-01-17 14:19:26 +01:00
Rasmus Lerchedahl Petersen
5f189a7e43 Python: Address reviews 2021-01-15 20:18:37 +01:00
Mathias Vorreiter Pedersen
dcbae8b22b Fix code tag. 2021-01-15 19:47:09 +01:00
yoff
1edad03622 Apply suggestions from code review
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2021-01-15 18:50:04 +01:00
Erik Krogh Kristensen
401e516654 update expected output, and update PackageExports test 2021-01-15 17:40:47 +01:00
intrigus
a4cbd7037b Java: Add tests for different versions.
Adds a test for version 6.24, because that version is not vulnerable.
The other test is for versions < 6.24, because these versions are
vulnerable.
2021-01-15 17:20:57 +01:00
luchua-bc
3af8773dd6 Add more cases 2021-01-15 16:20:31 +00:00
Erik Krogh Kristensen
26783b6ab0 make getTopmostPackageJSON public again, and update PackageExports test 2021-01-15 16:05:49 +01:00
Tom Hvitved
9a9a57716c C#: Improved extraction of type nullability 2021-01-15 16:01:14 +01:00
Asger Feldthaus
5fa3b17956 JS: Tolerate Angular-specific HTML attribute names 2021-01-15 14:51:10 +00:00
Asger Feldthaus
f33630aab6 JS: Reformat HTMLExtractor 2021-01-15 14:51:10 +00:00
yoff
48910d0597 Apply suggestions from code review
Co-authored-by: Taus <tausbn@github.com>
2021-01-15 14:02:27 +01:00
Erik Krogh Kristensen
1506ac09e5 limit the number of characters produced by getAThreewayIntersect 2021-01-15 13:54:16 +01:00
Erik Krogh Kristensen
0117a0fac1 specialize the getAValueExportedBy predicate to only topmost package.jsons 2021-01-15 13:54:16 +01:00
Erik Krogh Kristensen
0c9d46a7f9 changes based on review
Co-authored-by: Esben Sparre Andreasen <esbena@github.com>
2021-01-15 13:54:05 +01:00
luchua-bc
32c54628f8 Drop fieldName from the function for runtime evaluation 2021-01-15 12:33:00 +00:00
Anders Schack-Mulligen
545451e602 Merge pull request #4960 from github/yo-h/java15-change-note
Java: update documentation on supported language versions
2021-01-15 10:19:46 +01:00
Tamás Vajk
81ce29c6c8 Merge pull request #4656 from tamasvajk/feature/csharp9-not-pattern
C#: Extract unary patterns
2021-01-15 09:44:53 +01:00
luchua-bc
e5a703e49c Revamp the query 2021-01-15 04:05:11 +00:00
yo-h
27fd16ae87 Java: update documentation on supported language versions 2021-01-14 20:29:16 -05:00
Tom Hvitved
d7ca065192 Merge pull request #4923 from hvitved/csharp/ssa/refactor
C#: SSA refactorings
2021-01-14 17:28:14 +01:00
Geoffrey White
15089c4117 Merge branch 'main' into modelclasses 2021-01-14 15:57:02 +00:00
Geoffrey White
7012bc05a2 C++: Simplification. 2021-01-14 15:21:26 +00:00
Geoffrey White
54bd36def2 C++: Correct QLDoc comments. 2021-01-14 15:20:29 +00:00
Geoffrey White
13d0efe96d C++: Change to more natural expressions without use of weird predicates or 'any'. The classes for string objects now match instantiations directly rather than the template. 2021-01-14 15:02:51 +00:00
Tom Hvitved
6cf684f615 C#: Fix QL doc 2021-01-14 15:59:22 +01:00
ihsinme
805352945e Update CompilerRemovalOfCodeToClearBuffers.ql 2021-01-14 17:27:58 +03:00
ihsinme
10ab1d9b54 Update CompilerRemovalOfCodeToClearBuffers.ql 2021-01-14 17:24:49 +03:00
ihsinme
cd0d2a5692 Update cpp/ql/src/experimental/Security/CWE/CWE-14/CompilerRemovalOfCodeToClearBuffers.ql
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2021-01-14 17:21:19 +03:00
ihsinme
7f5e5fcb99 Update cpp/ql/src/experimental/Security/CWE/CWE-14/CompilerRemovalOfCodeToClearBuffers.qhelp
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2021-01-14 17:19:57 +03:00
ihsinme
3e715ff52d Update cpp/ql/src/experimental/Security/CWE/CWE-14/CompilerRemovalOfCodeToClearBuffers.qhelp
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2021-01-14 17:19:23 +03:00
ihsinme
0d0ea0c5e1 Update cpp/ql/src/experimental/Security/CWE/CWE-14/CompilerRemovalOfCodeToClearBuffers.ql
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2021-01-14 17:17:56 +03:00
yoff
b5d40e4c9a Merge pull request #4944 from RasmusWL/flask-class-based-handlers
Python: Add modeling of Flask class based (HTTP) request handlers
2021-01-14 15:17:36 +01:00
ihsinme
4ba4de3d41 Update cpp/ql/src/experimental/Security/CWE/CWE-14/CompilerRemovalOfCodeToClearBuffers.c
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2021-01-14 17:17:08 +03:00
ihsinme
76b768f7e0 Update cpp/ql/src/experimental/Security/CWE/CWE-14/CompilerRemovalOfCodeToClearBuffers.c
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2021-01-14 17:16:53 +03:00
ihsinme
4631658e5e Update cpp/ql/src/experimental/Security/CWE/CWE-14/CompilerRemovalOfCodeToClearBuffers.c
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2021-01-14 17:16:37 +03:00
ihsinme
9e3b288f33 Update cpp/ql/src/experimental/Security/CWE/CWE-14/CompilerRemovalOfCodeToClearBuffers.c
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2021-01-14 17:16:21 +03:00
ihsinme
b26a90e1e6 Update cpp/ql/src/experimental/Security/CWE/CWE-14/CompilerRemovalOfCodeToClearBuffers.ql
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2021-01-14 17:15:58 +03:00
ihsinme
1c4610c722 Update cpp/ql/src/experimental/Security/CWE/CWE-14/CompilerRemovalOfCodeToClearBuffers.ql
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2021-01-14 17:15:36 +03:00
yoff
de8ac6c12d Merge pull request #4869 from RasmusWL/tornado-source-modeling
Python: Add Tornado source modeling
2021-01-14 14:40:14 +01:00
Tamas Vajk
4b32fd0556 Update change note date 2021-01-14 14:29:13 +01:00
Tamas Vajk
b7b4ed8774 Add DB upgrade folder 2021-01-14 14:26:40 +01:00
Erik Krogh Kristensen
c106b09d49 change-note 2021-01-14 14:17:32 +01:00
Tamas Vajk
66d8b0f1a0 Add new .stats file 2021-01-14 14:11:28 +01:00
Erik Krogh Kristensen
c5595f4cbd improve alert message for js/polynomial-redos 2021-01-14 13:48:26 +01:00
Rasmus Wriedt Larsen
4cb2f2ed1e Python: Proper models of flask MethodView classes 2021-01-14 13:42:18 +01:00
Rasmus Wriedt Larsen
e327fdb317 Python: Model flask View classes 2021-01-14 13:42:18 +01:00
Rasmus Wriedt Larsen
0b1cece523 Python: Add tests for class based handlers in Flask 2021-01-14 13:42:17 +01:00
Rasmus Wriedt Larsen
14bb10a361 Python: Use LocalSourceNode for TornadoRouteRegex 2021-01-14 13:39:41 +01:00
Erik Krogh Kristensen
86e33d9d79 select the shortest possible reason 2021-01-14 13:38:37 +01:00
Rasmus Wriedt Larsen
f9a29cb886 Python: Add change-note for tornado source modeling 2021-01-14 13:37:27 +01:00
Rasmus Wriedt Larsen
812ea5dde5 Python: Tornado: Model request handlers without known route 2021-01-14 13:37:27 +01:00
Rasmus Wriedt Larsen
1849b9e771 Python: Tornado: Handle basic route setup with tuples
The reason this becomes valueable right now, is that we can mark routed params
as taint-sources. Longer down the line, we can (hopefully) detect that a routed
param will only accept digits, and mark it safe for some of our taint-tracking
queries.
2021-01-14 13:37:26 +01:00
Rasmus Wriedt Larsen
39d85896a1 Python: Add basic taint modeling of tornado request 2021-01-14 13:37:26 +01:00
Rasmus Wriedt Larsen
4641150d45 Python: Basic taint-modeling of tornado.web.RequestHandler classes 2021-01-14 13:37:25 +01:00
Rasmus Wriedt Larsen
9cd8a862a0 Python: Expand Tornado tests and add annotations
I should probably have split this up into 2 commits, so sorry that didn't happen :|
2021-01-14 13:37:24 +01:00
Rasmus Wriedt Larsen
b4f3399534 Python: Add reverse inheritance test for Tornado 2021-01-14 13:37:24 +01:00
Rasmus Wriedt Larsen
57d08a8523 Python: Rewrite old Tornado tests
Now you can run them, and the examples have been adjusted so they actually work!
2021-01-14 13:37:23 +01:00
Rasmus Wriedt Larsen
7db55906b9 Python: Copy old tornado tests 2021-01-14 13:37:22 +01:00
Erik Krogh Kristensen
03d8aeb7b6 refactor PolynomialBackTrackingTerm, to allow getting the pump string and the prefix-message 2021-01-14 13:35:32 +01:00
Tom Hvitved
f5eb131e2d C#: Address review comments 2021-01-14 12:42:43 +01:00
yoff
c69b776d34 Merge pull request #4864 from RasmusWL/django-request-handler-without-route
Python: Model Django request handler without route
2021-01-14 12:06:59 +01:00
Tamás Vajk
fa8e902fe4 Merge pull request #4922 from tamasvajk/feature/fix-finally-cfg-opass
C#: Fix expanded assignment lookup in finally blocks for CFG
2021-01-14 11:26:33 +01:00
Tamás Vajk
36a1293156 Merge pull request #4952 from tamasvajk/feature/type-mention-nullable
C#: Fix type mention extraction of named types with nullability enabled
2021-01-14 11:25:44 +01:00
Erik Krogh Kristensen
a520a51d42 highlight the use of the regular expression, instead of the sink for user input 2021-01-14 11:22:20 +01:00
Mathias Vorreiter Pedersen
3468593d3a Merge pull request #4915 from geoffw0/sqltaint
C++: Fix FPs in cpp/sql-injection
2021-01-14 11:20:08 +01:00
Erik Krogh Kristensen
e8ea720650 adjust description to not mention user-provided values 2021-01-14 10:36:10 +01:00
Tamas Vajk
48d8ee9166 Fix failing test 2021-01-14 09:47:46 +01:00
Tamas Vajk
927dd514ea C#: Extract unary patterns 2021-01-14 09:47:46 +01:00
Tamás Vajk
842ed62875 Merge pull request #4927 from tamasvajk/feature/comp-assembly
C#: Add output assembly to compilation
2021-01-14 09:45:11 +01:00
CodeQL CI
4229f556cb Merge pull request #4751 from erik-krogh/logInjection
Approved by asgerf, mchammer01
2021-01-14 00:32:46 -08:00
Tamas Vajk
05c858ec2c C#: Fix expanded assignment lookup in finally blocks for CFG 2021-01-14 08:54:10 +01:00
Tamas Vajk
5803a449be Add test case for assign operation in finally 2021-01-14 08:39:46 +01:00
Tamas Vajk
ec669c883a Add DB upgrade folder 2021-01-14 08:25:35 +01:00
Tamas Vajk
5060756a0b Fix typo in comment 2021-01-14 08:20:45 +01:00
Tamás Vajk
b6107d341b Merge pull request #4924 from tamasvajk/feature/remove-string-literal-might-throw
C#: Remove throw completion from StringLiteral
2021-01-14 08:15:33 +01:00
Rasmus Lerchedahl Petersen
dfdfd3c2b7 Python: FIx flow 2021-01-14 01:19:58 +01:00
Rasmus Lerchedahl Petersen
6dc0d691ac Python: Final(?!) fix of annotations 2021-01-14 01:06:10 +01:00
Rasmus Lerchedahl Petersen
e3199fbbe2 Python: Fix inconsostencies to fix flow
(and fix annotations again)
2021-01-14 00:09:18 +01:00
intrigus-lgtm
b8076481bf Java: Suggestions from Review 2021-01-13 20:32:23 +01:00
Rasmus Lerchedahl Petersen
36a4a5081e Python: big refactor and fix tests
Make sure tests are valid
Fix wrong test annotations
Big refactor to make code readable
Big comment to explain code
2021-01-13 18:33:08 +01:00
Tamas Vajk
12d602b798 Add new .stats file 2021-01-13 15:46:08 +01:00
Jonas Jensen
5eafe63a82 Merge pull request #4941 from geoffw0/cpp409
C++: Test of taint through ConstructorDelegationInit.
2021-01-13 15:06:37 +01:00
Esben Sparre Andreasen
1bc7d68a50 Update javascript/ql/test/query-tests/Security/CWE-730/server-crash.js
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2021-01-13 14:49:42 +01:00
Esben Sparre Andreasen
12b985be87 Update javascript/ql/src/Security/CWE-730/ServerCrash.ql
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2021-01-13 14:49:29 +01:00
Anders Schack-Mulligen
f3b8fe2e2e Java: Add Member.hasQualifiedName. 2021-01-13 13:42:35 +01:00
Tamas Vajk
61b207f067 Rework type mention test 2021-01-13 13:24:48 +01:00
Tamas Vajk
c0e0bd2531 C#: Fix type mention extraction of named types with nullability enabled 2021-01-13 12:58:41 +01:00
Tamas Vajk
c2a4235db8 C#: Add type-mention tests with nullability 2021-01-13 12:55:27 +01:00
ihsinme
3ad45f28c9 Add files via upload 2021-01-13 14:18:54 +03:00
ihsinme
4cee67da75 Add files via upload 2021-01-13 14:17:21 +03:00
Geoffrey White
69664535b0 Merge pull request #4881 from ihsinme/main
CPP: Add query for CWE-401 memory leak on unsuccessful call to realloc function
2021-01-13 10:58:09 +00:00
Anders Schack-Mulligen
29935e1388 Merge pull request #4771 from intrigus-lgtm/split-cwe-295
Java: Add unsafe hostname verification query and remove existing overlapping query
2021-01-13 11:31:38 +01:00
Erik Krogh Kristensen
c98dacf842 changes based on doc review 2021-01-13 10:38:19 +01:00
Erik Krogh Kristensen
d71adff079 dont sanitize global replacements where the regexp is a char class 2021-01-13 10:12:12 +01:00
Tamas Vajk
fb13126676 C#: Store output assembly in compilation_assembly relation 2021-01-13 09:23:56 +01:00
Tamas Vajk
983c4d06d4 Revert "C#: Add output assembly to compilation"
This reverts commit 5cfa900828.
2021-01-13 09:12:31 +01:00
Tamas Vajk
5cfa900828 C#: Add output assembly to compilation 2021-01-13 09:10:49 +01:00
Tamas Vajk
7418c05594 Always populate assemblies 2021-01-13 09:10:49 +01:00
Rasmus Lerchedahl Petersen
b2d95e617d Python: Test interaction between nesting,
iteration, and conversion
2021-01-13 09:02:56 +01:00
Rasmus Lerchedahl Petersen
b10cf78e17 Python: start handling iterated unpacking 2021-01-13 08:40:47 +01:00
luchua-bc
babe744a30 Add SECURITY_PROTOCOL check 2021-01-13 03:49:08 +00:00
Esben Sparre Andreasen
d591c519a8 JS: reformulate js/server-crash as a path problem 2021-01-13 00:08:28 +01:00
intrigus
5b3086a93a Java: Fix capitalization of JxBrowser 2021-01-12 22:43:41 +01:00
intrigus
1ebc9f4d93 Java: Only detect JxBrowser < 6.24 2021-01-12 22:39:08 +01:00
Rasmus Lerchedahl Petersen
4ee2f49f38 Python: model conversion during unpacking 2021-01-12 22:19:31 +01:00
Rasmus Lerchedahl Petersen
d8d8b45c6a Python: add test annotations 2021-01-12 22:03:49 +01:00
Erik Krogh Kristensen
0a17b04650 refactor copy-pasted code into getAnLibraryInputParameter 2021-01-12 20:21:37 +01:00
Erik Krogh Kristensen
eaee5c2d87 add library input as source for js/polynomial-redos 2021-01-12 20:21:33 +01:00
Geoffrey White
3f09a047ae C++: Test comments. 2021-01-12 14:52:52 +00:00
intrigus
2931e1f3fb Java: Add change note for #4771 2021-01-12 15:37:45 +01:00
intrigus
1901f6bf55 Java: Make @id @name of query more similar. 2021-01-12 15:36:55 +01:00
intrigus
4fa8f5eab2 Java: Accept test changes 2021-01-12 15:29:03 +01:00
intrigus
b30872806d Java: Add tests and test stubs. 2021-01-12 14:49:12 +01:00
intrigus
9b3070ab7c Java: Add JXBrowser disabled certificate query. 2021-01-12 14:48:22 +01:00
Rasmus Wriedt Larsen
2ba7ed4940 Python: Add note about future work for getARequestHandler 2021-01-12 13:32:43 +01:00
Esben Sparre Andreasen
3c9c79a550 JS: remove flow labels from js/resource-exhaustion 2021-01-12 13:20:20 +01:00
Esben Sparre Andreasen
5965035c09 JS: add query js/resource-exhaustion 2021-01-12 13:20:20 +01:00
Rasmus Lerchedahl Petersen
a1ab5cc2b8 Python: start support for nested unpacking 2021-01-12 13:09:12 +01:00
Rasmus Lerchedahl Petersen
9c08467828 Python: add tests for conversion during unpacking 2021-01-12 12:46:51 +01:00
Rasmus Lerchedahl Petersen
4d9f5be2bc Python: Add more unpacking tests 2021-01-12 12:30:03 +01:00
CodeQL CI
1c8547c897 Merge pull request #4774 from erik-krogh/forms
Approved by asgerf
2021-01-12 02:01:38 -08:00
Mathias Vorreiter Pedersen
84f1b11448 Merge branch 'main' into mathiasvp/reverse-read-take-3 2021-01-12 10:37:32 +01:00
Esben Sparre Andreasen
847687974f JS: only select non-nullable terms in the broken sanitizer 2021-01-12 08:50:19 +01:00
Esben Sparre Andreasen
40cfbab335 JS: address review feedback 2021-01-12 08:49:08 +01:00
ihsinme
bbd3f7631e Delete test.c
sorry i was in a hurry
2021-01-11 23:52:26 +03:00
ihsinme
b92d63d5df Delete CompilerRemovalOfCodeToClearBuffers.qlref
sorry i was in a hurry
2021-01-11 23:51:37 +03:00
ihsinme
05f866e912 Delete CompilerRemovalOfCodeToClearBuffers.expected
sorry i was in a hurry
2021-01-11 23:51:18 +03:00
ihsinme
d7a5e61f8e Delete CompilerRemovalOfCodeToClearBuffers.qhelp
sorry i was in a hurry
2021-01-11 23:50:47 +03:00
ihsinme
c38cfcb735 Delete CompilerRemovalOfCodeToClearBuffers.ql
sorry i was in a hurry
2021-01-11 23:50:19 +03:00
ihsinme
65ff526eef Delete CompilerRemovalOfCodeToClearBuffers.c
sorry i was in a hurry
2021-01-11 23:49:53 +03:00
ihsinme
ed6d8e3d18 Add files via upload 2021-01-11 23:40:38 +03:00
ihsinme
b185a33157 Add files via upload 2021-01-11 23:39:02 +03:00
Geoffrey White
7409dd015e C++: Autoformat. 2021-01-11 18:58:32 +00:00
ihsinme
b28444b55c Update MemoryLeakOnFailedCallToRealloc.ql
I thought since there is no work on this PR, I will delete the residual import.
2021-01-11 21:17:49 +03:00
intrigus
85286f362c Java: Replace global flow by local flow 2021-01-11 19:02:07 +01:00
intrigus-lgtm
722bd4dafa Java: Revise qhelp 2021-01-11 18:57:24 +01:00
intrigus-lgtm
4cfdb10ddc Java: Improve QLDoc & simplify code
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2021-01-11 18:50:43 +01:00
Geoffrey White
1cde5e1828 C++: Test of taint through ConstructorDelegationInit. 2021-01-11 17:35:50 +00:00
luchua-bc
86c04e6971 Detect the scenario of passwords concatenated with a salt to reduce FPs 2021-01-11 16:59:57 +00:00
CodeQL CI
4bc287e89b Merge pull request #4933 from madneal/fix-for-predicates
Approved by shati-patel
2021-01-11 06:01:33 -08:00
Max Schaefer
f40b406a2d JavaScript: Address review comments. 2021-01-11 13:53:47 +00:00
Max Schaefer
c9132ca6f8 JavaScript: Refactor trackUseNode to avoid bad join order. 2021-01-11 13:53:47 +00:00
Max Schaefer
7a229d9381 JavaScript: Simplify NoSQL framework modelling. 2021-01-11 13:53:47 +00:00
Max Schaefer
b3ab6efd1d JavaScript: Remove a bindingset annotation. 2021-01-11 13:53:47 +00:00
Max Schaefer
3853da0969 JavaScript: Teach API-graphs about bound arguments. 2021-01-11 13:53:46 +00:00
Max Schaefer
ecab17a626 JavaScript: Teach API graphs to handle promisify.
Following a suggestion by Asger, we track use nodes through calls to `promisify`. When we see a call to a promisified function, we introduce a new synthetic API-graph node representing the callback argument synthesised by the promisification, and track the result of the call to an `await` (or other promise resolution), which is then considered to be a use of the first parameter of the synthetic callback (the zeroth parameter being an error code, which we do not model yet).
2021-01-11 13:53:46 +00:00
madneal
ee3ffa0700 add extra clarifications in the comments 2021-01-11 21:43:24 +08:00
Esben Sparre Andreasen
2dbd762bd9 JS: reintroduce reverted js/server-crash
This reverts commit 0a8d15ccc4.
2021-01-11 14:13:41 +01:00
Mathias Vorreiter Pedersen
59abcd6dae Merge pull request #4938 from geoffw0/cpp302
C++: Tidy up old QL headers
2021-01-11 14:12:16 +01:00
intrigus
5c1e746c96 Java: Rename to EnvReadMethod 2021-01-11 13:42:08 +01:00
intrigus
1eb2b75389 Java: Further reduce FPs, simply Flag2Guard flow 2021-01-11 13:42:08 +01:00
intrigus
b4692734b2 Java: Add QLDoc improve query message 2021-01-11 13:42:08 +01:00
intrigus-lgtm
f4b912cd8a Apply suggestions from doc review
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2021-01-11 13:42:08 +01:00
intrigus
e11304a1ca Java: Autoformat 2021-01-11 13:42:08 +01:00
intrigus-lgtm
b8f3e64a0f Apply suggestions from code review
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2021-01-11 13:42:08 +01:00
intrigus
502e4c39f5 Java: Fix Qhelp 2021-01-11 13:42:08 +01:00
intrigus-lgtm
355cb6eeec Fix Qhelp format
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2021-01-11 13:42:07 +01:00
intrigus-lgtm
10fc2cf9f8 Apply suggestions from code review
Co-authored-by: Chris Smowton <smowton@github.com>
2021-01-11 13:42:07 +01:00
intrigus
c88f07dde4 Java: Accept test output 2021-01-11 13:42:07 +01:00
intrigus
33b0ff28d8 Java: Update test 2021-01-11 13:42:07 +01:00
intrigus
9e2ef9bd74 Java: Filter results by feature flags.
This ignores results that are guarded by a feature flag
that suggests an intentionally insecure feature.
Inspired by Go's `InsecureFeatureFlag.qll` and
`DisabledCertificateCheck.ql`.
2021-01-11 13:42:07 +01:00
intrigus
a62a2e58dd Java: Improve QL-Doc 2021-01-11 13:42:07 +01:00
intrigus
d98b171998 Java: Make EnvTaintedMethod public + QL-Doc 2021-01-11 13:42:07 +01:00
intrigus
e021158b5f Java: Tighter model of HostnameVerifier#verify
This more tightly models `HostnameVerifier#verify` previously it
was possible to accidentally match other methods called `verify`.
2021-01-11 13:42:07 +01:00
intrigus
0a9df07df7 Apply suggestions from review. 2021-01-11 13:42:07 +01:00
intrigus
70b0703952 Java: Remove overlapping code 2021-01-11 13:42:07 +01:00
intrigus
3da1cb0879 Java: Add unsafe hostname verification query 2021-01-11 13:42:07 +01:00
intrigus
8df5d77398 Java: Model HostnameVerifier method
Model `HostnameVerifier#setDefaultHostnameVerifier`
2021-01-11 13:42:06 +01:00
Anders Schack-Mulligen
3a2dd8f1ed Merge pull request #4867 from RasmusWL/java-externalapis-taint-step
Java: Fix taint-step handling for untrusted-data-external-api
2021-01-11 13:36:59 +01:00
madneal
4e373aaf29 replace error with errors 2021-01-11 19:38:27 +08:00
Rasmus Wriedt Larsen
7d94bab75e Merge branch 'main' into django-request-handler-without-route 2021-01-11 12:24:41 +01:00
madneal
e0fc9bac08 add error for shotString 2021-01-11 19:15:22 +08:00
Rasmus Wriedt Larsen
828bb9a902 Python: Small refactor for request param modeling in Django 2021-01-11 11:29:54 +01:00
Esben Sparre Andreasen
580a24e982 JS: rewrite js/incomplete-multi-character-sanitization 2021-01-11 11:26:45 +01:00
Rasmus Wriedt Larsen
141b9adc4d Python: Minor refactoring
Co-authored-by: yoff <lerchedahl@gmail.com>
2021-01-11 11:18:59 +01:00
Geoffrey White
cf1d1dc5c0 C++: Remove old tags. 2021-01-11 09:31:06 +00:00
Mathias Vorreiter Pedersen
46393c33ef C++: Fix bad join orders introduced in previous commit. 2021-01-11 09:19:58 +01:00
madneal
1e2487320c address #4932,fix for errors of Binding behavior 2021-01-09 21:38:25 +08:00
Mathias Vorreiter Pedersen
a00bd7ae02 C++: Respond to review comments. 2021-01-08 19:47:02 +01:00
Geoffrey White
70ce5fde75 C++: Improve metadata for GlobalNamespaceClasses.ql. 2021-01-08 18:27:06 +00:00
Geoffrey White
a6937beee3 Merge branch 'main' into sqltaint 2021-01-08 17:27:43 +00:00
Geoffrey White
7f0209f72e Merge branch 'main' into modelclasses 2021-01-08 17:11:25 +00:00
Shati Patel
b794fcb841 Merge pull request #4925 from shati-patel/fix-links
Fix broken links in CodeQL documentation
2021-01-08 16:35:15 +00:00
Shati Patel
53c46edc1c Address review comments 2021-01-08 15:20:40 +00:00
Rasmus Wriedt Larsen
00c253a710 Java: Don't ignore local taint steps (fixup) 2021-01-08 15:29:01 +01:00
luchua-bc
39103af718 Remove additional taint step 2021-01-08 13:02:57 +00:00
Anders Schack-Mulligen
e5b4975450 Merge pull request #4675 from luchua-bc/cleartext-storage-shared-prefs
Java: Query to detect cleartext storage of sensitive information using Android SharedPreferences
2021-01-08 12:41:34 +01:00
Tamás Vajk
136e5c93d1 Merge pull request #4672 from tamasvajk/feature/extract-anon-types
C#: Extract anonymous types explicitly
2021-01-08 11:54:37 +01:00
CodeQL CI
807fc94627 Merge pull request #4921 from erik-krogh/moreShellSan
Approved by esbena
2021-01-08 00:58:26 -08:00
Tamas Vajk
800fd94572 Add DB upgrade folder 2021-01-08 08:20:49 +01:00
Tamas Vajk
056dbe31d5 C#: Remove throw completion from StringLiteral 2021-01-08 08:14:08 +01:00
Erik Krogh Kristensen
6423c32990 Update javascript/ql/src/semmle/javascript/security/dataflow/UnsafeShellCommandConstructionCustomizations.qll
Co-authored-by: Esben Sparre Andreasen <esbena@github.com>
2021-01-07 22:02:39 +01:00
luchua-bc
b56fe2b25f Remove specific method name in additional taint step 2021-01-07 16:31:21 +00:00
Shati Patel
cdcb4a9599 Fix redirects from Sphinx linkcheck 2021-01-07 15:45:40 +00:00
Shati Patel
3da66b7fd9 Fix broken links from Sphinx linkcheck 2021-01-07 15:45:28 +00:00
Tamas Vajk
f971f42bb1 Add new stats file 2021-01-07 15:24:10 +01:00
Tamas Vajk
fdf5cf9dd0 C#: Extract anonymous types explicitly 2021-01-07 15:24:10 +01:00
Tom Hvitved
63f76b1b43 C#: Uniform treatment of all SSA definitions 2021-01-07 15:16:44 +01:00
Tom Hvitved
8d77f4bac9 C#: Remove ImplicitUntrackedDefinition 2021-01-07 15:16:39 +01:00
luchua-bc
606d0946fc Update qldoc 2021-01-07 14:05:12 +00:00
Tamás Vajk
3b16d2689d Merge pull request #4821 from tamasvajk/feature/csharp9-cil-init-prop
C#: Extract init only accessors from CIL
2021-01-07 15:04:40 +01:00
CodeQL CI
c193d9f375 Merge pull request #4823 from erik-krogh/furtherReDoS
Approved by esbena
2021-01-07 05:24:07 -08:00
luchua-bc
19ff00bad4 Enhance the additional step flow and update qldoc 2021-01-07 13:15:30 +00:00
Erik Krogh Kristensen
7eab08511b add source code examples to blocksCharInAccess 2021-01-07 13:58:26 +01:00
Erik Krogh Kristensen
8b03ab0c01 update docstring for getAShellChar
Co-authored-by: Esben Sparre Andreasen <esbena@github.com>
2021-01-07 13:58:26 +01:00
Erik Krogh Kristensen
2aa59a3f8b support sanitizers that sanitize individual chars in js/shell-command-constructed-from-input 2021-01-07 13:58:25 +01:00
Mathias Vorreiter Pedersen
13a67c906e Merge pull request #4810 from geoffw0/multtoalloc
C++: Query for multiplications used in allocations.
2021-01-07 13:48:58 +01:00
luchua-bc
b54e5b1c49 Revamp the library module 2021-01-07 12:44:59 +00:00
ihsinme
2d6dafc6be Update MemoryLeakOnFailedCallToRealloc.ql 2021-01-07 15:44:50 +03:00
ihsinme
f378c14659 Update MemoryLeakOnFailedCallToRealloc.expected 2021-01-07 15:43:58 +03:00
ihsinme
592cd284e8 Update test.c 2021-01-07 15:41:31 +03:00
CodeQL CI
7db5a999e9 Merge pull request #4919 from erik-krogh/revertSum
Approved by esbena
2021-01-07 03:55:14 -08:00
Tamás Vajk
6cbff13778 Merge pull request #4905 from tamasvajk/fix/attribute-argument-extraction
C#: Fix attribute argument extraction
2021-01-07 12:28:43 +01:00
Erik Krogh Kristensen
7e21081b70 add comment about regexp detected by js/polynomial-redos 2021-01-07 12:06:12 +01:00
Alexander Eyers-Taylor
4100973d17 Merge pull request #4914 from alexet/fix-spec-bugs
QL Language specification. Fix multiple spec bugs.
2021-01-07 10:56:53 +00:00
Mathias Vorreiter Pedersen
7b003678a9 Merge branch 'main' into mathiasvp/reverse-read-take-3 2021-01-07 11:56:18 +01:00
Tamas Vajk
e00db46d60 Minor code quality improvements 2021-01-07 09:19:13 +01:00
Tom Hvitved
2c09f9a8f2 Merge pull request #4903 from hvitved/csharp/ssa-fast-tc
C#: Port SSA performance improvements from Java
2021-01-07 09:17:21 +01:00
Erik Krogh Kristensen
bfd8d1b1e9 Merge branch 'main' into revertSum 2021-01-06 23:04:08 +01:00
ihsinme
abdeaabd77 Update MemoryLeakOnFailedCallToRealloc.ql 2021-01-06 22:46:03 +03:00
ihsinme
2b8227e04d Update cpp/ql/src/experimental/Security/CWE/CWE-401/MemoryLeakOnFailedCallToRealloc.ql
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2021-01-06 22:23:46 +03:00
ihsinme
f7eb328f76 Update cpp/ql/src/experimental/Security/CWE/CWE-401/MemoryLeakOnFailedCallToRealloc.qhelp
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2021-01-06 22:18:14 +03:00
ihsinme
d7f31ca1a0 Update cpp/ql/src/experimental/Security/CWE/CWE-401/MemoryLeakOnFailedCallToRealloc.qhelp
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2021-01-06 22:17:26 +03:00
CodeQL CI
9d4cd0aa85 Merge pull request #4862 from erik-krogh/shellSanitizer
Approved by esbena
2021-01-06 11:16:12 -08:00
Geoffrey White
b5bcbd303e C++: Cleaner solution. 2021-01-06 18:22:31 +00:00
Geoffrey White
f69ceb3dbb Merge pull request #4904 from MathiasVP/conflated-dataflow-testcases
C++: Add dataflow testcases that need flow through conflated memory
2021-01-06 17:48:18 +00:00
Francis Alexander
435502e070 missing new lines 2021-01-06 23:05:09 +05:30
luchua-bc
ce2db21f15 Query to detect hash without salt 2021-01-06 17:30:04 +00:00
Francis Alexander
1f5a466e46 Playframework test cases & review fixes 2021-01-06 22:57:14 +05:30
luchua-bc
f13b8814f5 Update class/method names in the module 2021-01-06 16:49:35 +00:00
luchua-bc
5690bf49f4 Optimize the query 2021-01-06 16:21:26 +00:00
Alexander Eyers-Taylor
2686335531 Merge pull request #1 from shati-patel/fix-spec-bugs-edits
Editorial review for QL language updates
2021-01-06 14:48:26 +00:00
Erik Krogh Kristensen
f1cee70e82 add class-field flowstep to js/shell-command-constructed-from-input 2021-01-06 14:37:00 +01:00
Tamas Vajk
04074c425b C#: Fix named attribute argument extraction 2021-01-06 14:27:36 +01:00
Tamas Vajk
44372f4db7 C#: Fix attribute argument extraction when default argument value is present 2021-01-06 14:27:36 +01:00
Tamas Vajk
6d95ad3282 C#: Add file instead of generated location for extraction errors when possible 2021-01-06 14:27:31 +01:00
luchua-bc
3d26e5b8a4 Update qldoc 2021-01-06 12:41:00 +00:00
Shati Patel
bc6b1e8ed7 Fix typos and small formatting bugs 2021-01-06 12:11:16 +00:00
Geoffrey White
81205f37c5 C++: Fix test annotation. 2021-01-06 11:45:17 +00:00
Tom Hvitved
74622cf6f3 C#: Fix join-order following stats update 2021-01-06 12:16:19 +01:00
Shati Patel
203d74f255 Remove links to QLDoc spec 2021-01-06 11:04:58 +00:00
Shati Patel
b230868893 Merge pull request #4874 from shati-patel/docs-highlighting
Docs: Tweak syntax highlighting
2021-01-06 10:51:01 +00:00
Jonas Jensen
2483b09e44 Merge pull request #4913 from MathiasVP/pre-hook-autoformat-check
Add pre-commit hook to scripts folder and document it
2021-01-06 11:26:39 +01:00
Erik Krogh Kristensen
28cffa1e07 add comment in isFork about /(a*)*/ regular expressions 2021-01-06 10:44:13 +01:00
Erik Krogh Kristensen
c58f67b189 reintroduce performance improvement - but sound this time 2021-01-06 10:44:13 +01:00
Erik Krogh Kristensen
4392f0270c autoformat 2021-01-06 10:37:36 +01:00
Erik Krogh Kristensen
3d98732136 support nested stars in js/ReDoS 2021-01-06 10:37:35 +01:00
Erik Krogh Kristensen
77967c3e63 undo unsound optimization in js/ReDoS 2021-01-06 10:36:21 +01:00
Erik Krogh Kristensen
b42aac17d5 add more tests for js/ReDoS 2021-01-06 10:34:06 +01:00
luchua-bc
f1763ae354 Use the sensitive info sink 2021-01-06 01:48:19 +00:00
Shati Patel
ad07072478 clarify highlight_language conf option 2021-01-05 19:13:28 +00:00
luchua-bc
367ff99909 Change the source to be the request variable 2021-01-05 17:30:19 +00:00
Shati Patel
5a9e098479 Merge pull request #4875 from madneal/htmlComment
Html comment
2021-01-05 16:15:57 +00:00
CodeQL CI
60bba5ea42 Merge pull request #4886 from madneal/test-custom-quries
Approved by shati-patel
2021-01-05 08:07:12 -08:00
Mathias Vorreiter Pedersen
f18486aa60 Update docs/pre-commit-hook-setup.md
Co-authored-by: Jonas Jensen <jbj@github.com>
2021-01-05 17:00:23 +01:00
Shati Patel
1c0e94984c Update docs/codeql/codeql-cli/query-reference-files.rst 2021-01-05 15:50:54 +00:00
Mathias Vorreiter Pedersen
ae388ec796 Update docs/pre-commit-hook-setup.md
Co-authored-by: Cornelius Riemenschneider <criemen@github.com>
2021-01-05 16:27:53 +01:00
Mathias Vorreiter Pedersen
11e2bc3b78 Respond to review comments. 2021-01-05 16:21:24 +01:00
alexet
0bd8c55510 Docs: Remove qldoc from the TOC as it no longer exists 2021-01-05 15:10:59 +00:00
Shati Patel
edcd2dd294 Merge pull request #4878 from shati-patel/docs-pullquotes
Docs: Change remaining notes to "pull-quote" directives
2021-01-05 14:51:01 +00:00
Shati Patel
2702b65651 Merge pull request #4873 from shati-patel/docs-formatting
Docs: Fix CSS for "pull-quotes" and expandable sections
2021-01-05 14:50:45 +00:00
alexet
5d84ecc7f3 QLSpecification: Fix handling of fields to handle overriding properly. 2021-01-05 14:49:02 +00:00
Tamas Vajk
12c28547fc Fix code review findings 2021-01-05 15:15:13 +01:00
Taus
75cfec863f Merge pull request #4828 from yoff/yoff-python-add-source-nodes
Python: add source nodes
2021-01-05 15:07:51 +01:00
alexet
ebb253e409 QLSpec: Fix typo 2021-01-05 14:01:36 +00:00
alexet
67c2006eb0 QLSpec: Adjust wierd wording 2021-01-05 14:01:36 +00:00
alexet
3db9ad3a97 QLSpec: Prevent int-float transitive closures 2021-01-05 14:01:36 +00:00
alexet
fa8a2c0cce QLSpec: Fix predicate resolution 2021-01-05 14:01:35 +00:00
alexet
ce905c0d34 QLSpec: Finish specification for fields. 2021-01-05 14:01:31 +00:00
Shati Patel
929c007e5d Update docs/codeql/ql-language-reference/expressions.rst
Co-authored-by: hubwriter <hubwriter@github.com>
2021-01-05 13:53:19 +00:00
alexet
82187cb1f6 QLSpec:Link to common mark spec 2021-01-05 12:52:48 +00:00
alexet
2bda26b3df QLSpec: Make qldoc part of the language.
We have treated it this way for a while internally and it corrects for some minor deviations from the spec.
2021-01-05 12:52:42 +00:00
Mathias Vorreiter Pedersen
229ab7623e - Add pre-commit hook script to misc/scripts
- Refer to it in CONTRIBUTING.md
- Add setup note in docs folder
2021-01-05 13:47:30 +01:00
Chris Smowton
e87fd86e63 Merge pull request #4814 from luchua-bc/java/password-in-configuration
Java: Password in Java EE configuration files
2021-01-05 11:42:27 +00:00
Geoffrey White
18890c4a77 C++: Use isAdditionalBarrier in the SqlTainted query. 2021-01-05 11:33:39 +00:00
Geoffrey White
69efe7a72a C++: Add isAdditionalBarrier to DefaultTaintTracking. 2021-01-05 11:32:43 +00:00
CodeQL CI
a5e28ac6d6 Merge pull request #4847 from erik-krogh/afterReDoS
Approved by esbena
2021-01-05 01:51:27 -08:00
Anders Schack-Mulligen
26a9ba4aa0 Merge pull request #4898 from JLLeitschuh/feat/JLL/system_get_property
Add MethodAccessSystemGetProperty predicate
2021-01-05 10:46:22 +01:00
Jonathan Leitschuh
ba4a562c9a Update PrintAst.actual with new test output 2021-01-04 23:37:58 -05:00
luchua-bc
195755d687 Revamp the query to be more selective 2021-01-05 00:04:08 +00:00
luchua-bc
496db4b42f Factor isGetServletMethod into the servlet library 2021-01-04 16:14:13 +00:00
Rasmus Lerchedahl Petersen
8ceb33d3f7 Python: Also restrict StepSumary::step 2021-01-04 16:42:11 +01:00
Geoffrey White
01b204ea30 C++: Add a test case with a tainted integer. 2021-01-04 15:35:18 +00:00
Geoffrey White
7a3f9c7895 C++: Add a test (cleaned up) that was previously in the internal repo. 2021-01-04 15:35:18 +00:00
Jonathan Leitschuh
028e4756bb Apply suggestions from code review
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2021-01-04 10:13:52 -05:00
luchua-bc
c069a5b4c6 Factor private host regex into the networking library and enhance the query 2021-01-04 14:51:32 +00:00
Erik Krogh Kristensen
368603eefa add change note 2021-01-04 15:23:52 +01:00
Tom Hvitved
7f25efd43f Merge pull request #4858 from hvitved/csharp/merge-format-queries
C#: Merge queries `FormatInvalid.ql`, `FormatMissingArgument.ql`, and `FormatUnusedArgument.ql`
2021-01-04 14:53:34 +01:00
Tom Hvitved
1237e566d0 C#: Fix typo 2021-01-04 12:59:45 +01:00
Erik Krogh Kristensen
ce8cc2368b improve precision of intersect 2021-01-04 11:55:51 +01:00
Mathias Vorreiter Pedersen
bb158f1857 C++: Add dataflow testcases that need flow through conflated memory. 2021-01-04 11:43:23 +01:00
Tom Hvitved
c1f822c83f C#: Port SSA performance improvements from Java 2021-01-04 10:18:17 +01:00
Jonas Jensen
86194226e2 Merge pull request #4891 from MathiasVP/get-an-overload-perf-fix
C++: Fix join order in getAnOverload
2021-01-04 10:02:59 +01:00
Tom Hvitved
6d973d0103 Merge pull request #4857 from hvitved/csharp/expr-has-value
C#: Move `Expr::hasValue()` to `DotNet::Expr`
2021-01-04 10:02:45 +01:00
Mathias Vorreiter Pedersen
134982c5a9 C++: Respond to review comments. 2021-01-04 09:06:58 +01:00
Jonathan Leitschuh
54950c2f42 Add MethodAccessSystemGetProperty predicate 2021-01-01 20:07:45 -05:00
Mathias Vorreiter Pedersen
258d04178f C++: Replace SkippableInstruction with local flow steps. 2020-12-30 13:39:24 +01:00
Mathias Vorreiter Pedersen
454605b7b1 C++: Fix join order in getAnOverload. 2020-12-30 10:34:26 +01:00
neal1991
380d15eabe fix for the dead link, #4885 2020-12-28 10:28:50 +08:00
ihsinme
0c7381a3b0 Add files via upload 2020-12-26 20:45:11 +03:00
ihsinme
cd7c47ea39 Add files via upload 2020-12-26 20:43:25 +03:00
luchua-bc
ffe9d4a310 Sensitive GET Query 2020-12-26 16:51:30 +00:00
Shati Patel
8c7245113d Change ordering of sidebar TOC to match index file 2020-12-23 17:16:56 +00:00
Shati Patel
050b15103e Convert remaining notes to pull-quote directives 2020-12-23 17:13:24 +00:00
Shati Patel
dc528767f6 Don't turn arrow into ▶ emoji 2020-12-23 16:47:37 +00:00
Shati Patel
ff8e9e6adf Fix code block in other CodeQL docs 2020-12-23 12:41:46 +00:00
madneal
583395d862 fix LineComment and BlockComment level 2020-12-23 19:49:30 +08:00
neal1991
623de3df41 the level of HTMLHtmlCommentStart and HtmlCommentEnd should be same 2020-12-23 19:18:13 +08:00
Shati Patel
f1d8d9414f Fix code blocks in QL language reference 2020-12-23 10:49:23 +00:00
Shati Patel
a14f53c02f Set default highlighting language to "none" globally
Otherwise Python is the default
2020-12-23 10:29:10 +00:00
Shati Patel
c2fdb47abe Docs: Fix CSS for "pull-quotes" 2020-12-23 07:30:11 +00:00
Mathias Vorreiter Pedersen
6545d0b53a C++: Move conflation check into each disjunct. 2020-12-22 16:56:30 +01:00
Mathias Vorreiter Pedersen
d2d8377e88 Update cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll
Co-authored-by: Jonas Jensen <jbj@github.com>
2020-12-22 16:34:53 +01:00
Erik Krogh Kristensen
44571ffeea use the full ascii set instead of a few chosen chars 2020-12-22 16:00:23 +01:00
Mathias Vorreiter Pedersen
b95cf94824 Update cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll
Co-authored-by: Jonas Jensen <jbj@github.com>
2020-12-22 15:57:34 +01:00
Erik Krogh Kristensen
303408b774 remove duplicate char 2020-12-22 15:48:24 +01:00
Erik Krogh Kristensen
354954c80c changes based on review 2020-12-22 15:41:06 +01:00
Mathias Vorreiter Pedersen
ec35e0d518 C++: Respond to review comments. 2020-12-22 15:22:33 +01:00
Rasmus Wriedt Larsen
3094aedf14 Python: Fix regression in ConceptTests
I accidentially deleted that line :D
2020-12-22 14:42:53 +01:00
Erik Krogh Kristensen
530a4aea35 Merge branch 'main' into shellSanitizer 2020-12-22 13:57:15 +01:00
Erik Krogh Kristensen
f7f88689c4 use strings in isTypeofGard 2020-12-22 13:55:32 +01:00
CodeQL CI
2bb96369f1 Merge pull request #4868 from erik-krogh/boundShell
Approved by esbena
2020-12-22 03:35:42 -08:00
CodeQL CI
7c6b4d7324 Merge pull request #4865 from esbena/js/fix-execa-model
Approved by erik-krogh
2020-12-22 03:32:26 -08:00
Rasmus Wriedt Larsen
dc0d940331 Python: Ensure all concept tests ignore irrelevant results
Since this was causing a CI error.

also changed things a bit so we do it in a consistent way :)
2020-12-22 11:32:42 +01:00
Rasmus Wriedt Larsen
bc4a0bcbeb Python: Split request handler / route setup concept tests
Not doing so earlier was just a mistake.
2020-12-22 11:31:20 +01:00
Erik Krogh Kristensen
da9a4e5267 add test 2020-12-22 11:22:25 +01:00
Erik Krogh Kristensen
b8b5aef5f4 recognize Object.defineProperty(obj, prop, {get: func}) as a property-write 2020-12-22 11:21:41 +01:00
Erik Krogh Kristensen
6a9089b15e recognize bound functions in js/shell-command-constructed-from-input 2020-12-22 11:20:34 +01:00
CodeQL CI
67d0f4d938 Merge pull request #4866 from esbena/js/add-tests-for-examples
Approved by erik-krogh
2020-12-22 02:04:47 -08:00
Rasmus Wriedt Larsen
874af7637f Java: Fix taint-step handling for untrusted-data-external-api
The previous implementation would not handle any `AdditionalTaintStep`
subclasses.
2020-12-22 11:02:50 +01:00
CodeQL CI
e2bba97794 Merge pull request #4860 from erik-krogh/functionExports
Approved by esbena
2020-12-22 01:05:37 -08:00
Erik Krogh Kristensen
df95562f8f remove TTUndefined from TypeOfSanitizer in js/shell-command-constructed-from-input 2020-12-22 09:43:50 +01:00
CodeQL CI
b35edc9de6 Merge pull request #4732 from github/esbena-patch-4
Approved by erik-krogh
2020-12-22 00:42:25 -08:00
Erik Krogh Kristensen
6eb88b9e41 introduce and use TaintTracking::isTypeofGuard 2020-12-22 09:42:12 +01:00
Esben Sparre Andreasen
34a09ff522 JS: add js/conditional-bypass example as a test case 2020-12-22 09:34:25 +01:00
Esben Sparre Andreasen
009527c69c JS: add change note 2020-12-22 09:26:35 +01:00
Mathias Vorreiter Pedersen
77aa9615c0 C++: Accept test changes in paths. 2020-12-22 09:14:55 +01:00
Mathias Vorreiter Pedersen
fd8034cd8c C++: Add store step out of read side effects when we don't have a model for the callee. This brings back the lost result on boost. 2020-12-22 09:14:55 +01:00
Mathias Vorreiter Pedersen
a8b4fb6fd0 C++: Add qldoc (and remove predicate that wasn't needed). 2020-12-22 09:14:54 +01:00
Mathias Vorreiter Pedersen
72a80e3722 C++: Accept test changes. 2020-12-22 09:14:54 +01:00
Mathias Vorreiter Pedersen
145ab17f6b Fix a bad join-order caused by the optimizer not seeing that
`Node.getEnclosingCallable` is functional. This is fixed in the same way
as in Java's DataFlowUtil: We make create a non-virtual dispatching
`getEnclosingCallableImpl`, and implement `getEnclosingCallable` as a
wrapper that uses the `unique` aggregate to tell the compiler that there
is exactly 1 result.

Tuple numbers from an arbitrarily chosen iteration of
DataFlowImpl3::Stage4::fwdFlow0#fffff.

Before:
4569      ~5%        {5} r24 = SCAN DataFlowImpl3::Stage4::fwdFlow#fffff#prev_delta AS I OUTPUT I.<0>, I.<4> 'config', I.<1>, I.<2>, I.<3>
2876      ~1%        {5} r25 = JOIN r24 WITH DataFlowImpl3::LocalFlowBigStep::localFlowEntry#ff AS R ON FIRST 2 OUTPUT r24.<2> 'cc', r24.<0>, r24.<3> 'argAp', r24.<4>, r24.<1> 'config'
409404537 ~0%        {6} r26 = JOIN r25 WITH DataFlowImplCommon::getLocalCallContext#cpe#12#ff AS R ON FIRST 1 OUTPUT r25.<1>, R.<1>, r25.<0> 'cc', r25.<2> 'argAp', r25.<3>, r25.<4> 'config'
2876      ~0%        {6} r27 = JOIN r26 WITH DataFlowUtil::Node::getEnclosingCallable_dispred#ff AS R ON FIRST 2 OUTPUT r26.<0>, true, r26.<5> 'config', r26.<2> 'cc', r26.<3> 'argAp', r26.<4>
79821     ~1781%     {5} r28 = JOIN r27 WITH DataFlowImpl3::Stage4::localStep#ffbfff_0241#join_rhs AS R ON FIRST 3 OUTPUT r27.<3> 'cc', r27.<4> 'argAp', r27.<2> 'config', r27.<5> 'ap', R.<3> 'node'
2876      ~0%        {5} r29 = JOIN r26 WITH DataFlowUtil::Node::getEnclosingCallable_dispred#ff AS R ON FIRST 2 OUTPUT r26.<4>, r26.<0>, r26.<2> 'cc', r26.<3> 'argAp', r26.<5> 'config'
0         ~0%        {5} r30 = JOIN r29 WITH DataFlowImpl3::TNil#ff_1#join_rhs AS R ON FIRST 1 OUTPUT r29.<1>, false, r29.<4> 'config', r29.<2> 'cc', r29.<3> 'argAp'
0         ~0%        {5} r31 = JOIN r30 WITH DataFlowImpl3::Stage4::localStep#ffbfff_02413#join_rhs AS R ON FIRST 3 OUTPUT r30.<3> 'cc', r30.<4> 'argAp', r30.<2> 'config', R.<4> 'ap', R.<3> 'node'
4569      ~157%      {6} r32 = JOIN DataFlowImpl3::Stage4::fwdFlow0#fffff#join_rhs AS L WITH DataFlowImpl3::Stage4::fwdFlow#fffff#prev_delta AS R CARTESIAN PRODUCT OUTPUT R.<3>, L.<0> 'ap', L.<1> 'cc', L.<2> 'argAp', R.<0>, R.<4> 'config'
0         ~0%        {5} r33 = JOIN r32 WITH DataFlowImpl3::TNil#ff_1#join_rhs AS R ON FIRST 1 OUTPUT r32.<4>, r32.<5> 'config', r32.<1> 'ap', r32.<2> 'cc', r32.<3> 'argAp'
0         ~0%        {5} r34 = JOIN r33 WITH DataFlowImpl3::additionalJumpStep#fff_021#join_rhs AS R ON FIRST 2 OUTPUT R.<2> 'node', r33.<2> 'ap', r33.<3> 'cc', r33.<4> 'argAp', r33.<1> 'config'
0         ~0%        {5} r35 = JOIN r34 WITH DataFlowUtil::TIRDataFlowNode#f@staged_ext AS R ON FIRST 1 OUTPUT r34.<0> 'node', r34.<1> 'ap', r34.<2> 'cc', r34.<3> 'argAp', r34.<4> 'config'
0         ~0%        {6} r36 = JOIN r35 WITH project#DataFlowImpl3::Stage3::revFlow#fffff#12 AS R ON FIRST 1 OUTPUT r35.<1> 'ap', r35.<2> 'cc', r35.<3> 'argAp', r35.<4> 'config', r35.<0> 'node', R.<1>

After:
4569     ~0%        {5} r24 = SCAN DataFlowImpl3::Stage4::fwdFlow#fffff#prev_delta AS I OUTPUT I.<0>, I.<4> 'config', I.<1>, I.<2>, I.<3>
2876     ~0%        {5} r25 = JOIN r24 WITH DataFlowImpl3::LocalFlowBigStep::localFlowEntry#ff AS R ON FIRST 2 OUTPUT r24.<0>, r24.<2> 'cc', r24.<3> 'argAp', r24.<4>, r24.<1> 'config'
2876     ~0%        {6} r26 = JOIN r25 WITH DataFlowUtil::Node::getEnclosingCallable_dispred#ff AS R ON FIRST 1 OUTPUT r25.<1> 'cc', R.<1>, r25.<0>, r25.<2> 'argAp', r25.<3>, r25.<4> 'config'
2876     ~0%        {6} r27 = JOIN r26 WITH DataFlowImplCommon::getLocalCallContext#cpe#12#fb AS R ON FIRST 2 OUTPUT r26.<2>, true, r26.<5> 'config', r26.<0> 'cc', r26.<3> 'argAp', r26.<4>
79821    ~1862%     {5} r28 = JOIN r27 WITH DataFlowImpl3::Stage4::localStep#ffbfff_0241#join_rhs AS R ON FIRST 3 OUTPUT r27.<3> 'cc', r27.<4> 'argAp', r27.<2> 'config', r27.<5> 'ap', R.<3> 'node'
2876     ~0%        {5} r29 = JOIN r26 WITH DataFlowImplCommon::getLocalCallContext#cpe#12#fb AS R ON FIRST 2 OUTPUT r26.<4>, r26.<2>, r26.<0> 'cc', r26.<3> 'argAp', r26.<5> 'config'
0        ~0%        {5} r30 = JOIN r29 WITH DataFlowImpl3::TNil#ff_1#join_rhs AS R ON FIRST 1 OUTPUT r29.<1>, false, r29.<4> 'config', r29.<2> 'cc', r29.<3> 'argAp'
0        ~0%        {5} r31 = JOIN r30 WITH DataFlowImpl3::Stage4::localStep#ffbfff_02413#join_rhs AS R ON FIRST 3 OUTPUT r30.<3> 'cc', r30.<4> 'argAp', r30.<2> 'config', R.<4> 'ap', R.<3> 'node'
4569     ~148%      {6} r32 = JOIN DataFlowImpl3::Stage4::fwdFlow0#fffff#join_rhs AS L WITH DataFlowImpl3::Stage4::fwdFlow#fffff#prev_delta AS R CARTESIAN PRODUCT OUTPUT R.<3>, L.<0> 'ap', L.<1> 'cc', L.<2> 'argAp', R.<0>, R.<4> 'config'
0        ~0%        {5} r33 = JOIN r32 WITH DataFlowImpl3::TNil#ff_1#join_rhs AS R ON FIRST 1 OUTPUT r32.<4>, r32.<5> 'config', r32.<1> 'ap', r32.<2> 'cc', r32.<3> 'argAp'
0        ~0%        {5} r34 = JOIN r33 WITH DataFlowImpl3::additionalJumpStep#fff_021#join_rhs AS R ON FIRST 2 OUTPUT R.<2> 'node', r33.<2> 'ap', r33.<3> 'cc', r33.<4> 'argAp', r33.<1> 'config'
0        ~0%        {5} r35 = JOIN r34 WITH DataFlowUtil::TIRDataFlowNode#f@staged_ext AS R ON FIRST 1 OUTPUT r34.<0> 'node', r34.<1> 'ap', r34.<2> 'cc', r34.<3> 'argAp', r34.<4> 'config'
0        ~0%        {6} r36 = JOIN r35 WITH project#DataFlowImpl3::Stage3::revFlow#fffff#12 AS R ON FIRST 1 OUTPUT r35.<1> 'ap', r35.<2> 'cc', r35.<3> 'argAp', r35.<4> 'config', r35.<0> 'node', R.<1>
2020-12-22 09:14:54 +01:00
Mathias Vorreiter Pedersen
f5a2603cc1 C++: Add store steps that target the new partial definitions. 2020-12-22 09:14:54 +01:00
Mathias Vorreiter Pedersen
7a2b69feed C++: Add partial definition class backed by an IPA. 2020-12-22 09:14:54 +01:00
Mathias Vorreiter Pedersen
2930128421 C++: Implement read steps using ReadNodes. 2020-12-22 09:14:54 +01:00
Mathias Vorreiter Pedersen
91debe8669 C++: Add ReadNodes and implement local flow steps into them. 2020-12-22 09:14:54 +01:00
Mathias Vorreiter Pedersen
ba4da72b9e C++: Add examples that require longer access paths 2020-12-22 09:14:53 +01:00
Esben Sparre Andreasen
ab4f3ea259 JS: fixup for execa.shell and execa.shellSync models 2020-12-22 09:06:18 +01:00
Esben Sparre Andreasen
ba714a1214 JS: add execa.shell tests 2020-12-22 09:01:43 +01:00
Erik Krogh Kristensen
34a6e15426 make TypeOfSanitizer slightly more robost 2020-12-22 08:53:14 +01:00
Erik Krogh Kristensen
18d26cabe5 Update javascript/ql/src/semmle/javascript/security/dataflow/UnsafeShellCommandConstructionCustomizations.qll
Co-authored-by: Esben Sparre Andreasen <esbena@github.com>
2020-12-22 08:37:24 +01:00
Jonas Jensen
430194bb66 Merge pull request #4863 from MathiasVP/is-source-on-default-taint-tracking
C++: Overridable isSource on DefaultTaintTracking
2020-12-22 08:32:07 +01:00
Mathias Vorreiter Pedersen
4f07474b62 C++: Also allow custom sources in taintedWithoutGlobals 2020-12-21 19:55:47 +01:00
Rasmus Wriedt Larsen
71a6ef5b00 Python: Model RequestHandler from standard library explicitly 2020-12-21 18:02:31 +01:00
Rasmus Wriedt Larsen
05ab6cd54a Python: Add RemoteFlowSource for django handler without route
A bit scary that we don't have any tests to indicate that I forgot to add this :O
2020-12-21 18:02:30 +01:00
Rasmus Wriedt Larsen
d4d6f0ca0c Python: Model django request handlers without known route 2020-12-21 18:02:22 +01:00
Rasmus Wriedt Larsen
004ff38e22 Python: Add separate RequestHandler concept
Since I really want to use our existing infrastructure to model that we can
recognize something as a request handler without it having a route, we need this
as a separate concept. All tests have been adjusted.

The early modeling was based on flask, where all request-handling is based on
handling requests from a specific route. But with the standard library handling
and handlers without routes, the naming had to change.
2020-12-21 17:31:58 +01:00
Mathias Vorreiter Pedersen
f4f96fe257 C++: Use isSource in queries. These were the only queries that restrict the source after dataflow terminates. 2020-12-21 16:35:35 +01:00
Mathias Vorreiter Pedersen
0e84c638b6 C++: Add isSource to AdjustedConfiguration 2020-12-21 16:34:22 +01:00
Rasmus Wriedt Larsen
a9bbe1d087 Python: Test Django un-routed class-based route handler 2020-12-21 16:01:23 +01:00
Erik Krogh Kristensen
876ba7ef2d add typeof sanitizer to js/shell-command-constructed-from-input 2020-12-21 14:16:55 +01:00
Tom Hvitved
0c78fb2933 Merge pull request #4855 from madneal/fix-for-csharp-docs
Fix for csharp docs
2020-12-21 14:11:36 +01:00
Erik Krogh Kristensen
4ef569fbbe recognize more exported functions in js/shell-command-constructed-from-input 2020-12-21 13:50:22 +01:00
Shati Patel
0a0137bb5e Merge pull request #4859 from github/shati-patel-patch-1
Fix typo in docs title
2020-12-21 12:07:32 +00:00
Erik Krogh Kristensen
e3ec67d5e3 avoid materializing isFeasibleTuple 2020-12-21 12:53:41 +01:00
Jonas Jensen
4308381057 Merge pull request #4846 from MathiasVP/default-taint-tracking-operand-instruction-interleaving
C++: Instruction -> Operand interleaving for DefaultTaintTracking
2020-12-21 12:44:06 +01:00
Shati Patel
66b85f1e5e Fix typo 2020-12-21 11:29:02 +00:00
Neal Caffery
ee0257836f removed, as it fixed by #4848 2020-12-21 19:05:37 +08:00
Erik Krogh Kristensen
cbad705029 general performance improvements in the ReDoS utility library 2020-12-21 11:49:21 +01:00
Tom Hvitved
591f90f98e C#: Add change note 2020-12-21 10:26:49 +01:00
Tom Hvitved
b5a1e039a4 C#: Merge queries FormatInvalid.ql, FormatMissingArgument.ql, and FormatUnusedArgument.ql 2020-12-21 10:13:56 +01:00
Tom Hvitved
8d6c69bf74 C#: Move Expr::hasValue() to DotNet::Expr 2020-12-21 09:46:45 +01:00
Mathias Vorreiter Pedersen
06366fa320 Merge pull request #4856 from jbj/gvn-wrapper-test
C++: Test the AST wrapper for IR GVN
2020-12-21 09:31:10 +01:00
Tom Hvitved
16aee6e71e Merge pull request #4842 from hvitved/csharp/format-method-no-insertion-param
C#: Recognize format methods without insertion parameters
2020-12-21 09:25:18 +01:00
Jonas Jensen
3236cbd83e C++: Test the AST wrapper for IR GVN
Out of our 3 GVN libraries, the one we actually use in production didn't
have tests -- except indirectly through `diff_ir_expr.ql`.
2020-12-21 08:21:02 +01:00
neal1991
b9d24b8255 fix for issue #4849 2020-12-21 08:54:15 +08:00
neal1991
eac83df40b fix for issue #4848 2020-12-21 08:52:42 +08:00
luchua-bc
4ec78d04f8 Insecure LDAP authentication 2020-12-21 00:15:15 +00:00
Erik Krogh Kristensen
3a43421193 add missing qhelp 2020-12-19 00:02:42 +01:00
Erik Krogh Kristensen
05569187b4 improve performance of suffix checking 2020-12-18 17:21:15 +01:00
Erik Krogh Kristensen
6369374224 implement new algorithm for detecting superlinear backtracking in regular expressions 2020-12-18 17:21:15 +01:00
Erik Krogh Kristensen
7ce91e9146 introduce cannonical representatives of RegExpTerms to decrease the number of InputSymbols in the NFA 2020-12-18 17:21:11 +01:00
Erik Krogh Kristensen
34dda6d38b refactor to share predicates between regular expression queries 2020-12-18 16:15:56 +01:00
Rasmus Wriedt Larsen
49f902d28b Merge pull request #4757 from yoff/python-dataflow-synthetic-callables
Python: Enclosing callable for synthetic arguments
2020-12-18 16:06:26 +01:00
yoff
a08eb99778 Merge pull request #4779 from RasmusWL/django-class-based-handlers
Python: Add modeling of django class based view handlers
2020-12-18 15:58:51 +01:00
Anders Schack-Mulligen
5106d5df53 Merge pull request #4833 from luchua-bc/java-broken-crypto-algorithms
Java: Add missing broken crypto algorithms
2020-12-18 15:12:29 +01:00
Rasmus Wriedt Larsen
3e6296c7b8 Python: Fix grammar in QLDoc 2020-12-18 14:54:14 +01:00
Rasmus Wriedt Larsen
ed11e8f916 Python: Simplify predicate implementation
Co-authored-by: yoff <lerchedahl@gmail.com>
2020-12-18 14:52:20 +01:00
Mathias Vorreiter Pedersen
b5102043b1 Fix comments. 2020-12-18 14:19:02 +01:00
Chris Smowton
de4cdda839 Merge pull request #4841 from smowton/smowton/admin/mergeback-126-2020-12-16
Mergeback rc/1.26
2020-12-18 12:59:06 +00:00
Mathias Vorreiter Pedersen
f5e4725642 C++: Propagate flow from instruction's to non-exact operands for arrays and unions, and accept test changes. 2020-12-18 13:54:34 +01:00
Rasmus Lerchedahl Petersen
e6e1cc2398 Python: Remember to accept failing tests 2020-12-18 13:38:14 +01:00
Rasmus Lerchedahl Petersen
712765c185 Python: Use ImportExp instead of SSA nodes
This also reverts the previous commit.
It should be squashed with that one, but for now we keep the history,
so we can track the performance tests.
2020-12-18 13:30:24 +01:00
Erik Krogh Kristensen
b2116dc5b4 add more tests for polynomial/exponential redos 2020-12-18 13:19:17 +01:00
Mathias Vorreiter Pedersen
2bf8e47932 Merge branch 'main' into default-taint-tracking-operand-instruction-interleaving 2020-12-18 11:59:10 +01:00
Mathias Vorreiter Pedersen
7ccd48e53c Make DefaultTaintTracking do operand->instruction->operand interleaving like DataFlowUtil. 2020-12-18 11:57:16 +01:00
Geoffrey White
dc4ca9b1b9 C++: Add qhelp and example. 2020-12-18 10:10:05 +00:00
Tom Hvitved
d53faa86dc C#: Restrict FormatInvalid.ql and UncontrolledFormatString.ql to calls with insertions 2020-12-18 10:53:11 +01:00
Rasmus Lerchedahl Petersen
0629d3e6e7 Python: Enclosing callable for synthetic arguments 2020-12-18 10:45:24 +01:00
Rasmus Lerchedahl Petersen
a16d58dfc0 Python: Add tests cases with synthetic arguments 2020-12-18 10:41:42 +01:00
Jonas Jensen
fd7dec7f20 Merge pull request #4824 from geoffw0/modelchanges5
C++: Add cases in the Allocation model.
2020-12-18 09:16:01 +01:00
Tamas Vajk
8e8c3a9ded Add change note 2020-12-18 09:15:33 +01:00
Tamas Vajk
6fd1f0049d Add DB upgrade folder 2020-12-18 09:10:55 +01:00
yoff
39acc9a40b Merge pull request #4735 from RasmusWL/python-untrusted-flow
Python: Untrusted data used in external APIs
2020-12-18 00:15:08 +01:00
yoff
9dd6439e3c Merge pull request #4749 from RasmusWL/command-injection-tests
Python: Add some command injection tests
2020-12-17 23:36:06 +01:00
yoff
8a44405365 Merge pull request #4827 from RasmusWL/reword-qldoc-for-type-tracking-classes
Python: Reword QLDoc for class modeling with type-tracking
2020-12-17 23:28:19 +01:00
Tamas Vajk
8eeab8fdd0 Add new stats file 2020-12-17 21:22:58 +01:00
Tamas Vajk
f3a0d1d138 Add test to list all custom modifiers extracted from IL 2020-12-17 15:43:41 +01:00
Tamas Vajk
7662b55ecc C#: Extract init only accessors and custom modifiers 2020-12-17 15:43:41 +01:00
luchua-bc
bfb138d415 Update qldoc 2020-12-17 14:42:14 +00:00
Tom Hvitved
7a132149a2 C#: Add change note 2020-12-17 15:39:01 +01:00
Tom Hvitved
fe559c190e C#: Recognize format methods without insertion parameters 2020-12-17 15:39:01 +01:00
Geoffrey White
fda531da49 C++: Add query precision. 2020-12-17 14:31:43 +00:00
luchua-bc
7b44ee50ea Revamp the functions to have a string parameter 2020-12-17 14:26:13 +00:00
Tamas Vajk
57c163f314 C#: Add test for CIL setter extraction 2020-12-17 15:23:33 +01:00
Tamás Vajk
45893ab084 Merge pull request #4775 from tamasvajk/feature/cil-attribute-decoding2
C#: Improve CIL attribute decoding
2020-12-17 15:20:44 +01:00
Tamás Vajk
65c58edbed Merge pull request #4617 from tamasvajk/feature/csharp9-implicit-obj-creation
C#: Extract 'ImplicitObjectCreationExpressionSyntax'
2020-12-17 15:20:13 +01:00
Tamas Vajk
f12befdcd0 Add extra test for collection initialization 2020-12-17 13:49:02 +01:00
luchua-bc
b44f01a87b Enhance the check for embedded passwords 2020-12-17 03:47:38 +00:00
luchua-bc
bed8a68d28 Exclude broken algorithms from the list of secure algorithms 2020-12-17 00:41:23 +00:00
Aditya Sharad
a79f1e145b Merge pull request #4832 from github/docs/add-favicon
[docs] Add GitHub favicon to CodeQL docs
2020-12-16 13:29:32 -08:00
Chris Smowton
faa08c10e0 Merge branch 'rc/1.26' of https://github.com/github/codeql into smowton/admin/mergeback-126-2020-12-16 2020-12-16 21:08:20 +00:00
James Fletcher
7bfc2853cb Merge pull request #4839 from github/docs/css-fixes-126
[CodeQL docs] Fix two CSS bugs (rc/1.26)
2020-12-16 18:10:18 +00:00
James Fletcher
58f17d79c2 Merge pull request #4838 from github/docs/css-fixes
[CodeQL docs] Fix two CSS bugs
2020-12-16 16:44:59 +00:00
james
6c430ce0c7 align list items correctly 2020-12-16 16:41:27 +00:00
james
686eca9adf fix footnote spacing 2020-12-16 16:41:27 +00:00
Geoffrey White
136fa01b87 C++: Query headers (apart from precison - needs more research). 2020-12-16 16:24:10 +00:00
Geoffrey White
1e3535754b C++: Violation message. 2020-12-16 16:13:02 +00:00
james
ff123f8e78 align list items correctly 2020-12-16 15:58:12 +00:00
Geoffrey White
2210344f4d C++: Add a test. 2020-12-16 15:44:53 +00:00
james
256460dddc fix footnote spacing 2020-12-16 15:31:25 +00:00
Tamas Vajk
1bc65a68df Address PR review comments 2020-12-16 16:12:11 +01:00
Geoffrey White
c89f7d824b C++: Back out support for SysAllocString. It turns out supporting all of the SysAlloc stuff is beyond our current models, supporting just SysFreeString as we do is OK. 2020-12-16 15:08:53 +00:00
CodeQL CI
41ef7a3fce Merge pull request #4733 from erik-krogh/args
Approved by esbena
2020-12-16 06:51:26 -08:00
CodeQL CI
287954e0d8 Merge pull request #4686 from erik-krogh/buildFp
Approved by esbena
2020-12-16 06:42:41 -08:00
Erik Krogh Kristensen
94e07bb91c add change note 2020-12-16 15:10:03 +01:00
Erik Krogh Kristensen
99af484042 move the "commander" source 2020-12-16 15:05:59 +01:00
luchua-bc
6b77922a25 Fix typo and update qldoc 2020-12-16 14:04:45 +00:00
Erik Krogh Kristensen
2ae0400922 update docstring for dashdash 2020-12-16 15:00:44 +01:00
Erik Krogh Kristensen
3d03e7192c Update javascript/ql/src/semmle/javascript/security/dataflow/IndirectCommandInjectionCustomizations.qll
Co-authored-by: Esben Sparre Andreasen <esbena@github.com>
2020-12-16 14:57:20 +01:00
Erik Krogh Kristensen
d377a02825 add change note 2020-12-16 14:53:23 +01:00
James Fletcher
8b6c53cbb5 Merge pull request #4830 from owen-mc/update-go-supported-frameworks
Update supported Go frameworks
2020-12-16 10:07:48 +00:00
Jonas Jensen
406cc64dcc Merge pull request #4831 from geoffw0/printfunknown
C++: Fix Printf.qll specsAreKnown
2020-12-16 10:56:56 +01:00
james
1a7ca1d3d2 add favicon to query help and support projects 2020-12-16 09:29:26 +00:00
CodeQL CI
9ae8880bd0 Merge pull request #4802 from max-schaefer/js/external-remote-flow-sources
Approved by asgerf, jf205
2020-12-16 00:34:40 -08:00
luchua-bc
d7facb42d6 Add missing broken crypto algorithms 2020-12-16 04:32:11 +00:00
Robert Marsh
5d2a553059 C++/C#: autoformat 2020-12-15 17:16:31 -08:00
james
c26ae246b3 correct path to favicon on docs landing page 2020-12-15 20:24:29 +00:00
Robert Marsh
fd14eb4c8c C++: remove unreachable IR operands in late stages 2020-12-15 11:45:40 -08:00
james
f8d8082cf3 add github favicon 2020-12-15 19:34:56 +00:00
Geoffrey White
93dfeac3c8 C++: Make specsAreKnown more accurate. 2020-12-15 17:43:28 +00:00
Geoffrey White
676e85a155 C++: Re-enable the check. 2020-12-15 17:42:10 +00:00
Geoffrey White
94dea9f71d C++: Add a test of unknown format specifiers (with specsAreKnown check disabled). 2020-12-15 17:40:32 +00:00
Tamas Vajk
8fd409898a Add new stats file 2020-12-15 18:34:47 +01:00
Owen Mansel-Chan
1d3d4ed4bf Update supported Go frameworks 2020-12-15 17:04:32 +00:00
Max Schaefer
cf5891487d Apply suggestions from code review
Co-authored-by: James Fletcher <42464962+jf205@users.noreply.github.com>
2020-12-15 15:56:05 +00:00
Max Schaefer
f8d8a9b356 Apply suggestions from code review
Co-authored-by: James Fletcher <42464962+jf205@users.noreply.github.com>
2020-12-15 15:44:19 +00:00
james
7e3feb4f52 add beta note and tweak intro text 2020-12-15 15:35:28 +00:00
james
4720e6cd3b typo 2020-12-15 15:26:07 +00:00
Rasmus Lerchedahl Petersen
638fcab12d Python: Allow path from non-sourceNodes
This is against the philosophy, but we
have still restricted attributes.
We use this PR to test performance.
2020-12-15 15:35:16 +01:00
Rasmus Wriedt Larsen
8df186167e Python: Reword QLDoc for class modeling with type-tracking
As discussed in https://github.com/github/codeql/pull/4797#discussion_r542423387
2020-12-15 15:15:03 +01:00
yoff
be5dbf2ccf Merge pull request #4797 from RasmusWL/stdlib-http-source-modeling
Python: Model sources from stdlib HTTP servers
2020-12-15 14:49:32 +01:00
Tamas Vajk
3cf967458f Fix failing test 2020-12-15 14:28:51 +01:00
james
99a634d2c2 add introduction to article 2020-12-15 12:11:29 +00:00
Tamas Vajk
adba961634 Add DB upgrade folder 2020-12-15 13:10:53 +01:00
Tamas Vajk
6cf3ca49e4 C#: Extract 'ImplicitObjectCreationExpressionSyntax' 2020-12-15 13:10:53 +01:00
Tom Hvitved
8c235323e7 Merge pull request #4796 from hvitved/csharp/cfg/simplify
C#: Various simplifications to CFG logic
2020-12-15 13:07:13 +01:00
Mathias Vorreiter Pedersen
9265e9ec3f Merge pull request #4822 from geoffw0/swap
C++: Bring 'swap' models together.
2020-12-15 12:45:43 +01:00
Rasmus Wriedt Larsen
050e720770 Python: Minor rewrite
Co-authored-by: yoff <lerchedahl@gmail.com>
2020-12-15 12:02:56 +01:00
Rasmus Wriedt Larsen
272feedb69 Merge branch 'main' into stdlib-http-source-modeling 2020-12-15 11:59:23 +01:00
Rasmus Wriedt Larsen
ed53742f03 Python: Fix additional taint-steps for cgi
So there isn't flow from *any* instance to *any* access of the methods,
but only from the _actual_ instance where the method is accessed.
2020-12-15 11:41:00 +01:00
Max Schaefer
00f244c1d4 JavaScript: Add documentation about new way of adding remote flow sources. 2020-12-15 10:16:20 +00:00
Geoffrey White
4bf2f3af50 C++: Fix comment. 2020-12-15 10:15:41 +00:00
Rasmus Lerchedahl Petersen
e64af59667 Merge branch 'main' of github.com:github/codeql into tausbn-python-add-source-nodes 2020-12-15 11:13:35 +01:00
Rasmus Lerchedahl Petersen
a152833a51 Merge branch 'python-add-source-nodes' of https://github.com/tausbn/codeql into tausbn-python-add-source-nodes 2020-12-15 11:13:02 +01:00
Tamás Vajk
e391356893 Merge pull request #4630 from tamasvajk/feature/csharp9-init-prop
C#: Add support for init only accessors
2020-12-15 11:12:32 +01:00
Geoffrey White
d7a92e581f Merge branch 'main' into swap 2020-12-14 17:54:11 +00:00
Geoffrey White
9c77d3c829 C++: Add AliasFunction model. 2020-12-14 17:52:02 +00:00
Geoffrey White
f9a7322d68 C++: Remove redundant check. 2020-12-14 17:16:16 +00:00
luchua-bc
523f0fb247 Enhance the query and update qldoc 2020-12-14 17:01:30 +00:00
Tamas Vajk
74c88e6bac Add DB stats 2020-12-14 17:16:29 +01:00
Geoffrey White
e02ebfb9bd C++: Add extra cases to Allocation / Deallocation. 2020-12-14 14:00:36 +00:00
Geoffrey White
899d1ab6d8 C++: Add tests of strdup (and variants) as allocators. 2020-12-14 13:50:11 +00:00
Rasmus Wriedt Larsen
ceaaac217e Merge pull request #4798 from yoff/python-reflected-xss-fp-examples
Python: Add example FP for reflected XSS
2020-12-14 13:56:24 +01:00
CodeQL CI
0420ac7aac Merge pull request #4820 from RasmusWL/add-pymysql-modeling
Approved by yoff
2020-12-14 03:04:24 -08:00
CodeQL CI
90dbb60c7f Merge pull request #4819 from RasmusWL/pep249-execute-on-connection
Approved by yoff
2020-12-14 03:04:08 -08:00
Rasmus Wriedt Larsen
daf418624e Python: Make all PEP249 implementations private
Since we're still sticking with `private by default` at least for a while longer.
2020-12-14 10:57:51 +01:00
Rasmus Wriedt Larsen
31d4ea77cb Python: Add modeling of PyMySQL 2020-12-14 10:56:47 +01:00
Rasmus Wriedt Larsen
e7b6400e48 Python: Add tests for PyMySQL 2020-12-14 10:55:01 +01:00
CodeQL CI
66f4120cdd Merge pull request #4721 from github/nextReDoS
Approved by asgerf
2020-12-14 01:48:12 -08:00
Tom Hvitved
bb637f666c C#: Introduce CfgScope class and generalize ControlFlowTree to include callables 2020-12-14 10:38:39 +01:00
Rasmus Wriedt Larsen
8d8e92eb09 Python: Model execute on a DB connection 2020-12-14 10:33:10 +01:00
Rasmus Wriedt Larsen
18f7dbe865 Python: Adjust PEP249 QLDocs 2020-12-14 10:26:17 +01:00
Tom Hvitved
a92404a6cd C#: Add LabeledStmtTree for goto CFG edges 2020-12-14 09:58:54 +01:00
Tom Hvitved
06d42dac3e C#: Use set literals in Splitting.qll 2020-12-14 09:58:54 +01:00
Tom Hvitved
0b2233155c C#: Simplify CFG logic for finally blocks 2020-12-14 09:58:53 +01:00
Tom Hvitved
249eea9d2b Merge pull request #4780 from hvitved/csharp/cfg/nested-finally
C#: Add missing CFG edges for nested `finally` blocks
2020-12-14 09:57:36 +01:00
luchua-bc
d469e9b24e Format the code and minor text change 2020-12-13 21:15:18 +00:00
luchua-bc
e27ccd0a81 Format the code and update qldoc 2020-12-13 02:33:03 +00:00
James Fletcher
ca80f04726 Merge pull request #4808 from github/jf205-patch-2
Add `workflow_dispatch` to `generate-query-help-docs.yml`
2020-12-12 13:45:51 +00:00
Max Schaefer
be35e85639 JavaScript: Add change note. 2020-12-12 11:42:55 +00:00
Max Schaefer
9f8508fdc7 JavaScript: Allow specifying additional remote flow sources through JSON. 2020-12-12 11:42:55 +00:00
luchua-bc
7ba237120b Password in Java EE configuration files 2020-12-12 05:15:04 +00:00
Robert Marsh
a404ca66d1 C++: fix typo 2020-12-11 16:16:19 -08:00
Robert Marsh
96e913031d C#: share IR Operand IPA type between stages 2020-12-11 16:11:00 -08:00
Robert Marsh
89a59d5f1a C++: comments about shared Operand IPA type 2020-12-11 15:52:07 -08:00
Robert Marsh
1e08c11d40 C++: Share Operand IPA type across IR stages 2020-12-11 14:47:25 -08:00
CodeQL CI
9ff6d68a9b Merge pull request #4778 from asgerf/js/more-prototype-pollution
Approved by erik-krogh, mchammer01
2020-12-11 13:58:09 -08:00
Robert Marsh
af180d430e Merge pull request #4805 from geoffw0/sscanf
C++: Refine examples and tests for cpp/memory-unsafe-function-scan (experimental) query
2020-12-11 12:42:11 -08:00
james
a5c0802379 address review comments 2020-12-11 17:29:22 +00:00
James Fletcher
e5ef0e35df Merge pull request #4813 from github/replace-language
[docs] Fix find and replace error
2020-12-11 17:16:43 +00:00
james
b9c8818da5 update landing page 2020-12-11 16:27:56 +00:00
james
bc3f7b61fb fix find and replace error 2020-12-11 14:47:40 +00:00
yoff
9bec9b46e1 Merge pull request #4801 from RasmusWL/sqlite3-support
Python: Add sqlite3 support
2020-12-11 13:30:24 +01:00
Tamas Vajk
1b50c2277f Add DB upgrade folder 2020-12-11 11:24:53 +01:00
Tamas Vajk
4318941009 C#: Add support for init only accessors 2020-12-11 10:06:38 +01:00
Robert Marsh
0210c1f721 Merge pull request #4783 from geoffw0/modelchanges4
C++:  More use of set literals.
2020-12-10 15:24:50 -08:00
Geoffrey White
b79ca4535a C++: Undo the iterator.qll change. Notice that it was 'and' not 'or'. 2020-12-10 18:29:39 +00:00
Geoffrey White
c5592a1ed7 C++: New experimental query. 2020-12-10 16:46:09 +00:00
James Fletcher
9c6962ec25 Update generate-query-help-docs.yml 2020-12-10 09:39:44 +00:00
James Fletcher
0640d2834d Update generate-query-help-docs.yml 2020-12-10 09:19:44 +00:00
James Fletcher
66c756b7f5 Update generate-query-help-docs.yml 2020-12-10 09:07:30 +00:00
Tamas Vajk
a7451a12fc Fix attribute test after rebase 2020-12-09 21:24:21 +01:00
Tamas Vajk
f50cdf5ac7 Add logging to missing underlying enum type 2020-12-09 21:04:12 +01:00
Tamas Vajk
8e6e4189b3 Add logging to attribute decoding failures 2020-12-09 21:04:12 +01:00
Tamas Vajk
db426c1ffe C#: Extract generic types in CIL attribute extraction 2020-12-09 21:04:12 +01:00
Tamas Vajk
56eb04fe6d C#: Improve attribute argument (type, enum) decoding in CIL extraction 2020-12-09 21:04:12 +01:00
Tamas Vajk
0c0ef772c1 Add method to get qualified name of CIL extraction types 2020-12-09 21:00:39 +01:00
Tamas Vajk
d270aa2281 C#: Extract ID writing logic to separate class 2020-12-09 21:00:39 +01:00
Tamas Vajk
fc5f6c5203 C#: Fix ID of TypeReferenceType for top level classes 2020-12-09 21:00:39 +01:00
Tamas Vajk
332a64a6ca Fix erroneous refactorings 2020-12-09 21:00:39 +01:00
Tamas Vajk
151379edd8 C#: Cleanup CIL extraction 'Type' classes 2020-12-09 21:00:39 +01:00
Tamás Vajk
b649ccd880 Merge pull request #4761 from tamasvajk/feature/cil-enum-underlying
C#: Extract enum underlying type from IL
2020-12-09 20:55:37 +01:00
Geoffrey White
3bef0e5c00 C++: Implement a general model. 2020-12-09 18:53:49 +00:00
yo-h
f95c480b51 Merge pull request #4799 from joefarebrother/xxe-fp
Java: Fix false positive in the XXE query
2020-12-09 12:08:20 -05:00
Geoffrey White
209191bb24 C++: Add another good example. 2020-12-09 16:55:07 +00:00
Geoffrey White
80db155d54 C++: Fix example and test. 2020-12-09 16:46:48 +00:00
Joe Farebrother
732542adcb Add change note 2020-12-09 16:41:31 +00:00
James Fletcher
48a9521df9 Merge pull request #4803 from github/rename-js-dataflow-article
Update JavaScript dataflow guide filename to match article title
2020-12-09 15:39:19 +00:00
james
70c5ce41c2 rename js-ts article 2020-12-09 14:49:58 +00:00
Max Schaefer
0ccfe4f135 JavaScript: Teach autobuilder to include codeql-javascript-*.json files. 2020-12-09 11:35:51 +00:00
Rasmus Wriedt Larsen
36e8ef53eb Python: Model sqlite3 as SQL interface 2020-12-09 11:36:18 +01:00
Rasmus Wriedt Larsen
767a246edc Python: Add sqlite3 test 2020-12-09 11:36:17 +01:00
Asger F
ed729a1963 Apply suggestions from code review
Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com>
2020-12-09 09:59:55 +00:00
Asger Feldthaus
fd293d07d7 JS: Address doc review 2020-12-09 09:58:52 +00:00
Geoffrey White
d08efb4e47 C++: Combine the member swap models. 2020-12-08 19:50:13 +00:00
Geoffrey White
4a81d36309 C++: Move all of the swap models into Swap.qll. 2020-12-08 18:19:43 +00:00
Geoffrey White
e18f290864 C++: Correct comment. 2020-12-08 16:55:19 +00:00
Joe Farebrother
24dc631a8f Java: Fix false positive in XXE query 2020-12-08 16:38:42 +00:00
Joe Farebrother
2fd5d26b1b Add FP as a test case 2020-12-08 16:37:53 +00:00
Rasmus Lerchedahl Petersen
a757a69f36 Python: Add example FP 2020-12-08 17:02:05 +01:00
Tamas Vajk
2257a8d47e Add change notes 2020-12-08 16:43:16 +01:00
Tamas Vajk
2d2b919651 Add DB upgrade folder 2020-12-08 16:43:16 +01:00
Tamas Vajk
52a73cb21b Add new stats containing 'cil_enum_underlying_type' 2020-12-08 16:40:29 +01:00
Tamás Vajk
6dd0234b68 Apply suggestions from code review
Co-authored-by: Tom Hvitved <hvitved@github.com>
2020-12-08 16:40:29 +01:00
Tamas Vajk
214cc90af5 Fix failing test 2020-12-08 16:40:29 +01:00
Tamas Vajk
44dfafc52c C#: remove 'System.Enum' from enums in QL 2020-12-08 16:40:29 +01:00
Tamas Vajk
6b3010e3e6 C#: Extract enum underlying type from IL 2020-12-08 16:40:29 +01:00
Tamas Vajk
c7d6c42851 C#: Add underlying enum type test for CIL extraction 2020-12-08 16:40:29 +01:00
Tamás Vajk
ec573b517f Merge pull request #4759 from tamasvajk/feature/cil-attribute-array
C#: Improve array argument CIL extraction for attributes
2020-12-08 16:38:36 +01:00
Tamás Vajk
cbcae667a8 Apply suggestions from code review
Co-authored-by: Tom Hvitved <hvitved@github.com>
2020-12-08 15:23:13 +01:00
yoff
3bddb946b7 Merge pull request #4773 from RasmusWL/path-injection-improvements
Python: Path injection improvements
2020-12-08 14:05:53 +01:00
Rasmus Wriedt Larsen
fabc6fb7d9 Python: Add change-note 2020-12-08 14:04:46 +01:00
Rasmus Wriedt Larsen
ba1ca70858 Python: Add source modeling of stdlib HTTPRequestHandlers 2020-12-08 14:04:15 +01:00
Rasmus Wriedt Larsen
34863721f0 Python: Model cgi.FieldStorage 2020-12-08 14:03:13 +01:00
Rasmus Wriedt Larsen
43688715f5 Python: Add test of stdlib HTTP server facilities
Just a port of the old tests, except for the fact that I learned
`cgi.FieldStorage()` _should_ be tainted when not specifying any arguments. (and
moved taint-test to own function)

Also clarified how imports of all the .*HTTPRequestHandler works in Python2
2020-12-08 14:01:55 +01:00
James Fletcher
2b5d12143c Merge pull request #4795 from github/126-mergeback
Merge `rc/1.26` into `main`
2020-12-08 11:21:28 +00:00
Rasmus Wriedt Larsen
976559889f Python: Reword qhelp text
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2020-12-08 11:34:44 +01:00
Rasmus Wriedt Larsen
fba16d24de Python: Bring back Path Injection query
Which was accidentially removed when resolving a merge conflict.
2020-12-08 11:26:04 +01:00
james
da16fad0f1 Merge branch 'rc/1.26' into 126-mergeback 2020-12-08 09:26:12 +00:00
Tom Hvitved
f8ad2ecc2c Merge pull request #4777 from hvitved/csharp/default-to-string-join
C#: Improve join-order in `DefaultToString.qll`
2020-12-08 08:53:58 +01:00
Geoffrey White
ef131d3951 C++: Fix StandardDeallocationFunction. 2020-12-07 18:52:35 +00:00
Geoffrey White
281b56b2ae C++: Add comments to the Allocation and Deallocation libraries indicating where the functions come from. 2020-12-07 18:52:03 +00:00
Rasmus Wriedt Larsen
e5e8ec6ecc Python: Add a few test-cases for barrier guards and references
I'm not sure references is the best name, but it's the best I could come up with
jsut now
2020-12-07 15:27:20 +01:00
Rasmus Wriedt Larsen
5aa2c2f9d4 Python: Add command injection regex restricted FP 2020-12-07 15:26:56 +01:00
Rasmus Wriedt Larsen
32b547b3f2 Python: Add example of bad command injection sanitizer 2020-12-07 15:26:55 +01:00
Rasmus Wriedt Larsen
8444654117 Python: Adjust whitespace in command injection test 2020-12-07 15:26:54 +01:00
CodeQL CI
8129d0c0ac Merge pull request #4762 from asgerf/js/template-sinks-in-code-injection
Approved by erik-krogh, mchammer01
2020-12-07 04:35:11 -08:00
Cornelius Riemenschneider
354adf363e Merge pull request #4787 from github/RasmusWL-patch-1
C++: Minor test README fixes
2020-12-07 12:42:55 +01:00
Asger Feldthaus
04f51bef5e JS: Add missing qldoc 2020-12-07 10:52:38 +00:00
Rasmus Wriedt Larsen
9e7d5b3a9c C++: Minor test README fixes 2020-12-07 11:52:18 +01:00
Asger Feldthaus
f96c425a72 JS: Deny -> block 2020-12-07 10:50:01 +00:00
Asger Feldthaus
254ac7f963 JS: Fix TypeofCheck 2020-12-07 10:46:00 +00:00
Tom Hvitved
6a55a22f18 Merge pull request #4781 from hvitved/csharp/persisten-cookie-tests
C#: Add tests for `PersistentCookie.ql`
2020-12-07 11:37:16 +01:00
Asger Feldthaus
0496642b0b JS: Add test for captured flow into callback 2020-12-07 10:34:27 +00:00
Asger Feldthaus
355cfaaf42 JS: Autoformat 2020-12-07 10:16:39 +00:00
Asger Feldthaus
1b0bec9143 JS: Remove magic from barrier guard predicates 2020-12-07 10:16:39 +00:00
Asger Feldthaus
fe86465a0b JS: Refactor store/load flow a bit 2020-12-07 10:16:38 +00:00
Asger Feldthaus
f132b4a279 JS: Add type confusion sink for prototype pollution checks 2020-12-07 10:16:38 +00:00
Asger Feldthaus
e10a22ec26 JS: Restrict size of some predicates 2020-12-07 10:16:38 +00:00
Asger Feldthaus
daab3c1437 JS: Add tests and fix some bugs 2020-12-07 10:16:38 +00:00
Asger Feldthaus
0a7513fdfb JS: Move and rename test cases as well 2020-12-07 10:16:38 +00:00
Asger Feldthaus
479dcf56ad JS: Update to use more inclusive language 2020-12-07 10:16:38 +00:00
Asger Feldthaus
544b3d9631 JS: Change note 2020-12-07 10:16:38 +00:00
Asger Feldthaus
e42ca881a3 JS: Update security suite after move to CWE-915 2020-12-07 10:16:38 +00:00
Asger Feldthaus
ca38a1c8b9 JS: Update CWE tags 2020-12-07 10:16:38 +00:00
Asger Feldthaus
25161ed338 JS: Move all prototype pollution queries to CWE-915 2020-12-07 10:16:38 +00:00
Asger Feldthaus
877b4b0752 JS: Move and rename other prototype pollution queries 2020-12-07 10:16:38 +00:00
Asger Feldthaus
972c4d61e5 JS: Add PrototypePollutingAssignment 2020-12-07 10:16:38 +00:00
Asger Feldthaus
ef52c46aed JS: Add spread step in TaintedObject 2020-12-07 10:16:37 +00:00
Sauyon Lee
b5ec26d935 Merge pull request #4744 from github/sauyon/html-refactor
JavaScript: Factor out HTML extractor
2020-12-07 02:06:42 -08:00
Sauyon Lee
17e450f227 JavaScript: Factor out HTML extractor 2020-12-06 05:04:10 -08:00
Tom Hvitved
3531dde032 C#: Simplify FinallySplit::toString() 2020-12-05 20:16:11 +01:00
Tom Hvitved
2f1057383e C#: Add missing CFG edges for nested finally blocks 2020-12-05 20:12:11 +01:00
Geoffrey White
998eaf90ee C++: Run through updated autoformat. 2020-12-04 18:53:24 +00:00
Jonas Jensen
bc340e210b Merge pull request #4745 from ihsinme/main
CPP: Add query for CWE-191 into experimental this reveals a dangerous comparison
2020-12-04 18:00:41 +01:00
yo-h
54d7cac46d Merge pull request #4718 from aschackmull/java/cleanup-deprecated
Java: Remove some deprecated classes.
2020-12-04 11:17:14 -05:00
yo-h
a5393b4661 Merge pull request #4746 from aschackmull/java/ssa-perf
Java: Improve performance of SSA.
2020-12-04 11:16:39 -05:00
Tom Hvitved
5d73566859 C#: Add tests for PersistentCookie.ql 2020-12-04 17:14:00 +01:00
Tamás Vajk
4226467556 Merge pull request #4678 from tamasvajk/feature/external-api-untrusted-data
C#: Add queries to check untrusted data flow to external APIs
2020-12-04 15:03:09 +01:00
Rasmus Wriedt Larsen
608ce50399 Python: Expose HTTP verbs in HTTP concept
Let's discuss whether doing it this way is reasonable, since I'm not 100% sure
whether this fits into "concepts" or not.
2020-12-04 14:04:56 +01:00
Rasmus Wriedt Larsen
c7ab78f8c2 Python: Add modeling of django class based view handlers
BUT, since MyCustomViewBaseClass.post (django-v2-v3/testapp/views.py) and
Foo.post (django-v2-v3/routing_test.py) aren't handled, this raises important
question about how to do MRO without points-to :S
2020-12-04 14:03:59 +01:00
Cornelius Riemenschneider
2ea9b4a62b Merge pull request #4719 from geoffw0/issue84
C++: Create tests readme.
2020-12-04 13:49:56 +01:00
Tamas Vajk
aa3ae0f567 Remove calls to deprecated predicates 2020-12-04 13:28:14 +01:00
Jonas Jensen
9cf318b72c C++: Autoformat the new query
Tweak whitespace, also in the alert message.
2020-12-04 13:27:07 +01:00
Rasmus Wriedt Larsen
4ead118a31 Python: Add class based route handler in django tests
Disabled CSRF middleware for now, since it blocked my debugging curl POST requests :(
2020-12-04 13:27:01 +01:00
Tamas Vajk
d55fbc8a05 Add test cases for safe API calls 2020-12-04 13:26:53 +01:00
Tamas Vajk
24670160c2 Address code review findings 2020-12-04 13:26:53 +01:00
Tamas Vajk
cd5c1f06ee C#: Add queries to check untrusted data flow to external APIs 2020-12-04 13:26:53 +01:00
Tom Hvitved
9afce31e92 C#: Add one more CFG test for nested finally blocks 2020-12-04 13:26:00 +01:00
Jonas Jensen
bf88df8134 C++: CRLF -> LF line endings 2020-12-04 13:25:32 +01:00
Tom Hvitved
37f32f4014 C#: Improve join-order in DefaultToString.qll 2020-12-04 13:05:53 +01:00
Rasmus Wriedt Larsen
ffdbecfbb7 Python: Simplify getARouteHandler for Django 2020-12-04 11:29:52 +01:00
CodeQL CI
0f5f0ed99e Merge pull request #4776 from asgerf/js/electron-openshell
Approved by erik-krogh
2020-12-04 09:12:44 +00:00
Asger F
22dbaf28ab Merge pull request #4709 from asgerf/js/typescript-4.1
JS: Support for TypeScript 4.1
2020-12-04 09:10:14 +00:00
Asger Feldthaus
f0516dd9e0 JS: Address review comments 2020-12-04 09:07:44 +00:00
Jonas Jensen
b4be72268d Merge pull request #4722 from rdmarsh2/rdmarsh2/cpp/range-analysis-overflow-perf
C++: Filter out lower bounds on overflowing exprs
2020-12-04 08:29:21 +01:00
ihsinme
69ed608a11 Update UnsignedDifferenceExpressionComparedZero.ql 2020-12-04 09:47:11 +03:00
Robert Marsh
b45f7846db C++: autoformat 2020-12-03 15:48:42 -08:00
Erik Krogh Kristensen
cc98c41dd6 revert marking repetitions with possibly empty body as forks 2020-12-03 20:08:07 +01:00
Geoffrey White
13d9d5dc45 C++: Use [,] more in general. 2020-12-03 18:50:43 +00:00
Geoffrey White
2a4fba0ff9 C++: Use [,] more in models. 2020-12-03 17:27:31 +00:00
Erik Krogh Kristensen
47488f86b5 update test 2020-12-03 16:58:08 +01:00
Erik Krogh Kristensen
3bad75dae5 better support for forms in js/xss-through-dom 2020-12-03 16:57:41 +01:00
Asger Feldthaus
20d9848f07 JS: Add test case 2020-12-03 15:08:43 +00:00
Asger Feldthaus
68d2bc861d JS: Update test expectations 2020-12-03 15:01:50 +00:00
Asger Feldthaus
e66a49bea6 JS: Change note 2020-12-03 13:58:40 +00:00
Asger Feldthaus
ec6b8d6d3a JS: Remove old workaround for template literals in import 2020-12-03 13:58:40 +00:00
Asger Feldthaus
757398f5fd JS: Add upgrade script and stats 2020-12-03 13:58:39 +00:00
Asger Feldthaus
3b3052d792 JS: Autoformat 2020-12-03 13:58:39 +00:00
Asger Feldthaus
5676891e44 JS: Add TemplateLiteralTypeExpr 2020-12-03 13:58:39 +00:00
Asger Feldthaus
9da5c5cc70 JS: Update to TypeScript 4.1.2 2020-12-03 13:58:39 +00:00
Asger F
254072dd6d Merge pull request #4546 from toufik-airane/main
JS: Add ElectronShellOpenExternalSink class for Electron framework security
2020-12-03 13:20:46 +00:00
Rasmus Wriedt Larsen
a9ce067e15 Python: Add examples of Path Injection FPs seen
Not quite sure how to deal with these cases of safe if UNIX-only, otherwise not
safe.

If/when we actually try to deal with these, we also need to figure that
out. We _could_ split this queyr into 3: (1) for path injection on any
platform, (2) path injection on windows, (3) path injection on UNIX. Then
UNIX-only projects could disable the path-injection on windows query. -- that's
my best idea, if you have better ideas, DO tell 👍
2020-12-03 13:41:55 +01:00
Rasmus Wriedt Larsen
e8f63311ac Python: Model abspath and realpath (for Path Injection) 2020-12-03 13:41:54 +01:00
Rasmus Wriedt Larsen
bd5cf80352 Python: Add Path Injection tests for realpath and abspath
Not supported currently
2020-12-03 13:41:53 +01:00
Rasmus Wriedt Larsen
e53ed478ab Python: Highlight os.path.join behavior with absolute paths 2020-12-03 13:41:52 +01:00
Rasmus Wriedt Larsen
4d9f24a24c Python: Rewrite path injection tests
To match how you would normally structure your application code. In itself not
that important, but makes it easier to add more tests :)
2020-12-03 13:41:26 +01:00
Tamás Vajk
3eb55ddc0b Merge pull request #4704 from tamasvajk/feature/stats2
C#: Update DB stats file
2020-12-03 13:13:43 +01:00
Mathias Vorreiter Pedersen
1142a79ad5 Merge pull request #4766 from criemen/cleanup-flow-tests
C++: Cleanup data/taint flow tests
2020-12-03 10:10:39 +01:00
CodeQL CI
edbbc846d0 Merge pull request #4753 from max-schaefer/js/more-nosql-query-args
Approved by asgerf, mchammer01
2020-12-03 08:46:47 +00:00
Tamás Vajk
04bacf4347 Merge pull request #4760 from tamasvajk/feature/cil-debug-build
C#: Fix CIL trap file writing in debug mode
2020-12-02 22:08:22 +01:00
CodeQL CI
e266cedc84 Merge pull request #4700 from RasmusWL/python-add-code-injection-FP
Approved by tausbn
2020-12-02 16:29:21 +00:00
CodeQL CI
6017f25106 Merge pull request #4740 from RasmusWL/fix-json-modeling
Approved by tausbn
2020-12-02 16:29:00 +00:00
Mathias Vorreiter Pedersen
e0a9e2dca7 Merge pull request #4754 from geoffw0/modelchanges3
C++: Expose more information in FormattingFunction and make subclasses private.
2020-12-02 17:12:55 +01:00
Geoffrey White
4322b214c6 C++: Link to standards. 2020-12-02 15:57:38 +00:00
Geoffrey White
420d47b676 Apply suggestions from code review
Co-authored-by: hubwriter <hubwriter@github.com>
2020-12-02 15:54:28 +00:00
Tamas Vajk
ba56993396 C#: Fix CIL trap file writing in debug mode 2020-12-02 16:52:33 +01:00
Tamas Vajk
d140b0121a C#: Improve array argument CIL extraction for attributes 2020-12-02 16:51:45 +01:00
Tamas Vajk
636ff2d76e C#: Add CIL attribute tests 2020-12-02 16:51:45 +01:00
Tamás Vajk
6e6cd05787 Merge pull request #4758 from tamasvajk/feature/cil-structure-change
C#: Cleanup CIL extraction structure
2020-12-02 16:49:31 +01:00
Geoffrey White
d20619d779 Merge branch 'main' into modelchanges3 2020-12-02 14:45:54 +00:00
Cornelius Riemenschneider
feb05542d2 C++: Refactor common implementation of data/taint flow tests. 2020-12-02 15:42:52 +01:00
Anders Schack-Mulligen
0cc324b715 Merge pull request #3839 from luchua-bc/uncaught-servlet-exception
Java: Uncaught servlet exception
2020-12-02 15:12:59 +01:00
Asger Feldthaus
412939d071 JS: Autoformat 2020-12-02 13:08:32 +00:00
Anders Schack-Mulligen
0175a596ef Update java/ql/src/experimental/Security/CWE/CWE-600/UncaughtServletException.ql 2020-12-02 13:33:59 +01:00
Taus
9eeaceac2a Merge pull request #4739 from RasmusWL/recrete-regex-fp
Python: Add regex FP with + for flags
2020-12-02 13:01:47 +01:00
Tom Hvitved
ecfa66e19a C#: Use getParentNamespace instead of getParent 2020-12-02 10:39:29 +01:00
Mathias Vorreiter Pedersen
203bbdd84f Merge pull request #4741 from criemen/port-dataflow-tests
C++: Port dataflow tests to inline expectations test library.
2020-12-02 10:25:52 +01:00
Tom Hvitved
9c516bf62c C#: Fix join-order in UselessUpcast.ql 2020-12-02 10:12:57 +01:00
Cornelius Riemenschneider
f3a7d87d46 C++: Remove vscode snippets. 2020-12-02 09:30:10 +01:00
Arthur Baars
7f485dfe70 Merge pull request #4763 from github/yo-h/java15-merge
Java: adjust test options for JDK 15 upgrade
2020-12-02 05:15:10 +01:00
yo-h
cdeeefc235 Merge commit '8f2094f' into yo-h/java15-merge 2020-12-01 17:47:58 -05:00
Robert Marsh
8c1f15b261 C++: refactor getLowerBoundsImpl for perfomance 2020-12-01 14:42:37 -08:00
Cornelius Riemenschneider
239588b5e0 C++: Remove MISSING annotations for tests that are already correct. 2020-12-01 19:41:24 +01:00
Geoffrey White
39a939c36f C++: Update change note. 2020-12-01 18:34:01 +00:00
Cornelius Riemenschneider
7700e87cca C++: Address review. 2020-12-01 19:08:49 +01:00
Cornelius Riemenschneider
5b1ab86ac6 C++: Port DefaultTaintTracking tests to inline expectations test. 2020-12-01 19:00:45 +01:00
Asger Feldthaus
5561e8f1f6 JS: Delete old query and update qhelp 2020-12-01 17:05:48 +00:00
Asger Feldthaus
6211fe718b JS: Add test 2020-12-01 17:05:48 +00:00
Asger Feldthaus
1459d9197d JS: Adjust alert message for template sinks 2020-12-01 17:05:48 +00:00
Asger Feldthaus
8412a6bcbb JS: Add template injection sinks to js/code-injection 2020-12-01 17:05:48 +00:00
Geoffrey White
7c00477736 C++: Combine getOutputParameterIndex and isOutputStream. 2020-12-01 16:27:30 +00:00
Geoffrey White
c9c159ad0b C++: Autoformat. 2020-12-01 15:37:26 +00:00
Geoffrey White
799b932c17 C++: Restore QLDoc on deprecated predicates. 2020-12-01 15:21:06 +00:00
Tamas Vajk
9ab930f812 C#: Remove marker interfaces from CIL extraction 2020-12-01 16:06:13 +01:00
Tamas Vajk
df28544020 C#: Separate all classes to dedicated files in CIL extractor 2020-12-01 15:20:02 +01:00
Tom Hvitved
9dbcb7c642 C#: Improve various join orders 2020-12-01 15:16:33 +01:00
Tom Hvitved
931e695ac7 C#: Fix bad join-order in UselessTypeTest.ql 2020-12-01 15:16:00 +01:00
Tamas Vajk
dffd95cb85 Add nomagic to fix performance 2020-12-01 15:16:00 +01:00
Tamas Vajk
cf76d31161 C#: Add nomagic pragmas to fix performance issues 2020-12-01 15:16:00 +01:00
Tamas Vajk
b20a08dbac C#: Update DB stats file 2020-12-01 15:16:00 +01:00
Mathias Vorreiter Pedersen
df29a16365 Merge pull request #4748 from aschackmull/autoformat-callchain
C++/C#/Java/JavaScript/Python: Autoformat.
2020-12-01 13:21:19 +01:00
Geoffrey White
79f32b0e26 C++: Autoformat. 2020-12-01 10:51:51 +00:00
Tom Hvitved
e86db3c7a1 Merge pull request #4725 from hvitved/csharp/cfg/constant-condition-block
C#: Always create basic blocks for nodes with a conditional predecessor
2020-12-01 10:03:17 +01:00
Erik Krogh Kristensen
c50951cbae add missing qldoc 2020-12-01 09:48:35 +01:00
Erik Krogh Kristensen
afbb921c7e add change note 2020-12-01 09:18:40 +01:00
Erik Krogh Kristensen
9a31ed13ac add test case 2020-12-01 09:18:40 +01:00
Erik Krogh Kristensen
dea2eb5443 simplify the logging sink - using the new API-graph logging models 2020-12-01 09:18:40 +01:00
Erik Krogh Kristensen
6f29a877fa move logInjection out of experimental 2020-12-01 09:18:40 +01:00
Erik Krogh Kristensen
f6c358861c convert logging models to use API-graphs 2020-12-01 09:18:36 +01:00
Geoffrey White
9c277b3cb1 C++: Fix a small bug in the ArrayFunction model for FormattingFunction. 2020-11-30 17:55:25 +00:00
Geoffrey White
510bce36f1 C++: Change note. 2020-11-30 17:55:24 +00:00
Geoffrey White
b52ddbfc42 C++: Implement isOutputStream, isOutputString for UserDefinedFormattingFunction as well. 2020-11-30 17:55:24 +00:00
Geoffrey White
c3b16a5fd2 C++: Implement FormattingFunction isOutputStream, isOutputString so that subclasses don't need to be accessed for this information, and can be private. 2020-11-30 17:55:23 +00:00
Rasmus Wriedt Larsen
a08e1db601 Python: Remove leftover note to self in qhelp file 2020-11-30 17:44:18 +01:00
Cornelius Riemenschneider
659e3d46e3 C++: Add vscode snippets for Inline Expectations test. 2020-11-30 17:34:02 +01:00
Cornelius Riemenschneider
0d0fa1b341 C++: Delete difference tests. 2020-11-30 17:33:27 +01:00
Cornelius Riemenschneider
b632ca40b4 C++: Port dataflow/taint-tests to inline expectations test. 2020-11-30 17:32:54 +01:00
Max Schaefer
978d2db252 JavaScript: Add models for more Mongoose methods. 2020-11-30 16:32:13 +00:00
Geoffrey White
99b01e7d36 C++: Additional test case for FormattingFunction. 2020-11-30 15:25:51 +00:00
Rasmus Lerchedahl Petersen
289b9e62f9 Python: Add read step for unpacking assignment 2020-11-30 15:30:14 +01:00
Anders Schack-Mulligen
8f2094f0bf Autoformat. 2020-11-30 14:42:38 +01:00
Rasmus Wriedt Larsen
94e90aac39 Python: Only one Unit implementation
Conflict arose since the Unit in DataFlowPrivate was added in a merged PR.

The behavior from this PR will make it match what java does (931322e4c5/java/ql/src/semmle/code/Unit.qll)
2020-11-30 14:41:47 +01:00
Rasmus Wriedt Larsen
1eac1995a9 Merge branch 'main' into python-untrusted-flow 2020-11-30 14:38:52 +01:00
Rasmus Lerchedahl Petersen
f345e55951 Python: Adjust test expectations 2020-11-30 14:21:30 +01:00
Rasmus Lerchedahl Petersen
673ff901fb Python: Test for unpacking assignment 2020-11-30 14:18:22 +01:00
Anders Schack-Mulligen
88e0759365 Java: Change RemoteUserInput to private instead of removing. 2020-11-30 13:40:53 +01:00
Anders Schack-Mulligen
5a66d6ab93 Java: Improve performance of SSA. 2020-11-30 11:26:03 +01:00
Rasmus Wriedt Larsen
4ab3fff973 Python: Fix untrusted data to external API example
The hmac.digest function was only added in python 3.7, so obviously doesn't work
on Python 2
2020-11-30 10:42:30 +01:00
Anders Schack-Mulligen
931322e4c5 Merge pull request #4668 from aschackmull/dataflow/refactor-pruning
Dataflow: Refactor pruning stages.
2020-11-30 09:37:04 +01:00
Pavel Avgustinov
74af41c76d Merge pull request #4357 from RasmusWL/design-patterns
Add docs on CodeQL Design Patterns
2020-11-30 08:19:15 +00:00
yo-h
7e8bc4a61b Merge commit '2fa9037' into yo-h/java15-merge 2020-11-29 18:42:20 -05:00
Erik Krogh Kristensen
33b2701551 refine isFork to remove false positive when a state has epsilon transition to itself 2020-11-29 21:42:50 +01:00
ihsinme
d088d5b0f3 CPP: Add query for CWE-191
into experimental this reveals a dangerous comparison
2020-11-28 15:52:00 +03:00
Erik Krogh Kristensen
d7b22e3b1b update expected output for PolynomialBackTracking 2020-11-27 20:15:27 +01:00
Erik Krogh Kristensen
729073fb43 detect ReDoS when the choices are "match some string" or "match Epsilon" 2020-11-27 20:15:23 +01:00
Geoffrey White
905b04a6fb C++: Model classes in StdString.qll. 2020-11-27 19:12:01 +00:00
Rasmus Wriedt Larsen
cbfcfdf883 Python: Fix UntrustedDataToExternalAPI.qhelp 2020-11-27 17:54:22 +01:00
luchua-bc
ad0ac5b874 Change kind to problem 2020-11-27 16:43:57 +00:00
Rasmus Wriedt Larsen
faa5c220c5 Design Patterns: Add advice on abstract classes 2020-11-27 17:38:56 +01:00
Rasmus Wriedt Larsen
452417509f Design Patterns: Reword advice on imports of subclasses
I had totally overlooked the fact that this doesn't only apply to abstract
classes.
2020-11-27 17:38:40 +01:00
Cornelius Riemenschneider
644a0fac98 C++: Port dataflow/dataflow-tests to inline expectations test library. 2020-11-27 16:03:15 +01:00
Rasmus Wriedt Larsen
a0c7365ae6 Python: Proper models of json.loads and json.dumps 2020-11-27 15:57:56 +01:00
Tom Hvitved
d4ee8cdd18 C#: Always create basic blocks for nodes with a conditional predecessor 2020-11-27 15:08:33 +01:00
Rasmus Wriedt Larsen
014fbfa86b Python: Add regex FP with + for flags
Notice that there is no new results for line 54

I also added a test for the short-named version of a flag, just since I didn't
see any of those already. That just works out of the box (due to points-to).
2020-11-27 14:57:11 +01:00
yoff
346a007bf6 Merge pull request #4720 from RasmusWL/python-better-open-models
Python: better models of `open` function
2020-11-27 14:47:10 +01:00
Anders Schack-Mulligen
028a72bcdd Merge pull request #4610 from luchua-bc/java-nfe-local-android-dos
Java: Query to detect Local Android DoS caused by NFE
2020-11-27 14:20:23 +01:00
Erik Krogh Kristensen
46ca56458a introduce a printable state class 2020-11-27 13:45:41 +01:00
Erik Krogh Kristensen
8a3e87fe42 remove unnecessary one-step inline 2020-11-27 13:45:41 +01:00
Erik Krogh Kristensen
36b9f0254e performance improvements for suffix check in js/redos 2020-11-27 13:45:41 +01:00
Erik Krogh Kristensen
e177d46c0a add two test cases that demonstrate the limits of the suffix construction 2020-11-27 13:45:34 +01:00
Rasmus Wriedt Larsen
e6319e5d84 Python: Rewrite StringConstCompare to use IterableNode 2020-11-27 13:37:03 +01:00
Rasmus Wriedt Larsen
098f8c4f21 Python: Add IterableNode
I'm specifically not using an abstract class, since that is an anti-pattern:
https://github.com/github/codeql/pull/4357#discussion_r520526275 (I'm still
trying to wrap my head fully aroudn this)
2020-11-27 13:36:55 +01:00
Tamás Vajk
2fa9037934 Merge pull request #4738 from tamasvajk/feature/revert-relational-pattern
C#: Revert "Merge pull request #4653 from tamasvajk/feature/csharp9-relational-pattern"
2020-11-27 13:30:33 +01:00
Rasmus Wriedt Larsen
33e46e168f Python: Add QLDoc for SetNode 2020-11-27 13:29:16 +01:00
Tamas Vajk
998e2de2c6 Revert "Merge pull request #4653 from tamasvajk/feature/csharp9-relational-pattern"
This reverts commit 5e75a4109c, reversing
changes made to c751c516bf.
2020-11-27 12:23:38 +01:00
Anders Schack-Mulligen
fec9758252 Dataflow: Sync. 2020-11-27 12:16:43 +01:00
Anders Schack-Mulligen
8f4fce185b Dataflow: Review fixes. 2020-11-27 12:16:28 +01:00
Rasmus Wriedt Larsen
cc9a7fe4fe Python: Move BarrierGuards to own file 2020-11-27 12:09:57 +01:00
Geoffrey White
a94f244659 Merge pull request #4736 from jbj/downgrade-to-recommendations
C++: Downgrade two queries to recommendation
2020-11-27 10:58:20 +00:00
CodeQL CI
d3cded330e Merge pull request #4693 from RasmusWL/python-add-import-test-shadowing-stdlib-v2
Approved by tausbn
2020-11-27 10:32:21 +00:00
Tamás Vajk
5e75a4109c Merge pull request #4653 from tamasvajk/feature/csharp9-relational-pattern
C#: Extract relational patterns
2020-11-27 11:23:12 +01:00
Geoffrey White
390e61b674 C++: Add public domain and translated from QL exceptions. 2020-11-27 10:15:56 +00:00
Rasmus Wriedt Larsen
7b4e890e7b Python: Fix grammar
Co-authored-by: Taus <tausbn@github.com>
2020-11-27 11:00:30 +01:00
Erik Krogh Kristensen
fd0d5c9e46 add command parsing model for "commander" 2020-11-27 09:58:00 +00:00
Erik Krogh Kristensen
653ebf7668 add command parsing model for "dashdash" 2020-11-27 09:57:05 +00:00
Erik Krogh Kristensen
269de49196 add model for "meow" 2020-11-27 09:57:05 +00:00
Erik Krogh Kristensen
c5ac98d2e8 add command parsing model for command-line-args 2020-11-27 09:57:05 +00:00
Erik Krogh Kristensen
f33cd8bc8e add command parsing model for argparse 2020-11-27 09:57:05 +00:00
Erik Krogh Kristensen
45067ee651 add command parsing model for "arg" 2020-11-27 09:57:05 +00:00
Erik Krogh Kristensen
821b4be522 more accurately model command parsers that take process.argv as an argument 2020-11-27 09:56:50 +00:00
Jonas Jensen
8069e7b031 C++: Downgrade two queries to recommendation
The `cpp/local-variable-hides-global-variable` doesn't seem right as a
warning without some additional context. For example, is the local
variable and the global variable used in the same function body, and
do they have similar enough types that it would be possible to confuse
them.

The `cpp/missing-header-guard` query enforces good style and helps with
compilation speed, but AFAIK it has never flagged a correctness issue.
Therefore I think it should be a recommendation.
2020-11-27 10:45:03 +01:00
Tamas Vajk
07c989deb1 C#: Add upgrade folder 2020-11-27 10:21:17 +01:00
Tamas Vajk
5a808190d4 Address review comments 2020-11-27 10:16:57 +01:00
Tamas Vajk
b11fc2f957 C#: Extract relational patterns 2020-11-27 10:16:57 +01:00
Tamás Vajk
c751c516bf Merge pull request #4614 from tamasvajk/feature/csharp9-target-typed
C#: C#9 Add target typed conditional tests
2020-11-27 10:10:58 +01:00
Jonas Jensen
a48235e871 Merge pull request #4730 from MathiasVP/definitionHasPhiNode-join-order-fix
C++: Fix join order in definitionHasPhiNode
2020-11-27 09:54:37 +01:00
Jonas Jensen
edb57c2da0 Merge pull request #4731 from criemen/remove-cpp-abstract
C++: Remove uses of abstract from the standard library.
2020-11-27 09:53:24 +01:00
Tom Hvitved
bc08e47a4e Merge pull request #4664 from hvitved/csharp/cfg/refactor
C#: Refactor CFG implementation
2020-11-27 09:26:57 +01:00
Tamas Vajk
548f276e1f Add more tests 2020-11-27 08:58:37 +01:00
Tamas Vajk
144e9e6271 C#: C#9 Add target typed conditional tests 2020-11-27 08:43:02 +01:00
Jonas Jensen
ad4b2beafa Merge pull request #4727 from criemen/remove-abstract-classes
C++/C#/JS/Python/Java XML.qll: Remove abstract from class hierarchy.
2020-11-27 08:17:21 +01:00
yo-h
301f49a9d9 Merge pull request #4723 from github/yo-h/java-jsp
Java: add support for extraction of SMAP files
2020-11-26 16:09:17 -05:00
Geoffrey White
1f5c6d4e71 C++: Add examples. 2020-11-26 19:31:06 +00:00
Anders Schack-Mulligen
2234d665ce Add manual magic 2020-11-26 13:55:20 -05:00
yo-h
9bb949a8b1 Java: make some SMAP predicates private and add QLDoc 2020-11-26 13:55:19 -05:00
yo-h
c077ca3fc9 Java: add dbscheme upgrade script for SMAP relations 2020-11-26 13:55:19 -05:00
yo-h
f9e78085ac Java: add dbscheme stats for SMAP relations 2020-11-26 13:55:18 -05:00
yo-h
edb41655b4 Java: incorporate SMAP locations into Top.hasLocationInfo 2020-11-26 13:55:17 -05:00
yo-h
e2419e8fed Java: add SMAP relations to dbscheme 2020-11-26 13:55:17 -05:00
Tamás Vajk
27aeb53f1e Merge pull request #4615 from tamasvajk/feature/csharp9-lambda-modifiers
C#: Extract modifiers for lambdas (async, static)
2020-11-26 19:35:51 +01:00
luchua-bc
a83ddd66eb Add comments about how the future promotion should go 2020-11-26 17:41:46 +00:00
Rasmus Wriedt Larsen
9e4910f863 Python: Untrusted data used in external APIs
A port of the one for Java that was added in https://github.com/github/codeql/pull/3938
2020-11-26 18:19:35 +01:00
Rasmus Wriedt Larsen
7e3dbb0149 Python: Add Unit helper library
Like Java did in https://github.com/github/codeql/pull/4184
2020-11-26 18:17:14 +01:00
luchua-bc
7ad031ca70 Move to experimental and update qldoc 2020-11-26 17:09:53 +00:00
Erik Krogh Kristensen
f576144ec6 more pruning based on states being inside a repetition 2020-11-26 17:30:37 +01:00
Tamas Vajk
864fce43bd C#: Add upgrade folder 2020-11-26 16:14:38 +01:00
Tamas Vajk
47ca4b0f3b Address review comments 2020-11-26 16:12:19 +01:00
Tamas Vajk
55d47a70f4 C#: Extract modifiers for lambdas (async, static) 2020-11-26 16:12:18 +01:00
Tamás Vajk
252692e5c1 Merge pull request #4616 from tamasvajk/feature/csharp9-attribute-local-function
C#: Allow attributes on local functions
2020-11-26 16:04:00 +01:00
Mathias Vorreiter Pedersen
a4c060a4c6 Merge pull request #4729 from MathiasVP/safe-external-api-function-use-model-interfaces-only
C++: Use model interfaces in DefaultSafeExternalAPIFunction
2020-11-26 16:00:19 +01:00
Geoffrey White
ab071b1e6a C++: Disambiguate 'Library'. 2020-11-26 14:57:18 +00:00
Tom Hvitved
cb91dc1308 C#: Rank StandardStmt::getChildElement() 2020-11-26 15:13:57 +01:00
Erik Krogh Kristensen
9468a6e8dc update expected output 2020-11-26 12:32:55 +01:00
Cornelius Riemenschneider
f6c3c2bdcc C++: Auto-format Type.qll. 2020-11-26 11:45:49 +01:00
Mathias Vorreiter Pedersen
b02ac7f523 C++: Use SideEffectFunction (instead of ArrayFunction) to define DefaultSafeExternalAPIFunction. 2020-11-26 11:02:47 +01:00
Esben Sparre Andreasen
82e8114c0f Add security tag to js/angular/double-compilation 2020-11-26 10:39:19 +01:00
Cornelius Riemenschneider
5d80417854 Update cpp/ql/src/semmle/code/cpp/Type.qll
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2020-11-26 10:39:17 +01:00
Tamas Vajk
18a757445d Add DB upgrade folder 2020-11-26 10:37:28 +01:00
Erik Krogh Kristensen
1b3c3ef4cb adjust comments in ReDoS test case 2020-11-26 10:31:44 +01:00
Tamas Vajk
a931c59a28 C#: Allow attributes on local functions 2020-11-26 10:24:12 +01:00
Tamás Vajk
89a4cff5f8 Merge pull request #4662 from tamasvajk/feature/csharp9-type-pattern
C#: Extract type patterns
2020-11-26 10:18:55 +01:00
Cornelius Riemenschneider
ba32459adf C++: Remove uses of abstract from the standard library. 2020-11-26 10:17:40 +01:00
Mathias Vorreiter Pedersen
5f4ad3ad7d C++: Fix join order in definitionHasPhiNode 2020-11-26 10:07:44 +01:00
Tamas Vajk
3bd6807681 C#: Extract type patterns 2020-11-26 08:54:40 +01:00
Anders Schack-Mulligen
f70072a2db Merge pull request #3454 from porcupineyhairs/javaSSRf
Java : add request forgery query
2020-11-26 08:52:15 +01:00
Tamás Vajk
d29a6ec4c6 Merge pull request #4654 from tamasvajk/feature/csharp9-parens-pattern
C#: Handle parenthesized pattern extraction
2020-11-26 08:46:38 +01:00
Jonas Jensen
6fecc38004 Merge pull request #4726 from MathiasVP/revert-4558
C++: Revert 4558
2020-11-26 08:44:32 +01:00
yo-h
eedc385b37 Java 15: adjust test options 2020-11-26 00:14:24 -05:00
Tamas Vajk
9b8d9771f8 C#: Handle parenthesized pattern extraction 2020-11-25 21:27:34 +01:00
Mathias Vorreiter Pedersen
c595baf1e3 C++: Remove INTERNAL from qldoc now that the Pure model implementations are private. 2020-11-25 21:07:47 +01:00
Geoffrey White
bc71c72084 Merge pull request #4728 from criemen/delete-magicdraw
C++: Remove MagicDraw.qll
2020-11-25 17:56:37 +00:00
Mathias Vorreiter Pedersen
7730f5dfcf C++: Use model interfaces in SafeExternalAPIFunction and make the three previosuly-used implementation models private. 2020-11-25 18:20:55 +01:00
Cornelius Riemenschneider
3bfb398516 Autoformat XML.qll. 2020-11-25 18:20:50 +01:00
Cornelius Riemenschneider
acf6c218bc C++: Remove MagicDraw.qll 2020-11-25 17:36:30 +01:00
Tamás Vajk
65dbb6e45f Merge pull request #4612 from tamasvajk/feature/csharp9-local-function-without-body
C#: C#9 Extract local functions without body
2020-11-25 17:28:03 +01:00
Cornelius Riemenschneider
7eec988fb5 XML.qll: Remove abstract from class hierarchy. 2020-11-25 17:22:03 +01:00
Jonas Jensen
dcc048139e Merge pull request #4717 from criemen/escapetree-temp-objects
C++: Improve EscapesTree.qll analysis in the presence of temporary objects
2020-11-25 17:11:44 +01:00
Cornelius Riemenschneider
0b8403fc05 C++: Add one more test. 2020-11-25 16:24:55 +01:00
Cornelius Riemenschneider
b4e45ad6cb C++: Address review. 2020-11-25 16:24:25 +01:00
Mathias Vorreiter Pedersen
4c3a26fea8 Revert "Merge pull request #4558 from rdmarsh2/rdmarsh2/cpp/remove-initialize-nonlocal"
This reverts commit 08efd7fbd9, reversing
changes made to cb8c5e8cca.
2020-11-25 15:51:52 +01:00
Tamas Vajk
19883302af C#: Extract local functions without body 2020-11-25 14:42:40 +01:00
Erik Krogh Kristensen
11d878b413 adjust comments to reflect the precission of the suffix search 2020-11-25 14:40:33 +01:00
Tamás Vajk
aa45920f31 Merge pull request #4613 from tamasvajk/feature/csharp9-multiple-discards
C#: C#9 add test cases for discards as lambda/delegate parameters
2020-11-25 14:33:55 +01:00
Geoffrey White
2b349f299a C++: Replace 'odasa qltest' with 'codeql test run'. 2020-11-25 13:16:50 +00:00
Erik Krogh Kristensen
b418cb5fe0 add test case where the successor of the repeating term matches epsilon 2020-11-25 13:59:10 +01:00
Erik Krogh Kristensen
500b94b50e rename witness to pump 2020-11-25 13:57:21 +01:00
Erik Krogh Kristensen
c5f5206174 update expected output 2020-11-25 13:57:20 +01:00
Erik Krogh Kristensen
e03c19b7fc only search prefixes/suffixes from the candidates that are used in the end 2020-11-25 13:57:20 +01:00
Erik Krogh Kristensen
b8fabfa24e only construct prefix/suffix for regular expressions that has a pumpable state 2020-11-25 13:57:20 +01:00
Erik Krogh Kristensen
a8944c8953 model accept states more accurately by adding an AcceptAny state, modelling $, and checking the existence of rejecting suffixes 2020-11-25 13:57:20 +01:00
Erik Krogh Kristensen
d9ebb7b20e escape tabs 2020-11-25 13:57:20 +01:00
Erik Krogh Kristensen
bcb2f2768d search for a prefix to the state that causes exponential backtracking 2020-11-25 13:57:20 +01:00
CodeQL CI
34ffcb5677 Merge pull request #4593 from asgerf/js/react-hot
Approved by erik-krogh
2020-11-25 12:01:38 +00:00
Tamas Vajk
6d9510591a C#: Adjust test for nint/nuint 2020-11-25 12:01:56 +01:00
Tamas Vajk
81b03bf876 C#: Add test cases for discards as lambda/delegate parameters 2020-11-25 11:56:25 +01:00
Rasmus Wriedt Larsen
e2c4af3031 Python: Add change note for improved open modeling 2020-11-25 11:39:02 +01:00
Tom Hvitved
7791ec3084 Merge pull request #4618 from hvitved/csharp/get-source-decl-rename
C#: Rename `getSourceDeclaration()` to `getUnboundDeclaration()`
2020-11-25 11:05:18 +01:00
Cornelius Riemenschneider
7f13d4c356 C++: Improve EscapesTree analysis in the presence of temporary objects. 2020-11-25 10:41:15 +01:00
Cornelius Riemenschneider
8d024c7ff1 C++: Add tests around references to pointers with temporary objects. 2020-11-25 10:40:33 +01:00
Cornelius Riemenschneider
e68352bcde C++: Add testcase for false positive. 2020-11-25 10:40:33 +01:00
Rasmus Wriedt Larsen
cafe55f5c7 Merge pull request #4701 from yoff/python-fix-return-node-enclosing-callable
Python: Use default `getEnclosingCallable` for `RetrunNode`
2020-11-25 10:36:41 +01:00
Jonas Jensen
5f0141953d Merge pull request #4644 from MathiasVP/unsafe-use-of-this-query
C++: Add 'unsafe use of this' query
2020-11-25 08:40:12 +01:00
Jonas Jensen
48460e3e45 Merge pull request #4716 from criemen/escapestree-code-cleanup
C++: Simplify and generalize EscapesTree::addressMayEscapeMutablyAt
2020-11-25 08:31:33 +01:00
Rasmus Lerchedahl Petersen
88643da01f Python: Use default getEnclosingCallable
for `RetrunNode`
2020-11-25 08:19:07 +01:00
Rasmus Lerchedahl Petersen
36d9097d03 Python: Add test for inner return 2020-11-25 07:09:27 +01:00
Rasmus Lerchedahl Petersen
34896ae0d7 Python: Fix failing test 2020-11-25 07:09:27 +01:00
luchua-bc
a49160423b Enhance the query and add more test cases 2020-11-25 04:33:26 +00:00
Robert Marsh
0cd6941a21 C++: Filter out lower bounds on overflowing exprs
Fixes performance issues where multiple lower bounds would be
computed for overflowing expressions
2020-11-24 12:57:11 -08:00
Robert Marsh
9b07782d19 Merge pull request #4634 from geoffw0/modelchanges2
C++: Make classes in models.implementations private
2020-11-24 15:18:10 -05:00
Erik Krogh Kristensen
94aa162f8d prune state-pairs that are outside a backtracking repetition 2020-11-24 20:18:45 +01:00
Erik Krogh Kristensen
f3c3b82827 move condition inside parens 2020-11-24 20:16:40 +01:00
Erik Krogh Kristensen
d1706e8048 reuse InfiniteRepetitionQuantifier from SuperLiniearBacktracking 2020-11-24 20:16:36 +01:00
CodeQL CI
395403789e Merge pull request #4585 from erik-krogh/moreReDoS
Approved by asgerf
2020-11-24 18:52:36 +00:00
Geoffrey White
71a8ac5183 C++: Autoformat. 2020-11-24 18:42:18 +00:00
porcupineyhairs
9c30b82116 Merge pull request #2 from aschackmull/java/ssrf-review
Java: Review fixes.
2020-11-24 23:14:50 +05:30
CodeQL CI
4be158b362 Merge pull request #4708 from erik-krogh/emptyName
Approved by asgerf
2020-11-24 17:34:55 +00:00
Rasmus Wriedt Larsen
d88e5bdb3a Python: Model io.open as FileSystemAccess 2020-11-24 18:27:33 +01:00
Rasmus Wriedt Larsen
e39bb56078 Python: Model builtin open function better 2020-11-24 18:27:31 +01:00
Rasmus Wriedt Larsen
5af1fdd06f Python: Expand tests of open 2020-11-24 18:27:30 +01:00
Rasmus Wriedt Larsen
caf73e4b9b Python: Wrap all Stdlib modeling consistently
Some of these predicates had fallen outside the `private module Stdlib`
2020-11-24 18:27:29 +01:00
Geoffrey White
8184f76d1f C++: Sync identical files. 2020-11-24 16:29:14 +00:00
Geoffrey White
d677305c90 C++: Create tests readme. 2020-11-24 16:08:02 +00:00
Mathias Vorreiter Pedersen
648acc3bfc C++: Prevent IR re-evaluation by importing GVN. 2020-11-24 17:04:54 +01:00
Cornelius Riemenschneider
026abae323 C++: Simplify some more. 2020-11-24 17:00:47 +01:00
Asger Feldthaus
432a59185f Merge branch 'js/api-graph-tweaks' of github.com:asgerf/codeql into js/api-graph-tweaks 2020-11-24 14:32:28 +00:00
Asger Feldthaus
cf12b65c80 JS: Autoformat 2020-11-24 14:32:20 +00:00
Rasmus Wriedt Larsen
aa4345ac76 Merge pull request #4710 from yoff/python-dataflow-variable-capture
Python: Dataflow, variable capture
2020-11-24 15:04:38 +01:00
yoff
215986bce5 Apply suggestions from code review
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2020-11-24 14:12:23 +01:00
Rasmus Lerchedahl Petersen
05d156ba0f Python: add comments 2020-11-24 14:11:14 +01:00
CodeQL CI
8c68463e76 Merge pull request #4711 from erik-krogh/locType
Approved by asgerf
2020-11-24 13:10:32 +00:00
Anders Schack-Mulligen
b192f6dfe0 Java: Remove some deprecated classes. 2020-11-24 14:04:01 +01:00
Anders Schack-Mulligen
3f04099c25 Update java/ql/src/experimental/CWE-918/RequestForgery.ql
Co-authored-by: Chris Smowton <smowton@github.com>
2020-11-24 13:18:58 +01:00
Jonas Jensen
260a8d4afb Merge pull request #4702 from MathiasVP/qualifier-as-parameter-for-callee
C++: Abstractions for treating qualifiers as parameters in IR
2020-11-24 12:58:27 +01:00
CodeQL CI
2277242196 Merge pull request #4692 from yoff/python-psycopg
Approved by RasmusWL
2020-11-24 10:59:04 +00:00
Rasmus Lerchedahl Petersen
80dcb8da4a Python: annotate missing flow 2020-11-24 11:55:28 +01:00
Geoffrey White
bc23809e1b Merge branch 'main' into modelchanges2 2020-11-24 10:49:14 +00:00
Cornelius Riemenschneider
7983b16e84 C++: Simplify and generalize EscapesTree::addressMayEscapeMutablyAt predicate. 2020-11-24 11:35:18 +01:00
Anders Schack-Mulligen
0450489022 Java: Review fixes. 2020-11-24 11:31:44 +01:00
Mathias Vorreiter Pedersen
9d21b226d2 Merge branch 'main' into qualifier-as-parameter-for-callee 2020-11-24 11:13:14 +01:00
Cornelius Riemenschneider
14a03e2f54 Merge pull request #4715 from MathiasVP/remove-failing-duplicate-tests
C++: Remove duplication-tests
2020-11-24 11:04:46 +01:00
Rasmus Lerchedahl Petersen
737f4dff09 Python: update test annotations 2020-11-24 10:57:57 +01:00
Rasmus Lerchedahl Petersen
da805f8242 Merge remote-tracking branch 'upstream/main' into python-dataflow-modernize-tests 2020-11-24 10:56:22 +01:00
Mathias Vorreiter Pedersen
08f8660b17 C++/C#: Add pragma[noinline] to hasIndex predicates. 2020-11-24 10:45:02 +01:00
Mathias Vorreiter Pedersen
8bd14c5af6 C++: Remove duplication-tests directory since we no longer detect duplication. 2020-11-24 10:10:31 +01:00
Rasmus Lerchedahl Petersen
a19304a4a0 Python: Factor out prettyPrinter and update tests 2020-11-24 02:17:38 +01:00
Erik Krogh Kristensen
f03429a4b8 change description for source root folder 2020-11-23 23:46:44 +01:00
CodeQL CI
9123f249ad Merge pull request #4705 from erik-krogh/bigString
Approved by asgerf
2020-11-23 22:40:42 +00:00
Asger F
ac6d4aac9d Apply suggestions from code review
Co-authored-by: Max Schaefer <54907921+max-schaefer@users.noreply.github.com>
2020-11-23 21:20:38 +00:00
Asger Feldthaus
d3412bb0ec JS: Fix typo in NoSQL model 2020-11-23 21:19:17 +00:00
Asger Feldthaus
85f0a627c4 JS: Autoformat 2020-11-23 16:17:22 +00:00
Asger Feldthaus
c146e044ca JS: Update NoSQL model 2020-11-23 16:17:00 +00:00
Asger Feldthaus
b6b8a55b37 JS: Add test case 2020-11-23 16:16:50 +00:00
Erik Krogh Kristensen
33dab1717e treat nodes with type "Location" as a location source - but not if we can track it from an original node with type "Location" 2020-11-23 17:03:50 +01:00
Rasmus Lerchedahl Petersen
39c5e0d487 Python: update test expectations 2020-11-23 16:46:35 +01:00
Rasmus Lerchedahl Petersen
38bb06a207 Merge remote-tracking branch 'upstream/main' into python-dataflow-variable-capture 2020-11-23 16:40:20 +01:00
Asger Feldthaus
ac00e02855 JS: Add API::Node.getAValueReachingRhs 2020-11-23 15:37:08 +00:00
Asger Feldthaus
3b5ff73862 JS: Introduce API::InvokeNode to simplify reasoning about calls 2020-11-23 15:36:32 +00:00
Tom Hvitved
129deb0a00 C#: Add change note 2020-11-23 16:09:33 +01:00
Tom Hvitved
cd77f14a75 C#: Rename getSourceDeclaration() to getUnboundDeclaration() 2020-11-23 16:09:33 +01:00
Geoffrey White
7015a9cf53 C++: Un-private a few classes that are now used by the current DefaultSafeExternalAPIFunction implementation. 2020-11-23 14:47:22 +00:00
Anders Schack-Mulligen
2cf10a7658 Merge pull request #4427 from aschackmull/java/fastjson
Java: Add support for FastJson in unsafe deserialization.
2020-11-23 14:40:14 +01:00
Erik Krogh Kristensen
f7f9beeefd avoid reporting empty names in js/exposure-of-private-files 2020-11-23 14:24:42 +01:00
Erik Krogh Kristensen
02d5fbf46b remove superfluous space 2020-11-23 14:22:16 +01:00
Rasmus Wriedt Larsen
9156163563 Merge pull request #4703 from github/hmakholm/pr/duplicate-code-2
Remove unit tests for duplicate-code detection, take II
2020-11-23 13:52:24 +01:00
Tom Hvitved
f0f5d44b33 C#: Replace BreakNormalCompletion with a nested completion 2020-11-23 11:38:24 +01:00
Tom Hvitved
17df059432 C#: Replace matchesCompletion() with getAMatchingSuccessorType() 2020-11-23 11:38:24 +01:00
Tom Hvitved
f3abaa406c C#: Refactor CFG implementation 2020-11-23 11:38:24 +01:00
Rasmus Wriedt Larsen
f35ffa5632 Python: Add support for x in ["safe", "also_safe"] (and not in) 2020-11-23 10:42:24 +01:00
Rasmus Wriedt Larsen
431aab45f7 Python: Add support for x != "safe" BarrierGuard 2020-11-23 10:36:55 +01:00
Rasmus Wriedt Larsen
18041fd059 Python: Expand string-const-compare tests
Also moved file to reflect that. Added tests of

+ `!=`
+ `in`
+ `not in`
2020-11-23 10:36:49 +01:00
Erik Krogh Kristensen
234730419b restrict computation of ConcatenationRoot::getConstantStringParts to results that are less than 1 million chars long 2020-11-23 10:29:47 +01:00
Tamás Vajk
7d38b2dd17 Merge pull request #4623 from tamasvajk/feature/csharp9-type-param-nullability
C#: Add type parameter ref/value type tests
2020-11-23 09:58:56 +01:00
Rasmus Lerchedahl Petersen
777100f25c Python: rename file, package, and class 2020-11-23 09:17:40 +01:00
Tom Hvitved
c571e42cd5 C#: Move internal CFG logic into separate file 2020-11-21 19:49:17 +01:00
Mathias Vorreiter Pedersen
a7644db762 C++: Use the new names in IR dataflow. Turns out DataFlowCall had its own implementation of getArgument already (which didn't handle qualifiers). The predicate wasn't used anywhere, so I simply removed it, as a better predicate is now available on the base class of DataFlowCall. 2020-11-21 01:00:59 +01:00
Mathias Vorreiter Pedersen
61bbceb201 C++/C#: Sync identical files 2020-11-21 00:55:07 +01:00
Mathias Vorreiter Pedersen
f173dc71c0 C++: Use shorter names for new IR predicates. This should hopefully guide users to use these predicates by default. 2020-11-21 00:54:50 +01:00
Geoffrey White
cc8d4b4c75 Merge branch 'main' into modelchanges2 2020-11-20 20:33:52 +00:00
Geoffrey White
fddd353155 C++: Updated autoformat. 2020-11-20 20:15:45 +00:00
Henning Makholm
a2a4938f60 Remove unit tests for duplicate-code detection, take II
In #4689 I forgot to remove the `.expected` files too, but they are
now of course useless.
2020-11-20 21:07:42 +01:00
Asger F
adc7bbfa4d Merge pull request #4694 from asgerf/js/flow-to-external-api
JS: Add UntrustedDataToExternalAPI query
2020-11-20 15:56:04 +00:00
Asger Feldthaus
f894cf2074 JS: Add support for react-hot-loader 2020-11-20 15:28:32 +00:00
Mathias Vorreiter Pedersen
6ead6c6d38 Merge branch 'main' into qualifier-as-parameter-for-callee 2020-11-20 16:17:10 +01:00
Tamas Vajk
0fa3cf7912 Simplify test predicates 2020-11-20 16:05:12 +01:00
Asger Feldthaus
16429c8ca4 JS: followed -> followed by 2020-11-20 14:44:25 +00:00
Mathias Vorreiter Pedersen
fd4f8c557c Merge branch 'main' into unsafe-use-of-this-query 2020-11-20 14:54:51 +01:00
Jonas Jensen
14aa6427ca Merge pull request #4696 from MathiasVP/get-result-memory-location-join-order-fix
C++: Fix bad join order in AliasedSSA::getResultMemoryLocation
2020-11-20 14:50:35 +01:00
Tamas Vajk
3e836ef671 C#: Add type parameter ref/value type tests 2020-11-20 13:08:38 +01:00
Tamás Vajk
77afd5a617 Merge pull request #4633 from tamasvajk/feature/csharp9-native-int
C#: Add test cases for native integers
2020-11-20 12:58:11 +01:00
Mathias Vorreiter Pedersen
c7efc91676 C++: Use the new predicates in IR dataflow. 2020-11-20 12:24:39 +01:00
Mathias Vorreiter Pedersen
f3b5d7b830 C++/C#: Sync identical files 2020-11-20 12:23:34 +01:00
Mathias Vorreiter Pedersen
416431a7c1 C++: Add convenience predicates for working with qualifiers as parameters. 2020-11-20 12:22:37 +01:00
Rasmus Wriedt Larsen
08bcba98e6 Python: Add BarrierGuard test with exception inside unsafe branch 2020-11-20 11:55:07 +01:00
Rasmus Wriedt Larsen
34f78d4211 Python: Add BarrierGuard test with return inside unsafe branch 2020-11-20 11:52:36 +01:00
Jonas Jensen
3342fac83e Merge pull request #4688 from criemen/printast-performance
C++: Speed up PrintAST.
2020-11-20 11:45:42 +01:00
Asger Feldthaus
7536c49c6f JS: Use getAParameter and not getReceiver instead of getASuccessor 2020-11-20 10:34:30 +00:00
Tamas Vajk
52680cd1dc C#: Add test cases for native integers 2020-11-20 11:31:20 +01:00
Asger F
405f07720a Apply suggestions from code review
Co-authored-by: Max Schaefer <54907921+max-schaefer@users.noreply.github.com>
2020-11-20 10:21:19 +00:00
Asger Feldthaus
b34df9ff33 JS: Autoformat 2020-11-20 10:15:35 +00:00
Cornelius Riemenschneider
1afd32c033 C++: Add comment, rename class. 2020-11-20 10:49:12 +01:00
yoff
b478a51d4e Apply suggestions from code review
Thanks for doing the work for me :-)

Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2020-11-20 10:46:04 +01:00
Rasmus Wriedt Larsen
6c8937c5a9 Python: Add StringConstCompare to new data-flow queries
In the future, I could imagine we would have something like this, but for now,
I'm just keeping it simple.

```codeql
  /**
   * A collection of common guards that ensure the checked value cannot have arbitrary
   * values.
   *
   * Currently only supports comparison with constant string value, but could also
   * include checking whether all characters are alphanumeric, or whether a regex is
   * matched against the value.
   *
   * Such guards will be useful for many taint-tracking queries, but not necessarily
   * all, which is why you need to opt into these manually.
   */
  class CommonNonArbitraryGuard extends BarrierGuard {
    CommonNonArbitraryGuard() {
      this instanceof StringConstCompare
    }

    override predicate checks(ControlFlowNode node, boolean branch) {
      this.(StringConstCompare).checks(node, branch)
    }
  }
```
2020-11-20 10:44:50 +01:00
Rasmus Wriedt Larsen
12b36b2245 Python: Highlight that safe or also_safe doesn't clear taint :( 2020-11-20 10:43:46 +01:00
Rasmus Wriedt Larsen
1a52f17da3 Python: Add StringConstCompare BarrierGuard 2020-11-20 10:40:04 +01:00
Rasmus Wriedt Larsen
a82936c904 Python: Enable test for sanitizer-guard and logic expressions
`not` is not working properly, but otherwise pretty good
2020-11-20 10:06:25 +01:00
Cornelius Riemenschneider
eeece5937d C++: One more speedup, address review. 2020-11-20 09:56:08 +01:00
Tamás Vajk
056b0c2627 Merge pull request #4626 from tamasvajk/feature/stats
C#: Add stats file from the jenkins job
2020-11-20 09:16:56 +01:00
Mathias Vorreiter Pedersen
490bba5c9f C++: Fix bad join order in AliasedSSA::getResultMemoryLocation. 2020-11-19 17:40:41 +01:00
Rasmus Wriedt Larsen
b3d3d6e142 Python: Move logical test of sanitizers
Don't know why it would ever have been under default sanitizers :D
2020-11-19 16:46:07 +01:00
Rasmus Lerchedahl Petersen
7cbbf3bbf7 Python: slightly nicer test 2020-11-19 16:20:57 +01:00
Rasmus Wriedt Larsen
4c7c940273 Python: Add example of Code Injection FP 2020-11-19 15:05:51 +01:00
Rasmus Wriedt Larsen
7e407d43d2 Python: Change (single) test to match codeql database create 2020-11-19 14:56:18 +01:00
Rasmus Wriedt Larsen
8ffcff0824 Python: Add example of top-level module shadowing stdlib
Although this test is added under the `wrong` folder, the current results from
this CodeQL test is actually correct (compared with the Python
interpreter). However, they don't match what the extractor does when invoked
with `codeql database create`.

Since I deemed it "more than an easy fix" to change the extractor behavior for
`codeql database create` to match the real python behavior, and it turned out to
be quite a challenge to change the extractor behavior for all tests, I'm just
going to make THIS ONE test-case behave like the extractor will with `codeql
database create`...

This is a first commit, to show how the extractor works with qltest by default.

Inspired by the debugging in https://github.com/github/codeql/issues/4640
2020-11-19 14:56:17 +01:00
Asger Feldthaus
f737f34dcd JS: Add UntrustedDataToExternalApi query 2020-11-19 13:42:25 +00:00
luchua-bc
a311462791 Move to query-test folder and update qldoc 2020-11-19 13:12:42 +00:00
Mathias Vorreiter Pedersen
2e6a3cd33b Merge branch 'main' into unsafe-use-of-this-query 2020-11-19 13:03:29 +01:00
Jonas Jensen
cd20163f6e Merge pull request #4676 from MathiasVP/untrusted-dataflow-to-external-api-query
C++: Untrusted data used in external APIs
2020-11-19 12:56:08 +01:00
Rasmus Lerchedahl Petersen
6cc8e5acf1 Python: support psycopg 2020-11-19 12:13:20 +01:00
Mathias Vorreiter Pedersen
072adaa279 C++: Require that no override of the called pure virtual function exists in any base class. This removes the false positive in the testcase. Based on the results on LGTM we have agreed to set the @precision to very-high. 2020-11-19 12:10:57 +01:00
Rasmus Lerchedahl Petersen
39f134c1c1 Python: reorganized and added to tests 2020-11-19 12:06:58 +01:00
Erik Krogh Kristensen
a3b21ad43b Apply suggestions from code review
Co-authored-by: Asger F <asgerf@github.com>
2020-11-19 11:42:12 +01:00
Tom Hvitved
02ec325380 C#: Fix bad join-orders following stats update 2020-11-19 10:42:35 +01:00
Tamas Vajk
866c98bbd9 C#: Add stats file from the jenkins job 2020-11-19 10:42:34 +01:00
Rasmus Wriedt Larsen
2945eada9e Merge pull request #4689 from github/hmakholm/pr/no-dup-code-tests
Remove unit tests for duplicate-code detection
2020-11-19 10:07:04 +01:00
Dave Bartolomeo
08efd7fbd9 Merge pull request #4558 from rdmarsh2/rdmarsh2/cpp/remove-initialize-nonlocal
Remove InitializeNonlocalInstruction
2020-11-18 20:23:08 -05:00
Porcupiney Hairs
ebc6c49555 include suggestions from review. 2020-11-19 03:37:00 +05:30
Robert Marsh
77729918c1 Merge branch 'main' into rdmarsh/cpp/use-taint-configuration-dtt
Update for submodule pointer
2020-11-18 13:09:02 -08:00
Erik Krogh Kristensen
cc1d797cef adjust top comment to reflect what the query does, and add comment about which kind of accepting state is assumed. 2020-11-18 21:32:31 +01:00
Robert Marsh
5753a2d401 C++: autoformat 2020-11-18 11:02:58 -08:00
Robert Marsh
693626e460 C++: accept value numbering test changes 2020-11-18 11:00:31 -08:00
Cornelius Riemenschneider
4405547b04 C++: Fix tests. 2020-11-18 17:41:08 +01:00
Cornelius Riemenschneider
cfe86bf53b C++: Remove default getAPrimaryQlClass(). 2020-11-18 17:34:56 +01:00
Cornelius Riemenschneider
f70f32e3ed C++: Fix tests for PrintAST. 2020-11-18 17:22:13 +01:00
Henning Makholm
a86679a377 Remove unit tests for duplicate-code detection
The old Semmle duplicate-code detection code has never been done when
extracting databases for the CodeQL CLI, except that `codeql test run`
will run it _just_ in order to support tests of the feature. With the
sunsetting of Odasa there's no need to even _test_ the feature anymore.

This commit removes those tests that fail when the duplicate-code
detector is turned off. Once it is merged and bumped, we can finally
remove it from `codeql`.
2020-11-18 16:37:29 +01:00
Cornelius Riemenschneider
429aa15b1b C++: Speed up PrintAST. 2020-11-18 16:08:51 +01:00
Tamás Vajk
cb8c5e8cca Merge pull request #4663 from tamasvajk/feature/patterns
C#: Refactor pattern extraction
2020-11-18 16:01:15 +01:00
Erik Krogh Kristensen
58c31f0eca prune more regexps initially in the ReDoS query 2020-11-18 15:14:46 +01:00
Erik Krogh Kristensen
c4153a617e remove duplicated test cases from ReDoS, and adjust variables names to match test output 2020-11-18 14:49:09 +01:00
Mathias Vorreiter Pedersen
4746320f3c Merge pull request #4684 from criemen/cleanup-api
C++: Clean up Type.qll, getSpecifierString() API.
2020-11-18 13:07:51 +01:00
Mathias Vorreiter Pedersen
715f233360 C++: Add a new model class describing pure memory functions, and use this new model in DefaultSafeExternalAPIFunction. 2020-11-18 12:47:33 +01:00
Geoffrey White
decbb08340 Merge pull request #4402 from github/matt-gretton-dann/cpp20-constinit-results
Update expected results for `constint' support
2020-11-18 11:46:41 +00:00
Cornelius Riemenschneider
959b8f39d2 C++: Autoformat. 2020-11-18 12:13:46 +01:00
Erik Krogh Kristensen
8270bf5bb9 make the character search skip unencodable characters 2020-11-18 11:55:49 +01:00
James Fletcher
47fa2d31cc Merge pull request #4685 from github/main-126-merge
Merge `rc/1.26` into `main`
2020-11-18 10:41:03 +00:00
yoff
04fc1e44f2 Merge pull request #4683 from RasmusWL/python-fix-bad-join-callStep-for-dist-upgrade
Python: Fix bad join order in TypeTracker::callStep
2020-11-18 11:12:38 +01:00
Rasmus Wriedt Larsen
ab856d6c01 Python: Show getCallableForArgument can have multiple results 2020-11-18 10:44:32 +01:00
Erik Krogh Kristensen
64828713d6 remove FPs in js/build-artifact-leak where the "leaked" properties are constrained to a safe subset 2020-11-18 10:35:02 +01:00
Erik Krogh Kristensen
06733eadea remove two unused imports 2020-11-18 10:34:15 +01:00
james
8c9ea1632f Merge branch 'rc/1.26' into main-126-merge 2020-11-18 09:33:21 +00:00
Cornelius Riemenschneider
b670522a9f Clean up Type.qll, getSpecifierString() API. 2020-11-18 10:21:03 +01:00
Mathias Vorreiter Pedersen
09c5caa3bd C++: Move ExternalAPI files into query directory to prevent out-of-tree use. 2020-11-18 10:18:03 +01:00
Rasmus Wriedt Larsen
abf2902a69 Python: Fix QLDoc
Co-authored-by: yoff <lerchedahl@gmail.com>
2020-11-18 09:47:23 +01:00
Rasmus Wriedt Larsen
39590a39cb Python: Rename helper predicate based on review 2020-11-18 09:26:53 +01:00
Erik Krogh Kristensen
55f2f86a26 limit the search of state-pairs to the ones that are reachable within the given length 2020-11-18 09:23:35 +01:00
Mathias Vorreiter Pedersen
f16591dffc C++: Respond to qhelp review comments. 2020-11-18 09:18:14 +01:00
Rasmus Wriedt Larsen
14136154d6 Python: Fix bad join order in TypeTracker::callStep
From a local evaluation against flask DB, after
https://github.com/github/codeql/pull/4649 was merged we would get:

```
Tuple counts for TypeTracker::callStep#ff/2@a21b71:
9876     ~0%     {3} r1 = SCAN DataFlowPrivate::DataFlowCall::getArg_dispred#fff AS I OUTPUT I.<2>, I.<0>, I.<1>
9876     ~2%     {3} r2 = JOIN r1 WITH project#DataFlowPrivate::DataFlowCall::getArg_dispred#fff AS R ON FIRST 1 OUTPUT r1.<2>, R.<0>, r1.<1>
72388997 ~0%     {4} r3 = JOIN r2 WITH DataFlowPublic::ParameterNode::isParameterOf_dispred#fff_201#join_rhs AS R ON FIRST 1 OUTPUT r2.<2>, R.<2>, r2.<1>, R.<1>
4952     ~0%     {2} r4 = JOIN r3 WITH DataFlowPrivate::DataFlowCall::getCallable_dispred#ff AS R ON FIRST 2 OUTPUT r3.<2>, r3.<3>
                     return r4
```
2020-11-18 09:17:31 +01:00
Dave Bartolomeo
ab715ec302 Merge pull request #4680 from criemen/printast-performance
C++: Improve PrintAST performance.
2020-11-17 23:13:26 -05:00
Robert Marsh
5aed82a210 C++: Autoformat more 2020-11-17 13:44:20 -08:00
luchua-bc
85434ca410 Format the source code and update qldoc 2020-11-17 21:20:53 +00:00
Robert Marsh
04641a3f2d Merge branch 'main' into rdmarsh/cpp/use-taint-configuration-dtt 2020-11-17 12:55:12 -08:00
Cornelius Riemenschneider
a92f7a4563 C++: Include trailing whitespace in Type.getSpecifierString(). 2020-11-17 18:50:34 +01:00
Robert Marsh
c2e44fa180 C++: autoformat 2020-11-17 09:28:39 -08:00
Cornelius Riemenschneider
5c3de06b6d C++: Improve PrintAST performance.
Co-authored-by: Jonas Jensen <jbj@github.com>
2020-11-17 17:47:16 +01:00
Aditya Sharad
b9b6a35564 Merge pull request #4629 from pwntester/improve_bean_validation_query
Java: add some improvements to the bean validation query
2020-11-17 08:35:49 -08:00
Erik Krogh Kristensen
c4d7533701 Merge branch 'main' into moreReDoS 2020-11-17 17:34:49 +01:00
Erik Krogh Kristensen
97acf1fd87 fix FP related to inverted character classes choosing a char that was not matched by the char class 2020-11-17 17:34:43 +01:00
Mathias Vorreiter Pedersen
52bbb326ca QLDoc: Wrap lines and disambiguate explanation. 2020-11-17 16:23:27 +01:00
Mathias Vorreiter Pedersen
d93d3c8699 C++: Use the getSourceType predicate on RemoteFlowSources for better alert messages. 2020-11-17 16:23:27 +01:00
Mathias Vorreiter Pedersen
d1272d3a79 C++: Use strictcount instead of count. 2020-11-17 16:23:27 +01:00
Mathias Vorreiter Pedersen
4cb25d8e18 C++: Add isParameterDerefOrQualifierObject helper predicate to FunctionInput and FunctionOutput. 2020-11-17 16:23:27 +01:00
Mathias Vorreiter Pedersen
dea16d4d62 QLDoc/C++: Rename {IR}ExternalAPIsUsedWithUntrustedData to {IR}CountUntrustedDataToExternalAPI 2020-11-17 16:23:13 +01:00
Mathias Vorreiter Pedersen
eabc69b98e C++: Autoformat 2020-11-17 16:09:25 +01:00
Matthew Gretton-Dann
62767e7e0d Update expected results for `constinit' support 2020-11-17 14:01:00 +00:00
Anders Schack-Mulligen
f74fc0ff26 Dataflow: Fix bad join-orders. 2020-11-17 14:28:25 +01:00
Mathias Vorreiter Pedersen
5d2b85fcf5 Update cpp/ql/src/semmle/code/cpp/models/implementations/Getenv.qll
Co-authored-by: hubwriter <hubwriter@github.com>
2020-11-17 13:02:28 +01:00
Tom Hvitved
7f0ad2d232 Merge pull request #4646 from hvitved/csharp/cfg/post-order-exprs
C#: Represent all expressions in post-order in the CFG
2020-11-17 13:01:35 +01:00
Mathias Vorreiter Pedersen
c37093f4bc C++: Add copies of qhelp files for IR. 2020-11-17 12:28:31 +01:00
Mathias Vorreiter Pedersen
3b8580efaf C++: Add qhelp and example files (modeled after the Java examples). 2020-11-17 12:27:53 +01:00
Mathias Vorreiter Pedersen
c3c29b8dd0 C++: Add qldoc to new library files. 2020-11-17 12:27:53 +01:00
Mathias Vorreiter Pedersen
5c9b8f1cff C++: Update sync-identical-files. 2020-11-17 12:27:53 +01:00
Mathias Vorreiter Pedersen
5ad18eb748 C++: Add ExternalAPI query files (for AST and IR). 2020-11-17 12:27:40 +01:00
Jonas Jensen
55a38803cb Merge pull request #4673 from MathiasVP/ir-post-dominance
C++: IR post dominance
2020-11-17 09:35:51 +01:00
Tamás Vajk
f2259de5f1 Merge pull request #4666 from tamasvajk/feature/roslyn-3.8.0
C#: Upgrade Roslyn dependencies to 3.8.0
2020-11-17 08:59:55 +01:00
Rasmus Lerchedahl Petersen
71830abda0 Python: remaining c# tests, except lambdas
both via nonlocal and via dict
2020-11-17 08:28:11 +01:00
Robert Marsh
db8766ca69 Merge branch 'main' into rdmarsh/cpp/use-taint-configuration-dtt 2020-11-16 17:46:20 -08:00
Mathias Vorreiter Pedersen
057bb14eee C++: Add ExternalAPI library files (for AST and IR). 2020-11-16 22:59:54 +01:00
luchua-bc
0bd6255c41 Query for cleartext storage using Android SharedPreferences 2020-11-16 17:23:01 +00:00
Robert Marsh
a94826dc81 C++: common superclass for Remote/LocalFlowSource 2020-11-16 18:05:17 +01:00
Robert Marsh
31d3e94cec C++: Grammar/style fixes from code review
Co-authored-by: Jonas Jensen <jbj@github.com>
2020-11-16 18:03:44 +01:00
Robert Marsh
74e05c111e C++: add local flow sources 2020-11-16 18:02:19 +01:00
Rasmus Lerchedahl Petersen
27b4c67b9f Python: Start of tests for captured variables 2020-11-16 17:25:39 +01:00
Tamas Vajk
8bef5f417e C#: Upgrade Roslyn dependencies to 3.8.0 2020-11-16 16:44:14 +01:00
Mathias Vorreiter Pedersen
4a7f9100e4 C++: Respond to review comments. 2020-11-16 15:30:42 +01:00
Mathias Vorreiter Pedersen
27aab4062a C++/C#: Sync identical files. 2020-11-16 15:05:59 +01:00
Mathias Vorreiter Pedersen
088d5863fc C++: Implement IR post-dominance predicates. 2020-11-16 15:04:40 +01:00
Mathias Vorreiter Pedersen
10a9f7ba13 Update cpp/change-notes/2020-11-12-unsafe-use-of-this.md
Co-authored-by: hubwriter <hubwriter@github.com>
2020-11-16 12:28:57 +01:00
Anders Schack-Mulligen
4be731d2ab Java: Adjust reference to static method and add test. 2020-11-16 11:47:58 +01:00
Anders Schack-Mulligen
80ee92ae97 Java: Add support for FastJson in unsafe deserialization. 2020-11-16 11:47:58 +01:00
Mathias Vorreiter Pedersen
020af1c88c C++: Add qhelp. 2020-11-16 11:21:18 +01:00
Geoffrey White
4b8f338139 C++: Autoformat. 2020-11-16 10:19:06 +00:00
CodeQL CI
09cfb24afa Merge pull request #4648 from erik-krogh/regexpParse
Approved by asgerf
2020-11-16 08:20:40 +00:00
CodeQL CI
13edc3713d Merge pull request #4638 from erik-krogh/jwt
Approved by asgerf
2020-11-16 08:19:58 +00:00
Anders Schack-Mulligen
3dbd48063c Dataflow: Add Unit type for all languages. 2020-11-16 09:02:44 +01:00
Robert Marsh
525aeb6551 C++: autoformat 2020-11-13 16:14:07 -08:00
Robert Marsh
29eacbd28b Merge branch 'main' into rdmarsh/cpp/use-taint-configuration-dtt
Update for submodule bump
2020-11-13 12:22:41 -08:00
Erik Krogh Kristensen
a49b99b18c autoformat 2020-11-13 20:06:17 +01:00
Erik Krogh Kristensen
affb11b0e3 changes based on review 2020-11-13 19:46:37 +01:00
Erik Krogh Kristensen
2f4fcc2f5e Apply suggestions from code review
Co-authored-by: Asger F <asgerf@github.com>
2020-11-13 18:03:07 +01:00
Mathias Vorreiter Pedersen
0a6a22562b C++: Respond to more review comments.
- Remove post-dominance requirement. It was really just hiding good
  results.
- Fix test annotations. Turns out Clang and GCC's 'undefined behavior'
  warning didn't align with the C++ standard.
2020-11-13 15:44:33 +01:00
Geoffrey White
dfcb0ae7c2 C++: Autoformat. 2020-11-13 14:39:33 +00:00
Anders Schack-Mulligen
9e45f10c5d Dataflow: Remove headUsesContent. 2020-11-13 15:12:39 +01:00
Anders Schack-Mulligen
e0a6a485df Dataflow: Sync. 2020-11-13 15:12:16 +01:00
Anders Schack-Mulligen
d324cd1844 Dataflow: Some qldoc. 2020-11-13 15:09:30 +01:00
Anders Schack-Mulligen
293429f821 Dataflow: Make a bunch of the interface predicates private. 2020-11-13 15:09:30 +01:00
Anders Schack-Mulligen
d028e6b334 Dataflow: Change some headUsesContent to getHead. 2020-11-13 15:09:30 +01:00
Anders Schack-Mulligen
aa66b9bb48 Dataflow: Align more predicates. 2020-11-13 15:09:30 +01:00
Anders Schack-Mulligen
6e6e5d6414 Dataflow: Renamings. 2020-11-13 15:09:29 +01:00
Anders Schack-Mulligen
786edbf045 Dataflow: Align on parameterMayFlowThrough.
This actually provides a decent pruning improvement in stages 3 and 4.
2020-11-13 15:09:29 +01:00
Anders Schack-Mulligen
15bf1b1026 Dataflow: Rename some stage 1 predicates. 2020-11-13 15:09:29 +01:00
Anders Schack-Mulligen
af54afa24b Dataflow: Add stage statistics. 2020-11-13 15:09:29 +01:00
Anders Schack-Mulligen
8b5e452728 Dataflow: Improve cons-cand relation.
Post-recursion we can filter the forward cons-candidates to only include
those that met a read step, and similarly restrict the reverse flow
cons-candidates to those that met a store step.
2020-11-13 15:09:29 +01:00
Anders Schack-Mulligen
e4fb41507b Dataflow: Reshuffle some predicates. 2020-11-13 15:09:29 +01:00
Anders Schack-Mulligen
5a1c0e9ec4 Dataflow: Get rid of early filter.
This constructs a few more tuples in Stage3::fwdFlow0, which are then
filtered in Stage3::fwdFlow. This is cleaner and appears faster.
2020-11-13 15:09:29 +01:00
Anders Schack-Mulligen
3e18e02d2c Dataflow: Refactor step predicate in fwdFlowRead. 2020-11-13 15:09:29 +01:00
Anders Schack-Mulligen
c5a2c261dc Dataflow: Refactor forward store step relation. 2020-11-13 15:09:29 +01:00
Anders Schack-Mulligen
b6f1ab6429 Dataflow: Refactor step relation in revFlowStore. 2020-11-13 15:09:29 +01:00
Anders Schack-Mulligen
12fe38bcb6 Dataflow: Reorder, rename, and add columns to store-flow. 2020-11-13 15:09:29 +01:00
Anders Schack-Mulligen
aa28fdb83d Dataflow: Align some qldoc. 2020-11-13 15:09:29 +01:00
Anders Schack-Mulligen
0a4c680e17 Dataflow: Align on localStep. 2020-11-13 15:09:29 +01:00
Anders Schack-Mulligen
4b5905c5e0 Dataflow: Risky! Remove fwdFlowLocalEntry.
This commit is a little bit risky, as it allows for some potentially bad
join-orders. The best order starts with the delta and proceeds with the
then functional `mid.getEnclosingCallable()` and `getLocalCallContext`.
In this order `localFlowEntry` becomes superfluous. The standard order
is however somewhat unwilling to choose this. If it picks
`getLocalCallContext` and `getEnclosingCallable` as the first join, the
result is really bad, but it appears that the existence of
`localFlowEntry` at least means that it'll do `localFlowEntry`,
`getEnclosingCallable`, `getLocalCallContext` in that order, which
appears to be acceptable, although it isn't optimal. Without the
`localFlowEntry` conjunct we end up with the worst case. We'll need to
watch this particular join-ordering until we get better join-ordering
directives.
2020-11-13 15:09:29 +01:00
Anders Schack-Mulligen
19a9285d00 Dataflow: Reshuffle a few conjuncts. 2020-11-13 15:09:29 +01:00
Anders Schack-Mulligen
7a95466241 Dataflow: Remove superfluous conjuncts. 2020-11-13 15:09:28 +01:00
Anders Schack-Mulligen
03ef9d00ec Dataflow: Refactor call contexts. 2020-11-13 15:09:28 +01:00
Anders Schack-Mulligen
dc2b2cc13f Dataflow: Some renamings. 2020-11-13 15:09:28 +01:00
Anders Schack-Mulligen
d037909c7b Dataflow: Minor reorderings and renamings. 2020-11-13 15:09:28 +01:00
Anders Schack-Mulligen
00d726de3f Dataflow: Refactor stage 4 read and stores. 2020-11-13 15:09:28 +01:00
Anders Schack-Mulligen
2afc572a34 Dataflow: Refactor stage 2 read and stores. 2020-11-13 15:09:28 +01:00
Anders Schack-Mulligen
b0e5925fea Dataflow: Refactor stage 3 conscand predicates. 2020-11-13 15:09:28 +01:00
Anders Schack-Mulligen
261ef0fbff Dataflow: Refactor forward stores and remove some useless conjuncts. 2020-11-13 15:09:28 +01:00
Anders Schack-Mulligen
628e0a795a Dataflow: A few variable renamings. 2020-11-13 15:09:28 +01:00
Anders Schack-Mulligen
bfd8a3d104 Dataflow: Rename stage 2 cons-cand predicates. 2020-11-13 15:09:28 +01:00
Anders Schack-Mulligen
0a60a3abb3 Dataflow: Align on ApNil. 2020-11-13 15:09:28 +01:00
Anders Schack-Mulligen
60b51011b9 Dataflow: Minor refactor of Stage2::revFlow. 2020-11-13 15:09:28 +01:00
Anders Schack-Mulligen
c054295347 Dataflow: Rename option type branches. 2020-11-13 15:09:28 +01:00
Anders Schack-Mulligen
7eeae49e06 Dataflow: Remove AccessPathFront column.
This column is functionally determined from the access path, and was
merely included to help with some join-orders that no longer appear
problematic.
2020-11-13 15:09:28 +01:00
Anders Schack-Mulligen
1fe423550f Dataflow: Stage comments and some formatting. 2020-11-13 15:09:27 +01:00
Anders Schack-Mulligen
586d52fac0 Dataflow: More renaming. 2020-11-13 15:09:27 +01:00
Anders Schack-Mulligen
3f25df902f Dataflow: Rename some types and variables. 2020-11-13 15:09:27 +01:00
Anders Schack-Mulligen
f3f968ce6d Dataflow: Rename predicates. 2020-11-13 15:09:27 +01:00
Anders Schack-Mulligen
aab5263c6a Dataflow: Add modules. 2020-11-13 15:09:22 +01:00
Jonas Jensen
8bb9e8a4af Merge pull request #4592 from geoffw0/varnotused
C++: Work around two false positive issues with the UnusedLocals.ql query
2020-11-13 14:53:58 +01:00
yoff
f7361cae31 Merge pull request #4667 from RasmusWL/python-add-code-snippets
Python: Add code snippets for VS Code
2020-11-13 13:48:37 +01:00
Porcupiney Hairs
402a320a55 include suggestions from review. 2020-11-13 18:07:42 +05:30
Porcupiney Hairs
4b25532b9f include suggestions from review. 2020-11-13 17:55:56 +05:30
Rasmus Wriedt Larsen
9f1d8cd1bb Python: Convert indentation to spaces for VS Code snippets 2020-11-13 13:05:23 +01:00
Rasmus Wriedt Larsen
5200af5244 Python: Add code snippets for VS Code
Notice that in this form, the filename doesn't matter, and you need to specify
`scope` to limit the snippet to only trigger for `ql`.
2020-11-13 10:57:17 +01:00
Mathias Vorreiter Pedersen
b249777bfb C++: Respond to review comments. 2020-11-13 10:44:06 +01:00
Tom Hvitved
708fca4a2f C#: Update ConstantCondition.ql 2020-11-13 10:23:09 +01:00
Erik Krogh Kristensen
7f68b07665 Merge branch 'main' into regexpParse 2020-11-13 09:33:16 +01:00
Rasmus Lerchedahl Petersen
dc91406ff0 Python: make .expected empty
still need to annotate missing results
2020-11-13 09:22:57 +01:00
Tamás Vajk
19fac60e6d Merge pull request #4661 from tamasvajk/feature/fix-var-decl-type-mention
C#: Fix parent of 'TypeMention' for some variable declaration
2020-11-13 09:08:21 +01:00
Robert Marsh
bd00988c37 C++: accept test output for DefaultTaintTracking 2020-11-12 14:38:53 -08:00
Robert Marsh
68040b717e C++: autoformat 2020-11-12 14:32:19 -08:00
Rasmus Lerchedahl Petersen
e468d49b19 Python: routing tests 3-7 and some annotations 2020-11-12 23:07:01 +01:00
Rasmus Lerchedahl Petersen
4fe2576b9a Python: start modernizing routing tests 2020-11-12 22:43:34 +01:00
Erik Krogh Kristensen
7cf7a44fda autoformat 2020-11-12 22:33:00 +01:00
Robert Marsh
275d75295c Merge branch 'main' into rdmarsh/cpp/use-taint-configuration-dtt
Fix test conflict
2020-11-12 13:28:10 -08:00
Rasmus Lerchedahl Petersen
823ed447df Python: Add new-style tests
should perhaps move `LocalFlowStepTest` and `MaximalFlowStep` into where
 they are referenced (they did not seem too reusable after all).
Should also add argument tests in the same way.
2020-11-12 21:57:29 +01:00
Erik Krogh Kristensen
49be7e959f Merge branch 'main' into jwt 2020-11-12 21:36:09 +01:00
Erik Krogh Kristensen
99d03bab24 only flag the secret key in JWT 2020-11-12 21:36:05 +01:00
Porcupiney Hairs
eb6d6113d9 minor nit. 2020-11-13 00:39:09 +05:30
Tom Hvitved
94deed39a2 C#: Represent all expressions in post-order in the CFG 2020-11-12 20:04:48 +01:00
Tom Hvitved
202f7f07ec C#: Update modulus analysis tests 2020-11-12 20:04:48 +01:00
Porcupiney Hairs
f8de94e906 refactor SpringWebClient 2020-11-13 00:32:27 +05:30
Porcupiney Hairs
2525cfd786 include suggestions from review. 2020-11-13 00:28:06 +05:30
Geoffrey White
0804df42d1 C++: Autoformat. 2020-11-12 18:23:11 +00:00
Dave Bartolomeo
f43d9119c8 Merge pull request #4573 from MathiasVP/interleave-op-instr-field-flow
C++: instruction -> operand field flow
2020-11-12 10:14:19 -05:00
Mathias Vorreiter Pedersen
5e1f36e7ff Merge branch 'unsafe-use-of-this-query' of github.com:MathiasVP/ql into unsafe-use-of-this-query 2020-11-12 15:51:19 +01:00
Mathias Vorreiter Pedersen
f417831a23 C++: Add two more tests to 'unsafe use of this'. First, test that post-dominance removes some results. Second, that a cast to the pure virtual function's defining class (skipping past a derived class that overrides the function) followed by a call to the function still results in an alert. This is also undefined behavior. 2020-11-12 15:51:04 +01:00
Mathias Vorreiter Pedersen
896dee5fb7 C++: Fix dataflow pruning by evaluating successor before flowsToSink/flowsFromSource. 2020-11-12 15:47:48 +01:00
Mathias Vorreiter Pedersen
f2317aed55 C++/C#: Make post-dominator related predicates member predicates of IRBlock. 2020-11-12 15:41:52 +01:00
Tamas Vajk
dee1690748 C#: Remove duplicated pattern extraction logic 2020-11-12 14:34:54 +01:00
Geoffrey White
498177ce02 C++: Autoformat. 2020-11-12 13:30:58 +00:00
Tamas Vajk
3f150bb09b C#: Reorganize patterns 2020-11-12 13:47:38 +01:00
Tamas Vajk
8cbe8bc6b5 C#: Fix parent of 'TypeMention' for some variable declaration 2020-11-12 13:43:13 +01:00
CodeQL CI
6696d18f56 Merge pull request #4659 from asgerf/js/autoformat-date-functions
Approved by erik-krogh
2020-11-12 11:32:47 +00:00
Mathias Vorreiter Pedersen
00f067be84 Update cpp/change-notes/2020-11-12-unsafe-use-of-this.md
Co-authored-by: Jonas Jensen <jbj@github.com>
2020-11-12 11:28:12 +01:00
James Fletcher
19b974832b Merge pull request #4658 from github/main-126-merge
Merge rc/1.26 into main branch
2020-11-12 10:18:24 +00:00
Asger Feldthaus
4d3d982bde JS: Autoformat date-functions file 2020-11-12 10:07:30 +00:00
james
9fc84f8061 Merge branch 'rc/1.26' into main-126-merge 2020-11-12 09:55:32 +00:00
Mathias Vorreiter Pedersen
50e90510ef C++: Follow the new change-note protocol. 2020-11-12 10:27:11 +01:00
Mathias Vorreiter Pedersen
4c27c3757c C++: Respond to more review comments. 2020-11-12 10:27:03 +01:00
Tamás Vajk
b5ef3bd5ec Merge pull request #4516 from tamasvajk/feature/attributes
C#: Refactor attribute extraction
2020-11-12 09:57:46 +01:00
Erik Krogh Kristensen
044fbc0b49 optimize the regexp parser 2020-11-11 21:13:11 +01:00
Erik Krogh Kristensen
de6b21986c bump extractor version string 2020-11-11 21:10:03 +01:00
Erik Krogh Kristensen
74d933d475 move change note 2020-11-11 21:09:08 +01:00
Erik Krogh Kristensen
67d581edec Update javascript/2020-11-09-jwt.md
Co-authored-by: Asger F <asgerf@github.com>
2020-11-11 21:06:30 +01:00
Geoffrey White
2aa6ff6239 C++: Add comments about the temporary exclusions. 2020-11-11 17:33:16 +00:00
Mathias Vorreiter Pedersen
44e38ab6d2 Merge branch 'unsafe-use-of-this-query' of github.com:MathiasVP/ql into unsafe-use-of-this-query 2020-11-11 18:30:20 +01:00
Mathias Vorreiter Pedersen
e1ef41bd38 C++: Respond to review comments. 2020-11-11 18:29:51 +01:00
Mathias Vorreiter Pedersen
de0ca0aa74 Update cpp/ql/src/Likely Bugs/OO/UnsafeUseOfThis.cpp
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2020-11-11 18:12:49 +01:00
luchua-bc
dcb7324643 Add the constraint that the caller method must throw an exception 2020-11-11 16:47:53 +00:00
Geoffrey White
5359e13421 C++: Remove abstraction of OperatorNew/DeleteAllocationFunction. 2020-11-11 15:35:34 +00:00
yoff
86fc9e62ef Merge pull request #4650 from RasmusWL/python-set-literal-formatting
Python: Update set literal formatting
2020-11-11 15:35:12 +01:00
Alvaro Muñoz
30d8dce389 check that either there are no custom message interpolator configured, or there is at least one that is insecure 2020-11-11 12:53:54 +01:00
CodeQL CI
f9d62adcb2 Merge pull request #4567 from asgerf/js/date-functions
Approved by erik-krogh
2020-11-11 11:17:30 +00:00
Alvaro Muñoz
c3bc0d6c15 Apply formatting 2020-11-11 12:06:39 +01:00
Alvaro Muñoz
5b1858a514 Do not report the issue only if all message interpolators are secure 2020-11-11 11:50:15 +01:00
Rasmus Wriedt Larsen
611398586d Merge pull request #4649 from yoff/python-dataflow-cfgparameters
Python: Make `ParameterNode` a `CfgNode`
2020-11-11 10:22:12 +01:00
Tamas Vajk
453c97a8c3 Fix expected files of failing tests 2020-11-11 09:57:52 +01:00
Tom Hvitved
e57134e8a4 C#: Address comments 2020-11-11 09:54:51 +01:00
Tom Hvitved
d6515e7963 C#: Changes to extraction of attributes in assemblies
- Only cache on `AttributeData` and not the parent entity.
- Move `CreateGeneratedExpressionFromArgument` to `Expression.cs`.
- Restructure the various `CreateGenerated` methods so child entities are
  created inside them (and therefore no need to expose child index logic).
- Add locations to generated expressions.
- Avoid linear lookup in `CompilationUnit.cs`.
- Consolidate tests.
2020-11-11 09:54:51 +01:00
Tom Hvitved
b8d6070e00 C#: Remove redundant conjunct 2020-11-11 09:54:51 +01:00
Tom Hvitved
3048919fce C#: Introduce AssertionFailure class 2020-11-11 09:54:51 +01:00
Tom Hvitved
91dd67798a C#: Exclude assembly attribute expressions from CFG construction 2020-11-11 09:50:59 +01:00
Tamas Vajk
4b88b237b3 C#: Fix failing tests 2020-11-11 09:50:59 +01:00
Tamas Vajk
4d6ccb1ef4 C#: Add change note for attribute extraction refactoring 2020-11-11 09:46:18 +01:00
Tamas Vajk
ba730b6f02 Fix failing tests 2020-11-11 09:46:18 +01:00
Tamas Vajk
5f18840a9e C#: Extract attributes of referenced assembly 2020-11-11 09:46:18 +01:00
Tamas Vajk
cdea3afced C#: Change extraction of Attributes to have ID based on the location when location is from source 2020-11-11 09:46:18 +01:00
Tamas Vajk
c04d6f479c C#: Change attribute extraction to use AttributeData and created generated expressions when missing 2020-11-11 09:46:18 +01:00
Tamas Vajk
883795e126 C#: Add attribute test for extraction from symbols without syntax nodes 2020-11-11 09:46:18 +01:00
Tamas Vajk
c14a63488c C#: Add missing tests for attribute extraction 2020-11-11 09:46:18 +01:00
Rasmus Wriedt Larsen
9ed15732ed Python: Update set literal formatting
Now that auto-formatting rules have been updated
2020-11-11 09:38:25 +01:00
Rasmus Lerchedahl Petersen
0710963fc3 Python: update test expectations
EssaNode -> ControlFlowNode
2020-11-10 23:58:55 +01:00
Erik Krogh Kristensen
e01d4b104e update expected output 2020-11-10 23:42:38 +01:00
Robert Marsh
049bff09e6 Merge branch 'main' into rdmarsh/cpp/use-taint-configuration-dtt
Make this branch a valid taget for a submodule bump
2020-11-10 14:25:05 -08:00
Robert Marsh
2a6ba40a93 C++: Accept more test changes 2020-11-10 13:59:35 -08:00
luchua-bc
018d5c46da Simplify the query 2020-11-10 21:07:44 +00:00
Mathias Vorreiter Pedersen
8d4b948acf Merge branch 'main' into interleave-op-instr-field-flow 2020-11-10 21:15:50 +01:00
Erik Krogh Kristensen
6b7f8dd505 fix parse errors related to char escapes and char ranges 2020-11-10 21:02:29 +01:00
Robert Marsh
14f1fa50f1 Merge branch 'main' into rdmarsh2/cpp/remove-initialize-nonlocal
Accept test changes from IR temporaries and block ordering
2020-11-10 11:14:26 -08:00
Geoffrey White
2c7a01952e C++: Improve the changes to Iterator. 2020-11-10 17:11:47 +00:00
Jonas Jensen
fc764db8e1 Merge pull request #4643 from nickrolfe/getFileBySourceArchiveName
Replace getEncodedFile with shared getFileBySourceArchiveName predicate
2020-11-10 17:36:29 +01:00
Geoffrey White
c635166079 Merge remote-tracking branch 'upstream/main' into modelchanges2 2020-11-10 16:30:03 +00:00
Mathias Vorreiter Pedersen
a330cae2f9 C++: Update change-notes. 2020-11-10 17:24:45 +01:00
Mathias Vorreiter Pedersen
4bcf1f498b C++: Add new query for unsafe use of this. 2020-11-10 17:23:55 +01:00
Pavel Avgustinov
60ea9cec6e Update docs/ql-design-patterns.md
Co-authored-by: Rasmus Wriedt Larsen <rasmuswl@github.com>
2020-11-10 15:59:45 +00:00
Mathias Vorreiter Pedersen
884554692f Merge pull request #4645 from geoffw0/oddsends2
C++: Odds and ends
2020-11-10 16:59:10 +01:00
Mathias Vorreiter Pedersen
618d9c33a1 Merge pull request #4642 from geoffw0/memberfn
C++: Improve MemberFunction.qll data flows
2020-11-10 16:54:42 +01:00
Jonas Jensen
da90717ef0 Merge pull request #4641 from aschackmull/autoformat-setliterals
C++/C#/Java/JavaScript/Python: Autoformat set literals.
2020-11-10 16:11:11 +01:00
Tom Hvitved
7e89e57f5d Merge pull request #4606 from hvitved/csharp/dataflow/ef
C#: Precise data flow for EntityFramework(Core)
2020-11-10 15:54:20 +01:00
Rasmus Wriedt Larsen
14236709f6 Fix typo ql-design-patterns.md
Co-authored-by: Pavel Avgustinov <54942558+p0@users.noreply.github.com>
2020-11-10 15:39:45 +01:00
Nick Rolfe
ac4a1f1d9b Update comment to be a QLDoc comment 2020-11-10 14:14:27 +00:00
Geoffrey White
be537a8021 C++: Move ThrowExpr, ReThrowExpr definitions to a more logical location. 2020-11-10 14:06:58 +00:00
Nick Rolfe
1e1eb7ee33 Replace getEncodedFile with shared getFileBySourceArchiveName predicate
While also making it work with paths for databases created on Windows.
2020-11-10 13:55:27 +00:00
Geoffrey White
2beb7824ec C++: Backticks. 2020-11-10 13:35:05 +00:00
Geoffrey White
599034668f C++: Fix typo. 2020-11-10 13:32:31 +00:00
Geoffrey White
f109e8ccbc C++: Remove duplicate import. 2020-11-10 13:31:47 +00:00
Geoffrey White
c4fe8df04c C++: Support data flow from parameter deref to return value. 2020-11-10 13:17:34 +00:00
Geoffrey White
4563e32e92 C++: Remove data flows we shouldn't need in MemberFunction. 2020-11-10 13:17:24 +00:00
Anders Schack-Mulligen
89ef6ea4eb C++/C#/Java/JavaScript/Python: Autoformat set literals. 2020-11-10 13:32:27 +01:00
Alvaro Muñoz
02cf49a773 apply codeql formatting 2020-11-10 11:46:42 +01:00
Rasmus Lerchedahl Petersen
109d55eb25 Python: Make ParameterNode a CfgNode
Add a step from that `CfgNode` to the corresponding `EssaNode`.
The intended effect is seen in `ImpliesDataflow.expected`.
The efeect seen in other `.expected`-files is that parameter nodes
change type, that the extra steps are seen, and that flow from
`EssaVar`s is mirrored in flow from `CfgNode`s.
There is one surprise, which is the `.0` node in
`coverage/localFlow.expected`.
2020-11-10 11:35:50 +01:00
Alvaro Muñoz
24a47fbb0f additional qldoc commentes 2020-11-10 10:48:47 +01:00
Alvaro Muñoz
3545edb92c address code review suggestions 2020-11-10 10:45:14 +01:00
Tom Hvitved
697b0ba4c1 C#: Address review comments 2020-11-10 10:42:05 +01:00
Erik Krogh Kristensen
ae7c7607f1 fix typos in documentation strings
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com>
2020-11-10 10:41:39 +01:00
Erik Krogh Kristensen
b5b4d6d62a add change note 2020-11-10 10:41:39 +01:00
Erik Krogh Kristensen
5ecae55e77 add keys used by jsonwebtoken as CredentialsExpr 2020-11-10 10:41:39 +01:00
Erik Krogh Kristensen
e75259d3a6 model the verify function in jsonwebtoken 2020-11-10 10:41:39 +01:00
Erik Krogh Kristensen
6732493377 add model for jwt-decode 2020-11-10 10:41:36 +01:00
yoff
26286e534e Merge pull request #4174 from yoff/SharedDataflow_PointsToImpliesDataflow
Python: Dataflow, Test that `pointsTo` implies data flow
merging now, will fix `self` in a later PR
2020-11-10 10:25:29 +01:00
Robert Marsh
c00587d2cb C++/C#: Conflated memory as IR dump annotation
Removes the IR consistency checks for conflated memory and marks
instructions that have a conflated result with a percent sign (%)
instead. This avoids reimplementing part of the alias analysis logic
in the consistency check.
2020-11-09 14:55:47 -08:00
Robert Marsh
04ad94d1cc C++: model taint from pointers to aliased buffers 2020-11-09 13:52:08 -08:00
Robert Marsh
afbeca0d54 C++: Accept test outputs 2020-11-09 13:24:31 -08:00
Robert Marsh
95ed5465de C++: improve handling of function arguments in DTT 2020-11-09 13:02:06 -08:00
Robert Marsh
fbe857d1fa C++: require that other operands be predictable
This brings back a constraint that was lost when switching
DefaultTaintTracking to use a TaintTracking::Configuration
2020-11-09 13:00:55 -08:00
Robert Marsh
7d79be71d1 C++: taint tracking conf in DefaultTaintTracking
Switch from using additional flow steps with a DataFlow::Configuration
in DefaultTaintTracking to using a TaintTracking::Configuration. This
makes future improvements to TaintTracking::Configuration reflected in
DefaultTaintTracking without further effort. It also removes the
predictability constraint in DefaultTaintTracking, which increases the
number of results, with both new true positives and new false positives.
Those may need to be addressed on a per-query basis.

There are some additional regressions from losing pointer/object
conflation for arguments. Those can be worked around by adding that
conflation to TaintTracking::Configuration until precise indirect
parameter flow is ready.
2020-11-09 13:00:55 -08:00
Porcupiney Hairs
38de9b6433 add request forgery query 2020-11-10 01:19:35 +05:30
CodeQL CI
1e048d8045 Merge pull request #4609 from asgerf/js/destructuring-export
Approved by erik-krogh
2020-11-09 15:47:00 +00:00
luchua-bc
bc899b6337 Move common code to a library and add more test cases 2020-11-09 14:14:54 +00:00
luchua-bc
b10552aa2e Specify exported Android components for local Android DoS 2020-11-09 14:10:01 +00:00
luchua-bc
76a0db84ee Query for detecting Local Android DoS caused by NFE 2020-11-09 14:10:00 +00:00
Anders Schack-Mulligen
31ec79819e Merge pull request #4631 from luchua-bc/java-nfe-library
Java: Factor NumberFormatException out into a library file
2020-11-09 13:50:31 +01:00
yoff
3215f50b73 Merge pull request #4632 from RasmusWL/python-move-configurations-out-of-queries
Python: move configurations out of queries
2020-11-09 13:10:33 +01:00
luchua-bc
a83f9ced96 Change the query to only catch the common exception rethrown case 2020-11-09 12:07:43 +00:00
luchua-bc
d765c7bbb2 Update qldoc 2020-11-09 11:23:48 +00:00
Asger Feldthaus
32c5bc4836 JS: Update test case output (new flow is correct) 2020-11-09 11:19:47 +00:00
Mathias Vorreiter Pedersen
25ba6ca160 Merge pull request #4637 from jbj/temp-objects-perf-fixup
C++: pragma[noinline] parameter index predicates
2020-11-09 10:12:50 +01:00
Mathias Vorreiter Pedersen
3c2fb5a93f Merge branch 'main' into interleave-op-instr-field-flow 2020-11-09 09:58:19 +01:00
Rasmus Wriedt Larsen
fbe51c51bb Python: Add missing QLDoc 2020-11-09 09:05:08 +01:00
Jonas Jensen
b8b1f0c617 C++: pragma[noinline] parameter index predicates
A performance regression in `definitionByReferenceNodeFromArgument#ff`
was ultimately caused by a join on parameter indexes in
`DefinitionByReferenceNode.getArgument`. Joining on numbers in QL is
always fragile, and somehow the changes in #4432 had caused the join
order here to break.

Instead of tweaking the join order in the slow predicate itself, I added
`pragma[noinline]` to one of the predicates involved in the join on
parameter indexes. This should prevent us from getting similar
performance problems in the future when we write code that joins on
parameter numbers. Joining on indexes is always risky, but it's even
more risky when one of the predicates in the join is inlined by the
compiler and expands to further joins.

I tested performance by running `CgiXss.ql` on a ChakraCore snapshot.
Tuple counts before (I interrupted execution after five minutes or so):

    (626s) Tuple counts for DataFlowUtil::definitionByReferenceNodeFromArgument#ff:
    58162      ~0%     {3} r1 = SCAN DataFlowUtil::DefinitionByReferenceNode#class#ff AS I OUTPUT I.<1>, -1, I.<0>
    26934      ~0%     {2} r2 = JOIN r1 WITH Instruction::IndexedInstruction#ff AS R ON FIRST 2 OUTPUT r1.<0>, r1.<2>
    26934      ~1%     {2} r3 = JOIN r2 WITH Instruction::SideEffectInstruction::getPrimaryInstruction_dispred#3#ff AS R ON FIRST 1 OUTPUT R.<1>, r2.<1>
    26850      ~1%     {2} r4 = JOIN r3 WITH Instruction::CallInstruction::getThisArgumentOperand_dispred#ff AS R ON FIRST 1 OUTPUT R.<1>, r3.<1>
    26850      ~0%     {2} r5 = JOIN r4 WITH Operand::Operand::getDef_dispred#3#ff AS R ON FIRST 1 OUTPUT R.<1>, r4.<1>
    26850      ~1%     {2} r6 = JOIN r5 WITH Instruction::Instruction::getUnconvertedResultExpression_dispred#ff AS R ON FIRST 1 OUTPUT R.<1>, r5.<1>
    58162      ~0%     {2} r7 = SCAN DataFlowUtil::DefinitionByReferenceNode#class#ff AS I OUTPUT I.<1>, I.<0>
    58162      ~4%     {3} r8 = JOIN r7 WITH Instruction::IndexedInstruction#ff AS R ON FIRST 1 OUTPUT R.<1>, r7.<1>, r7.<0>
    4026581120 ~0%     {4} r9 = JOIN r8 WITH Instruction::CallInstruction::getPositionalArgumentOperand_dispred#fff_102#join_rhs AS R ON FIRST 1 OUTPUT r8.<2>, R.<1>, r8.<1>, R.<2>
    31154      ~4%     {2} r10 = JOIN r9 WITH Instruction::SideEffectInstruction::getPrimaryInstruction_dispred#3#ff AS R ON FIRST 2 OUTPUT r9.<3>, r9.<2>
    31154      ~8%     {2} r11 = JOIN r10 WITH Operand::Operand::getDef_dispred#3#ff AS R ON FIRST 1 OUTPUT R.<1>, r10.<1>
    31154      ~0%     {2} r12 = JOIN r11 WITH Instruction::Instruction::getUnconvertedResultExpression_dispred#ff AS R ON FIRST 1 OUTPUT R.<1>, r11.<1>
    58004      ~0%     {2} r13 = r6 \/ r12
                       return r13

Tuple counts after:

    (0s) Tuple counts for DataFlowUtil::definitionByReferenceNodeFromArgument#ff:
    385785  ~6%     {2} r1 = SCAN DataFlowUtil::DefinitionByReferenceNode#class#ff AS I OUTPUT I.<1>, I.<0>
    385785  ~0%     {3} r2 = JOIN r1 WITH Instruction::IndexedInstruction#ff AS R ON FIRST 1 OUTPUT r1.<0>, r1.<1>, R.<1>
    385785  ~1%     {3} r3 = JOIN r2 WITH Instruction::SideEffectInstruction::getPrimaryInstruction_dispred#3#ff AS R ON FIRST 1 OUTPUT R.<1>, r2.<2>, r2.<1>
    198736  ~4%     {2} r4 = JOIN r3 WITH Instruction::CallInstruction::getPositionalArgument#fff AS R ON FIRST 2 OUTPUT R.<2>, r3.<2>
    198736  ~0%     {2} r5 = JOIN r4 WITH Instruction::Instruction::getUnconvertedResultExpression_dispred#ff AS R ON FIRST 1 OUTPUT R.<1>, r4.<1>
    385785  ~1%     {3} r6 = SCAN DataFlowUtil::DefinitionByReferenceNode#class#ff AS I OUTPUT I.<1>, -1, I.<0>
    186891  ~1%     {2} r7 = JOIN r6 WITH Instruction::IndexedInstruction#ff AS R ON FIRST 2 OUTPUT r6.<0>, r6.<2>
    186891  ~2%     {2} r8 = JOIN r7 WITH Instruction::SideEffectInstruction::getPrimaryInstruction_dispred#3#ff AS R ON FIRST 1 OUTPUT R.<1>, r7.<1>
    183201  ~3%     {2} r9 = JOIN r8 WITH Instruction::CallInstruction::getThisArgumentOperand_dispred#ff AS R ON FIRST 1 OUTPUT R.<1>, r8.<1>
    183201  ~0%     {2} r10 = JOIN r9 WITH Operand::Operand::getDef_dispred#3#ff AS R ON FIRST 1 OUTPUT R.<1>, r9.<1>
    175449  ~8%     {2} r11 = JOIN r10 WITH Instruction::Instruction::getUnconvertedResultExpression_dispred#ff AS R ON FIRST 1 OUTPUT R.<1>, r10.<1>
    374185  ~3%     {2} r12 = r5 \/ r11
                    return r12
2020-11-09 09:01:22 +01:00
Rasmus Wriedt Larsen
ed0e4f8425 Python: reasoning about => detecting
Co-authored-by: yoff <lerchedahl@gmail.com>
2020-11-09 09:01:04 +01:00
Erik Krogh Kristensen
3ef5d89e39 update expected output 2020-11-08 23:27:38 +01:00
Erik Krogh Kristensen
17a687b344 testing many possible intersections, instead of a single intersection 2020-11-08 23:24:36 +01:00
Erik Krogh Kristensen
34fd0d89f5 finding the minimum that is not an FP - instead of finding the minimum and then checking if it was an FP. And detecting more FPs by finding when a witness pass through the accept state 2020-11-08 23:24:27 +01:00
Erik Krogh Kristensen
ac514b1739 remove false positives where the analysis would wrongly conclude that the accept state could not be reached 2020-11-08 23:24:03 +01:00
Erik Krogh Kristensen
5f199e8b1a improve performance by removing bindingset[char] 2020-11-08 23:24:03 +01:00
Erik Krogh Kristensen
d038e9c658 small performance improvements 2020-11-08 23:24:03 +01:00
Erik Krogh Kristensen
a5e75f53ff add support for escape char classes inside char classes 2020-11-08 23:22:49 +01:00
Erik Krogh Kristensen
0063cb140c add support for \W, \S, \D 2020-11-08 23:16:56 +01:00
Erik Krogh Kristensen
2dd8b6ffef support \f and \v in the \s class 2020-11-08 23:16:56 +01:00
Erik Krogh Kristensen
68fe03060d support \d \s and \w in ReDoS.ql 2020-11-08 23:16:56 +01:00
Erik Krogh Kristensen
fa54ad1a5e refactor character class implementation in ReDoS.ql - preparing support for RegExpCharacterClassEscape 2020-11-08 23:16:55 +01:00
Erik Krogh Kristensen
a09ffd5cda expand getAOverlapBetweenCharacterClasses to support overlap between more char classes 2020-11-08 23:16:37 +01:00
Erik Krogh Kristensen
4ede04f4d1 improve performance by pruning based on shared root 2020-11-08 23:16:37 +01:00
Erik Krogh Kristensen
82252c0f1c detect redos between charclass and inverted charclass 2020-11-08 23:16:34 +01:00
Taus
a9149b7e47 Python: Update python/ql/src/semmle/python/dataflow/new/internal/DataFlowPrivate.qll
Co-authored-by: yoff <lerchedahl@gmail.com>
2020-11-06 17:15:58 +01:00
Taus Brock-Nannestad
5a9cc0861c Merge branch 'main' into python-add-source-nodes 2020-11-06 17:12:41 +01:00
Geoffrey White
62a8427d37 C++: Change note. 2020-11-06 15:55:31 +00:00
Geoffrey White
74a4f5887b C++: Remove implementation import from printf.qll. 2020-11-06 15:44:11 +00:00
Geoffrey White
e065466180 C++: Give Snprintf a proper interface. 2020-11-06 15:38:57 +00:00
luchua-bc
d568eb635f Update qldoc 2020-11-06 15:33:26 +00:00
Geoffrey White
0790fb6324 Update cpp/change-notes/2020-11-02-unused-local-variable.md
Co-authored-by: Jonas Jensen <jbj@github.com>
2020-11-06 14:42:48 +00:00
yoff
45317bcec9 Update python/ql/test/library-tests/PointsTo/new/code/w_function_values.py
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2020-11-06 15:03:20 +01:00
Rasmus Wriedt Larsen
9ebe59d393 Python: Move UnsafeDeserialization configuration to own file 2020-11-06 14:27:37 +01:00
luchua-bc
450ff26694 Convert the query to a library 2020-11-06 13:25:00 +00:00
Rasmus Wriedt Larsen
d38c48d2c8 Python: Move ReflectedXSS configuration to own file 2020-11-06 14:24:31 +01:00
Rasmus Wriedt Larsen
1897a0d59a Python: Move PathInjection configuration to own file
This one required a bit more thought, but ended up pretty nicely. Had to write
some QLDoc, but I think it turned out OK.
2020-11-06 14:21:23 +01:00
Rasmus Wriedt Larsen
0c6bd8401a Python: Move SqlInjection configuration to own file 2020-11-06 14:09:46 +01:00
Rasmus Wriedt Larsen
6299b73a46 Python: Move CommandInjection configuration to own file 2020-11-06 14:07:06 +01:00
Rasmus Wriedt Larsen
7c04c59456 Python: Move CodeInjection configuration to own file
This makes it easy to extend the sources/sinks of the configuration and re-run
the query from the query console on LGTM.com.

File location in `semmle.<lang>.security.dataflow.<QueryName>.qll` is matching
what we currently do in other languages (JS and C# sampled).

I did not follow the pattern in other languages for wrapping all the code in a
`module CodeInjection`, since I didn't understand the value in doing so -- I
would like confirmation from the other teams if we _should_ actually do that,
before merging.
2020-11-06 13:58:06 +01:00
Rasmus Lerchedahl Petersen
fe186bf854 Python: Add test 2020-11-06 13:30:11 +01:00
Alvaro Muñoz
9db340c9ca add some improvements to the bean validation query 2020-11-06 13:08:45 +01:00
Asger Feldthaus
acb30e73bc JS: More precise handling of default import fallback 2020-11-06 12:04:41 +00:00
Rasmus Lerchedahl Petersen
64b9e9150e Python: only show results in extracted files 2020-11-06 12:01:16 +01:00
Erik Krogh Kristensen
16473fc2a4 matching a inverted char class with a char 2020-11-06 10:18:57 +01:00
Erik Krogh Kristensen
804aaf36f0 support inverted char class and dot 2020-11-06 10:18:57 +01:00
Erik Krogh Kristensen
64d680e2d3 support that an inverted char class can intersect with itself 2020-11-06 10:18:57 +01:00
Erik Krogh Kristensen
321cf09bd8 add redos support for the simplest possible inverted char class 2020-11-06 10:18:57 +01:00
Erik Krogh Kristensen
d04f3df1cd remove rendundant check 2020-11-06 10:18:57 +01:00
Asger Feldthaus
1e45bc75c4 JS: Add change note in new format 2020-11-06 09:14:03 +00:00
Asger Feldthaus
24714c41be JS: Update test output after rebase 2020-11-06 09:14:03 +00:00
Asger Feldthaus
9e25bbc4ed JS: Add support for moment-timezone as well 2020-11-06 09:13:52 +00:00
Asger Feldthaus
7bf21d80b2 JS: Shift line numbers in test file 2020-11-06 09:13:52 +00:00
Asger Feldthaus
9418c6c8fe JS: Add support for dateformat package 2020-11-06 09:13:52 +00:00
CodeQL CI
9f2eb84f2b Merge pull request #4624 from erik-krogh/concatFix
Approved by asgerf
2020-11-06 09:11:41 +00:00
Asger Feldthaus
39c8226fba JS: Autoformat 2020-11-06 09:06:20 +00:00
Asger Feldthaus
790526b529 JS: Some fixes and address review comments 2020-11-06 09:06:20 +00:00
Asger Feldthaus
8a3fba05e9 JS: Add steps through date-formatting functions 2020-11-06 09:06:18 +00:00
Anders Schack-Mulligen
cb77e460ae Merge pull request #4600 from porcupineyhairs/urirefactor
Java : Refactor all instances of `java.net.URI` into TypeUri
2020-11-06 09:35:09 +01:00
Asger Feldthaus
d07e69e529 JS: Improve handling of destructuring export declaration 2020-11-05 23:51:44 +00:00
CodeQL CI
a908e5938e Merge pull request #4574 from erik-krogh/jsdom
Approved by asgerf
2020-11-05 22:13:39 +00:00
Erik Krogh Kristensen
9137759d7c calculate the size of the concatenation before doing the actual concatenation in Expr.qll 2020-11-05 22:55:52 +01:00
Tom Hvitved
a3894be1c5 Merge pull request #4607 from hvitved/csharp/msbuild-mono-no-shared-compilation
C#: Disable shared compilation when building with Mono+MSBuild
2020-11-05 19:56:25 +01:00
Geoffrey White
c9f846e0d2 C++: Give Iterator a proper interface. 2020-11-05 16:43:50 +00:00
Geoffrey White
b5326b3937 C++: Give OperatorNewAllocationFunction, OperatorDeleteAllocationFunction proper interfaces. 2020-11-05 16:43:49 +00:00
Geoffrey White
7f54379a0c C++: Make more function models private (except a few that are used outside the library). 2020-11-05 16:43:42 +00:00
Taus Brock-Nannestad
7c58b28e36 Python: Write DataFlow::update more succinctly
This has no impact on performance, but it cleans up the code a bit,
and (hopefully) makes it more readable.
2020-11-05 16:47:41 +01:00
Taus Brock-Nannestad
bae4acabb1 Python: Fix bad join in StrConst::isUnicode
Also fixes a bug ("`B`" was not recognised as a bytestring prefix).

The basic idea behind this fix is that the set of possible prefixes is
fairly small, so it's easier just to precompute them, and then join
them with the entire prefix of the string in question (rather than
look at each string in isolation, get its prefix, and _then_ check
whether it looks like it's a unicode string prefix, which essentially
is what the code did before).
2020-11-05 16:45:27 +01:00
Taus Brock-Nannestad
1251bc57f5 Python: Fix bad join in TObject::literal_instantiation
Here, `context.appliesTo(n)` was being distributed across all of the
disjuncts, which caused poor performance.

The new helper predicate, `literal_node_class` should be fairly small,
since it only applies to a subset of `ControlFlowNode`s, and only
assigns a limited set of `ClassObjectInternal`s to these nodes.
2020-11-05 16:40:29 +01:00
Taus Brock-Nannestad
35a63e2411 Python: Fix bad join in regex::used_as_regex
Since the number of relevant attributes in the `re` module is fairly
small, it made sense to factor this out in a separate predicate, and
the join order also became more sensible.
2020-11-05 16:33:59 +01:00
Taus Brock-Nannestad
035e747ad5 Python: Fix slow use of regexCapture in Builtin::strValue
This is only _really_ expensive when there are a _lot_ of strings in
the database, but for this case, where we're always extracting the
same substring of the string, it's easier -- and faster -- to just
make a substring operation directly.
2020-11-05 16:33:33 +01:00
Taus Brock-Nannestad
83ba8c9bf5 Python: Add LocalSourceNode and flowsTo
This fixes the major performance problem with type tracking on
some (pathological) databases.

The interface could probably be improved a bit. In particular, I'm
thinking that we might want to have `DataFlow::exprNode` return a
`LocalSourceNode` so that a cast isn't necessary in order to use
`flowsTo`.

I have added two `cached` annotations. The one on `flowsTo` is
crucial, as performance regresses without it. The one on
`simpleLocalFlowStep` may not be needed, but Java has a similar
annotation, and to me it makes sense to have this relation cached.
2020-11-05 16:26:03 +01:00
Erik Krogh Kristensen
e124ba66b4 moving jsdom sink to js/xss 2020-11-05 16:10:33 +01:00
Tom Hvitved
10ab3304c1 Merge pull request #4575 from hvitved/csharp/cfg/post-dominance
C#: Restrict post-dominance to normal execution
2020-11-05 15:31:13 +01:00
Anders Schack-Mulligen
45d117b68e Merge pull request #4603 from pwntester/new_deser_sink
New UnsafeDeserialization sink and improvements to SnakeYaml sink
2020-11-05 13:09:15 +01:00
Rasmus Lerchedahl Petersen
6cecd3ba83 Python: Move and rename query 2020-11-05 11:49:39 +01:00
Alvaro Muñoz
f103955f38 change qldoc formating according to LSP suggestion 2020-11-05 11:48:26 +01:00
CodeQL CI
89a808cafe Merge pull request #4552 from erik-krogh/tsImport
Approved by asgerf
2020-11-05 09:23:58 +00:00
CodeQL CI
b55f18bffd Merge pull request #4549 from erik-krogh/pruneReturn
Approved by asgerf
2020-11-05 09:13:21 +00:00
CodeQL CI
c85f817cee Merge pull request #4579 from erik-krogh/redos
Approved by asgerf
2020-11-05 08:38:44 +00:00
Robert Marsh
2f204869e7 Merge pull request #4604 from criemen/ir-block-sort-order
C++, C# IR: Stabilize sort order for basic blocks.
2020-11-04 18:22:23 -05:00
Erik Krogh Kristensen
342b6a4f2d Update javascript/ql/src/semmle/javascript/security/performance/SuperlinearBackTracking.qll
Co-authored-by: Asger F <asgerf@github.com>
2020-11-04 22:37:56 +01:00
Tom Hvitved
1ba9e29a40 C#: Precise data flow for EntityFramework(Core) 2020-11-04 19:48:03 +01:00
Alvaro Muñoz
302062b670 Merge branch 'new_deser_sink' of https://github.com/pwntester/ql into new_deser_sink 2020-11-04 18:58:57 +01:00
Alvaro Muñoz
6fef63306e add qldoc 2020-11-04 18:58:41 +01:00
Erik Krogh Kristensen
e16fa0668a update expected output 2020-11-04 18:24:31 +01:00
Asger Feldthaus
5eb3067f58 JS: Add test case 2020-11-04 16:50:23 +00:00
Geoffrey White
48628fa195 Merge pull request #4589 from criemen/model-vector-emplace
C++: Model std::vector emplace and emplace_back()
2020-11-04 16:09:31 +00:00
Tom Hvitved
b5063bbcb5 Merge pull request #4495 from hvitved/csharp/dataflow/summaries
C#: Shared interface/implementation for flow summaries
2020-11-04 17:02:19 +01:00
Cornelius Riemenschneider
78d885ee7d C++: Accept test output. 2020-11-04 16:45:07 +01:00
Cornelius Riemenschneider
44d6584fa2 C++, C#: Auto-format. 2020-11-04 16:26:56 +01:00
Cornelius Riemenschneider
a13947424a C++, C# IR: Stabilize sort order for basic blocks. 2020-11-04 16:26:56 +01:00
Cornelius Riemenschneider
e7e5754270 C++: Add taint model for std::vector::emplace/_back. 2020-11-04 16:20:01 +01:00
Erik Krogh Kristensen
03c46c9be0 autoformat 2020-11-04 16:18:24 +01:00
yoff
79fcf598f3 Merge pull request #4608 from RasmusWL/patch-1
Python: Remove unnecessary cached annotation from adjacentRefUse
2020-11-04 16:08:30 +01:00
Cornelius Riemenschneider
62a02cde73 C++: Add test to show missing taint steps for std::vector::emplace/_back 2020-11-04 16:07:15 +01:00
Cornelius Riemenschneider
081ab1e2bb C++: Add std::vector::emplace/_back to our STL model. 2020-11-04 16:07:08 +01:00
Rasmus Lerchedahl Petersen
38b2bb2828 Python: Add testfile with regressions 2020-11-04 15:55:59 +01:00
Ian Lynagh
6ff939db5c Merge pull request #4432 from dbartol/dbartol/temporaries/work
C++: Represent temporary object initialization in AST and IR
2020-11-04 14:38:45 +00:00
Rasmus Lerchedahl Petersen
6df3b8d524 Python: Update query and expectation 2020-11-04 15:17:38 +01:00
Rasmus Wriedt Larsen
31247739d7 Python: Remove unnecessary cached annotation from adjacentRefUse
As discussed in https://github.com/github/codeql/pull/4544#pullrequestreview-516575676
2020-11-04 15:16:08 +01:00
Rasmus Lerchedahl Petersen
9baa7b73da Merge branch 'main' of github.com:github/codeql into SharedDataflow_PointsToImpliesDataflow 2020-11-04 15:05:59 +01:00
yoff
62cb4ec974 Merge pull request #4605 from RasmusWL/python-fix-django-response-modeling
Python: fix django response modeling
2020-11-04 15:00:52 +01:00
Tom Hvitved
131a05563a C#: Disable shared compilation when building with Mono+MSBuild 2020-11-04 14:16:25 +01:00
Porcupiney Hairs
0a028dcb47 Java : Refactor all instances of java.net.URI into TypeUri 2020-11-04 18:23:26 +05:30
Rasmus Wriedt Larsen
5cf8285717 Python: Fix default mimetype for django FileResponse 2020-11-04 12:28:51 +01:00
Rasmus Wriedt Larsen
826aedeb85 Python: Remove resolved TODO 2020-11-04 12:17:31 +01:00
Rasmus Wriedt Larsen
353505ec6c Python: Handle content of Django redirects correctly 2020-11-04 12:10:58 +01:00
Taus
180373c41d Merge pull request #4597 from yoff/python-fix-ql-doc
Python: Fix ql doc
2020-11-04 11:37:32 +01:00
Rasmus Wriedt Larsen
92dc7dc2f3 Python: Use mimetype instead of content-type in django modeling
This enables the XSS query to actually find results from django responses.
2020-11-04 11:34:20 +01:00
Alvaro Muñoz
aa7b87aa33 Update java/change-notes/2020-11-04-commonslang-unsafe-deserialization-sinks.md
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2020-11-04 10:58:27 +01:00
Alvaro Muñoz
b284141a16 Merge branch 'new_deser_sink' of https://github.com/pwntester/ql into new_deser_sink 2020-11-04 10:51:07 +01:00
Alvaro Muñoz
436563d914 ChangeNote for new unsafe deserialization sinks 2020-11-04 10:50:50 +01:00
Anders Schack-Mulligen
22b4df0f3c Merge pull request #4512 from luchua-bc/sensitive-broadcast
Java: Sensitive broadcast
2020-11-04 10:47:48 +01:00
Alvaro Muñoz
6f78b725e6 Apply suggestions from code review
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2020-11-04 10:43:37 +01:00
Anders Schack-Mulligen
26495225e0 Update java/ql/src/experimental/Security/CWE/CWE-927/SensitiveBroadcast.qhelp
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
2020-11-04 10:05:55 +01:00
luchua-bc
3f0cdb6a1a Update qldoc and comments 2020-11-03 19:40:28 +00:00
Tom Hvitved
c5abf29dfc C#: Update flow-summary test 2020-11-03 20:28:42 +01:00
Dave Bartolomeo
4cc9110dbd Fix test expectation 2020-11-03 13:39:33 -05:00
Dave Bartolomeo
f0b9794907 Merge remote-tracking branch 'upstream/main' into work 2020-11-03 11:33:44 -05:00
luchua-bc
fa54c23a83 Handle the edge case that an exception is rethrown in a catch clause 2020-11-03 16:31:12 +00:00
Anders Schack-Mulligen
92494441a7 Merge pull request #4554 from aschackmull/dataflow/reverse-partial
Dataflow: Add support reverse partial flow exploration.
2020-11-03 15:34:30 +01:00
Tom Hvitved
438b8dd273 C#: Fix typos 2020-11-03 14:57:07 +01:00
Erik Krogh Kristensen
b02004430c prune results that end with newline, where the input cannot contain newlines 2020-11-03 14:48:39 +01:00
Erik Krogh Kristensen
120faf9d1a add a code injection sink for JSDOM when "runScripts" is set to "dangerously" 2020-11-03 14:29:00 +01:00
Tom Hvitved
f4d1d73bcd C#: Shared interface/implementation for flow summaries 2020-11-03 13:47:28 +01:00
luchua-bc
f8fd2ea821 Add qldoc and autoformat query 2020-11-03 12:23:40 +00:00
Rasmus Lerchedahl Petersen
1023b239e4 Python: Simplify doc 2020-11-03 12:10:00 +01:00
yoff
d6a33a1253 Apply suggestions from code review
Co-authored-by: Taus <tausbn@github.com>
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2020-11-03 12:04:43 +01:00
Rasmus Lerchedahl Petersen
b71ea40dbd Python: QL doc for Werkzeug 2020-11-03 11:44:48 +01:00
Rasmus Lerchedahl Petersen
1773cc3a38 Python: QL doc for MySQLdb 2020-11-03 11:39:28 +01:00
Rasmus Lerchedahl Petersen
01783acca6 Python: QL doc for RemoteFlowSources 2020-11-03 11:37:34 +01:00
Rasmus Lerchedahl Petersen
f44cbf4b6c Python: QL doc for TypeTracker 2020-11-03 11:32:57 +01:00
Rasmus Lerchedahl Petersen
50eb51b6fe Python: QL doc for StepSummary 2020-11-03 11:30:52 +01:00
Rasmus Lerchedahl Petersen
6103dbcfff Python: QL doc for Node 2020-11-03 11:13:58 +01:00
Rasmus Lerchedahl Petersen
2bb1917733 Python: QlDoc for content 2020-11-03 11:10:33 +01:00
Rasmus Wriedt Larsen
c04e96453d Update ::Range part of CodeQL design patterns
Co-authored-by: Pavel Avgustinov <54942558+p0@users.noreply.github.com>
2020-11-03 11:07:11 +01:00
Anders Schack-Mulligen
2971784f9c Dataflow: Add missing qldoc and sync. 2020-11-03 09:21:48 +01:00
Anders Schack-Mulligen
7eb64aa998 Dataflow: Code review fixes. 2020-11-03 09:16:20 +01:00
Anders Schack-Mulligen
1ae76a80aa Dataflow: Fix qldoc. 2020-11-03 09:16:20 +01:00
Anders Schack-Mulligen
d5be4d7b92 Dataflow: Add support reverse partial flow exploration. 2020-11-03 09:16:19 +01:00
Dave Bartolomeo
0d1fbd1bdc Fix annotations 2020-11-02 18:03:40 -05:00
Dave Bartolomeo
e9d1f0dacf Merge remote-tracking branch 'upstream/main' into work 2020-11-02 17:31:15 -05:00
Robert Marsh
0e4d69709f C++/C#: autoformat 2020-11-02 14:00:53 -08:00
Robert Marsh
f917cf826f C++: accept test output 2020-11-02 13:59:23 -08:00
Erik Krogh Kristensen
e6e4a485c8 add JSDOM.fromUrl() as a request forgery sink 2020-11-02 17:05:56 +01:00
Geoffrey White
6629696e8a C++: Change note. 2020-11-02 15:46:38 +00:00
Geoffrey White
e9bde9b711 C++: Work around issue with ConditionalDeclExpr. 2020-11-02 15:46:38 +00:00
Geoffrey White
79bda0055c C++: Work around issue with 'Unknown literal'. 2020-11-02 15:46:36 +00:00
luchua-bc
6a8ce37428 Add query for initCause and addSuppressed 2020-11-02 11:59:14 +00:00
Geoffrey White
35f4646ee0 C++: Add test cases for UnusedLocals. 2020-11-02 10:40:42 +00:00
luchua-bc
78d7fe2fbb Detect rethrowing unprocessed exceptions in catch clause 2020-11-01 02:13:50 +00:00
luchua-bc
c89ebeeb5e Text changes 2020-11-01 00:39:00 +00:00
Dave Bartolomeo
69dee154f3 Fix PR feedback 2020-10-31 09:03:51 -04:00
luchua-bc
756db4c03a Simplify the query and add more test cases 2020-10-31 01:33:24 +00:00
luchua-bc
67af9b0f3e Add comments and update JavaDocs of GenericServlet using the source JAR 2020-10-30 17:05:53 +00:00
Dave Bartolomeo
be180aac25 Fixup after merge 2020-10-30 12:52:58 -04:00
luchua-bc
93d1393ded Add error-page check 2020-10-30 16:45:56 +00:00
Dave Bartolomeo
ec398b2a67 Merge remote-tracking branch 'upstream/main' into work 2020-10-30 12:36:33 -04:00
Dave Bartolomeo
42373417e2 Merge from main 2020-10-30 12:02:56 -04:00
Mathias Vorreiter Pedersen
177f94368e C++: Respond to review comments and accept test changes. 2020-10-30 15:59:39 +01:00
Erik Krogh Kristensen
39028f62a3 add test for outDir 2020-10-30 10:37:10 +01:00
Erik Krogh Kristensen
ebc4856456 detect more expensive regexps in js/polynomial-redos 2020-10-30 09:52:13 +01:00
Tom Hvitved
6723e5b31c C#: Restrict post-dominance to normal execution 2020-10-30 09:14:12 +01:00
Tom Hvitved
ade8ff9593 C#: Add more CFG tests 2020-10-30 09:14:12 +01:00
Robert Marsh
7e8770d731 C#: Remove reference to InitializeNonLocal in IR 2020-10-29 16:08:23 -07:00
Robert Marsh
5dfe04a7a7 C++: Respond to PR comments 2020-10-29 16:00:08 -07:00
luchua-bc
5a6339c1af Remove userid from the regex 2020-10-29 15:46:05 +00:00
luchua-bc
90d11812be Update the regex to be the original one 2020-10-29 13:04:15 +00:00
Mathias Vorreiter Pedersen
f3f9a044e0 C++: Accept more tests. 2020-10-29 13:55:45 +01:00
Mathias Vorreiter Pedersen
835d3fc2b7 C++: Accept tests 2020-10-29 09:27:03 +01:00
Mathias Vorreiter Pedersen
43a231f0a5 C++: Store steps now go from operands to instructions, and read steps now go from instructions and operands. There are a couple of read steps that still target instructions because I couldn't decide on an operand to target. 2020-10-29 09:26:51 +01:00
Dave Bartolomeo
c49e33f9cd Fixup after merge 2020-10-28 16:59:13 -04:00
luchua-bc
908d659906 Minor updates 2020-10-28 20:23:22 +00:00
Dave Bartolomeo
7a2c59c194 Merge from main 2020-10-28 15:35:46 -04:00
Dave Bartolomeo
5a6cd4aca9 Fix test expectations for new nodes and edges in path queries 2020-10-28 14:47:42 -04:00
Alvaro Muñoz
a57308a519 Fix SnakeYaml query to account for Yaml subclasses and compose methods 2020-10-28 14:52:14 +01:00
Alvaro Muñoz
c28856d3dc remove wicket taintstep from TaintTrackingUtil 2020-10-28 14:51:44 +01:00
luchua-bc
99c79f4aa3 Enhance the dataflow sink and update test cases 2020-10-28 03:07:01 +00:00
Robert Marsh
7d7b0eaa7b C++: accept test changes
The conflation-related changes result from aliased accesses for which a
precise Phi node is generated.
2020-10-27 09:33:28 -07:00
Alvaro Muñoz
a4a91eb1d2 new deserialization sink 2020-10-27 14:24:17 +01:00
Erik Krogh Kristensen
33465dbe6b refactor parameterPropRead and reachesReturn to get a slight performance improvement 2020-10-26 16:49:49 +01:00
luchua-bc
07830aae05 Fix typo 2020-10-25 22:34:15 +00:00
Erik Krogh Kristensen
0b41a59dbf add support for imports into "outDir" from tsconfig.json 2020-10-25 22:51:21 +01:00
luchua-bc
d9c140dc6c Enhance the query to use sanitizer and null/empty array flow 2020-10-25 15:33:09 +00:00
Francis Alexander
27c554c164 feedback integration - Move all files to Play.qll, improvements to add methods to remotetainted method for play 2020-10-24 11:56:06 +05:30
Dave Bartolomeo
3fce971f2d Fix taint propagation to qualifier objects and update test expectations 2020-10-23 17:48:37 -04:00
Dave Bartolomeo
86668058dc Avoid ODR violation in test code 2020-10-23 17:45:01 -04:00
Dave Bartolomeo
4d2f658ece Don't treat allocator argument as a string input 2020-10-23 17:44:07 -04:00
Dave Bartolomeo
1e96404ee0 Revert bad changes to basic_string 2020-10-23 13:46:27 -04:00
Dave Bartolomeo
35abcae5d3 Fix formatting 2020-10-23 13:43:29 -04:00
Dave Bartolomeo
bace0dca6d Handle more cases that require synthesizing temporary objects
- Parens around qualifier expressions
- Inheritance conversions involving class prvalues
2020-10-23 12:04:09 -04:00
toufik-airane
7d2741a287 Add newline 2020-10-23 17:42:55 +02:00
toufik-airane
3ccdc2c518 Update ElectronShellOpenExternalSink location
Move the class ElectronShellOpenExternalSink to
ClientSideUrlRedirect.qll. It's been to be a more appropriate location.
2020-10-23 17:39:03 +02:00
toufik-airane
e87790b828 Add ElectronShellOpenExternalSink class
Add ElectronShellOpenExternalSink class to detect untrusted input
interpreted by `openExternal` function call in `electron` module.

Based on the #14 Electron Security checklist:
https://www.electronjs.org/docs/tutorial/security#14-do-not-use-openexternal-with-untrusted-content
2020-10-23 15:41:03 +02:00
Francis Alexander
5d5b84974b Play remote source update to return functionaccessexpr 2020-10-22 22:29:43 +05:30
Dave Bartolomeo
99072483b8 Fix PR feedback 2020-10-22 12:55:40 -04:00
Francis Alexander
d216dcdee0 updates & conflict marker removal 2020-10-22 22:25:36 +05:30
Dave Bartolomeo
b62bda6c3a Fix regression due to primary instructions for side effects not being computed correctly in the presence of synthetic temporary objects. 2020-10-22 12:55:30 -04:00
Francis Alexander
518de822e1 updates 2020-10-22 20:47:11 +05:30
Francis Alexander
5c256dadc8 Feedback incorporation and documentation updates 2020-10-22 20:27:38 +05:30
Francis Alexander
f7d63f8666 Feedback incorporation and documentation updates 2020-10-22 20:21:47 +05:30
Francis Alexander
33f7d52a46 Naming Fixes 2020-10-22 20:20:52 +05:30
Francis Alexander
ddc544aa07 Initial support for Play Framework > 2.6.x 2020-10-22 20:20:49 +05:30
Dave Bartolomeo
f7eeadadd9 Accept more diffs 2020-10-21 18:37:49 -04:00
Dave Bartolomeo
1de1ab65b7 Merge remote-tracking branch 'upstream/main' into work 2020-10-21 18:22:55 -04:00
Dave Bartolomeo
5259f86e32 Accept diff (needs further investigation, though) 2020-10-21 18:06:34 -04:00
Robert Marsh
1a365d2098 C++: remove InitializeNonLocalInstruction from IR
Instead, have AliasedDefinition initialize read-only nonlocal memory
2020-10-21 12:12:38 -07:00
Dave Bartolomeo
ee18db7b36 Fix IR for member accesses on prvalues
This fixes the IR generation for member accesses where the qualifier is a prvalue that is _not_ the load of a `TemporaryObjectExpr`. We synthesize a temporary variable during IR generation instead. It fits into the IR construction code at the same spot as `TranslatedLoad`, since it's basically the opposite of `TranslatedLoad` (prvalue->glvalue instead of vice versa). Note that array prvalues require special treatment.

This fixes some consistency errors in the `syntax-zoo`. It introduces three new ones in `dataflow-ir-consistency.expected`, but those are along the same lines as tons of existing failures.
2020-10-21 13:32:15 -04:00
luchua-bc
478771ccc5 Fix issues with method signature check 2020-10-21 02:49:53 +00:00
Dave Bartolomeo
98e0ae4865 Add tests for member accesses on temporary objects 2020-10-20 17:35:12 -04:00
Dave Bartolomeo
08af0803ff Add examples to QLDoc comment 2020-10-20 17:34:46 -04:00
Dave Bartolomeo
c739f98f7d Merge remote-tracking branch 'upstream/main' into work 2020-10-20 13:42:42 -04:00
Dave Bartolomeo
8c8daa38ec Update stats 2020-10-20 13:41:52 -04:00
Dave Bartolomeo
4ba281731c Fix IR generation for member access with a prvalue on the RHS
For historical reasons, the extractor marks the temporary object expression used as the qualifier of a member access as a prvalue(load), even though the current C++ standard says that the temporary object materialization results in a glvalue. Added some special handling to ignore the load for both field accesses and member function calls.

This fixes all of the consistency failures in our regular tests, and all of the related failures in `syntax-zoo` other than the ones that deal with pointers-to-member, which aren't really supported yet anyway.
2020-10-20 12:53:47 -04:00
Dave Bartolomeo
735c657326 IR consistency checks for FieldAddress and this arguments that are not actually addresses.
Exposes failures in existing tests. Also added a small test case for `FieldAddress` on a prvalue.
2020-10-20 10:32:28 -04:00
Dave Bartolomeo
7de6415d00 Accept test diffs after merge 2020-10-20 07:40:44 -04:00
Dave Bartolomeo
ade6d10e58 Merge remote-tracking branch 'upstream/main' into work 2020-10-20 07:24:42 -04:00
Dave Bartolomeo
2eaa4a4ecf Merge remote-tracking branch 'upstream/main' into work 2020-10-19 15:19:03 -04:00
Dave Bartolomeo
d0b93df4ec Merge from main 2020-10-19 15:17:19 -04:00
Dave Bartolomeo
2ba1ef9961 Merge remote-tracking branch 'upstream/main' into work 2020-10-19 13:28:59 -04:00
luchua-bc
2c2aab6ffc Sensitive broadcast 2020-10-19 16:16:13 +00:00
Dave Bartolomeo
ece20cdb5e Merge branch 'main' into dbartol/temporaries/work 2020-10-18 13:11:06 -04:00
Dave Bartolomeo
b73cb3a4ce Accept C# IR diffs 2020-10-18 11:11:05 -04:00
Dave Bartolomeo
2f34c78552 Fix formatting 2020-10-18 11:08:42 -04:00
Dave Bartolomeo
0b2acff837 Add upgrade script 2020-10-18 08:42:24 -04:00
Dave Bartolomeo
939bfae6e0 Fix formatting 2020-10-18 08:32:08 -04:00
Dave Bartolomeo
5f6ae32f1c Accept test output after merge 2020-10-17 18:16:21 -04:00
Dave Bartolomeo
129e250569 Update test expectations 2020-10-17 17:01:24 -04:00
Dave Bartolomeo
eb9cea48b8 Fix modeling of std::set::emplace 2020-10-17 17:00:29 -04:00
Dave Bartolomeo
40cd96eb1d Merge from main 2020-10-17 15:14:26 -04:00
Dave Bartolomeo
4e0afb0dc3 Print targets of Load and Store instructions in IR dump 2020-10-17 15:01:45 -04:00
Dave Bartolomeo
e4fdf699ad Accept improved test results 2020-10-17 14:33:10 -04:00
Dave Bartolomeo
4814dcf145 Print partial flow info in PrintIRLocalFlow.qll 2020-10-17 14:32:31 -04:00
Dave Bartolomeo
1dae8f62c1 Model copy-ish constructors for std::pair 2020-10-17 11:33:20 -04:00
Dave Bartolomeo
1b53c4684d Fix test expectations due to pair/make_pair fixes 2020-10-17 09:46:18 -04:00
Dave Bartolomeo
686f5aa8ed Handle parameter indirections in make_shared and make_unique 2020-10-17 08:53:55 -04:00
Dave Bartolomeo
7da4eef90d Fix subtle typing issue with std::makr_pair 2020-10-17 08:53:20 -04:00
Dave Bartolomeo
675256acab Accept test diffs from set.cpp (50 new good results!) 2020-10-16 17:14:41 -04:00
Dave Bartolomeo
af799a79da Accept good test diffs 2020-10-16 17:07:46 -04:00
Dave Bartolomeo
cf19fcf4c0 C++: Improve dataflow model for copy/move constructors 2020-10-16 16:55:59 -04:00
Dave Bartolomeo
9afddf0dad Insert a load of the temporary object for arguments passed by value 2020-10-16 12:56:46 -04:00
Dave Bartolomeo
6a9ecf7ba2 Dump static call target for Call instructions 2020-10-16 12:55:30 -04:00
Dave Bartolomeo
14ac9859c1 Remove more ODR violations from test code.
PrintAST now works on `library-tests/dataflow/taint-tests`.
2020-10-16 10:26:42 -04:00
Dave Bartolomeo
3767a52e9a Fix ODR violations in test code 2020-10-15 17:54:48 -04:00
Dave Bartolomeo
ceea5b3ec6 Fix test code that returns reference to local 2020-10-15 13:37:20 -04:00
Dave Bartolomeo
794a6729bc C++: Add ability to dump local dataflow info in IR dumps
This change adds a new module, `PrintIRLocalFlow.qll`, which can be imported into any query that uses both `PrintIR.qll` and the IR dataflow library. The IR dump printed by `PrintIR.qll` will be annotated with information about how each operand and instruction participates in dataflow.

For each operand and instruction, the following propeties are displayed:
- `flow`: Which local operands/instructions have flow to this node, and which local operands/instruction this node has flow to.
- `source`: `true` if this node is a source
- `sink`: `true` if this node is a sink
- `barrier`: Lists which kinds of barrier this node is. Can be zero or more of `full`, `in`, `out`, and `guard`. If the node is a guard barrier, the IR of the guarding instruction is also printed.

We already had a way to print additional properties for instructions and blocks, but not for operands. I added support for operand properties to `IRPropertyProvider`. These are now printed in a curly-brace-enclosed list immediately after the corresponding operand.

When printing flow, instructions are identified by their result ID (e.g., `m128`). Operands are identified by both the result ID of their instruction and their kind (e.g., `r145.left`). For flow from an operand to its use instruction, it just prints `result` at the operand, and prints only the operand kind on the instruction.

Example output:
```
#  344|     m344_34(vector<int, allocator<int>>)                                               = Chi                             : total:m344_20{flow:def->@, @->result}, partial:m344_33{flow:def->@, @->result}
#  344|         flow = total->@, partial->@, +m344_33->@, @->+r347_3, @->v347_7.side_effect, @->m347_9.total, @->m344_20.1
```
The `+` annotations indicate when the flow came from `isAdditionalFlowStep()`, rather than built-in local flow.
2020-10-14 18:02:45 -04:00
Dave Bartolomeo
fba4313457 Merge remote-tracking branch 'upstream/main' into work 2020-10-13 13:07:28 -04:00
Dave Bartolomeo
93f5ae4763 Clean up test formatting and accept new lines in results 2020-10-13 12:57:52 -04:00
Dave Bartolomeo
dfe69d8ada Update taint test to propagate through string constructor 2020-10-13 12:06:34 -04:00
Dave Bartolomeo
e4bfb75f90 C++: Fix pointer flow through temporary objects 2020-10-08 12:24:59 -04:00
Dave Bartolomeo
1e455f08a3 Fix test expectations 2020-10-07 13:14:54 -04:00
Dave Bartolomeo
bf8340f102 Fix test expectations in syntax-zoo 2020-10-07 10:26:02 -04:00
Dave Bartolomeo
22638fdfc7 Merge remote-tracking branch 'upstream/main' into work 2020-10-06 18:33:14 -04:00
Dave Bartolomeo
80b832eb49 Fix test expectations 2020-10-06 18:27:33 -04:00
Dave Bartolomeo
badb11750a AST and IR support for TemporaryObjectExpr 2020-10-05 17:53:35 -04:00
Rasmus Wriedt Larsen
f501003879 Design Patterns: Recommend this = range for ::Range pattern 2020-09-30 14:28:08 +02:00
Rasmus Wriedt Larsen
e859a804c4 Update docs on CodeQL design patterns 2020-09-29 09:05:18 +02:00
Rasmus Wriedt Larsen
a62c3345d1 Add docs on CodeQL Design Patterns 2020-09-28 16:38:48 +02:00
Rasmus Lerchedahl Petersen
8b13a429b7 Python: Address review comments 2020-09-01 14:00:41 +02:00
Rasmus Lerchedahl Petersen
6d23d7fa0e Python: Test that pointsTo implies data flow
Running the test on a larger database gives some interesting results.
2020-09-01 11:56:22 +02:00
dilanbhalla
26b030f8cc fixed pr suggestions 2020-07-07 10:52:26 -07:00
luchua-bc
a61f814b4b Change to ServletResponse type and fix formatting error 2020-07-02 12:49:25 +00:00
luchua-bc
1d0232b464 Add more servlet methods and fix formatting errors 2020-07-02 03:07:19 +00:00
dilanbhalla
dc73fcc4e8 moved to experimental 2020-07-01 09:54:58 -07:00
luchua-bc
d978f28822 Simplify the query for subtype check 2020-06-30 11:15:18 +00:00
luchua-bc
382e5a5a7a Revert "Add remote source of Android intent extra"
This reverts commit 65e76ab18f.
2020-06-30 00:55:05 +00:00
luchua-bc
3e8e9f9969 Revert "Add method access qualifier as source"
This reverts commit 87668bf075.
2020-06-30 00:54:27 +00:00
luchua-bc
065b90ab6b Revert "text changes"
This reverts commit 0f8dd7c328.
2020-06-30 00:53:03 +00:00
luchua-bc
ede9cec4a9 Uncaught Servlet Exception 2020-06-29 20:07:53 +00:00
luchua-bc
0f8dd7c328 text changes 2020-06-27 22:56:00 +00:00
Bt2018
87668bf075 Add method access qualifier as source 2020-06-27 18:00:52 -04:00
luchua-bc
65e76ab18f Add remote source of Android intent extra 2020-06-25 20:20:18 +00:00
dilanbhalla
dc58f6fa87 function/class synatax 2020-06-25 11:39:09 -07:00
Taus Brock-Nannestad
ead687da06 Python: Add false positive test example for issue #2652. 2020-01-21 15:28:01 +01:00
4611 changed files with 354168 additions and 114276 deletions

23
.github/workflows/check-change-note.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: Check change note
on:
pull_request_target:
types: [labeled, unlabeled, opened, synchronize, reopened, ready_for_review]
paths:
- "*/ql/src/**/*.ql"
- "*/ql/src/**/*.qll"
- "!**/experimental/**"
jobs:
check-change-note:
runs-on: ubuntu-latest
steps:
- name: Fail if no change note found. To fix, either add one, or add the `no-change-note-required` label.
if: |
github.event.pull_request.draft == false &&
!contains(github.event.pull_request.labels.*.name, 'no-change-note-required')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api 'repos/${{github.repository}}/pulls/${{github.event.number}}/files' --paginate |
jq 'any(.[].filename ; test("/change-notes/.*[.]md$"))' --exit-status

30
.github/workflows/close-stale.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Mark stale issues
on:
workflow_dispatch:
schedule:
- cron: "30 1 * * *"
jobs:
stale:
if: github.repository == 'github/codeql'
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 14 days with no activity. Comment or remove the `Stale` label in order to avoid having this issue closed in 7 days.'
close-issue-message: 'This issue was closed because it has been inactive for 7 days.'
days-before-stale: 14
days-before-close: 7
only-labels: awaiting-response
# do not mark PRs as stale
days-before-pr-stale: -1
days-before-pr-close: -1
# Uncomment for dry-run
# debug-only: true
# operations-per-run: 1000

View File

@@ -2,7 +2,15 @@ name: "Code scanning - action"
on:
push:
branches:
- main
- 'rc/*'
pull_request:
branches:
- main
- 'rc/*'
paths:
- 'csharp/**'
schedule:
- cron: '0 9 * * 1'
@@ -14,16 +22,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1

View File

@@ -1,57 +0,0 @@
name: Generate CodeQL query help documentation using Sphinx
on:
push:
branches:
- main
- 'rc/**'
- 'lgtm.com'
pull_request:
paths:
- '.github/workflows/generate-query-help-docs.yml'
- 'docs/codeql/query-help/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone github/codeql
uses: actions/checkout@v2
with:
path: codeql
- name: Clone github/codeql-go
uses: actions/checkout@v2
with:
repository: 'github/codeql-go'
path: codeql-go
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Download CodeQL CLI
uses: dsaltares/fetch-gh-release-asset@aa37ae5c44d3c9820bc12fe675e8670ecd93bd1c
with:
repo: "github/codeql-cli-binaries"
version: "latest"
file: "codeql-linux64.zip"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Unzip CodeQL CLI
run: unzip -d codeql-cli codeql-linux64.zip
- name: Set up query help docs folder
run: |
cp -r codeql/docs/codeql/** .
- name: Query help to markdown
run: |
PATH="$PATH:codeql-cli/codeql" python codeql/docs/codeql/query-help-markdown.py
- name: Run Sphinx for query help
uses: ammaraskar/sphinx-action@8b4f60114d7fd1faeba1a712269168508d4750d2 # v0.4
with:
docs-folder: "query-help/"
pre-build-command: "python -m pip install --upgrade recommonmark"
build-command: "sphinx-build -b dirhtml . _build"
- name: Upload HTML artifacts
uses: actions/upload-artifact@v2
with:
name: query-help-html
path: query-help/_build

3
.gitignore vendored
View File

@@ -17,6 +17,9 @@
# Byte-compiled python files
*.pyc
# python virtual environment folder
.venv/
# It's useful (though not required) to be able to unpack codeql in the ql checkout itself
/codeql/

View File

@@ -1,3 +1,3 @@
{
"omnisharp.autoStart": false
}
}

View File

@@ -4,17 +4,16 @@
/javascript/ @github/codeql-javascript
/python/ @github/codeql-python
# Assign query help for docs review
/cpp/**/*.qhelp @hubwriter
/csharp/**/*.qhelp @jf205
/java/**/*.qhelp @felicitymay
/javascript/**/*.qhelp @mchammer01
/python/**/*.qhelp @felicitymay
/docs/language/ @shati-patel @jf205
# Make @xcorail (GitHub Security Lab) a code owner for experimental queries so he gets pinged when we promote a query out of experimental
/cpp/**/experimental/**/* @github/codeql-c-analysis @xcorail
/csharp/**/experimental/**/* @github/codeql-csharp @xcorail
/java/**/experimental/**/* @github/codeql-java @xcorail
/javascript/**/experimental/**/* @github/codeql-javascript @xcorail
/python/**/experimental/**/* @github/codeql-python @xcorail
# Exclude help for experimental queries from docs review
/cpp/**/experimental/**/*.qhelp @github/codeql-c-analysis
/csharp/**/experimental/**/*.qhelp @github/codeql-csharp
/java/**/experimental/**/*.qhelp @github/codeql-java
/javascript/**/experimental/**/*.qhelp @github/codeql-javascript
/python/**/experimental/**/*.qhelp @github/codeql-python
# Notify members of codeql-go about PRs to the shared data-flow library files
/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl.qll @github/codeql-java @github/codeql-go
/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl2.qll @github/codeql-java @github/codeql-go
/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll @github/codeql-java @github/codeql-go
/java/ql/src/semmle/code/java/dataflow/internal/tainttracking1/TaintTrackingImpl.qll @github/codeql-java @github/codeql-go
/java/ql/src/semmle/code/java/dataflow/internal/tainttracking2/TaintTrackingImpl.qll @github/codeql-java @github/codeql-go

View File

@@ -38,6 +38,8 @@ If you have an idea for a query that you would like to share with other CodeQL u
- The queries and libraries must be autoformatted, for example using the "Format Document" command in [CodeQL for Visual Studio Code](https://help.semmle.com/codeql/codeql-for-vscode/procedures/about-codeql-for-vscode.html).
If you prefer, you can use this [pre-commit hook](misc/scripts/pre-commit) that automatically checks whether your files are correctly formatted. See the [pre-commit hook installation guide](docs/pre-commit-hook-setup.md) for instructions on how to install the hook.
4. **Compilation**
- Compilation of the query and any associated libraries and tests must be resilient to future development of the [supported](docs/supported-queries.md) libraries. This means that the functionality cannot use internal libraries, cannot depend on the output of `getAQlClass`, and cannot make use of regexp matching on `toString`.
@@ -47,7 +49,11 @@ If you have an idea for a query that you would like to share with other CodeQL u
- The query must have at least one true positive result on some revision of a real project.
Experimental queries and libraries may not be actively maintained as the [supported](docs/supported-queries.md) libraries evolve. They may also be changed in backwards-incompatible ways or may be removed entirely in the future without deprecation warnings.
6. **Query help files and unit tests**
- Query help (`.qhelp`) files and unit tests are optional (but strongly encouraged!) for queries in the `experimental` directories. For more information about contributing query help files and unit tests, see [Supported CodeQL queries and libraries](docs/supported-queries.md).
Experimental queries and libraries may not be actively maintained as the supported libraries evolve. They may also be changed in backwards-incompatible ways or may be removed entirely in the future without deprecation warnings.
After the experimental query is merged, we welcome pull requests to improve it. Before a query can be moved out of the `experimental` subdirectory, it must satisfy [the requirements for being a supported query](docs/supported-queries.md).

View File

@@ -36,6 +36,7 @@
"cpp/ql/src/semmle/code/cpp/dataflow/internal/tainttracking2/TaintTrackingImpl.qll",
"cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/tainttracking1/TaintTrackingImpl.qll",
"cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/tainttracking2/TaintTrackingImpl.qll",
"cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/tainttracking3/TaintTrackingImpl.qll",
"csharp/ql/src/semmle/code/csharp/dataflow/internal/tainttracking1/TaintTrackingImpl.qll",
"csharp/ql/src/semmle/code/csharp/dataflow/internal/tainttracking2/TaintTrackingImpl.qll",
"csharp/ql/src/semmle/code/csharp/dataflow/internal/tainttracking3/TaintTrackingImpl.qll",
@@ -55,6 +56,10 @@
"csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImplConsistency.qll",
"python/ql/src/semmle/python/dataflow/new/internal/DataFlowImplConsistency.qll"
],
"DataFlow Java/C# Flow Summaries": [
"java/ql/src/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll",
"csharp/ql/src/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll"
],
"SsaReadPosition Java/C#": [
"java/ql/src/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll",
"csharp/ql/src/semmle/code/csharp/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll"
@@ -356,8 +361,17 @@
],
"Inline Test Expectations": [
"cpp/ql/test/TestUtilities/InlineExpectationsTest.qll",
"java/ql/test/TestUtilities/InlineExpectationsTest.qll",
"python/ql/test/TestUtilities/InlineExpectationsTest.qll"
],
"C++ ExternalAPIs": [
"cpp/ql/src/Security/CWE/CWE-020/ExternalAPIs.qll",
"cpp/ql/src/Security/CWE/CWE-020/ir/ExternalAPIs.qll"
],
"C++ SafeExternalAPIFunction": [
"cpp/ql/src/Security/CWE/CWE-020/SafeExternalAPIFunction.qll",
"cpp/ql/src/Security/CWE/CWE-020/ir/SafeExternalAPIFunction.qll"
],
"XML": [
"cpp/ql/src/semmle/code/cpp/XML.qll",
"csharp/ql/src/semmle/code/csharp/XML.qll",
@@ -365,49 +379,65 @@
"javascript/ql/src/semmle/javascript/XML.qll",
"python/ql/src/semmle/python/xml/XML.qll"
],
"DuplicationProblems.qhelp": [
"cpp/ql/src/Metrics/Files/DuplicationProblems.qhelp",
"csharp/ql/src/Metrics/Files/DuplicationProblems.qhelp",
"javascript/ql/src/Metrics/DuplicationProblems.qhelp",
"python/ql/src/Metrics/DuplicationProblems.qhelp"
"DuplicationProblems.inc.qhelp": [
"cpp/ql/src/Metrics/Files/DuplicationProblems.inc.qhelp",
"javascript/ql/src/Metrics/DuplicationProblems.inc.qhelp",
"python/ql/src/Metrics/DuplicationProblems.inc.qhelp"
],
"CommentedOutCodeQuery.qhelp": [
"cpp/ql/src/Documentation/CommentedOutCodeQuery.qhelp",
"python/ql/src/Lexical/CommentedOutCodeQuery.qhelp",
"csharp/ql/src/Bad Practices/Comments/CommentedOutCodeQuery.qhelp",
"java/ql/src/Violations of Best Practice/Comments/CommentedOutCodeQuery.qhelp",
"javascript/ql/src/Comments/CommentedOutCodeQuery.qhelp"
"CommentedOutCodeQuery.inc.qhelp": [
"cpp/ql/src/Documentation/CommentedOutCodeQuery.inc.qhelp",
"python/ql/src/Lexical/CommentedOutCodeQuery.inc.qhelp",
"csharp/ql/src/Bad Practices/Comments/CommentedOutCodeQuery.inc.qhelp",
"java/ql/src/Violations of Best Practice/Comments/CommentedOutCodeQuery.inc.qhelp",
"javascript/ql/src/Comments/CommentedOutCodeQuery.inc.qhelp"
],
"FLinesOfCodeReferences.qhelp": [
"java/ql/src/Metrics/Files/FLinesOfCodeReferences.qhelp",
"javascript/ql/src/Metrics/FLinesOfCodeReferences.qhelp"
"FLinesOfCodeReferences.inc.qhelp": [
"java/ql/src/Metrics/Files/FLinesOfCodeReferences.inc.qhelp",
"javascript/ql/src/Metrics/FLinesOfCodeReferences.inc.qhelp"
],
"FCommentRatioCommon.qhelp": [
"java/ql/src/Metrics/Files/FCommentRatioCommon.qhelp",
"javascript/ql/src/Metrics/FCommentRatioCommon.qhelp"
"FCommentRatioCommon.inc.qhelp": [
"java/ql/src/Metrics/Files/FCommentRatioCommon.inc.qhelp",
"javascript/ql/src/Metrics/FCommentRatioCommon.inc.qhelp"
],
"FLinesOfCodeOverview.qhelp": [
"java/ql/src/Metrics/Files/FLinesOfCodeOverview.qhelp",
"javascript/ql/src/Metrics/FLinesOfCodeOverview.qhelp"
"FLinesOfCodeOverview.inc.qhelp": [
"java/ql/src/Metrics/Files/FLinesOfCodeOverview.inc.qhelp",
"javascript/ql/src/Metrics/FLinesOfCodeOverview.inc.qhelp"
],
"CommentedOutCodeMetricOverview.qhelp": [
"cpp/ql/src/Metrics/Files/CommentedOutCodeMetricOverview.qhelp",
"csharp/ql/src/Metrics/Files/CommentedOutCodeMetricOverview.qhelp",
"java/ql/src/Metrics/Files/CommentedOutCodeMetricOverview.qhelp",
"javascript/ql/src/Comments/CommentedOutCodeMetricOverview.qhelp",
"python/ql/src/Lexical/CommentedOutCodeMetricOverview.qhelp"
"CommentedOutCodeMetricOverview.inc.qhelp": [
"cpp/ql/src/Metrics/Files/CommentedOutCodeMetricOverview.inc.qhelp",
"csharp/ql/src/Metrics/Files/CommentedOutCodeMetricOverview.inc.qhelp",
"java/ql/src/Metrics/Files/CommentedOutCodeMetricOverview.inc.qhelp",
"javascript/ql/src/Comments/CommentedOutCodeMetricOverview.inc.qhelp",
"python/ql/src/Lexical/CommentedOutCodeMetricOverview.inc.qhelp"
],
"FLinesOfDuplicatedCodeCommon.qhelp": [
"cpp/ql/src/Metrics/Files/FLinesOfDuplicatedCodeCommon.qhelp",
"java/ql/src/Metrics/Files/FLinesOfDuplicatedCodeCommon.qhelp",
"javascript/ql/src/Metrics/FLinesOfDuplicatedCodeCommon.qhelp",
"python/ql/src/Metrics/FLinesOfDuplicatedCodeCommon.qhelp"
"FLinesOfDuplicatedCodeCommon.inc.qhelp": [
"cpp/ql/src/Metrics/Files/FLinesOfDuplicatedCodeCommon.inc.qhelp",
"java/ql/src/Metrics/Files/FLinesOfDuplicatedCodeCommon.inc.qhelp",
"javascript/ql/src/Metrics/FLinesOfDuplicatedCodeCommon.inc.qhelp",
"python/ql/src/Metrics/FLinesOfDuplicatedCodeCommon.inc.qhelp"
],
"CommentedOutCodeReferences.qhelp": [
"cpp/ql/src/Metrics/Files/CommentedOutCodeReferences.qhelp",
"csharp/ql/src/Metrics/Files/CommentedOutCodeReferences.qhelp",
"java/ql/src/Metrics/Files/CommentedOutCodeReferences.qhelp",
"javascript/ql/src/Comments/CommentedOutCodeReferences.qhelp",
"python/ql/src/Lexical/CommentedOutCodeReferences.qhelp"
"CommentedOutCodeReferences.inc.qhelp": [
"cpp/ql/src/Metrics/Files/CommentedOutCodeReferences.inc.qhelp",
"csharp/ql/src/Metrics/Files/CommentedOutCodeReferences.inc.qhelp",
"java/ql/src/Metrics/Files/CommentedOutCodeReferences.inc.qhelp",
"javascript/ql/src/Comments/CommentedOutCodeReferences.inc.qhelp",
"python/ql/src/Lexical/CommentedOutCodeReferences.inc.qhelp"
],
"IDE Contextual Queries": [
"cpp/ql/src/IDEContextual.qll",
"csharp/ql/src/IDEContextual.qll",
"java/ql/src/IDEContextual.qll",
"javascript/ql/src/IDEContextual.qll",
"python/ql/src/analysis/IDEContextual.qll"
],
"SSA C#": [
"csharp/ql/src/semmle/code/csharp/dataflow/internal/SsaImplCommon.qll",
"csharp/ql/src/semmle/code/csharp/controlflow/internal/pressa/SsaImplCommon.qll",
"csharp/ql/src/semmle/code/csharp/dataflow/internal/basessa/SsaImplCommon.qll",
"csharp/ql/src/semmle/code/cil/internal/SsaImplCommon.qll"
],
"CryptoAlgorithms Python/JS": [
"javascript/ql/src/semmle/javascript/security/CryptoAlgorithms.qll",
"python/ql/src/semmle/crypto/Crypto.qll"
]
}
}

View File

@@ -5,6 +5,7 @@ using System;
using System.Linq;
using Microsoft.Build.Construction;
using System.Xml;
using System.IO;
namespace Semmle.Autobuild.Cpp.Tests
{
@@ -43,6 +44,8 @@ namespace Semmle.Autobuild.Cpp.Tests
public IDictionary<string, int> RunProcess = new Dictionary<string, int>();
public IDictionary<string, string> RunProcessOut = new Dictionary<string, string>();
public IDictionary<string, string> RunProcessWorkingDirectory = new Dictionary<string, string>();
public HashSet<string> CreateDirectories { get; } = new HashSet<string>();
public HashSet<(string, string)> DownloadFiles { get; } = new HashSet<(string, string)>();
int IBuildActions.RunProcess(string cmd, string args, string? workingDirectory, IDictionary<string, string>? env, out IList<string> stdOut)
{
@@ -135,6 +138,14 @@ namespace Semmle.Autobuild.Cpp.Tests
string IBuildActions.GetFullPath(string path) => path;
string? IBuildActions.GetFileName(string? path) => Path.GetFileName(path?.Replace('\\', '/'));
public string? GetDirectoryName(string? path)
{
var dir = Path.GetDirectoryName(path?.Replace('\\', '/'));
return dir is null ? path : path?.Substring(0, dir.Length);
}
void IBuildActions.WriteAllText(string filename, string contents)
{
}
@@ -153,6 +164,18 @@ namespace Semmle.Autobuild.Cpp.Tests
s = s.Replace($"%{kvp.Key}%", kvp.Value);
return s;
}
public void CreateDirectory(string path)
{
if (!CreateDirectories.Contains(path))
throw new ArgumentException($"Missing CreateDirectory, {path}");
}
public void DownloadFile(string address, string fileName)
{
if (!DownloadFiles.Contains((address, fileName)))
throw new ArgumentException($"Missing DownloadFile, {address}, {fileName}");
}
}
/// <summary>
@@ -213,6 +236,7 @@ namespace Semmle.Autobuild.Cpp.Tests
Actions.GetEnvironmentVariable[$"CODEQL_EXTRACTOR_{codeqlUpperLanguage}_SOURCE_ARCHIVE_DIR"] = "";
Actions.GetEnvironmentVariable[$"CODEQL_EXTRACTOR_{codeqlUpperLanguage}_ROOT"] = $@"C:\codeql\{codeqlUpperLanguage.ToLowerInvariant()}";
Actions.GetEnvironmentVariable["CODEQL_JAVA_HOME"] = @"C:\codeql\tools\java";
Actions.GetEnvironmentVariable["CODEQL_PLATFORM"] = "win64";
Actions.GetEnvironmentVariable["SEMMLE_DIST"] = @"C:\odasa";
Actions.GetEnvironmentVariable["SEMMLE_JAVA_HOME"] = @"C:\odasa\tools\java";
Actions.GetEnvironmentVariable["SEMMLE_PLATFORM_TOOLS"] = @"C:\odasa\tools";
@@ -273,7 +297,8 @@ namespace Semmle.Autobuild.Cpp.Tests
[Fact]
public void TestCppAutobuilderSuccess()
{
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\csharp\nuget\nuget.exe restore C:\Project\test.sln"] = 1;
Actions.RunProcess[@"cmd.exe /C nuget restore C:\Project\test.sln -DisableParallelProcessing"] = 1;
Actions.RunProcess[@"cmd.exe /C C:\Project\.nuget\nuget.exe restore C:\Project\test.sln -DisableParallelProcessing"] = 0;
Actions.RunProcess[@"cmd.exe /C CALL ^""C:\Program Files ^(x86^)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat^"" && set Platform=&& type NUL && C:\odasa\tools\odasa index --auto msbuild C:\Project\test.sln /p:UseSharedCompilation=false /t:rebuild /p:Platform=""x86"" /p:Configuration=""Release"" /p:MvcBuildViews=true"] = 0;
Actions.RunProcessOut[@"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -prerelease -legacy -property installationPath"] = "";
Actions.RunProcess[@"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -prerelease -legacy -property installationPath"] = 1;
@@ -286,11 +311,13 @@ namespace Semmle.Autobuild.Cpp.Tests
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"] = true;
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\ntest.slx";
Actions.EnumerateDirectories[@"C:\Project"] = "";
Actions.CreateDirectories.Add(@"C:\Project\.nuget");
Actions.DownloadFiles.Add(("https://dist.nuget.org/win-x86-commandline/latest/nuget.exe", @"C:\Project\.nuget\nuget.exe"));
var autobuilder = CreateAutoBuilder(true);
var solution = new TestSolution(@"C:\Project\test.sln");
autobuilder.ProjectsOrSolutionsToBuild.Add(solution);
TestAutobuilderScript(autobuilder, 0, 2);
TestAutobuilderScript(autobuilder, 0, 3);
}
}
}

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<AssemblyName>Semmle.Autobuild.Cpp</AssemblyName>
<RootNamespace>Semmle.Autobuild.Cpp</RootNamespace>
<ApplicationIcon />
@@ -17,7 +17,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build" Version="16.0.461" />
<PackageReference Include="Microsoft.Build" Version="16.9.0" />
</ItemGroup>
<ItemGroup>

View File

@@ -0,0 +1,2 @@
lgtm,codescanning
* Two issues causing the 'Unused local variable' query (`cpp/unused-local-variable`) to produce false positive results have been fixed.

View File

@@ -0,0 +1,4 @@
lgtm,codescanning
* `FormattingFunction.getOutputParameterIndex` now has a parameter identifying whether the output at that index is a buffer or a stream.
* `FormattingFunction` now has a predicate `isOutputGlobal` indicating when the output is to a global stream.
* The `primitiveVariadicFormatter` and `variadicFormatter` predicates have more parameters exposing information about the function.

View File

@@ -0,0 +1,3 @@
lgtm,codescanning
* Various classes in `semmle.code.cpp.models.implementations` have been made private. Users should not depend on library implementation details.
* The `OperatorNewAllocationFunction`, `OperatorDeleteDeallocationFunction`, `Iterator` and `Snprintf` classes now have interfaces in `semmle.code.cpp.models.interfaces`.

View File

@@ -0,0 +1,2 @@
lgtm,codescanning
* A new query (`cpp/unsafe-use-of-this`) has been added. The query finds pure virtual function calls whose qualifier is an object under construction.

View File

@@ -0,0 +1,2 @@
lgtm,codescanning
* The queries `cpp/local-variable-hides-global-variable` and `cpp/missing-header-guard` now have severity `recommendation` instead of `warning`.

View File

@@ -0,0 +1,2 @@
lgtm
* A new query (`cpp/unsigned-difference-expression-compared-zero`) is run but not yet displayed on LGTM. The query finds unsigned subtractions used in relational comparisons with the value 0. This query was originally submitted as an experimental query by @ihsinme in https://github.com/github/codeql/pull/4745.

View File

@@ -0,0 +1,2 @@
lgtm,codescanning
* A new query (`cpp/memset-may-be-deleted`) is added to the default query suite. The query finds calls to `memset` that may be removed by the compiler. This behavior can make information-leak vulnerabilities easier to exploit. This query was originally [submitted as an experimental query by @ihsinme](https://github.com/github/codeql/pull/4953).

View File

@@ -0,0 +1,2 @@
lgtm,codescanning
* The data-flow library now recognises more side-effects of method chaining (e.g. `someObject.setX(clean).setY(tainted).setZ...` having a side-effect on `someObject`), as well as other related circumstances where a function input is directly passed to its output. All queries that use data-flow analysis, including most security queries, may return more results accordingly.

View File

@@ -0,0 +1,2 @@
codescanning
* Added cpp/diagnostics/failed-extractions. This query gives information about which extractions did not run to completion.

View File

@@ -0,0 +1,2 @@
lgtm,codescanning
* The 'Resource not released in destructor' (cpp/resource-not-released-in-destructor) query has been improved to recognize more releases of resources.

View File

@@ -0,0 +1,2 @@
lgtm,codescanning
* The 'Assignment where comparison was intended' (cpp/assign-where-compare-meant) query has been improved to flag fewer benign assignments in conditionals.

View File

@@ -0,0 +1,2 @@
lgtm
* The queries cpp/tainted-arithmetic, cpp/uncontrolled-arithmetic, and cpp/arithmetic-with-extreme-values have been improved to produce fewer false positives.

View File

@@ -9,6 +9,8 @@
+ semmlecode-cpp-queries/Likely Bugs/Conversion/CastArrayPointerArithmetic.ql: /Correctness/Dangerous Conversions
+ semmlecode-cpp-queries/Likely Bugs/Underspecified Functions/MistypedFunctionArguments.ql: /Correctness/Dangerous Conversions
+ semmlecode-cpp-queries/Security/CWE/CWE-253/HResultBooleanConversion.ql: /Correctness/Dangerous Conversions
+ semmlecode-cpp-queries/Likely Bugs/OO/UnsafeUseOfThis.ql: /Correctness/Dangerous Conversions
+ semmlecode-cpp-queries/Security/CWE/CWE-191/UnsignedDifferenceExpressionComparedZero.ql: /Correctness/Dangerous Conversions
# Consistent Use
+ semmlecode-cpp-queries/Critical/ReturnValueIgnored.ql: /Correctness/Consistent Use
+ semmlecode-cpp-queries/Likely Bugs/InconsistentCheckReturnNull.ql: /Correctness/Consistent Use

View File

@@ -4,9 +4,6 @@
* @kind graph
* @id cpp/architecture/class-hierarchies
* @graph.layout organic
* @workingset jhotdraw
* @result succeed 48
* @result_ondemand succeed 48
* @tags maintainability
*/

View File

@@ -4,9 +4,6 @@
* @kind chart
* @id cpp/architecture/inheritance-depth-distribution
* @chart.type line
* @workingset jhotdraw
* @result succeed 48
* @result_ondemand succeed 48
* @tags maintainability
*/

View File

@@ -1,7 +1,8 @@
/**
* @name Global namespace classes
* @description Finds classes that belong to no namespace.
* @kind table
* @kind problem
* @problem.severity recommendation
* @id cpp/architecture/global-namespace-classes
* @tags maintainability
* modularity

View File

@@ -4,9 +4,6 @@
* @kind problem
* @id cpp/architecture/classes-with-many-dependencies
* @problem.severity recommendation
* @workingset jhotdraw
* @result succeed 20
* @result_ondemand succeed 20
* @tags maintainability
* statistical
* non-attributable

View File

@@ -2,7 +2,7 @@
* @name Local variable hides global variable
* @description A local variable or parameter that hides a global variable of the same name. This may be confusing. Consider renaming one of the variables.
* @kind problem
* @problem.severity warning
* @problem.severity recommendation
* @precision very-high
* @id cpp/local-variable-hides-global-variable
* @tags maintainability

View File

@@ -10,6 +10,7 @@
* security
* external/cwe/cwe-120
* external/cwe/cwe-125
* security-severity/8.1
*/
import cpp

View File

@@ -8,168 +8,41 @@ import semmle.code.cpp.AutogeneratedFile
predicate trivialPositiveIntValue(string s) {
// Small numbers
s = [0 .. 20].toString() or
// Popular powers of two (decimal)
s = "16" or
s = "24" or
s = "32" or
s = "64" or
s = "128" or
s = "256" or
s = "512" or
s = "1024" or
s = "2048" or
s = "4096" or
s = "16384" or
s = "32768" or
s = "65536" or
s = "1048576" or
s = "2147483648" or
s = "4294967296" or
// Popular powers of two, minus one (decimal)
s = "15" or
s = "31" or
s = "63" or
s = "127" or
s = "255" or
s = "511" or
s = "1023" or
s = "2047" or
s = "4095" or
s = "16383" or
s = "32767" or
s = "65535" or
s = "1048577" or
s = "2147483647" or
s = "4294967295" or
// Popular powers of two (32-bit hex)
s = "0x00000001" or
s = "0x00000002" or
s = "0x00000004" or
s = "0x00000008" or
s = "0x00000010" or
s = "0x00000020" or
s = "0x00000040" or
s = "0x00000080" or
s = "0x00000100" or
s = "0x00000200" or
s = "0x00000400" or
s = "0x00000800" or
s = "0x00001000" or
s = "0x00002000" or
s = "0x00004000" or
s = "0x00008000" or
s = "0x00010000" or
s = "0x00020000" or
s = "0x00040000" or
s = "0x00080000" or
s = "0x00100000" or
s = "0x00200000" or
s = "0x00400000" or
s = "0x00800000" or
s = "0x01000000" or
s = "0x02000000" or
s = "0x04000000" or
s = "0x08000000" or
s = "0x10000000" or
s = "0x20000000" or
s = "0x40000000" or
s = "0x80000000" or
// Popular powers of two, minus one (32-bit hex)
s = "0x00000001" or
s = "0x00000003" or
s = "0x00000007" or
s = "0x0000000f" or
s = "0x0000001f" or
s = "0x0000003f" or
s = "0x0000007f" or
s = "0x000000ff" or
s = "0x000001ff" or
s = "0x000003ff" or
s = "0x000007ff" or
s = "0x00000fff" or
s = "0x00001fff" or
s = "0x00003fff" or
s = "0x00007fff" or
s = "0x0000ffff" or
s = "0x0001ffff" or
s = "0x0003ffff" or
s = "0x0007ffff" or
s = "0x000fffff" or
s = "0x001fffff" or
s = "0x003fffff" or
s = "0x007fffff" or
s = "0x00ffffff" or
s = "0x01ffffff" or
s = "0x03ffffff" or
s = "0x07ffffff" or
s = "0x0fffffff" or
s = "0x1fffffff" or
s = "0x3fffffff" or
s = "0x7fffffff" or
s = "0xffffffff" or
// Popular powers of two (16-bit hex)
s = "0x0001" or
s = "0x0002" or
s = "0x0004" or
s = "0x0008" or
s = "0x0010" or
s = "0x0020" or
s = "0x0040" or
s = "0x0080" or
s = "0x0100" or
s = "0x0200" or
s = "0x0400" or
s = "0x0800" or
s = "0x1000" or
s = "0x2000" or
s = "0x4000" or
s = "0x8000" or
// Popular powers of two, minus one (16-bit hex)
s = "0x0001" or
s = "0x0003" or
s = "0x0007" or
s = "0x000f" or
s = "0x001f" or
s = "0x003f" or
s = "0x007f" or
s = "0x00ff" or
s = "0x01ff" or
s = "0x03ff" or
s = "0x07ff" or
s = "0x0fff" or
s = "0x1fff" or
s = "0x3fff" or
s = "0x7fff" or
s = "0xffff" or
// Popular powers of two (8-bit hex)
s = "0x01" or
s = "0x02" or
s = "0x04" or
s = "0x08" or
s = "0x10" or
s = "0x20" or
s = "0x40" or
s = "0x80" or
// Popular powers of two, minus one (8-bit hex)
s = "0x01" or
s = "0x03" or
s = "0x07" or
s = "0x0f" or
s = "0x1f" or
s = "0x3f" or
s = "0x7f" or
s = "0xff" or
s = "0x00" or
// Powers of ten
s = "10" or
s = "100" or
s = "1000" or
s = "10000" or
s = "100000" or
s = "1000000" or
s = "10000000" or
s = "100000000" or
s = "1000000000"
s =
[
// Popular powers of two (decimal)
"16", "24", "32", "64", "128", "256", "512", "1024", "2048", "4096", "16384", "32768",
"65536", "1048576", "2147483648", "4294967296",
// Popular powers of two, minus one (decimal)
"15", "31", "63", "127", "255", "511", "1023", "2047", "4095", "16383", "32767", "65535",
"1048577", "2147483647", "4294967295",
// Popular powers of two (32-bit hex)
"0x00000001", "0x00000002", "0x00000004", "0x00000008", "0x00000010", "0x00000020",
"0x00000040", "0x00000080", "0x00000100", "0x00000200", "0x00000400", "0x00000800",
"0x00001000", "0x00002000", "0x00004000", "0x00008000", "0x00010000", "0x00020000",
"0x00040000", "0x00080000", "0x00100000", "0x00200000", "0x00400000", "0x00800000",
"0x01000000", "0x02000000", "0x04000000", "0x08000000", "0x10000000", "0x20000000",
"0x40000000", "0x80000000",
// Popular powers of two, minus one (32-bit hex)
"0x00000001", "0x00000003", "0x00000007", "0x0000000f", "0x0000001f", "0x0000003f",
"0x0000007f", "0x000000ff", "0x000001ff", "0x000003ff", "0x000007ff", "0x00000fff",
"0x00001fff", "0x00003fff", "0x00007fff", "0x0000ffff", "0x0001ffff", "0x0003ffff",
"0x0007ffff", "0x000fffff", "0x001fffff", "0x003fffff", "0x007fffff", "0x00ffffff",
"0x01ffffff", "0x03ffffff", "0x07ffffff", "0x0fffffff", "0x1fffffff", "0x3fffffff",
"0x7fffffff", "0xffffffff",
// Popular powers of two (16-bit hex)
"0x0001", "0x0002", "0x0004", "0x0008", "0x0010", "0x0020", "0x0040", "0x0080", "0x0100",
"0x0200", "0x0400", "0x0800", "0x1000", "0x2000", "0x4000", "0x8000",
// Popular powers of two, minus one (16-bit hex)
"0x0001", "0x0003", "0x0007", "0x000f", "0x001f", "0x003f", "0x007f", "0x00ff", "0x01ff",
"0x03ff", "0x07ff", "0x0fff", "0x1fff", "0x3fff", "0x7fff", "0xffff",
// Popular powers of two (8-bit hex)
"0x01", "0x02", "0x04", "0x08", "0x10", "0x20", "0x40", "0x80",
// Popular powers of two, minus one (8-bit hex)
"0x01", "0x03", "0x07", "0x0f", "0x1f", "0x3f", "0x7f", "0xff", "0x00",
// Powers of ten
"10", "100", "1000", "10000", "100000", "1000000", "10000000", "100000000", "1000000000"
]
}
predicate trivialIntValue(string s) {
@@ -235,10 +108,7 @@ predicate joiningStringTrivial(Literal lit) {
// understand (which is against the spirit of these queries).
stringLiteral(lit) and
exists(FunctionCall fc |
(
fc.getTarget().getName() = "operator+" or
fc.getTarget().getName() = "operator<<"
) and
fc.getTarget().getName() = ["operator+", "operator<<"] and
fc.getAnArgument().getAChild*() = lit
) and
lit.getValue().length() < 16
@@ -291,8 +161,7 @@ predicate arrayInitializerChild(AggregateLiteral parent, Expr e) {
// i.e. not a constant folded expression
predicate literallyLiteral(Literal lit) {
lit
.getValueText()
lit.getValueText()
.regexpMatch(".*\".*|\\s*+[-+]?+\\s*+(0[xob][0-9a-fA-F]|[0-9])[0-9a-fA-F,._]*+([eE][-+]?+[0-9,._]*+)?+\\s*+[a-zA-Z]*+\\s*+")
}

View File

@@ -57,5 +57,12 @@ where
not declarationHasSideEffects(v) and
not exists(AsmStmt s | f = s.getEnclosingFunction()) and
not v.getAnAttribute().getName() = "unused" and
not any(ErrorExpr e).getEnclosingFunction() = f // unextracted expr likely used `v`
not any(ErrorExpr e).getEnclosingFunction() = f and // unextracted expr may use `v`
not exists(
Literal l // this case can be removed when the `myFunction2( [obj](){} );` test case doesn't depend on this exclusion
|
l.getEnclosingFunction() = f and
not exists(l.getValue())
) and
not any(ConditionDeclExpr cde).getEnclosingFunction() = f // this case can be removed when the `if (a = b; a)` test case doesn't depend on this exclusion
select v, "Variable " + v.getName() + " is not used"

View File

@@ -9,7 +9,7 @@
It is likely that these conditions indicate an error in the branching condition.
Alternatively, the conditions may have been left behind after debugging.</p>
<include src="aliasAnalysisWarning.qhelp" />
<include src="aliasAnalysisWarning.inc.qhelp" />
</overview>
<recommendation>

View File

@@ -13,7 +13,7 @@ If left in the code base they increase object code size, decrease code comprehen
This type of function may be part of the program's API and could be used by external programs.
</p>
<include src="callGraphWarning.qhelp" />
<include src="callGraphWarning.inc.qhelp" />
</overview>
<recommendation>

View File

@@ -10,7 +10,7 @@ This query looks at functions that return file or socket descriptors, but may re
This can occur when an operation performed on the open descriptor fails, and the function returns with an error before it closes the open resource. An improperly handled error could cause the function to leak resource descriptors. Failing to close resources in the function that opened them also makes it more difficult to detect leaks.
</p>
<include src="dataFlowWarning.qhelp" />
<include src="dataFlowWarning.inc.qhelp" />
</overview>
<recommendation>

View File

@@ -10,7 +10,7 @@ This rule finds calls to <code>socket</code> where there is no corresponding <co
Leaving descriptors open will cause a resource leak that will persist even after the program terminates.
</p>
<include src="aliasAnalysisWarning.qhelp" />
<include src="aliasAnalysisWarning.inc.qhelp" />
</overview>
<recommendation>

View File

@@ -10,7 +10,7 @@ This rule looks at functions that return a <code>FILE*</code>, but may return an
This can occur when an operation performed on the open descriptor fails, and the function returns with an error before closing the open resource. An improperly handled error may cause the function to leak file descriptors.
</p>
<include src="dataFlowWarning.qhelp" />
<include src="dataFlowWarning.inc.qhelp" />
</overview>
<recommendation>

View File

@@ -10,7 +10,7 @@ This rule finds calls to <code>fopen</code> with no corresponding <code>fclose</
Leaving files open will cause a resource leak that will persist even after the program terminates.
</p>
<include src="aliasAnalysisWarning.qhelp" />
<include src="aliasAnalysisWarning.inc.qhelp" />
</overview>
<recommendation>

View File

@@ -10,7 +10,7 @@ Not all compilers generate code that zero-out memory, especially when optimizati
is not compliant with the latest language standards. Accessing uninitialized memory will lead to undefined results.
</p>
<include src="dataFlowWarning.qhelp" />
<include src="dataFlowWarning.inc.qhelp" />
</overview>
<recommendation>

View File

@@ -12,7 +12,7 @@ Dereferencing a null pointer and attempting to modify its contents can lead to a
important system data (including the interrupt table in some architectures).
</p>
<include src="pointsToWarning.qhelp" />
<include src="pointsToWarning.inc.qhelp" />
</overview>
<recommendation>

View File

@@ -7,6 +7,7 @@
* @tags reliability
* security
* external/cwe/cwe-476
* security-severity/7.5
*/
import cpp

View File

@@ -11,7 +11,7 @@ Uninitialized variables may contain any value, as not all compilers generate cod
optimizations are enabled or the compiler is not compliant with the latest language standards.
</p>
<include src="callGraphWarning.qhelp" />
<include src="callGraphWarning.inc.qhelp" />
</overview>
<recommendation>

View File

@@ -13,7 +13,7 @@ after. Otherwise, if the value is negative then the program will have failed
before performing the test.
</p>
<include src="dataFlowWarning.qhelp" />
<include src="dataFlowWarning.inc.qhelp" />
</overview>
<recommendation>

View File

@@ -9,7 +9,7 @@
This rule looks for functions that allocate memory, but may return without freeing it. This can occur when an operation performed on the memory block fails, and the function returns with an error before freeing the allocated block. This causes the function to leak memory and may eventually lead to software failure.
</p>
<include src="dataFlowWarning.qhelp" />
<include src="dataFlowWarning.inc.qhelp" />
</overview>
<recommendation>

View File

@@ -7,6 +7,7 @@
* @tags efficiency
* security
* external/cwe/cwe-401
* security-severity/7.5
*/
import MemoryFreed

View File

@@ -10,7 +10,7 @@ This rule finds calls to the <code>alloc</code> family of functions without a co
This leads to memory leaks.
</p>
<include src="aliasAnalysisWarning.qhelp" />
<include src="aliasAnalysisWarning.inc.qhelp" />
</overview>
<recommendation>

View File

@@ -7,6 +7,7 @@
* @tags efficiency
* security
* external/cwe/cwe-401
* security-severity/7.5
*/
import MemoryFreed

View File

@@ -16,7 +16,7 @@ buffer overruns.
The query looks only at the return values of functions that may return a negative value (not all functions).
</p>
<include src="dataFlowWarning.qhelp" />
<include src="dataFlowWarning.inc.qhelp" />
</overview>
<recommendation>

View File

@@ -7,6 +7,7 @@
* @tags reliability
* security
* external/cwe/cwe-476
* security-severity/7.5
*/
import cpp

View File

@@ -63,7 +63,7 @@ destructors likely not be called (as previously noted), but the pointer will als
potentially less of a serious issue than that posed by the first approach, but it should still be avoided.</li>
</ul>
<include src="pointsToWarning.qhelp" />
<include src="pointsToWarning.inc.qhelp" />
</overview>
<recommendation>

View File

@@ -5,8 +5,6 @@
import cpp
import semmle.code.cpp.controlflow.SSA
import semmle.code.cpp.dataflow.DataFlow
import semmle.code.cpp.models.implementations.Allocation
import semmle.code.cpp.models.implementations.Deallocation
/**
* Holds if `alloc` is a use of `malloc` or `new`. `kind` is

View File

@@ -18,7 +18,7 @@ an array (which could have header data specifying the length of the array) and w
element of the 'array', which would likely lead to a segfault due to the invalid header data.
</p>
<include src="pointsToWarning.qhelp" />
<include src="pointsToWarning.inc.qhelp" />
</overview>
<recommendation>

View File

@@ -8,6 +8,7 @@
* @tags reliability
* security
* external/cwe/cwe-401
* security-severity/7.5
*/
import NewDelete

View File

@@ -19,7 +19,7 @@ the data being copied. Buffer overflows can result to anything from a segmentati
if the array is on stack-allocated memory).
</p>
<include src="aliasAnalysisWarning.qhelp" />
<include src="aliasAnalysisWarning.inc.qhelp" />
</overview>
<recommendation>

View File

@@ -8,6 +8,7 @@
* security
* external/cwe/cwe-131
* external/cwe/cwe-120
* security-severity/9.8
*/
import cpp

View File

@@ -14,7 +14,7 @@ Buffer overflows can lead to anything from a segmentation fault to a security vu
Ensure that the size parameter is derived from the size of the destination buffer, and
not the source buffer.</p>
<include src="aliasAnalysisWarning.qhelp" />
<include src="aliasAnalysisWarning.inc.qhelp" />
</recommendation>

View File

@@ -10,6 +10,7 @@
* security
* external/cwe/cwe-119
* external/cwe/cwe-131
* security-severity/8.8
*/
import cpp

View File

@@ -10,6 +10,7 @@
* security
* external/cwe/cwe-119
* external/cwe/cwe-131
* security-severity/8.8
*/
import cpp

View File

@@ -12,7 +12,7 @@ the contents of that memory become undefined after that. Clearly, using a pointe
memory after the function has already returned will have undefined results.
</p>
<include src="pointsToWarning.qhelp" />
<include src="pointsToWarning.inc.qhelp" />
</overview>
<recommendation>

View File

@@ -10,6 +10,7 @@
* security
* external/cwe/cwe-131
* external/cwe/cwe-122
* security-severity/8.1
*/
import cpp

View File

@@ -10,6 +10,7 @@
* security
* external/cwe/cwe-131
* external/cwe/cwe-122
* security-severity/8.1
*/
import cpp

View File

@@ -12,7 +12,7 @@ from a segfault to memory corruption that would cause subsequent calls to the dy
erratically, to a possible security vulnerability.
</p>
<include src="pointsToWarning.qhelp" />
<include src="pointsToWarning.inc.qhelp" />
</overview>
<recommendation>

View File

@@ -7,6 +7,7 @@
* @tags reliability
* security
* external/cwe/cwe-416
* security-severity/8.8
*/
import cpp

View File

@@ -59,14 +59,9 @@ class Options extends string {
predicate exits(Function f) {
f.getAnAttribute().hasName("noreturn")
or
exists(string name | f.hasGlobalOrStdName(name) |
name = "exit" or
name = "_exit" or
name = "abort" or
name = "__assert_fail" or
name = "longjmp" or
name = "__builtin_unreachable"
)
f.hasGlobalOrStdName([
"exit", "_exit", "abort", "__assert_fail", "longjmp", "__builtin_unreachable"
])
or
CustomOptions::exits(f) // old Options.qll
}

View File

@@ -0,0 +1,16 @@
/**
* @name Extraction errors
* @description List all extraction errors for files in the source code directory.
* @kind diagnostic
* @id cpp/diagnostics/extraction-errors
*/
import cpp
import ExtractionErrors
from ExtractionError error
where
error instanceof ExtractionUnknownError or
exists(error.getFile().getRelativePath())
select error, "Extraction failed in " + error.getFile() + " with error " + error.getErrorMessage(),
error.getSeverity()

View File

@@ -0,0 +1,137 @@
/**
* Provides a common hierarchy of all types of errors that can occur during extraction.
*/
import cpp
/*
* A note about how the C/C++ extractor emits diagnostics:
* When the extractor frontend encounters an error, it emits a diagnostic message,
* that includes a message, location and severity.
* However, that process is best-effort and may fail (e.g. due to lack of memory).
* Thus, if the extractor emitted at least one diagnostic of severity discretionary
* error (or higher), it *also* emits a simple "There was an error during this compilation"
* error diagnostic, without location information.
* In the common case, this means that a compilation during which one or more errors happened also gets
* the catch-all diagnostic.
* This diagnostic has the empty string as file path.
* We filter out these useless diagnostics if there is at least one error-level diagnostic
* for the affected compilation in the database.
* Otherwise, we show it to indicate that something went wrong and that we
* don't know what exactly happened.
*/
/**
* An error that, if present, leads to a file being marked as non-successfully extracted.
*/
class ReportableError extends Diagnostic {
ReportableError() {
(
this instanceof CompilerDiscretionaryError or
this instanceof CompilerError or
this instanceof CompilerCatastrophe
) and
// Filter for the catch-all diagnostic, see note above.
not this.getFile().getAbsolutePath() = ""
}
}
private newtype TExtractionError =
TReportableError(ReportableError err) or
TCompilationFailed(Compilation c, File f) {
f = c.getAFileCompiled() and not c.normalTermination()
} or
// Show the catch-all diagnostic (see note above) only if we haven't seen any other error-level diagnostic
// for that compilation
TUnknownError(CompilerError err) {
not exists(ReportableError e | e.getCompilation() = err.getCompilation())
}
/**
* Superclass for the extraction error hierarchy.
*/
class ExtractionError extends TExtractionError {
/** Gets the string representation of the error. */
string toString() { none() }
/** Gets the error message for this error. */
string getErrorMessage() { none() }
/** Gets the file this error occured in. */
File getFile() { none() }
/** Gets the location this error occured in. */
Location getLocation() { none() }
/** Gets the SARIF severity of this error. */
int getSeverity() {
// Unfortunately, we can't distinguish between errors and fatal errors in SARIF,
// so all errors have severity 2.
result = 2
}
}
/**
* An unrecoverable extraction error, where extraction was unable to finish.
* This can be caused by a multitude of reasons, for example:
* - hitting a frontend assertion
* - crashing due to dereferencing an invalid pointer
* - stack overflow
* - out of memory
*/
class ExtractionUnrecoverableError extends ExtractionError, TCompilationFailed {
Compilation c;
File f;
ExtractionUnrecoverableError() { this = TCompilationFailed(c, f) }
override string toString() {
result = "Unrecoverable extraction error while compiling " + f.toString()
}
override string getErrorMessage() { result = "unrecoverable compilation failure." }
override File getFile() { result = f }
override Location getLocation() { result = f.getLocation() }
}
/**
* A recoverable extraction error.
* These are compiler errors from the frontend.
* Upon encountering one of these, we still continue extraction, but the
* database will be incomplete for that file.
*/
class ExtractionRecoverableError extends ExtractionError, TReportableError {
ReportableError err;
ExtractionRecoverableError() { this = TReportableError(err) }
override string toString() { result = "Recoverable extraction error: " + err }
override string getErrorMessage() { result = err.getFullMessage() }
override File getFile() { result = err.getFile() }
override Location getLocation() { result = err.getLocation() }
}
/**
* An unknown error happened during extraction.
* These are only displayed if we know that we encountered an error during extraction,
* but, for some reason, failed to emit a proper diagnostic with location information
* and error message.
*/
class ExtractionUnknownError extends ExtractionError, TUnknownError {
CompilerError err;
ExtractionUnknownError() { this = TUnknownError(err) }
override string toString() { result = "Unknown extraction error: " + err }
override string getErrorMessage() { result = err.getFullMessage() }
override File getFile() { result = err.getFile() }
override Location getLocation() { result = err.getLocation() }
}

View File

@@ -0,0 +1,22 @@
/**
* @name Failed extractor invocations
* @description Gives the command line of compilations for which extraction did not run to completion.
* @kind diagnostic
* @id cpp/diagnostics/failed-extractor-invocations
*/
import cpp
class AnonymousCompilation extends Compilation {
override string toString() { result = "<compilation>" }
}
string describe(Compilation c) {
if c.getArgument(1) = "--mimic"
then result = "compiler invocation " + concat(int i | i > 1 | c.getArgument(i), " " order by i)
else result = "extractor invocation " + concat(int i | | c.getArgument(i), " " order by i)
}
from Compilation c
where not c.normalTermination()
select c, "Extraction aborted for " + describe(c), 2

View File

@@ -0,0 +1,15 @@
/**
* @name Successfully extracted files
* @description Lists all files in the source code directory that were extracted without encountering an error in the file.
* @kind diagnostic
* @id cpp/diagnostics/successfully-extracted-files
*/
import cpp
import ExtractionErrors
from File f
where
not exists(ExtractionError e | e.getFile() = f) and
exists(f.getRelativePath())
select f, ""

View File

@@ -2,6 +2,6 @@
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<include src="CommentedOutCodeQuery.qhelp" />
<include src="../Metrics/Files/CommentedOutCodeReferences.qhelp" />
<include src="CommentedOutCodeQuery.inc.qhelp" />
<include src="../Metrics/Files/CommentedOutCodeReferences.inc.qhelp" />
</qhelp>

View File

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

View File

@@ -21,15 +21,7 @@ class Initialization extends Function {
}
class Allocation extends FunctionCall {
Allocation() {
exists(string name | name = this.getTarget().getName() |
name = "malloc" or
name = "calloc" or
name = "alloca" or
name = "sbrk" or
name = "valloc"
)
}
Allocation() { this.getTarget().getName() = ["malloc", "calloc", "alloca", "sbrk", "valloc"] }
}
from Function f, Allocation a

View File

@@ -13,13 +13,8 @@ import cpp
class ForbiddenCall extends FunctionCall {
ForbiddenCall() {
exists(string name | name = this.getTarget().getName() |
name = "task_delay" or
name = "taskDelay" or
name = "sleep" or
name = "nanosleep" or
name = "clock_nanosleep"
)
this.getTarget().getName() =
["task_delay", "taskDelay", "sleep", "nanosleep", "clock_nanosleep"]
}
}

View File

@@ -6,12 +6,7 @@ import cpp
class SemaphoreCreation extends FunctionCall {
SemaphoreCreation() {
exists(string name | name = this.getTarget().getName() |
name = "semBCreate" or
name = "semMCreate" or
name = "semCCreate" or
name = "semRWCreate"
)
this.getTarget().getName() = ["semBCreate", "semMCreate", "semCCreate", "semRWCreate"]
}
Variable getSemaphore() { result.getAnAccess() = this.getParent().(Assignment).getLValue() }
@@ -72,11 +67,7 @@ class SemaphoreGive extends UnlockOperation {
}
class LockingPrimitive extends FunctionCall, LockOperation {
LockingPrimitive() {
exists(string name | name = this.getTarget().getName() |
name = "taskLock" or name = "intLock" or name = "taskRtpLock"
)
}
LockingPrimitive() { this.getTarget().getName() = ["taskLock", "intLock", "taskRtpLock"] }
override Function getLocked() { result = this.getTarget() }
@@ -89,11 +80,7 @@ class LockingPrimitive extends FunctionCall, LockOperation {
}
class UnlockingPrimitive extends FunctionCall, UnlockOperation {
UnlockingPrimitive() {
exists(string name | name = this.getTarget().getName() |
name = "taskUnlock" or name = "intUnlock" or name = "taskRtpUnlock"
)
}
UnlockingPrimitive() { this.getTarget().getName() = ["taskUnlock", "intUnlock", "taskRtpUnlock"] }
Function getLocked() { result = getMatchingLock().getLocked() }

View File

@@ -12,18 +12,7 @@
import cpp
predicate allowedTypedefs(TypedefType t) {
exists(string name | name = t.getName() |
name = "I64" or
name = "U64" or
name = "I32" or
name = "U32" or
name = "I16" or
name = "U16" or
name = "I8" or
name = "U8" or
name = "F64" or
name = "F32"
)
t.getName() = ["I64", "U64", "I32", "U32", "I16", "U16", "I8", "U8", "F64", "F32"]
}
/**

View File

@@ -5,8 +5,8 @@ import cpp
*/
class Task extends Function {
Task() {
exists(FunctionCall taskCreate, string name | name = "taskCreate" or name = "taskSpawn" |
name = taskCreate.getTarget().getName() and
exists(FunctionCall taskCreate |
taskCreate.getTarget().getName() = ["taskCreate", "taskSpawn"] and
this = taskCreate.getArgument(4).(AddressOfExpr).getAddressable()
)
}

View File

@@ -13,6 +13,7 @@
* security
* external/cwe/cwe-190
* external/cwe/cwe-192
* security-severity/8.1
*/
import cpp

View File

@@ -14,6 +14,7 @@
* external/cwe/cwe-192
* external/cwe/cwe-197
* external/cwe/cwe-681
* security-severity/8.1
*/
import cpp

View File

@@ -12,6 +12,7 @@
* security
* external/cwe/cwe-119
* external/cwe/cwe-843
* security-severity/8.8
* @id cpp/upcast-array-pointer-arithmetic
*/

View File

@@ -13,38 +13,17 @@ import cpp
import semmle.code.cpp.dataflow.DataFlow
predicate whitelist(Function f) {
exists(string fName |
fName = f.getName() and
(
fName = "ceil" or
fName = "ceilf" or
fName = "ceill" or
fName = "floor" or
fName = "floorf" or
fName = "floorl" or
fName = "nearbyint" or
fName = "nearbyintf" or
fName = "nearbyintl" or
fName = "rint" or
fName = "rintf" or
fName = "rintl" or
fName = "round" or
fName = "roundf" or
fName = "roundl" or
fName = "trunc" or
fName = "truncf" or
fName = "truncl" or
fName.matches("__builtin_%")
)
)
f.getName() =
[
"ceil", "ceilf", "ceill", "floor", "floorf", "floorl", "nearbyint", "nearbyintf",
"nearbyintl", "rint", "rintf", "rintl", "round", "roundf", "roundl", "trunc", "truncf",
"truncl"
] or
f.getName().matches("__builtin_%")
}
predicate whitelistPow(FunctionCall fc) {
(
fc.getTarget().getName() = "pow" or
fc.getTarget().getName() = "powf" or
fc.getTarget().getName() = "powl"
) and
fc.getTarget().getName() = ["pow", "powf", "powl"] and
exists(float value |
value = fc.getArgument(0).getValue().toFloat() and
(value.floor() - value).abs() < 0.001

View File

@@ -12,6 +12,7 @@
* correctness
* security
* external/cwe/cwe-134
* security-severity/9.8
*/
import semmle.code.cpp.dataflow.TaintTracking

View File

@@ -3,7 +3,7 @@
"qhelp.dtd">
<qhelp>
<overview>
<include src="LeapYear.qhelp" />
<include src="LeapYear.inc.qhelp" />
<p>When performing arithmetic operations on a variable that represents a date, leap years must be taken into account.
It is not safe to assume that a year is 365 days long.</p>

View File

@@ -3,7 +3,7 @@
"qhelp.dtd">
<qhelp>
<overview>
<include src="LeapYear.qhelp" />
<include src="LeapYear.inc.qhelp" />
<p>When performing arithmetic operations on a variable that represents a year, it is important to consider that the resulting value may not be a valid date.</p>
<p>The typical example is doing simple year arithmetic (i.e. <code>date.year++</code>) without considering if the resulting value will be a valid date or not.</p>

View File

@@ -3,7 +3,7 @@
"qhelp.dtd">
<qhelp>
<overview>
<include src="LeapYear.qhelp" />
<include src="LeapYear.inc.qhelp" />
<p>When using a function that transforms a date structure, and the year on the input argument for the API has been manipulated, it is important to check for the return value of the function to make sure it succeeded.</p>
<p>Otherwise, the function may have failed, and the output parameter may contain invalid data that can cause any number of problems on the affected system.</p>

View File

@@ -50,10 +50,12 @@ class SafeTimeGatheringFunction extends Function {
class TimeConversionFunction extends Function {
TimeConversionFunction() {
this.getQualifiedName() =
["FileTimeToSystemTime", "SystemTimeToFileTime", "SystemTimeToTzSpecificLocalTime",
"SystemTimeToTzSpecificLocalTimeEx", "TzSpecificLocalTimeToSystemTime",
"TzSpecificLocalTimeToSystemTimeEx", "RtlLocalTimeToSystemTime",
"RtlTimeToSecondsSince1970", "_mkgmtime"]
[
"FileTimeToSystemTime", "SystemTimeToFileTime", "SystemTimeToTzSpecificLocalTime",
"SystemTimeToTzSpecificLocalTimeEx", "TzSpecificLocalTimeToSystemTime",
"TzSpecificLocalTimeToSystemTimeEx", "RtlLocalTimeToSystemTime",
"RtlTimeToSecondsSince1970", "_mkgmtime"
]
}
}

View File

@@ -3,7 +3,7 @@
"qhelp.dtd">
<qhelp>
<overview>
<include src="LeapYear.qhelp" />
<include src="LeapYear.inc.qhelp" />
<p>This query helps to detect when a developer allocates an array or other fixed-length data structure such as <code>std::vector</code> with 365 elements one for each day of the year.</p>
<p>Since leap years have 366 days, there will be no allocated element on December 31st at the end of a leap year; which will lead to a buffer overflow on a leap year.</p>

View File

@@ -54,7 +54,7 @@ class BooleanControllingAssignmentInExpr extends BooleanControllingAssignment {
override predicate isWhitelisted() {
this.getConversion().(ParenthesisExpr).isParenthesised()
or
// whitelist this assignment if all comparison operations in the expression that this
// Allow this assignment if all comparison operations in the expression that this
// assignment is part of, are not parenthesized. In that case it seems like programmer
// is fine with unparenthesized comparison operands to binary logical operators, and
// the parenthesis around this assignment was used to call it out as an assignment.
@@ -62,6 +62,21 @@ class BooleanControllingAssignmentInExpr extends BooleanControllingAssignment {
forex(ComparisonOperation op | op = getComparisonOperand*(this.getParent+()) |
not op.isParenthesised()
)
or
// Match a pattern like:
// ```
// if((a = b) && use_value(a)) { ... }
// ```
// where the assignment is meant to update the value of `a` before it's used in some other boolean
// subexpression that is guarenteed to be evaluate _after_ the assignment.
this.isParenthesised() and
exists(LogicalAndExpr parent, Variable var, VariableAccess access |
var = this.getLValue().(VariableAccess).getTarget() and
access = var.getAnAccess() and
not access.isUsedAsLValue() and
parent.getRightOperand() = access.getParent*() and
parent.getLeftOperand() = this.getParent*()
)
}
}

View File

@@ -9,6 +9,7 @@
* correctness
* security
* external/cwe/cwe-770
* security-severity/7.5
*/
import cpp

View File

@@ -8,6 +8,7 @@
* @tags security
* external/cwe/cwe-170
* external/cwe/cwe-665
* security-severity/7.8
*/
import cpp

View File

@@ -13,6 +13,7 @@
import cpp
import semmle.code.cpp.dataflow.EscapesTree
import semmle.code.cpp.models.interfaces.PointerWrapper
import semmle.code.cpp.dataflow.DataFlow
/**
@@ -39,6 +40,10 @@ predicate hasNontrivialConversion(Expr e) {
e instanceof ParenthesisExpr
)
or
// A smart pointer can be stack-allocated while the data it points to is heap-allocated.
// So we exclude such "conversions" from this predicate.
e = any(PointerWrapper wrapper).getAnUnwrapperFunction().getACallToThisFunction()
or
hasNontrivialConversion(e.getConversion())
}

View File

@@ -12,6 +12,7 @@
* external/cwe/cwe-676
* external/cwe/cwe-119
* external/cwe/cwe-251
* security-severity/8.8
*/
import cpp

View File

@@ -12,6 +12,7 @@
* external/cwe/cwe-676
* external/cwe/cwe-119
* external/cwe/cwe-251
* security-severity/8.8
*/
import cpp

View File

@@ -9,6 +9,7 @@
* @tags security
* external/cwe/cwe-665
* external/cwe/cwe-457
* security-severity/7.8
*/
import cpp

View File

@@ -12,6 +12,7 @@
* external/cwe/cwe-676
* external/cwe/cwe-120
* external/cwe/cwe-251
* security-severity/9.8
*/
import cpp

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