CodeQL query help for Go¶
Visit the articles below to see the documentation for the queries included in the following query suites:
default: queries run by default in CodeQL code scanning on GitHub.security-extended: queries fromdefault, plus extra security queries with slightly lower precision and severity.security-and-quality: queries fromdefault,security-extended, plus extra maintainability and reliability queries.
These queries are published in the CodeQL query pack codeql/go-queries (changelog, source).
For shorter queries that you can use as building blocks when writing your own queries, see the example queries in the CodeQL repository.
- Arbitrary file access during archive extraction (”Zip Slip”)
- Arbitrary file write extracting an archive containing symbolic links
- Bad redirect check
- Bitwise exclusive-or used like exponentiation
- Clear-text logging of sensitive information
- Command built from user-controlled sources
- Comparison of identical values
- Constant length comparison
- Cookie ‘HttpOnly’ attribute is not set to true
- Cookie ‘Secure’ attribute is not set to true
- Cross-site scripting via HTML template escaping bypass
- Database query built from user-controlled sources
- Disabled TLS certificate check
- Duplicate ‘if’ branches
- Duplicate ‘if’ condition
- Duplicate switch case
- Email content injection
- Expression has no effect
- Identical operands
- Impossible interface nil check
- Incomplete URL scheme check
- Incomplete regular expression for hostnames
- Inconsistent direction of for loop
- Incorrect conversion between integer types
- Information exposure through a stack trace
- Insecure TLS configuration
- Log entries created from user input