CodeQL 2.12.4 (2023-03-09)¶
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
--modeswitch tocodeql pack installhas changed. The default is now--mode minimal-update. Previously, it wasuse-lock.
Deprecations¶
The
--freezeswitch forcodeql pack create,codeql pack bundle, andcodeql pack publishis now deprecated and ignored, as there is no longer a cache within a pack.The
--mode updateswitch tocodeql pack resolve-dependenciesis now deprecated. Instead, use the new--mode upgradeswitch, which has identical behavior.The
--modeswitch tocodeql pack installis now deprecated.Instead of
--mode update, usecodeql pack upgrade.Instead of
--mode verify, usecodeql pack ci.
New Features¶
The per-pack compilation cache has been replaced with a global compilation cache found within
~/.codeql.codeql pack installnow 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--modeswitch tocodeql pack installis 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.ymlfile, the command generates an error. This is equivalent tocodeql pack install --mode verify. Note that the--modeswitch tocodeql pack installis now deprecated.
Query Packs¶
Minor Analysis Improvements¶
Golang¶
The query
go/incorrect-integer-conversionnow correctly recognizes guards of the formif val <= xto protect a conversionuintX(val)whenxis in the range(math.MaxIntX, math.MaxUintX].
JavaScript/TypeScript¶
The
js/regex-injectionquery now recognizes environment variables and command-line arguments as sources.
Language Libraries¶
Breaking Changes¶
JavaScript/TypeScript¶
The
CryptographicOperationconcept has been changed to use a range pattern. This is a breaking change and existing implementations ofCryptographicOperationwill need to be updated in order to compile. These implementations can be updated by:Extending
CryptographicOperation::Rangerather thanCryptographicOperationRenaming 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.
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-instanceis 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
filescoped types.C# 11: Added extractor support for
requiredfields and properties.C# 11: Added library support for
checkedoperators.
Java/Kotlin¶
Added new sinks for
java/hardcoded-credential-api-callto 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-callnow 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
hmaclibrary.
Ruby¶
Flow is now tracked between ActionController
before_filterandafter_filtercallbacks and their associated action methods.Calls to
ApplicationController#renderandApplicationController::Renderer#renderare recognized as Rails rendering calls.Support for Twirp framework.