CodeQL 2.22.1 (2025-06-26)¶
This is an overview of changes in the CodeQL CLI and relevant CodeQL query and library packs. For additional updates on changes to the CodeQL code scanning experience, check out the code scanning section on the GitHub blog, relevant GitHub Changelog updates, changes in the CodeQL extension for Visual Studio Code, and the CodeQL Action changelog.
Security Coverage¶
CodeQL 2.22.1 runs a total of 449 security queries when configured with the Default suite (covering 165 CWE). The Extended suite enables an additional 129 queries (covering 33 more CWE).
CodeQL CLI¶
New Features¶
Rust language support is now in public preview.
Miscellaneous¶
The version of
jgit
used by the CodeQL CLI has been updated to6.10.1.202505221210-r
.
Query Packs¶
Minor Analysis Improvements¶
C/C++¶
Added flow model for the following libraries:
madler/zlib
,google/brotli
,libidn/libidn2
,libssh2/libssh2/
,nghttp2/nghttp2
,libuv/libuv/
, andcurl/curl
. This may result in more alerts when running queries on codebases that use these libraries.
C#¶
The queries
cs/dereferenced-value-is-always-null
andcs/dereferenced-value-may-be-null
have been improved to reduce false positives. The queries no longer assume that expressions are dereferenced when passed as the receiver (this
parameter) to extension methods where that parameter is a nullable type.
JavaScript/TypeScript¶
The
js/loop-iteration-skipped-due-to-shifting
query now has thereliability
tag.Fixed false positives in the
js/loop-iteration-skipped-due-to-shifting
query when the return value ofsplice
is used to decide whether to adjust the loop counter.Fixed false positives in the
js/template-syntax-in-string-literal
query where template syntax in string concatenation and “manual string interpolation” patterns were incorrectly flagged.The
js/useless-expression
query now correctly flags only the innermost expressions with no effect, avoiding duplicate alerts on compound expressions.
Python¶
The
py/iter-returns-non-self
query has been modernized, and no longer alerts for certain cases where an equivalent iterator is returned.
New Queries¶
Rust¶
Initial public preview release.
Query Metadata Changes¶
C#¶
Query metadata tags have been systematically updated for many C# queries. Primary categorization as either
reliability
ormaintainability
, and relevant sub-category tags such asreadability
,useless-code
,complexity
,performance
,correctness
,error-handling
, andconcurrency
. Aligns with the established Query file metadata and alert message style guide.Adjusts the
@security-severity
from 9.3 to 7.3 forcs/uncontrolled-format-string
to alignCWE-134
severity for memory safe languages to better reflect their impact.
Golang¶
The tag
quality
has been added to multiple Go quality queries for consistency. They have all been given a tag for one of the two top-level categoriesreliability
ormaintainability
, and a tag for a sub-category. See Query file metadata and alert message style guide for more information about these categories.The tag
external/cwe/cwe-129
has been added togo/constant-length-comparison
.The tag
external/cwe/cwe-193
has been added togo/index-out-of-bounds
.The tag
external/cwe/cwe-197
has been added togo/shift-out-of-range
.The tag
external/cwe/cwe-248
has been added togo/redundant-recover
.The tag
external/cwe/cwe-252
has been added togo/missing-error-check
andgo/unhandled-writable-file-close
.The tag
external/cwe/cwe-480
has been added togo/mistyped-exponentiation
.The tag
external/cwe/cwe-570
has been added togo/impossible-interface-nil-check
andgo/comparison-of-identical-expressions
.The tag
external/cwe/cwe-571
has been added togo/negative-length-check
andgo/comparison-of-identical-expressions
.The tag
external/cwe/cwe-783
has been added togo/whitespace-contradicts-precedence
.The tag
external/cwe/cwe-835
has been added togo/inconsistent-loop-direction
.The tag
error-handling
has been added togo/missing-error-check
,go/unhandled-writable-file-close
, andgo/unexpected-nil-value
.The tag
useless-code
has been added togo/useless-assignment-to-field
,go/useless-assignment-to-local
,go/useless-expression
, andgo/unreachable-statement
.The tag
logic
has been removed fromgo/index-out-of-bounds
andgo/unexpected-nil-value
.The tags
call
anddefer
have been removed fromgo/unhandled-writable-file-close
.The tags
correctness
andquality
have been reordered ingo/missing-error-check
andgo/unhandled-writable-file-close
.The tag
maintainability
has been changed toreliability
forgo/unhandled-writable-file-close
.The tag order has been standardized to have
quality
first, followed by the top-level category (reliability
ormaintainability
), then sub-category tags, and finally CWE tags.The description text has been updated in
go/whitespace-contradicts-precedence
to change “may even indicate” to “may indicate”.
Java/Kotlin¶
The tag
quality
has been added to multiple Java quality queries for consistency. They have all been given a tag for one of the two top-level categoriesreliability
ormaintainability
, and a tag for a sub-category. See Query file metadata and alert message style guide for more information about these categories.The tag
external/cwe/cwe-571
has been added tojava/equals-on-unrelated-types
.The tag
readability
has been added tojava/missing-override-annotation
,java/deprecated-call
,java/inconsistent-javadoc-throws
,java/unknown-javadoc-parameter
,java/jdk-internal-api-access
,java/underscore-identifier
,java/misleading-indentation
,java/inefficient-empty-string-test
,java/non-static-nested-class
,inefficient-string-constructor
, andjava/constants-only-interface
.The tag
useless-code
has been added tojava/useless-type-test
, andjava/useless-tostring-call
.The tag
complexity
has been added tojava/chained-type-tests
, andjava/abstract-to-concrete-cast
.The tag
error-handling
has been added tojava/ignored-error-status-of-call
, andjava/uncaught-number-format-exception
.The tag
correctness
has been added tojava/evaluation-to-constant
,java/whitespace-contradicts-precedence
,java/empty-container
,java/string-buffer-char-init
,java/call-to-object-tostring
,java/print-array
andjava/internal-representation-exposure
.The tag
performance
has been added tojava/input-resource-leak
,java/database-resource-leak
,java/output-resource-leak
,java/inefficient-key-set-iterator
,java/inefficient-output-stream
, andjava/inefficient-boxed-constructor
.The tag
correctness
has been removed fromjava/call-to-thread-run
,java/unsafe-double-checked-locking
,java/unsafe-double-checked-locking-init-order
,java/non-sync-override
,java/sync-on-boxed-types
,java/unsynchronized-getter
,java/input-resource-leak
,java/output-resource-leak
,java/database-resource-leak
, andjava/ignored-error-status-of-call
.The tags
maintainability
has been removed fromjava/string-buffer-char-init
,java/inefficient-key-set-iterator
,java/inefficient-boxed-constructor
, andjava/internal-representation-exposure
.The tags
reliability
has been removed fromjava/subtle-inherited-call
,java/print-array
, andjava/call-to-object-tostring
.The tags
maintainability
anduseless-code
have been removed fromjava/evaluation-to-constant
.The tags
maintainability
andreadability
have been removed fromjava/whitespace-contradicts-precedence
.The tags
maintainability
anduseless-code
have been removed fromjava/empty-container
.Adjusts the
@precision
from high to medium forjava/concatenated-command-line
because it is producing false positive alerts when the concatenated strings are hard-coded.Adjusts the
@security-severity
from 9.3 to 7.3 forjava/tainted-format-string
to alignCWE-134
severity for memory safe languages to better reflect their impact.
JavaScript/TypeScript¶
The
quality
tag has been added to multiple JavaScript quality queries, with tags forreliability
ormaintainability
categories and their sub-categories. See Query file metadata and alert message style guide for more information about these categories.Added
reliability
tag to thejs/suspicious-method-name-declaration
query.Added
reliability
andlanguage-features
tags to thejs/template-syntax-in-string-literal
query.
Python¶
The tag
quality
has been added to multiple Python quality queries for consistency. They have all been given a tag for one of the two top-level categoriesreliability
ormaintainability
, and a tag for a sub-category. See Query file metadata and alert message style guide for more information about these categories.
Ruby¶
Update query metadata tags for
rb/database-query-in-loop
andrb/useless-assignment-to-local
to align with the established Query file metadata and alert message style guide.
Swift¶
Adjusts the
@security-severity
from 9.3 to 7.3 forswift/uncontrolled-format-string
to alignCWE-134
severity for memory safe languages to better reflect their impact.
Language Libraries¶
Bug Fixes¶
C/C++¶
resolveTypedefs
now properly resolves typedefs forArrayType
s.
Minor Analysis Improvements¶
Java/Kotlin¶
Java
assert
statements are now assumed to be executed for the purpose of analysing control flow. This improves precision for a number of queries.
JavaScript/TypeScript¶
Calls to
sinon.match()
are no longer incorrectly identified as regular expression operations.Improved data flow tracking through middleware to handle default value and similar patterns.
Added
req._parsedUrl
as a remote input source.Improved taint tracking through calls to
serialize-javascript
.Removed
encodeURI
andescape
functions from the sanitizer list for request forgery.The JavaScript extractor now skips generated JavaScript files if the original TypeScript files are already present. It also skips any files in the output directory specified in the
compilerOptions
part of thetsconfig.json
file.Added support for Axios instances in the
axios
module.
GitHub Actions¶
Fixed performance issues in the parsing of Bash scripts in workflow files, which led to out-of-disk errors when analysing certain workflow files with complex interpolations of shell commands or quoted strings.
Deprecated APIs¶
C/C++¶
The
ThrowingFunction
class (semmle.code.cpp.models.interfaces.Throwing
) has been deprecated. Please use theAlwaysSehThrowingFunction
class instead.
New Features¶
C/C++¶
Added a predicate
getAnAttribute
toNamespace
to retrieve a namespace attribute.The Microsoft-specific
__leave
statement is now supported.A new class
LeaveStmt
extendingJumpStmt
was added to represent__leave
statements.Added a predicate
hasParameterList
toLambdaExpression
to capture whether a lambda has an explicitly specified parameter list.
Rust¶
Initial public preview release.