CodeQL documentation

CodeQL 2.27.5 (2026-11-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.27.5 runs a total of 499 security queries when configured with the Default suite (covering 169 CWE). The Extended suite enables an additional 131 queries (covering 32 more CWE). 1 security query has been added with this release.

CodeQL CLI

Breaking Changes

  • The C/C++ extractor no longer supports Brotli compression. Users invoking the extractor directly should replace --trap-compression=brotli or --tar-entry-compression=brotli with the corresponding zstd option. The --brotli-quality option has also been removed.

Bug Fixes

  • When choosing the default queries for a language whose extractor is found on --search-path, the CLI now uses the extractor’s default_queries property instead of codeql/<language>-queries.

  • codeql test run now accepts .qlref consistency queries passed via --consistency-queries as it already does for ordinary unit tests, and applies the same .qlref precedence: if a .ql file has a synonymous .qlref file, the .qlref file is resolved and run instead, and the .ql file is skipped.

Security Updates

  • When invoked by codeql test run, extractors for XML, YAML, and Java .properties files run in a mode that traverses the source root directory and extracts all relevant files. This mode has been updated so that it no longer follows symbolic links.

QL Language

  • The string type now has built-in member predicates startsWith(string prefix), endsWith(string suffix), and contains(string substring). These perform case-sensitive matching of literal strings, without wildcards or regular expressions. All three predicates hold for an empty argument.

Query Packs

Minor Analysis Improvements

C/C++

  • The cpp/cleartext-transmission and cpp/cleartext-storage-file queries now track flow through character types. As a result, these queries may find additional results.

  • The cpp/unused-static-variable query no longer reports compiler-generated variables, such as placeholders for empty function parameter packs.

  • The cpp/unused-local-variable and cpp/unused-static-variable queries no longer report variables whose initializers may have side effects.

  • The cpp/missing-check-scanf query produces fewer false positives when an unaliased local output variable is overwritten with a default value if a scanf-like call fails.

Golang

  • Added value flow models for functions in the maps package which do not involve the iter package.

Java/Kotlin

  • The java/local-variable-is-never-read query no longer reports unnamed variables (_), for example in case Foo _ -> patterns, for (var _ : items) loops, and var _ = ...; declarations.

JavaScript/TypeScript

  • The js/command-line-injection query now reports remote input that reaches argument arrays when the shell option is enabled. The js/shell-command-constructed-from-input query also recognizes string-valued shell paths. Both queries now handle execFile calls without a callback and check argument-array input at the execution call, avoiding alerts for later array mutations.

  • Valid arguments passed to the StorageEvent constructor no longer produce alerts from js/superfluous-trailing-arguments.

New Queries

Rust

  • Added a new query, rust/unsafe-deserialization, to detect deserialization of user-controlled data.

Language Libraries

Breaking Changes

Golang

  • The Go SSA API now uses the shared SSA classes (SsaDefinition, SsaWriteDefinition, SsaExplicitWrite, SsaParameterInit, SsaImplicitWrite, SsaUncertainWrite, and SsaPhiDefinition):

    • SsaVariable, SsaExplicitDefinition, SsaImplicitDefinition, SsaVariableCapture, SsaPseudoDefinition, and SsaPhiNode have been deprecated.

    • ControlFlow::WriteNode.definesSsaVariable, IR::WriteTarget.asSsaVariable, SsaWithFields.getBaseVariable, and DataFlow::ReadNode.readsSsaVariable have been deprecated in favor of definesSsaDefinition, asSsaDefinition, getBaseDefinition, and readsSsaDefinition, respectively.

    • SsaDefinition no longer defines getVariable(), getRoot(), or hasLocationInfo(...). Use SsaDefinition directly, getBasicBlock().getScope(), and getLocation().hasLocationInfo(...) instead.

    • SsaDefinition.getAFirstUse() is no longer available. First-use access remains available through getAFirstUse() on the deprecated SsaVariable class. DataFlow::ReadNode.readsSsaDefinition() matches all reads, not just first uses, and is not an equivalent replacement.

    • SsaDefinition.getARead() returns expression reads only. Use DataFlow::ReadNode.readsSsaDefinition() to include implicit reads, such as reads of result variables at function exit.

    • IR::TypeSwitchImplicitVariableInstruction now extends IR::WriteInstruction, with target class IR::ImplicitVariableTarget.

Minor Analysis Improvements

C#

  • Added support for data flow through property patterns in is expressions and switch cases.

Java/Kotlin

  • Added taint flow model for reactor.core.publisher.Mono<T>.

  • The java/weak-cryptographic-algorithm, java/potentially-weak-cryptographic-algorithm, and java/rsa-without-oaep queries now match cryptographic algorithm names and modes case-insensitively (for example, AES/CBC/PKCS5PADDING and AES/cbc/Pkcs5Padding).

  • Java taint-tracking queries now recognize equality and case-insensitive equality checks against fixed string constants as sanitizers. The queries java/ssrf and java/unvalidated-url-redirection also recognize checks of URI.getHost() against fixed collections of strings, including when the host is normalized to upper or lower case.

JavaScript/TypeScript

  • Checks of the form isNaN(parseInt(x)) and isNaN(parseFloat(x)) are no longer treated as checking that x is a number, since parseInt and parseFloat only validate a numeric prefix of x. This can reveal previously missed alerts, for example from js/shell-command-constructed-from-input and js/unsafe-jquery-plugin.

  • The command injection queries now properly recognize argument arrays passed to spawn and execFile as sinks when the shell option is enabled.

  • The sensitive data heuristics treat names built on trusted_schema, such as SQLite’s set_trusted_schema setting, as non-sensitive. This removes false positive results from queries that use the sensitive data library (for example js/clear-text-logging).

  • Regular expression checks using multiline (m) or unknown flags are no longer treated as generic taint sanitizers just because the pattern is anchored with ^ and $. This can reveal previously missed alerts, including command injection and reflected cross-site scripting.

  • Added modeling of the @modelcontextprotocol/sdk and @modelcontextprotocol/server (the official Model Context Protocol SDK) and fastmcp npm packages. The arguments of MCP tool, resource and prompt callbacks and the requests that handlers of the low-level Server receive are now sources of the opt-in ai threat model, as their values are produced by a language model. The request headers and the bearer token that the SDK passes to a callback are sources of the remote threat model.

  • Added flow summaries for schema parsing with the zod npm package: data now flows from the argument of parse, safeParse, parseAsync and safeParseAsync to the parsed result.

Python

  • The py/tarslip query now uses the correct argument positions and parameter names for TarFile.extract and TarFile.extractall sinks, reporting extract(member=...) calls with untrusted members and no longer falsely reporting extractall(path, members) calls when sanitized members are passed positionally.

  • Await expressions are now treated as having side effects. This prevents false positives from the “Statement has no effect” query (py/ineffectual-statement) when an awaited task or coroutine’s result is discarded.

  • The sensitive data heuristics treat names built on trusted_schema, such as SQLite’s set_trusted_schema setting, as non-sensitive. This removes false positive results from queries that use the sensitive data library (for example py/clear-text-logging-sensitive-data).

  • Added modeling of the mcp (the official Model Context Protocol SDK) and fastmcp PyPI packages. The parameters of MCP tool, resource and prompt handlers are now sources of the opt-in ai threat model, as their values are produced by a language model; the Context parameter that the SDKs inject is not a source. The HTTP headers that fastmcp handlers read through get_http_headers() or get_http_request(), and the bearer token that token verifiers (verify_token) and get_access_token() receive, are sources of the remote threat model.

  • Type tracking now works for values stored in instance attributes and read from outside the class (for example instance.attr where the value was assigned to self.attr in a method), provided the instance at the read is reachable by local flow from a resolved constructor call. This excludes, for example, instances returned by a function and module-level instances read inside a function.

Ruby

  • The sensitive data heuristics treat names built on trusted_schema, such as SQLite’s set_trusted_schema setting, as non-sensitive. This removes false positive results from queries that use the sensitive data library (for example rb/clear-text-logging-sensitive-data).

Swift

  • The sensitive data heuristics treat names built on trusted_schema, such as SQLite’s set_trusted_schema setting, as non-sensitive. This removes false positive results from queries that use the sensitive data library (for example swift/cleartext-logging).

Rust

  • The Rust AST no longer exposes ParenExpr and ParenPat nodes. Parenthesized expressions and patterns are represented by their inner entities instead.

  • The rust/access-after-lifetime-ended query now detects more accesses through pointers to struct fields created by std::ptr::addr_of! and std::ptr::addr_of_mut!.

  • The sensitive data heuristics treat names built on trusted_schema, such as SQLite’s set_trusted_schema setting, as non-sensitive. This removes false positive results from queries that use the sensitive data library (for example rust/cleartext-logging).

  • © GitHub, Inc.
  • Terms
  • Privacy