Skip to content

Commit 14f1fa5

Browse files
author
Robert Marsh
committed
Merge branch 'main' into rdmarsh2/cpp/remove-initialize-nonlocal
Accept test changes from IR temporaries and block ordering
2 parents c00587d + 1e048d8 commit 14f1fa5

File tree

773 files changed

+67807
-24514
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

773 files changed

+67807
-24514
lines changed

change-notes/1.26/analysis-csharp.md

Lines changed: 0 additions & 35 deletions
This file was deleted.

change-notes/1.26/analysis-java.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ The following changes in version 1.26 affect Java analysis in all applications.
1818

1919
## Changes to libraries
2020

21-
* The QL class `Block`, denoting the `{ ... }` statement, is renamed to `BlockStmt`.

change-notes/1.26/analysis-javascript.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@
44

55
* Angular-specific taint sources and sinks are now recognized by the security queries.
66

7+
* Support for React has improved, with better handling of react hooks, react-router path parameters, lazy-loaded components, and components transformed using `react-redux` and/or `styled-components`.
8+
9+
* Dynamic imports are now analyzed more precisely.
10+
711
* Support for the following frameworks and libraries has been improved:
812
- [@angular/*](https://www.npmjs.com/package/@angular/core)
913
- [AWS Serverless](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html)
1014
- [Alibaba Serverless](https://www.alibabacloud.com/help/doc-detail/156876.htm)
1115
- [debounce](https://www.npmjs.com/package/debounce)
1216
- [bluebird](https://www.npmjs.com/package/bluebird)
1317
- [call-limit](https://www.npmjs.com/package/call-limit)
18+
- [classnames](https://www.npmjs.com/package/classnames)
19+
- [clsx](https://www.npmjs.com/package/clsx)
1420
- [express](https://www.npmjs.com/package/express)
1521
- [fast-json-stable-stringify](https://www.npmjs.com/package/fast-json-stable-stringify)
1622
- [fast-safe-stringify](https://www.npmjs.com/package/fast-safe-stringify)
@@ -27,7 +33,13 @@
2733
- [needle](https://www.npmjs.com/package/needle)
2834
- [object-inspect](https://www.npmjs.com/package/object-inspect)
2935
- [pretty-format](https://www.npmjs.com/package/pretty-format)
36+
- [react](https://www.npmjs.com/package/react)
37+
- [react-router-dom](https://www.npmjs.com/package/react-router-dom)
38+
- [react-redux](https://www.npmjs.com/package/react-redux)
39+
- [redis](https://www.npmjs.com/package/redis)
40+
- [redux](https://www.npmjs.com/package/redux)
3041
- [stringify-object](https://www.npmjs.com/package/stringify-object)
42+
- [styled-components](https://www.npmjs.com/package/styled-components)
3143
- [throttle-debounce](https://www.npmjs.com/package/throttle-debounce)
3244
- [underscore](https://www.npmjs.com/package/underscore)
3345

@@ -53,7 +65,9 @@
5365
| Client-side URL redirect (`js/client-side-unvalidated-url-redirection`) | More results | This query now recognizes some unsafe uses of `importScripts()` inside WebWorkers. |
5466
| Missing CSRF middleware (`js/missing-token-validation`) | More results | This query now recognizes writes to cookie and session variables as potentially vulnerable to CSRF attacks. |
5567
| Missing CSRF middleware (`js/missing-token-validation`) | Fewer results | This query now recognizes more ways of protecting against CSRF attacks. |
68+
| Client-side cross-site scripting (`js/xss`) | More results | This query now tracks data flow from `location.hash` more precisely. |
5669

5770

5871
## Changes to libraries
5972
* The predicate `TypeAnnotation.hasQualifiedName` now works in more cases when the imported library was not present during extraction.
73+
* The class `DomBasedXss::Configuration` has been deprecated, as it has been split into `DomBasedXss::HtmlInjectionConfiguration` and `DomBasedXss::JQueryHtmlOrSelectorInjectionConfiguration`. Unless specifically working with jQuery sinks, subclasses should instead be based on `HtmlInjectionConfiguration`. To use both configurations in a query, see [Xss.ql](https://github.com/github/codeql/blob/main/javascript/ql/src/Security/CWE-079/Xss.ql) for an example.

config/identical-files.json

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,17 @@
1919
"csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl3.qll",
2020
"csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl4.qll",
2121
"csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl5.qll",
22-
"python/ql/src/experimental/dataflow/internal/DataFlowImpl.qll",
23-
"python/ql/src/experimental/dataflow/internal/DataFlowImpl2.qll"
22+
"python/ql/src/semmle/python/dataflow/new/internal/DataFlowImpl.qll",
23+
"python/ql/src/semmle/python/dataflow/new/internal/DataFlowImpl2.qll",
24+
"python/ql/src/semmle/python/dataflow/new/internal/DataFlowImpl3.qll",
25+
"python/ql/src/semmle/python/dataflow/new/internal/DataFlowImpl4.qll"
2426
],
2527
"DataFlow Java/C++/C#/Python Common": [
2628
"java/ql/src/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll",
2729
"cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImplCommon.qll",
2830
"cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll",
2931
"csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImplCommon.qll",
30-
"python/ql/src/experimental/dataflow/internal/DataFlowImplCommon.qll"
32+
"python/ql/src/semmle/python/dataflow/new/internal/DataFlowImplCommon.qll"
3133
],
3234
"TaintTracking::Configuration Java/C++/C#/Python": [
3335
"cpp/ql/src/semmle/code/cpp/dataflow/internal/tainttracking1/TaintTrackingImpl.qll",
@@ -41,14 +43,17 @@
4143
"csharp/ql/src/semmle/code/csharp/dataflow/internal/tainttracking5/TaintTrackingImpl.qll",
4244
"java/ql/src/semmle/code/java/dataflow/internal/tainttracking1/TaintTrackingImpl.qll",
4345
"java/ql/src/semmle/code/java/dataflow/internal/tainttracking2/TaintTrackingImpl.qll",
44-
"python/ql/src/experimental/dataflow/internal/tainttracking1/TaintTrackingImpl.qll"
46+
"python/ql/src/semmle/python/dataflow/new/internal/tainttracking1/TaintTrackingImpl.qll",
47+
"python/ql/src/semmle/python/dataflow/new/internal/tainttracking2/TaintTrackingImpl.qll",
48+
"python/ql/src/semmle/python/dataflow/new/internal/tainttracking3/TaintTrackingImpl.qll",
49+
"python/ql/src/semmle/python/dataflow/new/internal/tainttracking4/TaintTrackingImpl.qll"
4550
],
4651
"DataFlow Java/C++/C#/Python Consistency checks": [
4752
"java/ql/src/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll",
4853
"cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImplConsistency.qll",
4954
"cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImplConsistency.qll",
5055
"csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImplConsistency.qll",
51-
"python/ql/src/experimental/dataflow/internal/DataFlowImplConsistency.qll"
56+
"python/ql/src/semmle/python/dataflow/new/internal/DataFlowImplConsistency.qll"
5257
],
5358
"SsaReadPosition Java/C#": [
5459
"java/ql/src/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll",
@@ -345,6 +350,10 @@
345350
"csharp/ql/src/experimental/ir/implementation/raw/gvn/internal/ValueNumberingImports.qll",
346351
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/gvn/internal/ValueNumberingImports.qll"
347352
],
353+
"C# ControlFlowReachability": [
354+
"csharp/ql/src/semmle/code/csharp/dataflow/internal/ControlFlowReachability.qll",
355+
"csharp/ql/src/semmle/code/csharp/dataflow/internal/rangeanalysis/ControlFlowReachability.qll"
356+
],
348357
"Inline Test Expectations": [
349358
"cpp/ql/test/TestUtilities/InlineExpectationsTest.qll",
350359
"python/ql/test/TestUtilities/InlineExpectationsTest.qll"
@@ -401,4 +410,4 @@
401410
"javascript/ql/src/Comments/CommentedOutCodeReferences.qhelp",
402411
"python/ql/src/Lexical/CommentedOutCodeReferences.qhelp"
403412
]
404-
}
413+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lgtm,codescanning
2+
* The `cpp/wrong-type-format-argument` and `cpp/non-portable-printf` queries have been hardened so that they do not produce nonsensical results on databases that contain errors (specifically the `ErroneousType`).
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lgtm,codescanning
2+
* The 'Not enough memory allocated for pointer type' (cpp/allocation-too-small) and 'Not enough memory allocated for array of pointer type' (cpp/suspicious-allocation-size) queries have been improved. Previously some allocations would be reported by both queries, this no longer occurs. In addition more allocation functions are now understood by both queries.

cpp/ql/src/Best Practices/Exceptions/LeakyCatch.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void good() {
3939
</example>
4040
<references>
4141

42-
<li>MSDN Library for MFC: <a href="http://msdn.microsoft.com/en-us/library/0e5twxsh(v=vs.110).aspx">Exceptions: Catching and Deleting Exceptions</a>.</li>
42+
<li>MSDN Library for MFC: <a href="https://docs.microsoft.com/en-us/cpp/mfc/exceptions-catching-and-deleting-exceptions">Exceptions: Catching and Deleting Exceptions</a>.</li>
4343

4444

4545
</references>

cpp/ql/src/Best Practices/Unused Entities/UnusedStaticVariables.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ then removing it will make code more readable. If the static variable is needed
2727
<a href="https://www.securecoding.cert.org/confluence/display/c/MSC12-C.+Detect+and+remove+code+that+has+no+effect+or+is+never+executed">Detect and remove code that has no effect</a>
2828
</li>
2929
<li>
30-
<a href="https://www.securecoding.cert.org/confluence/display/cplusplus/DCL07-CPP.+Minimize+the+scope+of+variables+and+methods">Minimize the scope of variables and methods</a>
30+
<a href="https://wiki.sei.cmu.edu/confluence/display/c/DCL19-C.+Minimize+the+scope+of+variables+and+functions">Minimize the scope of variables and functions</a>
3131
</li>
3232

3333

cpp/ql/src/Best Practices/UseOfGoto.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ this rule.
4141
E. W. Dijkstra Archive: <a href="http://www.cs.utexas.edu/users/EWD/transcriptions/EWD02xx/EWD215.html">A Case against the GO TO Statement (EWD-215)</a>.
4242
</li>
4343
<li>
44-
MSDN Library: <a href="http://msdn.microsoft.com/en-gb/library/b34dt9cd%28v=vs.80%29.aspx">The goto Statement</a>.
44+
MSDN Library: <a href="https://docs.microsoft.com/en-us/cpp/cpp/goto-statement-cpp">goto Statement (C++)</a>.
4545
</li>
4646
<li>
4747
Mats Henricson and Erik Nyquist, <i>Industrial Strength C++</i>, Rule 4.6. Prentice Hall PTR, 1997.

cpp/ql/src/Critical/MissingNullTest.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ this cannot happen.
2727
</example>
2828

2929
<references>
30-
<li>SEI CERT C Coding Standard: <a href="https://wiki.sei.cmu.edu/confluence/display/c/EXP34-C.+Do+not+dereference+null+pointerss">EXP34-C. Do not dereference null pointers</a>.</li>
30+
<li>SEI CERT C Coding Standard: <a href="https://wiki.sei.cmu.edu/confluence/display/c/EXP34-C.+Do+not+dereference+null+pointers">EXP34-C. Do not dereference null pointers</a>.</li>
3131
</references>
3232
</qhelp>

0 commit comments

Comments
 (0)