CodeQL 2.12.4 (2023-03-09)¶
Contents
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.12.4 runs a total of 385 security queries when configured with the Default suite (covering 154 CWE). The Extended suite enables an additional 122 queries (covering 31 more CWE).
CodeQL CLI¶
Breaking Changes¶
- The default value of the
--mode
switch tocodeql pack install
has changed. The default is now--mode minimal-update
. Previously, it wasuse-lock
.
Deprecations¶
- The
--freeze
switch forcodeql pack create
,codeql pack bundle
, andcodeql pack publish
is now deprecated and ignored, as there is no longer a cache within a pack. - The
--mode update
switch tocodeql pack resolve-dependencies
is now deprecated. Instead, use the new--mode upgrade
switch, which has identical behavior. - The
--mode
switch tocodeql pack install
is now deprecated.- Instead of
--mode update
, usecodeql pack upgrade
. - Instead of
--mode verify
, usecodeql pack ci
.
- Instead of
New Features¶
- The per-pack compilation cache has been replaced with a global compilation cache found within
~/.codeql
. codeql pack install
now uses a new algorithm to determine which versions of the pack’s dependencies to use, based on the PubGrub algorithm. The new algorithm is able to find a solution for many cases that the previous algorithm would fail to solve. When the new algorithm is unable to find a valid solution, it generates a detailed error message explaining why there is no valid solution.- Added a new command,
codeql pack upgrade
. This command is similar tocodeql pack install
, except that it ignores any existing lock file, installs the latest compatible version of each dependency, and writes a new lock file. This is equivalent tocodeql pack install --mode update
. Note that the--mode
switch tocodeql pack install
is now deprecated. - Added a new command,
codeql pack ci
. This command is similar tocodeql pack install
, except if the existing lock file is missing, or if it conflicts with the version constraints in theqlpack.yml
file, the command generates an error. This is equivalent tocodeql pack install --mode verify
. Note that the--mode
switch tocodeql pack install
is now deprecated.
Query Packs¶
Minor Analysis Improvements¶
Golang¶
- The query
go/incorrect-integer-conversion
now correctly recognizes guards of the formif val <= x
to protect a conversionuintX(val)
whenx
is in the range(math.MaxIntX, math.MaxUintX]
.
JavaScript/TypeScript¶
- The
js/regex-injection
query now recognizes environment variables and command-line arguments as sources.
Language Libraries¶
Breaking Changes¶
JavaScript/TypeScript¶
- The
CryptographicOperation
concept has been changed to use a range pattern. This is a breaking change and existing implementations ofCryptographicOperation
will need to be updated in order to compile. These implementations can be updated by:- Extending
CryptographicOperation::Range
rather thanCryptographicOperation
- Renaming the
getInput()
member predicate asgetAnInput()
- Implementing the
BlockMode getBlockMode()
member predicate. The implementation for this can benone()
if the operation is a hashing operation or an encryption operation using a stream cipher.
- Extending
Major Analysis Improvements¶
Python¶
- We use a new analysis for the call-graph (determining which function is called). This can lead to changed results. In most cases this is much more accurate than the old call-graph that was based on points-to, but we do lose a few valid edges in the call-graph, especially around methods that are not defined inside its class.
Minor Analysis Improvements¶
C#¶
- The query
cs/static-field-written-by-instance
is updated to handle properties. - C# 11: Support for explicit interface member implementation of operators.
- The extraction of member modifiers has been generalized, which could lead to the extraction of more modifiers.
- C# 11: Added extractor and library support for
file
scoped types. - C# 11: Added extractor support for
required
fields and properties. - C# 11: Added library support for
checked
operators.
Java/Kotlin¶
- Added new sinks for
java/hardcoded-credential-api-call
to identify the use of hardcoded secrets in the creation and verification of JWT tokens usingcom.auth0.jwt
. These sinks are from an experimental query submitted by @luchua. - The Java extractor now supports builds against JDK 20.
- The query
java/hardcoded-credential-api-call
now recognizes methods that accept user and password from the SQLServerDataSource class of the Microsoft JDBC Driver for SQL Server.
Python¶
- Fixed module resolution so we properly recognize definitions made within if-then-else statements.
- Added modeling of cryptographic operations in the
hmac
library.
Ruby¶
- Flow is now tracked between ActionController
before_filter
andafter_filter
callbacks and their associated action methods. - Calls to
ApplicationController#render
andApplicationController::Renderer#render
are recognized as Rails rendering calls. - Support for Twirp framework.