CodeQL 2.13.4 (2023-06-19)¶
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-tracingand--trace-process-name=CExecSvc.exearguments are passed tocodeql database init.Improved the error message for the
codeql pack createcommand 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-deserializationquery has been updated in favor of consistency with other languages.
Minor Analysis Improvements¶
Java/Kotlin¶
The
java/summary/lines-of-codequery now only counts lines of Java code. The newjava/summary/lines-of-code-kotlincounts lines of Kotlin code.
JavaScript/TypeScript¶
Fixed an issue where calls to a method named
searchwould 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 treatsearchcalls as regular expression sinks.
Ruby¶
Fixed a bug that would occur when an
initializemethod returnsselfor one of its parameters. In such cases, the corresponding calls tonewwould 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
deleteorassocwith 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-conflationquery, caused by imprecise sinks.
New Queries¶
C/C++¶
Added a new query,
cpp/overrun-write, to detect buffer overflows in C-style functions that manipulate buffers.
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,
.cshtmlfiles and their generated.cshtml.g.cscounterparts are extracted on dotnet 6 and above.
JavaScript/TypeScript¶
Added support for TypeScript 5.1.
Swift¶
Incorporated the cross-language
SensitiveDataHeuristics.qllheuristics library into the SwiftSensitiveExprs.qlllibrary. This adds a number of new heuristics enhancing detection from the library.
Minor Analysis Improvements¶
C/C++¶
Deleted the deprecated
hasCopyConstructorpredicate from theClassclass 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.qllfile.
C#¶
C#: Analysis of the
dotnet testcommand supplied with adllorexefile as argument no longer fails due to the addition of an erroneous-p:SharedCompilation=falseargument.Deleted the deprecated
WebConfigXML,ConfigurationXMLElement,LocationXMLElement,SystemWebXMLElement,SystemWebServerXMLElement,CustomErrorsXMLElement, andHttpRuntimeXMLElementclasses fromWebConfig.qll. The non-deprecated names with PascalCased Xml suffixes should be used instead.Deleted the deprecated
Recordclass from bothTypes.qllandType.qll.Deleted the deprecated
StructuralComparisonConfigurationclass fromStructuralComparison.qll, usesameGvninstead.Deleted the deprecated
isParameterOfpredicate from theParameterNodeclass.Deleted the deprecated
SafeExternalAPICallable,ExternalAPIDataNode,UntrustedDataToExternalAPIConfig,UntrustedExternalAPIDataNode, andExternalAPIUsedWithUntrustedDataclasses 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.
codetocode-injectionsqltosql-injectionhtmltohtml-injectionxsstojs-injectionremotetofile-content-store
Java/Kotlin¶
Added flow through the block arguments of
kotlin.io.useandkotlin.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
getRHSpredicate from theLValueclass, usegetRhsinstead.Deleted the deprecated
getCFGNodepredicate from theSsaVariableclass, usegetCfgNodeinstead.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.copyso that generic[Input|Output]Streamarguments are not considered file-related sinks.Dataflow analysis has a new flow step through constructors of transitive subtypes of
java.io.InputStreamthat wrap an underlying data source. Previously, the step only existed for direct subtypes ofjava.io.InputStream.Path creation sinks modeled in
PathCreation.qllhave been added to the models-as-data sink kindpath-injection.Updated the regular expression in the
HostnameSanitizersanitizer in thesemmle.code.java.security.RequestForgerylibrary to better detect strings prefixed with a hostname.Changed the
android-widgetJava source kind toremote. Any custom data extensions that use theandroid-widgetsource 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.
sqltosql-injectionurl-redirecttourl-redirectionxpathtoxpath-injectionsstitotemplate-injectionloggingtolog-injectiongroovytogroovy-injectionjexltojexl-injectionmveltomvel-injectionxslttoxslt-injectionldaptoldap-injectionpending-intent-senttopending-intentsintent-starttointent-redirectionset-hostname-verifiertohostname-verificationheader-splittingtoresponse-splittingxsstohtml-injectionandjs-injectionwrite-filetofile-system-storecreate-fileandread-filetopath-injectionopen-urlandjdbc-urltorequest-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
localTaintSteppredicate fromDataFlow.qll.Deleted the deprecated
stringStep, andlocalTaintSteppredicates fromTaintTracking.qll.Deleted many modules that started with a lowercase letter. Use the versions that start with an uppercase letter instead.
Deleted the deprecated
HtmlInjectionConfigurationandJQueryHtmlOrSelectorInjectionConfigurationclasses fromDomBasedXssQuery.qll, useConfigurationinstead.Deleted the deprecated
DefiningIdentifierclass and theDefinitions.qllfile it was in. UseSsaDefinitioninstead.Deleted the deprecated
definitionReaches,localDefinitionReaches,getAPseudoDefinitionInput,nextDefAfter, andlocalDefinitionOverwritespredicates 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-injectiontocommand-injectioncredentials[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
getValueTextpredicate from theExpr,StringComponent, andExprCfgNodeclasses. UsegetConstantValueinstead.Deleted the deprecated
VariableReferencePatternclass, useReferencePatterninstead.Deleted all deprecated aliases in
StandardLibrary.qll, usecodeql.ruby.frameworks.Coreandcodeql.ruby.frameworks.Stdlibinstead.Support for the
sequelgem 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
mysql2gem 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
pggem 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
Dataclass have been generalized toDataProtocolso that they apply more widely.
New Features¶
Java/Kotlin¶
Kotlin versions up to 1.9.0 are now supported.