CodeQL 2.11.1 (2022-10-11)¶
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.11.1 runs a total of 354 security queries when configured with the Default suite (covering 148 CWE). The Extended suite enables an additional 109 queries (covering 30 more CWE). 1 security query has been added with this release.
CodeQL CLI¶
Breaking Changes¶
- Pack installation using the CodeQL Packaging beta will now fail if a compatible version cannot be found. This replaces the previous behavior where
codeql pack download
and related commands would instead install the latest version of the pack in this situation.
Bug Fixes¶
- It is no longer an error to call
codeql pack create <path>
with a<path>
option pointing to a file name. The CLI will walk up the directory tree and run the command in the first directory containing theqlpack.yml
orcodeql-pack.yml
file. - Fixed a concurrency error observed when using
codeql database import
orcodeql database finalize
with multiple threads and multiple additional databases on a C++ codebase.
Deprecations¶
- The
--[no-]count-lines
option tocodeql database create
and related commands is now deprecated and will be removed in a future release of the CodeQL CLI (earliest 2.12.0). It is replaced by--[no-]calculate-baseline
to reflect the additional baseline information that is now captured as of this release.
New Features¶
Subcommands that compile QL accept a new
--no-release-compatibility
option. It does nothing for now, but in the future it will be used to control a trade-off between query performance and compatibility with older/newer releases of the QL evaluator.codeql database analyze
and related commands now support absolute paths containing the@
or:
characters when specifying which queries to run. To reference a query file, directory, or suite whose path contains a literal@
or:
, prefix the query specifier withpath:
, for example:codeql database analyze --format=sarif-latest --output=results <db> path:C:/Users/ci/workspace@2/security/query.ql
Query Packs¶
Minor Analysis Improvements¶
C/C++¶
- The alert message of many queries have been changed to better follow the style guide and make the message consistent with other languages.
C#¶
- The alert message of many queries have been changed to better follow the style guide and make the message consistent with other languages.
Java/Kotlin¶
- The alert message of many queries have been changed to better follow the style guide and make the message consistent with other languages.
PathSanitizer.qll
has been promoted from experimental to the main query pack. This sanitizer was originally submitted as part of an experimental query by @luchua-bc.- The queries
java/path-injection
,java/path-injection-local
andjava/zipslip
now use the sanitizers provided byPathSanitizer.qll
.
Ruby¶
- The
rb/xxe
query has been updated to add the following sinks for XML external entity expansion:- Calls to parse XML using
LibXML
when itsdefault_substitute_entities
option is enabled. - Uses of the Rails methods
ActiveSupport::XmlMini.parse
,Hash.from_xml
, andHash.from_trusted_xml
whenActiveSupport::XmlMini
is configured to useLibXML
as its backend, and itsdefault_substitute_entities
option is enabled.
- Calls to parse XML using
Language Libraries¶
Minor Analysis Improvements¶
C#¶
DateTime
expressions are now considered simple type sanitizers. This affects a wide range of security queries.- ASP.NET Core controller definition has been made more precise. The amount of introduced taint sources or eliminated false positives should be low though, since the most common pattern is to derive all user defined ASP.NET Core controllers from the standard Controller class, which is not affected.
Golang¶
- Added support for
BeegoInput.RequestBody
as a source of untrusted data.
Java/Kotlin¶
- Added external flow sources for the intents received in exported Android services.
JavaScript/TypeScript¶
- Several of the SQL and NoSQL library models have improved, leading to more results for the
js/sql-injection
query, and in some cases thejs/missing-rate-limiting
query.
Python¶
- Added the ability to refer to subscript operations in the API graph. It is now possible to write
response().getMember("cookies").getASubscript()
to find code likeresp.cookies["key"]
(assumingresponse
returns an API node for response objects). - Added modeling of creating Flask responses with
flask.jsonify
.
Ruby¶
- The following classes have been moved from
codeql.ruby.frameworks.ActionController
tocodeql.ruby.frameworks.Rails
:ParamsCall
, now accessed asRails::ParamsCall
.CookieCall
, now accessed asRails::CookieCall
.
- The following classes have been moved from
codeql.ruby.frameworks.ActionView
tocodeql.ruby.frameworks.Rails
:HtmlSafeCall
, now accessed asRails::HtmlSafeCall
.HtmlEscapeCall
, now accessed asRails::HtmlEscapeCall
.RenderCall
, now accessed asRails::RenderCall
.RenderToCall
, now accessed asRails::RenderToCall
.
- Subclasses of
ActionController::Metal
are now recognised as controllers. ActionController::DataStreaming::send_file
is now recognized as aFileSystemAccess
.- Various XSS sinks in the ActionView library are now recognized.
- Calls to
ActiveRecord::Base.create
are now recognized as model instantiations. - Various code executions, command executions and HTTP requests in the ActiveStorage library are now recognized.
MethodBase
now has two new predicates related to visibility:isPublic
andisProtected
. These hold, respectively, if the method is public or protected.