CodeQL 2.13.4 (2023-06-19)¶
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.13.4 runs a total of 390 security queries when configured with the Default suite (covering 155 CWE). The Extended suite enables an additional 125 queries (covering 32 more CWE). 1 security query has been added with this release.
CodeQL CLI¶
Bug Fixes¶
- Fixed an issue where indirect build tracing did not work in Azure DevOps pipeline jobs in Windows containers. To use indirect build tracing in such environments, ensure both the
--begin-tracing
and--trace-process-name=CExecSvc.exe
arguments are passed tocodeql database init
. - Improved the error message for the
codeql pack create
command when the pack being published has a dependency with no scope in its name.
New Features¶
- Temporary files and folders created by the CodeQL CLI will now be cleaned up when each CLI command (and its internal JVM) shuts down normally.
Query Packs¶
Bug Fixes¶
Python¶
- The display name (
@name
) of thepy/unsafe-deserialization
query has been updated in favor of consistency with other languages.
Minor Analysis Improvements¶
Java/Kotlin¶
- The
java/summary/lines-of-code
query now only counts lines of Java code. The newjava/summary/lines-of-code-kotlin
counts lines of Kotlin code.
JavaScript/TypeScript¶
- Fixed an issue where calls to a method named
search
would lead to false positive alerts related to regular expressions. This happened when the call was incorrectly seen as a call toString.prototype.search
, since this function converts its first argument to a regular expression. The analysis is now more restrictive about when to treatsearch
calls as regular expression sinks.
Ruby¶
- Fixed a bug that would occur when an
initialize
method returnsself
or one of its parameters. In such cases, the corresponding calls tonew
would be associated with an incorrect return type. This could result in inaccurate call target resolution and cause false positive alerts. - Fixed an issue where calls to
delete
orassoc
with a constant-valued argument would be analyzed imprecisely, as if the argument value was not a known constant.
Swift¶
- Fixed some false positive results from the
swift/string-length-conflation
query, caused by imprecise sinks.
Language Libraries¶
Bug Fixes¶
Swift¶
- Fixed a number of inconsistencies in the abstract syntax tree (AST) and in the control-flow graph (CFG). This may lead to more results in queries that use these libraries, or libraries that depend on them (such as dataflow).
Major Analysis Improvements¶
C#¶
- The extractor has been changed to run after the traced compiler call. This allows inspecting compiler generated files, such as the output of source generators. With this change,
.cshtml
files and their generated.cshtml.g.cs
counterparts are extracted on dotnet 6 and above.
JavaScript/TypeScript¶
- Added support for TypeScript 5.1.
Swift¶
- Incorporated the cross-language
SensitiveDataHeuristics.qll
heuristics library into the SwiftSensitiveExprs.qll
library. This adds a number of new heuristics enhancing detection from the library.
Minor Analysis Improvements¶
C/C++¶
- Deleted the deprecated
hasCopyConstructor
predicate from theClass
class inClass.qll
. - Deleted many deprecated predicates and classes with uppercase
AST
,SSA
,CFG
,API
, etc. in their names. Use the PascalCased versions instead. - Deleted the deprecated
CodeDuplication.qll
file.
C#¶
- C#: Analysis of the
dotnet test
command supplied with adll
orexe
file as argument no longer fails due to the addition of an erroneous-p:SharedCompilation=false
argument. - Deleted the deprecated
WebConfigXML
,ConfigurationXMLElement
,LocationXMLElement
,SystemWebXMLElement
,SystemWebServerXMLElement
,CustomErrorsXMLElement
, andHttpRuntimeXMLElement
classes fromWebConfig.qll
. The non-deprecated names with PascalCased Xml suffixes should be used instead. - Deleted the deprecated
Record
class from bothTypes.qll
andType.qll
. - Deleted the deprecated
StructuralComparisonConfiguration
class fromStructuralComparison.qll
, usesameGvn
instead. - Deleted the deprecated
isParameterOf
predicate from theParameterNode
class. - Deleted the deprecated
SafeExternalAPICallable
,ExternalAPIDataNode
,UntrustedDataToExternalAPIConfig
,UntrustedExternalAPIDataNode
, andExternalAPIUsedWithUntrustedData
classes fromExternalAPIsQuery.qll
. The non-deprecated names with PascalCased Api suffixes should be used instead. - Updated the following C# sink kind names. Any custom data extensions that use these sink kinds will need to be updated accordingly in order to continue working.
code
tocode-injection
sql
tosql-injection
html
tohtml-injection
xss
tojs-injection
remote
tofile-content-store
Java/Kotlin¶
- Added flow through the block arguments of
kotlin.io.use
andkotlin.with
. - Added models for the following packages:
- com.alibaba.druid.sql
- com.fasterxml.jackson.databind
- com.jcraft.jsch
- io.netty.handler.ssl
- okhttp3
- org.antlr.runtime
- org.fusesource.leveldbjni
- org.influxdb
- org.springframework.core.io
- org.yaml.snakeyaml
- Deleted the deprecated
getRHS
predicate from theLValue
class, usegetRhs
instead. - Deleted the deprecated
getCFGNode
predicate from theSsaVariable
class, usegetCfgNode
instead. - Deleted many deprecated predicates and classes with uppercase
XML
,JSON
,URL
,API
, etc. in their names. Use the PascalCased versions instead. - Added models for the following packages:
- java.lang
- java.nio.file
- Added dataflow models for the Gson deserialization library.
- Added models for the following packages:
- okhttp3
- Added more dataflow models for the Play Framework.
- Modified the models related to
java.nio.file.Files.copy
so that generic[Input|Output]Stream
arguments are not considered file-related sinks. - Dataflow analysis has a new flow step through constructors of transitive subtypes of
java.io.InputStream
that wrap an underlying data source. Previously, the step only existed for direct subtypes ofjava.io.InputStream
. - Path creation sinks modeled in
PathCreation.qll
have been added to the models-as-data sink kindpath-injection
. - Updated the regular expression in the
HostnameSanitizer
sanitizer in thesemmle.code.java.security.RequestForgery
library to better detect strings prefixed with a hostname. - Changed the
android-widget
Java source kind toremote
. Any custom data extensions that use theandroid-widget
source kind will need to be updated accordingly in order to continue working. - Updated the following Java sink kind names. Any custom data extensions will need to be updated accordingly in order to continue working.
sql
tosql-injection
url-redirect
tourl-redirection
xpath
toxpath-injection
ssti
totemplate-injection
logging
tolog-injection
groovy
togroovy-injection
jexl
tojexl-injection
mvel
tomvel-injection
xslt
toxslt-injection
ldap
toldap-injection
pending-intent-sent
topending-intents
intent-start
tointent-redirection
set-hostname-verifier
tohostname-verification
header-splitting
toresponse-splitting
xss
tohtml-injection
andjs-injection
write-file
tofile-system-store
create-file
andread-file
topath-injection
open-url
andjdbc-url
torequest-forgery
JavaScript/TypeScript¶
- Deleted many deprecated predicates and classes with uppercase
XML
,JSON
,URL
,API
, etc. in their names. Use the PascalCased versions instead. - Deleted the deprecated
localTaintStep
predicate fromDataFlow.qll
. - Deleted the deprecated
stringStep
, andlocalTaintStep
predicates fromTaintTracking.qll
. - Deleted many modules that started with a lowercase letter. Use the versions that start with an uppercase letter instead.
- Deleted the deprecated
HtmlInjectionConfiguration
andJQueryHtmlOrSelectorInjectionConfiguration
classes fromDomBasedXssQuery.qll
, useConfiguration
instead. - Deleted the deprecated
DefiningIdentifier
class and theDefinitions.qll
file it was in. UseSsaDefinition
instead. - Deleted the deprecated
definitionReaches
,localDefinitionReaches
,getAPseudoDefinitionInput
,nextDefAfter
, andlocalDefinitionOverwrites
predicates fromDefUse.qll
. - Updated the following JavaScript sink kind names. Any custom data extensions that use these sink kinds will need to be updated accordingly in order to continue working.
command-line-injection
tocommand-injection
credentials[kind]
tocredentials-kind
- Added a support of sub modules in
node_modules
.
Ruby¶
- Deleted many deprecated predicates and classes with uppercase
URL
,XSS
, etc. in their names. Use the PascalCased versions instead. - Deleted the deprecated
getValueText
predicate from theExpr
,StringComponent
, andExprCfgNode
classes. UsegetConstantValue
instead. - Deleted the deprecated
VariableReferencePattern
class, useReferencePattern
instead. - Deleted all deprecated aliases in
StandardLibrary.qll
, usecodeql.ruby.frameworks.Core
andcodeql.ruby.frameworks.Stdlib
instead. - Support for the
sequel
gem has been added. Method calls that execute queries against a database that may be vulnerable to injection attacks will now be recognized. - Support for the
mysql2
gem has been added. Method calls that execute queries against an MySQL database that may be vulnerable to injection attacks will now be recognized. - Support for the
pg
gem has been added. Method calls that execute queries against a PostgreSQL database that may be vulnerable to injection attacks will now be recognized.
Swift¶
- Some models for the
Data
class have been generalized toDataProtocol
so that they apply more widely.