CodeQL 2.12.5 (2023-03-21)¶
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.5 runs a total of 385 security queries when configured with the Default suite (covering 154 CWE). The Extended suite enables an additional 124 queries (covering 31 more CWE). 2 security queries have been added with this release.
CodeQL CLI¶
Bug Fixes¶
- Fix a bug in
codeql query run
where queries whose path contain colons cannot be run.
New Features¶
The
codeql pack install
command now accepts a--additional-packs
option. This option takes a list of directories to search for locally available packs when resolving which packs to install. Any pack that is found locally through--additional-packs
will override any other version of a pack found in the package registry. Locally resolved packs are not added to the lock file.Because the use of
--additional-packs
when runningcodeql pack install
makes running queries dependent on the local state of the machine initially invokingcodeql pack install
, a warning is emitted if any pack is found outside of the package registry. This warning can be suppressed by using the--no-strict-mode
option.
Query Packs¶
Minor Analysis Improvements¶
JavaScript/TypeScript¶
- The following queries now recognize HTML sanitizers as propagating taint:
js/sql-injection
,js/path-injection
,js/server-side-unvalidated-url-redirection
,js/client-side-unvalidated-url-redirection
, andjs/request-forgery
.
Deprecated Queries¶
C/C++¶
- The
NetworkToBufferSizeConfiguration
andUntrustedDataToExternalApiConfig
dataflow configurations have been deprecated. Please useNetworkToBufferSizeFlow
andUntrustedDataToExternalApiFlow
. - The
LeapYearCheckConfiguration
,FiletimeYearArithmeticOperationCheckConfiguration
, andPossibleYearArithmeticOperationCheckConfiguration
dataflow configurations have been deprecated. Please useLeapYearCheckFlow
,FiletimeYearArithmeticOperationCheckFlow
andPossibleYearArithmeticOperationCheckFlow
.
New Queries¶
Java/Kotlin¶
- Added a new query,
java/android/arbitrary-apk-installation
, to detect installation of APKs from untrusted sources.
Python¶
- Added a new query,
py/shell-command-constructed-from-input
, to detect libraries that unsafely construct shell commands from their inputs.
Ruby¶
- Added a new query,
rb/zip-slip
, to detect arbitrary file writes during extraction of zip/tar archives.
Language Libraries¶
Breaking Changes¶
C/C++¶
- The
semmle.code.cpp.commons.Buffer
andsemmle.code.cpp.commons.NullTermination
libraries no longer exposesemmle.code.cpp.dataflow.DataFlow
. Please importsemmle.code.cpp.dataflow.DataFlow
directly.
Major Analysis Improvements¶
C/C++¶
A new C/C++ dataflow library (
semmle.code.cpp.dataflow.new.DataFlow
) has been added. The new library behaves much more like the dataflow library of other CodeQL supported languages by following use-use dataflow paths instead of def-use dataflow paths. The new library also better supports dataflow through indirections, and new predicates such asNode::asIndirectExpr
have been added to facilitate working with indirections.The
semmle.code.cpp.ir.dataflow.DataFlow
library is now identical to the newsemmle.code.cpp.dataflow.new.DataFlow
library.The main data flow and taint tracking APIs have been changed. The old APIs remain in place for now and translate to the new through a backwards-compatible wrapper. If multiple configurations are in scope simultaneously, then this may affect results slightly. The new API is quite similar to the old, but makes use of a configuration module instead of a configuration class.
C#¶
- The main data flow and taint tracking APIs have been changed. The old APIs remain in place for now and translate to the new through a backwards-compatible wrapper. If multiple configurations are in scope simultaneously, then this may affect results slightly. The new API is quite similar to the old, but makes use of a configuration module instead of a configuration class.
Golang¶
- The main data flow and taint tracking APIs have been changed. The old APIs remain in place for now and translate to the new through a backwards-compatible wrapper. If multiple configurations are in scope simultaneously, then this may affect results slightly. The new API is quite similar to the old, but makes use of a configuration module instead of a configuration class.
Java/Kotlin¶
- Removed low-confidence call edges to known neutral call targets from the call graph used in data flow analysis. This includes, for example, custom
List.contains
implementations when the best inferrable type at the call site is simplyList
. - Added more sink and summary dataflow models for the following packages:
java.io
java.lang
java.sql
javafx.scene.web
org.apache.commons.compress.archivers.tar
org.apache.http.client.utils
org.codehaus.cargo.container.installer
- The main data flow and taint tracking APIs have been changed. The old APIs remain in place for now and translate to the new through a backwards-compatible wrapper. If multiple configurations are in scope simultaneously, then this may affect results slightly. The new API is quite similar to the old, but makes use of a configuration module instead of a configuration class.
Python¶
- The main data flow and taint tracking APIs have been changed. The old APIs remain in place for now and translate to the new through a backwards-compatible wrapper. If multiple configurations are in scope simultaneously, then this may affect results slightly. The new API is quite similar to the old, but makes use of a configuration module instead of a configuration class.
Ruby¶
- The main data flow and taint tracking APIs have been changed. The old APIs remain in place for now and translate to the new through a backwards-compatible wrapper. If multiple configurations are in scope simultaneously, then this may affect results slightly. The new API is quite similar to the old, but makes use of a configuration module instead of a configuration class.
Minor Analysis Improvements¶
C/C++¶
- Deleted the deprecated
hasGeneratedCopyConstructor
andhasGeneratedCopyAssignmentOperator
predicates from theFolder
class. - Deleted the deprecated
getPath
andgetFolder
predicates from theXmlFile
class. - Deleted the deprecated
getMustlockFunction
,getTrylockFunction
,getLockFunction
, andgetUnlockFunction
predicates from theMutexType
class. - Deleted the deprecated
getPosInBasicBlock
predicate from theSubBasicBlock
class. - Deleted the deprecated
getExpr
predicate from thePointerDereferenceExpr
class. - Deleted the deprecated
getUseInstruction
andgetDefinitionInstruction
predicates from theOperand
class. - Deleted the deprecated
isInParameter
,isInParameterPointer
, andisInQualifier
predicates from theFunctionInput
class. - Deleted the deprecated
isOutParameterPointer
,isOutQualifier
,isOutReturnValue
, andisOutReturnPointer
predicate from theFunctionOutput
class. - Deleted the deprecated 3-argument
isGuardPhi
predicate from theRangeSsaDefinition
class.
C#¶
- Deleted the deprecated
getPath
andgetFolder
predicates from theXmlFile
class. - Deleted the deprecated
getAssertionIndex
, andgetAssertedParameter
predicates from theAssertMethod
class. - Deleted the deprecated
OverridableMethod
andOverridableAccessor
classes. - The
unsafe
predicate forModifiable
has been extended to cover delegate return types and identify pointer-like types at any nest level. This is relevant forunsafe
declarations extracted from assemblies.
Java/Kotlin¶
- Deleted the deprecated
getPath
andgetFolder
predicates from theXmlFile
class. - Deleted the deprecated
getRepresentedString
predicate from theStringLiteral
class. - Deleted the deprecated
ServletWriterSource
class. - Deleted the deprecated
getGroupID
,getArtefactID
, andartefactMatches
predicates from theMavenRepoJar
class.
JavaScript/TypeScript¶
- Deleted the deprecated
getPath
andgetFolder
predicates from theXmlFile
class. - Deleted the deprecated
getId
from theFunction
,NamespaceDefinition
, andImportEqualsDeclaration
classes. - Deleted the deprecated
flowsTo
predicate from theHTTP::Servers::RequestSource
andHTTP::Servers::ResponseSource
class. - Deleted the deprecated
getEventName
predicate from theSocketIO::ReceiveNode
,SocketIO::SendNode
,SocketIOClient::SendNode
classes. - Deleted the deprecated
RateLimitedRouteHandlerExpr
andRouteHandlerExpressionWithRateLimiter
classes. - Import assertions are now supported. Previously this feature was only supported in TypeScript code, but is now supported for plain JavaScript as well and is also accessible in the AST.
Python¶
- Deleted the deprecated
getPath
andgetFolder
predicates from theXmlFile
class.
Ruby¶
- Data flow through
initialize
methods is now taken into account also when the receiver of anew
call is an (implicit or explicit)self
. - The Active Record query methods
reorder
andcount_by_sql
are now recognized as SQL executions. - Calls to
ActiveRecord::Connection#execute
, including those via subclasses, are now recognized as SQL executions. - Data flow through
ActionController::Parameters#require
is now tracked properly. - The severity of parse errors was reduced to warning (previously error).
- Deleted the deprecated
getQualifiedName
predicate from theConstantWriteAccess
class. - Deleted the deprecated
getWhenBranch
andgetAWhenBranch
predicates from theCaseExpr
class. - Deleted the deprecated
Self
,PatternParameter
,Pattern
,VariablePattern
,TuplePattern
, andTuplePatternParameter
classes.
Deprecated APIs¶
C/C++¶
- The
WriteConfig
taint tracking configuration has been deprecated. Please useWriteFlow
.
New Features¶
C/C++¶
- Added support for merging two
PathGraph
s via disjoint union to allow results from multiple data flow computations in a singlepath-problem
query.
C#¶
- Added support for merging two
PathGraph
s via disjoint union to allow results from multiple data flow computations in a singlepath-problem
query.
Golang¶
- Added support for merging two
PathGraph
s via disjoint union to allow results from multiple data flow computations in a singlepath-problem
query.
Java/Kotlin¶
- Added support for merging two
PathGraph
s via disjoint union to allow results from multiple data flow computations in a singlepath-problem
query.
Python¶
- Added support for merging two
PathGraph
s via disjoint union to allow results from multiple data flow computations in a singlepath-problem
query.
Ruby¶
- Added support for merging two
PathGraph
s via disjoint union to allow results from multiple data flow computations in a singlepath-problem
query.