CodeQL 2.19.0 (2024-09-18)¶
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.19.0 runs a total of 426 security queries when configured with the Default suite (covering 164 CWE). The Extended suite enables an additional 128 queries (covering 34 more CWE). 1 security query has been added with this release.
CodeQL CLI¶
Improvements¶
codeql database analyzeandcodeql database interpret-resultsnow support the--sarif-run-propertyoption. You can provide this option when using a SARIF output format to add a key-value pair to the property bag of the run object.
Miscellaneous¶
The build of Eclipse Temurin OpenJDK that is used to run the CodeQL CLI has been updated to version 21.0.4.
Query Packs¶
Major Analysis Improvements¶
JavaScript/TypeScript¶
Added a new query (
js/actions/actions-artifact-leak) to detect GitHub Actions artifacts that may leak the GITHUB_TOKEN token.
Minor Analysis Improvements¶
C/C++¶
Removed false positives caused by buffer accesses in unreachable code
Removed false positives caused by inconsistent type checking
Add modeling of C functions that don’t throw, thereby increasing the precision of the
cpp/incorrect-allocation-error-handling(“Incorrect allocation-error handling”) query. The query now produces additional true positives.
Python¶
The
py/clear-text-logging-sensitive-dataandpy/clear-text-storage-sensitive-dataqueries have been updated to exclude thecertificateclassification of sensitive sources, which often do not contain sensitive data.
Language Libraries¶
Bug Fixes¶
Golang¶
Golang vendor directories not at the root of a repository are now correctly excluded from the baseline Go file count. This means code coverage information will be more accurate.
Breaking Changes¶
C/C++¶
Deleted many deprecated taint-tracking configurations based on
TaintTracking::Configuration.Deleted many deprecated dataflow configurations based on
DataFlow::Configuration.Deleted the deprecated
hasQualifiedNameandisDefinedpredicates from theDeclarationclass, usehasGlobalNameandhasDefinitionrespectively instead.Deleted the
getFullSignaturepredicate from theFunctionclass, usegetIdentityString(Declaration)fromsemmle.code.cpp.Printinstead.Deleted the deprecated
freeCallpredicate fromAlloc.qll. UseDeallocationExprinstead.Deleted the deprecated
explorationLimitpredicate fromDataFlow::Configuration, useFlowExploration<explorationLimit>instead.Deleted the deprecated
getFieldExprpredicate fromClassAggregateLiteral, usegetAFieldExprinstead.Deleted the deprecated
getElementExprpredicate fromArrayOrVectorAggregateLiteral, usegetAnElementExprinstead.
C#¶
Deleted many deprecated taint-tracking configurations based on
TaintTracking::Configuration.Deleted many deprecated dataflow configurations based on
DataFlow::Configuration.Deleted the deprecated
explorationLimitpredicate fromDataFlow::Configuration, useFlowExploration<explorationLimit>instead.
Golang¶
Deleted many deprecated taint-tracking configurations based on
TaintTracking::Configuration.Deleted the deprecated
explorationLimitpredicate fromDataFlow::Configuration, useFlowExploration<explorationLimit>instead.
Java/Kotlin¶
Deleted the deprecated
ProcessBuilderConstructor,MethodProcessBuilderCommand, andMethodRuntimeExecfromJDK.qll.Deleted the deprecated
explorationLimitpredicate fromDataFlow::Configuration, useFlowExploration<explorationLimit>instead.Deleted many deprecated taint-tracking configurations based on
TaintTracking::Configuration.Deleted the deprecated
getURIpredicate fromCamelJavaDslToDeclandSpringCamelXmlToElement, usegetUriinstead.Deleted the deprecated
ExecCallableclass fromExternalProcess.qll.Deleted many deprecated dataflow configurations based on
DataFlow::Configuration.Deleted the deprecated
PathCreation.qllfile.Deleted the deprecated
WebviewDubuggingEnabledQuery.qllfile.
JavaScript/TypeScript¶
Deleted the deprecated
isHTMLElementandgetDOMNamepredicates from the JSX library, useisHtmlElementandgetDomNamerespectively instead.Deleted the deprecated
getPackageJSONpredicate from theSourceMappingCommentclass, useSourceMappingCommentinstead.Deleted many deprecated directives from the
Stmt.qllfile, use theDirective::module instead.Deleted the deprecated
YAMLNode,YAMLValue, andYAMLScalarclasses from the YAML libraries, useYamlNode,YamlValue, andYamlScalarrespectively instead.Deleted the deprecated
getARouteHandlerExprpredicate fromConnect.qll, usegetARouteHandlerNodeinstead.Deleted the deprecated
getGWTVersionpredicate fromGWT.qll, usegetGwtVersioninstead.Deleted the deprecated
getOwnOptionsObjectpredicate fromVue.qll, usegetOwnOptions().getASink()instead.
Python¶
Deleted the deprecated
explorationLimitpredicate fromDataFlow::Configuration, useFlowExploration<explorationLimit>instead.Deleted the deprecated
semmle.python.RegexTreeViewmodule, usesemmle.python.regexp.RegexTreeViewinstead.Deleted the deprecated
RegexStringclass fromregex.qll.Deleted the deprecated
Regexclass, useRegExpinstead.Deleted the deprecated
semmle/python/security/SQL.qllfile.Deleted the deprecated
useSSLpredicates from the LDAP libraries, useuseSslinstead.
Ruby¶
Deleted the deprecated
getURLpredicate theHttp::Requestclass, usegetAUrlPartinstead.Deleted the deprecated
getNodepredicate from theCfgNodeclass, usegetAstNodeinstead.Deleted the deprecated
explorationLimitpredicate fromDataFlow::Configuration, useFlowExploration<explorationLimit>instead.Deleted many deprecated dataflow configurations based on
DataFlow::Configuration.Deleted many deprecated taint-tracking configurations based on
TaintTracking::Configuration.
Swift¶
Deleted the deprecated
explorationLimitpredicate fromDataFlow::Configuration, useFlowExploration<explorationLimit>instead.Deleted the deprecated
getDerivedTypeDeclpredicate from theTypeDeclclass, usegetADerivedTypeDeclorgetABaseTypeDeclinstead.
Major Analysis Improvements¶
Java/Kotlin¶
A generated (Models as Data) summary model is no longer used, if there exists a source code alternative. This primarily affects the analysis, when the analysis includes generated models for the source code being analysed.
JavaScript/TypeScript¶
Added support for TypeScript 5.6.
Minor Analysis Improvements¶
C/C++¶
Added a data flow model for
swapmember functions, which were previously modeled as taint tracking functions. This change improves the precision of queries where flow throughswapmember functions might affect the results.Added a data flow model for
realloc-like functions, which were previously modeled as a taint tracking functions. This change improves the precision of queries where flow throughrealloc-like functions might affect the results.
C#¶
Parameters of public methods in abstract controller-like classes are now considered remote flow sources.
The reported location of
partialmethods has been changed from the definition to the implementation part.
Golang¶
When a function or type has more than one anonymous type parameters, they were mistakenly being treated as the same type parameter. This has now been fixed.
Local source models for reading and parsing environment variables have been added for the following libraries:
os
syscall
github.com/caarlos0/env
github.com/gobuffalo/envy
github.com/hashicorp/go-envparse
github.com/joho/godotenv
github.com/kelseyhightower/envconfig
Local source models have been added for the APIs which open files in the
io/fs,io/ioutilandospackages in the Go standard library. You can optionally include threat models as appropriate when using the CodeQL CLI and in GitHub code scanning. For more information, see Analyzing your code with CodeQL queries and Customizing your advanced setup for code scanning.
New Features¶
C/C++¶
Added a class
C11GenericExprto represent C11 generic selection expressions. The generic selection is represented as aConversionon the expression that will be selected.Added subclasses of
BuiltInOperationsfor the__is_scoped_enum,__is_trivially_equality_comparable, and__is_trivially_relocatablebuiltin operations.Added a subclass of
Exprfor__datasizeofexpressions.