No user-facing changes.
No user-facing changes.
No user-facing changes.
No user-facing changes.
No user-facing changes.
No user-facing changes.
No user-facing changes.
- The
go/cookie-http-only-not-setquery has been promoted from the experimental query pack. This query was originally contributed to the experimental query pack by @edvraa. - A new query
go/cookie-secure-not-sethas been added to detect cookies without theSecureflag set. - Added a new query,
go/weak-crypto-algorithm, to detect the use of a broken or weak cryptographic algorithm. A very simple version of this query was originally contributed as an experimental query by @dilanbhalla. - Added a new query,
go/weak-sensitive-data-hashing, to detect the use of a broken or weak cryptographic hash algorithm on sensitive data.
No user-facing changes.
No user-facing changes.
No user-facing changes.
No user-facing changes.
No user-facing changes.
No user-facing changes.
No user-facing changes.
No user-facing changes.
filepath.IsLocalis now recognized as a sanitizer against path-traversal and related vulnerabilities.
- The tag
qualityhas been added to multiple Go quality queries for consistency. They have all been given a tag for one of the two top-level categoriesreliabilityormaintainability, and a tag for a sub-category. See Query file metadata and alert message style guide for more information about these categories. - The tag
external/cwe/cwe-129has been added togo/constant-length-comparison. - The tag
external/cwe/cwe-193has been added togo/index-out-of-bounds. - The tag
external/cwe/cwe-197has been added togo/shift-out-of-range. - The tag
external/cwe/cwe-248has been added togo/redundant-recover. - The tag
external/cwe/cwe-252has been added togo/missing-error-checkandgo/unhandled-writable-file-close. - The tag
external/cwe/cwe-480has been added togo/mistyped-exponentiation. - The tag
external/cwe/cwe-570has been added togo/impossible-interface-nil-checkandgo/comparison-of-identical-expressions. - The tag
external/cwe/cwe-571has been added togo/negative-length-checkandgo/comparison-of-identical-expressions. - The tag
external/cwe/cwe-783has been added togo/whitespace-contradicts-precedence. - The tag
external/cwe/cwe-835has been added togo/inconsistent-loop-direction. - The tag
error-handlinghas been added togo/missing-error-check,go/unhandled-writable-file-close, andgo/unexpected-nil-value. - The tag
useless-codehas been added togo/useless-assignment-to-field,go/useless-assignment-to-local,go/useless-expression, andgo/unreachable-statement. - The tag
logichas been removed fromgo/index-out-of-boundsandgo/unexpected-nil-value. - The tags
callanddeferhave been removed fromgo/unhandled-writable-file-close. - The tags
correctnessandqualityhave been reordered ingo/missing-error-checkandgo/unhandled-writable-file-close. - The tag
maintainabilityhas been changed toreliabilityforgo/unhandled-writable-file-close. - The tag order has been standardized to have
qualityfirst, followed by the top-level category (reliabilityormaintainability), then sub-category tags, and finally CWE tags. - The description text has been updated in
go/whitespace-contradicts-precedenceto change "may even indicate" to "may indicate".
- Query (
go/html-template-escaping-bypass-xss) has been promoted to the main query suite. This query finds potential cross-site scripting (XSS) vulnerabilities when using thehtml/templatepackage, caused by user input being cast to a type which bypasses the HTML autoescaping. It was originally contributed to the experimental query pack by @gagliardetto in github/codeql-go#493.
- The query
go/hardcoded-credentialshas been removed from all query suites.
- The tag
external/cwe/cwe-20has been removed fromgo/count-untrusted-data-external-apiand the tagexternal/cwe/cwe-020has been added. - The tag
external/cwe/cwe-20has been removed fromgo/incomplete-hostname-regexpand the tagexternal/cwe/cwe-020has been added. - The tag
external/cwe/cwe-20has been removed fromgo/regex/missing-regexp-anchorand the tagexternal/cwe/cwe-020has been added. - The tag
external/cwe/cwe-20has been removed fromgo/suspicious-character-in-regexand the tagexternal/cwe/cwe-020has been added. - The tag
external/cwe/cwe-20has been removed fromgo/untrusted-data-to-external-apiand the tagexternal/cwe/cwe-020has been added. - The tag
external/cwe/cwe-20has been removed fromgo/untrusted-data-to-unknown-external-apiand the tagexternal/cwe/cwe-020has been added. - The tag
external/cwe/cwe-90has been removed fromgo/ldap-injectionand the tagexternal/cwe/cwe-090has been added. - The tag
external/cwe/cwe-74has been removed fromgo/dsn-injectionand the tagexternal/cwe/cwe-074has been added. - The tag
external/cwe/cwe-74has been removed fromgo/dsn-injection-localand the tagexternal/cwe/cwe-074has been added. - The tag
external/cwe/cwe-79has been removed fromgo/html-template-escaping-passthroughand the tagexternal/cwe/cwe-079has been added.
No user-facing changes.
No user-facing changes.
- False positives in "Log entries created from user input" (
go/log-injection) and "Clear-text logging of sensitive information" (go/clear-text-logging) which involved the verb%Tin a format specifier have been fixed. As a result, some users may also see more alerts from the "Use of constantstatevalue in OAuth 2.0 URL" (go/constant-oauth2-state) query.
No user-facing changes.
No user-facing changes.
- Added github.com/gorilla/mux.Vars to path sanitizers (disabled if github.com/gorilla/mix.Router.SkipClean has been called).
No user-facing changes.
No user-facing changes.
No user-facing changes.
- Added value flow models for functions in the
slicespackage which do not involve theiterpackage.
No user-facing changes.
No user-facing changes.
No user-facing changes.
- The precision of the
go/incorrect-integer-conversion-queryquery was decreased fromvery-hightohigh, since there is at least one known class of false positives involving dynamic bounds checking.
No user-facing changes.
No user-facing changes.
No user-facing changes.
No user-facing changes.
No user-facing changes.
No user-facing changes.
No user-facing changes.
No user-facing changes.
- CodeQL package management is now generally available, and all GitHub-produced CodeQL packages have had their version numbers increased to 1.0.0.
- The query
go/incorrect-integer-conversionhas now been restricted to only use flow through value-preserving steps. This reduces false positives, especially around type switches.
No user-facing changes.
- The query
go/incomplete-hostname-regexpnow recognizes more sources involving concatenation of string literals and also follows flow through string concatenation. This may lead to more alerts. - Added some more barriers to flow for
go/incorrect-integer-conversionto reduce false positives, especially around type switches.
No user-facing changes.
- The query "Slice memory allocation with excessive size value" (
go/uncontrolled-allocation-size) has been promoted from experimental to the main query pack. Its results will now appear by default. This query was originally submitted as an experimental query by @Malayke.
- The query
go/hardcoded-credentialsno longer discards string literals based on "weak password" heuristics. - The query
go/sql-injectionnow recognizes more sinks in the packagegithub.com/Masterminds/squirrel.
No user-facing changes.
No user-facing changes.
No user-facing changes.
- The query "Missing JWT signature check" (
go/missing-jwt-signature-check) has been promoted from experimental to the main query pack. Its results will now appear by default. This query was originally submitted as an experimental query by @am0o0.
- The query "Use of a hardcoded key for signing JWT" (
go/hardcoded-key) has been promoted from experimental to the main query pack. Its results will now appear by default as part ofgo/hardcoded-credentials. This query was originally submitted as an experimental query by @porcupineyhairs.
No user-facing changes.
- The query
go/insecure-randomnessnow recognizes the selection of candidates from a predefined set using a weak RNG when the result is used in a sensitive operation. Also, false positives have been reduced by adding more sink exclusions for functions in thecryptopackage not related to cryptographic operations. - Added more sources and sinks to the query
go/clear-text-logging.
- There was a bug in the query
go/incorrect-integer-conversionwhich meant that upper bound checks using a strict inequality (<) and comparing againstmath.MaxIntormath.MaxUintwere not considered correctly, which led to false positives. This has now been fixed.
No user-facing changes.
No user-facing changes.
No user-facing changes.
- The query
go/incorrect-integer-conversionnow correctly recognizes more guards of the formif val <= xto protect a conversionuintX(val).
- The query "Incorrect conversion between integer types" (
go/incorrect-integer-conversion) has been improved. It can now detect parsing an unsigned integer type (likeuint32) and converting it to the signed integer type of the same size (likeint32), which may lead to more results. It also treatsintanduintmore carefully, which may lead to more results or fewer incorrect results.
No user-facing changes.
No user-facing changes.
No user-facing changes.
No user-facing changes.
No user-facing changes.
No user-facing changes.
- The query "Arbitrary file write during zip extraction ("zip slip")" (
go/zipslip) has been renamed to "Arbitrary file access during archive extraction ("Zip Slip")."
No user-facing changes.
No user-facing changes.
No user-facing changes.
No user-facing changes.
- The receiver arguments of
net/http.Header.Setand.Delare no longer flagged by querygo/untrusted-data-to-external-api.
No user-facing changes.
No user-facing changes.
- The query
go/incorrect-integer-conversionnow correctly recognizes guards of the formif val <= xto protect a conversionuintX(val)whenxis in the range(math.MaxIntX, math.MaxUintX].
- Added a new query,
go/unhandled-writable-file-close, to detect instances where writable file handles are closed without appropriate checks for errors.
- The precision of the
go/log-injectionquery was decreased fromhightomedium, since it may not be able to identify every way in which log data may be sanitized. This also aligns it with the precision of comparable queries for other languages.
No user-facing changes.
- Replacing "\r" or "\n" using the functions
strings.ReplaceAll,strings.Replace,strings.Replacer.Replaceandstrings.Replacer.WriteStringhas been added as a sanitizer for the queries "Log entries created from user input". - The functions
strings.Replacer.Replaceandstrings.Replacer.WriteStringhave been added as sanitizers for the query "Potentially unsafe quoting".
- The
AlertSuppression.qlquery has been updated to support the new// codeql[query-id]supression comments. These comments can be used to suppress an alert and must be placed on a blank line before the alert. In addition the legacy// lgtmand// lgtm[query-id]comments can now also be placed on the line before an alert.
No user-facing changes.
No user-facing changes.
No user-facing changes.
- Query
go/clear-text-loggingnow excludesGetXmethods of protobufMessagestructs, except where taint is specifically known to belong to the right field. This is to avoid FPs where taint is written to one field and then spuriously read from another.
- The alert messages of many queries were changed to better follow the style guide and make the messages consistent with other languages.
No user-facing changes.
- Added the
security-severitytag and CWE tag to thego/insecure-hostkeycallbackquery.
- The alert message of many queries have been changed to make the message consistent with other languages.
- The query
go/path-injectionno longer considers user-controlled numeric or boolean-typed data as potentially dangerous.
- Added a new query,
go/unexpected-nil-value, to find calls toWrapfrompkg/errorswhere the error argument is always nil.
- Fixed sanitization by calls to
strings.Replaceandstrings.ReplaceAllin queriesgo/log-injectionandgo/unsafe-quoting.
- A new query Log entries created from user input (
go/log-injection) has been added. The query reports user-provided data reaching calls to logging methods.
- A new query "Log entries created from user input" (
go/log-injection) has been added. The query reports user-provided data reaching calls to logging methods.
- The query "Incorrect conversion between integer types" has been improved to
treat
math.MaxUintandmath.MaxIntas the values they would be on a 32-bit architecture. This should lead to fewer false positive results.