Skip to content

Commit adf109b

Browse files
authored
Merge branch 'main' into inline-fail-tag
2 parents 6d43db4 + 6d77b34 commit adf109b

File tree

89 files changed

+513
-74
lines changed

Some content is hidden

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

89 files changed

+513
-74
lines changed

change-notes/1.20/analysis-javascript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
| Unneeded defensive code | More true positive and fewer false positive results | This query now recognizes additional defensive code patterns. |
5353
| Unsafe dynamic method access | Fewer false positive results | This query no longer flags concatenated strings as unsafe method names. |
5454
| Unused parameter | Fewer false positive results | This query no longer flags parameters with leading underscore. |
55-
| Unused variable, import, function or class | Fewer false positive results | This query now flags fewer variables that are implictly used by JSX elements. It no longer flags variables with a leading underscore and variables in dead code. |
55+
| Unused variable, import, function or class | Fewer false positive results | This query now flags fewer variables that are implicitly used by JSX elements. It no longer flags variables with a leading underscore and variables in dead code. |
5656
| Unvalidated dynamic method call | More true positive results | This query now flags concatenated strings as unvalidated method names in more cases. |
5757
| Useless assignment to property. | Fewer false positive results | This query now treats assignments with complex right-hand sides correctly. |
5858
| Useless conditional | Fewer results | Additional defensive coding patterns are now ignored. |

change-notes/1.23/analysis-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The following changes in version 1.23 affect C/C++ analysis in all applications.
1919
| Hard-coded Japanese era start date in call (`cpp/japanese-era/constructor-or-method-with-exact-era-date`) | Deprecated | This query has been deprecated. Use the new combined query Hard-coded Japanese era start date (`cpp/japanese-era/exact-era-date`) instead. |
2020
| Hard-coded Japanese era start date in struct (`cpp/japanese-era/struct-with-exact-era-date`) | Deprecated | This query has been deprecated. Use the new combined query Hard-coded Japanese era start date (`cpp/japanese-era/exact-era-date`) instead. |
2121
| Hard-coded Japanese era start date (`cpp/japanese-era/exact-era-date`) | More correct results | This query now checks for the beginning date of the Reiwa era (1st May 2019). |
22-
| Non-constant format string (`cpp/non-constant-format`) | Fewer false positive results | Fixed false positive results triggrered by mismatching declarations of a formatting function. |
22+
| Non-constant format string (`cpp/non-constant-format`) | Fewer false positive results | Fixed false positive results triggered by mismatching declarations of a formatting function. |
2323
| Sign check of bitwise operation (`cpp/bitwise-sign-check`) | Fewer false positive results | Results involving `>=` or `<=` are no longer reported. |
2424
| Too few arguments to formatting function (`cpp/wrong-number-format-arguments`) | Fewer false positive results | Fixed false positive results triggered by mismatching declarations of a formatting function. |
2525
| Too many arguments to formatting function (`cpp/too-many-format-arguments`) | Fewer false positive results | Fixed false positive results triggered by mismatching declarations of a formatting function. |

change-notes/1.24/analysis-javascript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191

9292
## Changes to libraries
9393

94-
* The predicates `RegExpTerm.getSuccessor` and `RegExpTerm.getPredecessor` have been changed to reflect textual, not operational, matching order. This only makes a difference in lookbehind assertions, which are operationally matched backwards. Previously, `getSuccessor` would mimick this, so in an assertion `(?<=ab)` the term `b` would be considered the predecessor, not the successor, of `a`. Textually, however, `a` is still matched before `b`, and this is the order we now follow.
94+
* The predicates `RegExpTerm.getSuccessor` and `RegExpTerm.getPredecessor` have been changed to reflect textual, not operational, matching order. This only makes a difference in lookbehind assertions, which are operationally matched backwards. Previously, `getSuccessor` would mimic this, so in an assertion `(?<=ab)` the term `b` would be considered the predecessor, not the successor, of `a`. Textually, however, `a` is still matched before `b`, and this is the order we now follow.
9595
* An extensible model of the `EventEmitter` pattern has been implemented.
9696
* Taint-tracking configurations now interact differently with the `data` flow label, which may affect queries
9797
that combine taint-tracking and flow labels.

cpp/ql/src/Best Practices/Likely Errors/CommaBeforeMisleadingIndentation.ql

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,36 @@
1616
import cpp
1717
import semmle.code.cpp.commons.Exclusions
1818

19-
/** Gets the sub-expression of 'e' with the earliest-starting Location */
19+
/**
20+
* Gets a child of `e`, including conversions but excluding call arguments.
21+
*/
22+
pragma[inline]
23+
Expr getAChildWithConversions(Expr e) {
24+
result.getParentWithConversions() = e and
25+
not result = any(Call c).getAnArgument()
26+
}
27+
28+
/**
29+
* Gets the left-most column position of any transitive child of `e` (including
30+
* conversions but excluding call arguments).
31+
*/
32+
int getCandidateColumn(Expr e) {
33+
result = e.getLocation().getStartColumn() or
34+
result = getCandidateColumn(getAChildWithConversions(e))
35+
}
36+
37+
/**
38+
* Gets the transitive child of `e` (including conversions but excluding call
39+
* arguments) at the left-most column position, preferring less deeply nested
40+
* expressions if there is a choice.
41+
*/
2042
Expr normalizeExpr(Expr e) {
21-
result =
22-
min(Expr child |
23-
child.getParentWithConversions*() = e.getFullyConverted() and
24-
not child.getParentWithConversions*() = any(Call c).getAnArgument()
25-
|
26-
child order by child.getLocation().getStartColumn(), count(child.getParentWithConversions*())
27-
)
43+
e.getLocation().getStartColumn() = min(getCandidateColumn(e)) and
44+
result = e
45+
or
46+
not e.getLocation().getStartColumn() = min(getCandidateColumn(e)) and
47+
result = normalizeExpr(getAChildWithConversions(e)) and
48+
result.getLocation().getStartColumn() = min(getCandidateColumn(e))
2849
}
2950

3051
predicate isParenthesized(CommaExpr ce) {
@@ -43,8 +64,8 @@ from CommaExpr ce, Expr left, Expr right, Location leftLoc, Location rightLoc
4364
where
4465
ce.fromSource() and
4566
not isFromMacroDefinition(ce) and
46-
left = normalizeExpr(ce.getLeftOperand()) and
47-
right = normalizeExpr(ce.getRightOperand()) and
67+
left = normalizeExpr(ce.getLeftOperand().getFullyConverted()) and
68+
right = normalizeExpr(ce.getRightOperand().getFullyConverted()) and
4869
leftLoc = left.getLocation() and
4970
rightLoc = right.getLocation() and
5071
not isParenthesized(ce) and

docs/change-notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The valid YAML properties in the metadata are:
4545
After the `---` line following the metadata, the rest of the markdown file is the user-visible content of the change note. This should usually be a single markdown bullet list entry (starting with `*`), although it is acceptable to have multiple bullet entries in the same change note if there are multiple changes that are closely related and have the same category metadata.
4646

4747
## Change categories
48-
Each change note must specifiy a `category` property in its metadata. This category servers two purposes: It determines how the change affects the version number of the next release of the pack, and it is used to group related changes in the final changelog. There is one set of available categories for query packs, and another set of available categories for library packs.
48+
Each change note must specify a `category` property in its metadata. This category servers two purposes: It determines how the change affects the version number of the next release of the pack, and it is used to group related changes in the final changelog. There is one set of available categories for query packs, and another set of available categories for library packs.
4949

5050
### Query pack change categories
5151
| Category | SemVer effect | Description |

docs/codeql/codeql-for-visual-studio-code/exploring-data-flow-with-path-queries.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Running path queries in VS Code
2828
#. Once the query has finished running, you can see the results in the Results view as usual (under ``alerts`` in the dropdown menu). Each query result describes the flow of information between a source and a sink.
2929
#. Expand the result to see the individual steps that the data follows.
3030
#. Click each step to jump to it in the source code and investigate the problem further.
31-
#. To navigate the path from your keyboard, you can bind shortcuts to the **CodeQL: Show Previous Step on Path** and **CodeQL: Show Next Step on Path** commands.
31+
#. To navigate the results from your keyboard, you can bind shortcuts to the **CodeQL: Navigate Up/Down/Left/Right in Result Viewer** commands.
3232

3333
Further reading
3434
-----------------

docs/ql-libraries/dataflow/dataflow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ through an additional step targeting a `PostUpdateNode`).
294294

295295
It is recommended to introduce `PostUpdateNode`s for all `ArgumentNode`s (this
296296
can be skipped for immutable arguments), and all field qualifiers for both
297-
reads and stores. Note also that in the case of compund arguments, such as
298-
`b ? x : y`, it is recommented to have post-update nodes for `x` and `y` (and
297+
reads and stores. Note also that in the case of compound arguments, such as
298+
`b ? x : y`, it is recommended to have post-update nodes for `x` and `y` (and
299299
not the compound argument itself), and let `[post update] x` have both `x`
300300
and `b ? x : y` as pre-update nodes (and similarly for `[post update] y`).
301301

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
lgtm,codescanning
2-
* Improved recongition of sanitizer functions for the `go/zipslip` query. This may reduce false-positives (but also perhaps false-negatives) when application code attempts to check a zip header entry does not contain an illegal path traversal attempt.
2+
* Improved recognition of sanitizer functions for the `go/zipslip` query. This may reduce false-positives (but also perhaps false-negatives) when application code attempts to check a zip header entry does not contain an illegal path traversal attempt.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
lgtm,codescanning
2-
* Added support for [the offical Couchbase Go SDK library](https://github.com/couchbase/gocb), v1 and v2. The `go/sql-injection` query (which also handles non-SQL databases such as Couchbase) will now identify Couchbase queries built from untrusted external input.
2+
* Added support for [the official Couchbase Go SDK library](https://github.com/couchbase/gocb), v1 and v2. The `go/sql-injection` query (which also handles non-SQL databases such as Couchbase) will now identify Couchbase queries built from untrusted external input.

java/documentation/library-coverage/coverage.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,20 @@ Java framework & library support
88

99
Framework / library,Package,Flow sources,Taint & value steps,Sinks (total),`CWE‑022` :sub:`Path injection`,`CWE‑036` :sub:`Path traversal`,`CWE‑079` :sub:`Cross-site scripting`,`CWE‑089` :sub:`SQL injection`,`CWE‑090` :sub:`LDAP injection`,`CWE‑094` :sub:`Code injection`,`CWE‑319` :sub:`Cleartext transmission`
1010
Android,``android.*``,52,479,116,,,3,67,,,
11+
Android extensions,``androidx.*``,5,183,8,,,,,,,
1112
`Apache Commons Collections <https://commons.apache.org/proper/commons-collections/>`_,"``org.apache.commons.collections``, ``org.apache.commons.collections4``",,1600,,,,,,,,
1213
`Apache Commons IO <https://commons.apache.org/proper/commons-io/>`_,``org.apache.commons.io``,,556,106,91,,,,,,15
1314
`Apache Commons Lang <https://commons.apache.org/proper/commons-lang/>`_,``org.apache.commons.lang3``,,424,,,,,,,,
1415
`Apache Commons Text <https://commons.apache.org/proper/commons-text/>`_,``org.apache.commons.text``,,272,,,,,,,,
1516
`Apache HttpComponents <https://hc.apache.org/>`_,"``org.apache.hc.core5.*``, ``org.apache.http``",5,136,28,,,3,,,,25
17+
`Apache Log4j 2 <https://logging.apache.org/log4j/2.0/>`_,``org.apache.logging.log4j``,,8,359,,,,,,,
1618
`Google Guava <https://guava.dev/>`_,``com.google.common.*``,,728,39,,6,,,,,
19+
JBoss Logging,``org.jboss.logging``,,,324,,,,,,,
1720
`JSON-java <https://github.com/stleary/JSON-java>`_,``org.json``,,236,,,,,,,,
1821
Java Standard Library,``java.*``,3,589,130,28,,,7,,,10
1922
Java extensions,"``javax.*``, ``jakarta.*``",63,609,32,,,4,,1,1,2
23+
Kotlin Standard Library,``kotlin*``,,1835,12,10,,,,,,2
2024
`Spring <https://spring.io/>`_,``org.springframework.*``,29,477,101,,,,19,14,,29
21-
Others,"``androidx.core.app``, ``androidx.slice``, ``cn.hutool.core.codec``, ``com.esotericsoftware.kryo.io``, ``com.esotericsoftware.kryo5.io``, ``com.fasterxml.jackson.core``, ``com.fasterxml.jackson.databind``, ``com.hubspot.jinjava``, ``com.mitchellbosecke.pebble``, ``com.opensymphony.xwork2.ognl``, ``com.rabbitmq.client``, ``com.unboundid.ldap.sdk``, ``com.zaxxer.hikari``, ``flexjson``, ``freemarker.cache``, ``freemarker.template``, ``groovy.lang``, ``groovy.util``, ``jodd.json``, ``kotlin``, ``net.sf.saxon.s9api``, ``ognl``, ``okhttp3``, ``org.apache.commons.codec``, ``org.apache.commons.jexl2``, ``org.apache.commons.jexl3``, ``org.apache.commons.logging``, ``org.apache.commons.ognl``, ``org.apache.directory.ldap.client.api``, ``org.apache.ibatis.jdbc``, ``org.apache.log4j``, ``org.apache.logging.log4j``, ``org.apache.shiro.codec``, ``org.apache.shiro.jndi``, ``org.apache.velocity.app``, ``org.apache.velocity.runtime``, ``org.codehaus.groovy.control``, ``org.dom4j``, ``org.hibernate``, ``org.jboss.logging``, ``org.jdbi.v3.core``, ``org.jooq``, ``org.mvel2``, ``org.scijava.log``, ``org.slf4j``, ``org.thymeleaf``, ``org.xml.sax``, ``org.xmlpull.v1``, ``play.mvc``, ``ratpack.core.form``, ``ratpack.core.handling``, ``ratpack.core.http``, ``ratpack.exec``, ``ratpack.form``, ``ratpack.func``, ``ratpack.handling``, ``ratpack.http``, ``ratpack.util``, ``retrofit2``",65,2326,972,10,,,14,18,,5
25+
Others,"``cn.hutool.core.codec``, ``com.esotericsoftware.kryo.io``, ``com.esotericsoftware.kryo5.io``, ``com.fasterxml.jackson.core``, ``com.fasterxml.jackson.databind``, ``com.hubspot.jinjava``, ``com.mitchellbosecke.pebble``, ``com.opensymphony.xwork2.ognl``, ``com.rabbitmq.client``, ``com.unboundid.ldap.sdk``, ``com.zaxxer.hikari``, ``flexjson``, ``freemarker.cache``, ``freemarker.template``, ``groovy.lang``, ``groovy.util``, ``jodd.json``, ``net.sf.saxon.s9api``, ``ognl``, ``okhttp3``, ``org.apache.commons.codec``, ``org.apache.commons.jexl2``, ``org.apache.commons.jexl3``, ``org.apache.commons.logging``, ``org.apache.commons.ognl``, ``org.apache.directory.ldap.client.api``, ``org.apache.ibatis.jdbc``, ``org.apache.log4j``, ``org.apache.shiro.codec``, ``org.apache.shiro.jndi``, ``org.apache.velocity.app``, ``org.apache.velocity.runtime``, ``org.codehaus.groovy.control``, ``org.dom4j``, ``org.hibernate``, ``org.jdbi.v3.core``, ``org.jooq``, ``org.mvel2``, ``org.scijava.log``, ``org.slf4j``, ``org.thymeleaf``, ``org.xml.sax``, ``org.xmlpull.v1``, ``play.mvc``, ``ratpack.core.form``, ``ratpack.core.handling``, ``ratpack.core.http``, ``ratpack.exec``, ``ratpack.form``, ``ratpack.func``, ``ratpack.handling``, ``ratpack.http``, ``ratpack.util``, ``retrofit2``",60,300,269,,,,14,18,,3
2226
Totals,,217,8432,1524,129,6,10,107,33,1,86
2327

0 commit comments

Comments
 (0)