CodeQL
CodeQL treats code as data so you can query it for vulnerabilities; it powers GitHub code scanning and is free for open-source research (see licence terms).
Legal & ethical use. Use this tool only on systems, networks and data that you own or have explicit written permission to test. Unauthorised access or scanning can break computer-misuse laws (for example Pakistan's Prevention of Electronic Crimes Act, 2016, and equivalents elsewhere). Practise in your own lab or in authorised environments such as CTFs.
What it is used for
- Find vulnerabilities in open-source projects
- Write custom queries for recurring bug patterns
Key features
- Query language over a code database
- Large query packs
- GitHub Actions integration
Installation
Use the CodeQL CLI bundle from the docs or enable code scanning in GitHub.
Beginner usage guide
Create a database from a small project and run the standard security query pack.
Example commands
Run these only against your own lab or authorised targets. Placeholder addresses such as 192.0.2.x are documentation ranges.
Create a database (docs)
codeql database create db --language=python --source-root=.Builds a CodeQL database for the project in the current directory.
References
Source verification
Last reviewed: 2026-10-27
Links checked over HTTP: 2026-10-27 07:51 UTC — official: 200, docs: 200, repo: 200
Commands were written from the official documentation and have not been executed on this site; test them in your lab.
