Bug class · Intermediate
SQL injection
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.
- disclosed reports
- 1,659
- median public bounty
- $1,750
How it works
Full lessonThe pattern behind every report in this class.
SQL injection is a flaw where user input reaches a database query without being properly separated from the query's structure. The evidence shows it recurring across URL parameters, path segments, search boxes, login fields, headers, JSON bodies and GraphQL arguments, on targets ranging from government sites to WordPress plugins and enterprise appliances. Programs care because a confirmed injection can expose or alter the whole database, and in several reports it was chained to command execution or file writes.
The root cause is almost always the same: input is concatenated into a statement instead of being bound as a parameter, or a library, ORM or connector fails to escape it. The evidence includes raw concatenation, bad escaping in database libraries, unsafe alias and connector handling, and ORM methods that accept raw fragments. It also shows that defences such as WAFs and input filters are often incomplete, so a blocked payload does not mean the endpoint is safe.
Where it turns up most often in this evidence: ordinary request parameters on new targets, numeric identifiers in URL paths, search boxes and search APIs, login and password reset fields, sort and order parameters, WordPress plugin handlers, legacy CGI scripts, and known vulnerable appliances. The typical fix is parameterised queries everywhere, including dynamic fragments such as ORDER BY and aliases, plus patching known CVEs.
A query is built by joining fixed SQL text with user input. If the input contains characters that change the query's meaning, the database executes a different statement than the developer intended. The evidence shows this happening when parameters, path values, JSON keys, headers and GraphQL arguments are inserted directly into queries.
Things to try
All 475Each line worked in a disclosed report. Test only what a program's scope allows.
WAF bypass and filter evasion 187
- Work around input length filters to still dump the database.
- Remove client-side length limits on identifier fields and inject into them.
- When requests are encrypted client-side, reverse the encryption in the client and automate injection testing against the decrypted request.
- Test parameters on Google BigQuery for injection and WAF bypass.
Other 44
- Test basic request parameters for SQL injection as a starting point on any new target.
- Test several parameters by hand in a repeater tab rather than relying only on a scanner.
- Test parameters on DoD sites for injection, including blind and time-based variants.
- Test parameters on Eternal and Zomato for injection.
CMS and third-party software CVEs 29
- Test parameters on Concrete5 search endpoints for time-based injection.
- Test parameters on file transfer services for known CVE injection.
- Test parameters on Moodle installations for blind injection and broken access control.
- Test parameters on MOVEit Transfer for known CVE injection.
JSON body and API parameters 19
- Test an email check API for unauthenticated Oracle injection.
- Send POST requests to an unauthenticated items endpoint and test its parameters for injection.
- Test JSON body parameters for boolean-based injection by comparing true and false responses.
- Test acctid parameters on comment and import endpoints for time-based injection.
Blind and time-based confirmation 16
- Use blind and timing-based techniques against a search box whose terms are split on whitespace before reaching the query.
- Test search pages ending in .aspx for blind SQL injection through their query parameters.
- Test an identifier string parameter in a bibliography search CGI for blind injection.
- Test a training course search API for blind injection.
Bypasses and variations
All 309- Try unusual encodings and syntax variations against a leading WAF before exploiting the injection.
- Use a tamper script to encode payloads past a WAF.
- Use double encoding to get past a WAF.
- Use case variation and comments to get past a WAF.
- Use alternative syntax when commas are filtered.
- Use UNION with a WAF bypass to extract data.
Typical fixes
All 30- Use parameterised queries and prepared statements for all database access, including bound parameters for every piece of user input.
- Fix parameter escaping in database libraries, including the WordPress DB class prepare method.
- Parameterise or sanitise URL path values before they reach SQL queries.
- Quote and validate aliases before they reach generated SQL.
- Escape user input before building Solr queries.
- Patch MOVEit Transfer against CVE-2023-36934.
Tips for beginners
All 13- Start with simple request parameters on a new target, including search boxes, lookup forms and numeric identifiers in the URL path. The evidence shows these are common entry points and are often overlooked in favour of login pages.
- Test login username fields, password reset username fields and forgotten password forms. The evidence records injections in these fields, including time-based confirmation in a login request.
- Do not ignore sort and order parameters. The evidence shows ORDER BY clauses and ORM ordering methods accepting raw fragments, and conditional delays placed in sort parameters to confirm injection.
- When error output is suppressed, use time-based tests and repeat them with shorter delays to rule out network jitter. The evidence describes confirming delays that scale with the supplied value before automating extraction.
- Compare true and false conditions in search fields and JSON bodies, watching status codes and response lengths. The evidence shows this working where scanners failed and where the search term was split before reaching the query.
- Test headers and less obvious inputs such as the User-Agent, Referer, cookies and custom headers. The evidence records injections in these locations, confirmed with time delays.
Start here: a reading path
Open the pathClear reports in order, easiest first.
-
1
Bypassing airport security via SQL injectionBeginner
Likely the username was concatenated directly into the login SQL query instead of being passed as a parameter, so input could alter the query's logic.
-
2
Milesight MilesightVPN requestHandlers.js LoginAuth SQL injection vulnerabilityBeginner
The SQL query is built by concatenating user input directly into the string instead of using a prepared statement.
-
3
[query-mysql] SQL Injection due to lack of user input sanitization allows to run arbitrary SQL queries when fetching data from databaseBeginner
The module constructs SQL queries by concatenating user-supplied values directly into the query string without escaping or parameterisation.
-
4
I Asked PostgreSQL a Question It Wasn’t Supposed to AnswerBeginner
The application concatenated the user-supplied category value directly into a SQL query instead of using parameterised queries.
-
5
Taking over 60k spyware user accounts with SQL injectionBeginner
Likely the application built SQL queries by directly inserting user-supplied input (the imei parameter) without proper sanitisation or parameterised queries.
-
6
SQL-Injektion in Hafenverwaltung YABOOK erlaubt Umgehung der AuthentisierungBeginner
Likely the application concatenated user input directly into the SQL login query instead of using parameterised queries, so crafted input altered the query logic.
-
7
Secure Code Audit 01: A Login and Avatar Upload in PHPBeginner
The code passes untrusted user input directly into SQL, file system paths, and include statements without validation, sanitisation, or encoding.
-
8
coTURN Administrator Web Portal SQL injection vulnerabilityBeginner
The username from the login request is inserted into an SQL statement without sanitisation or parameterisation.
Guides and techniques
View allThe best explainers, cheat sheets and technique posts on SQL injection, from around the web.
-
NoSQLi: A complete guide to exploiting advanced NoSQL injection vulnerabilitiesComprehensive guide to NoSQL injection covering operator injection, authentication bypass, time-based data extraction and server-side JavaScript execution.
Explainer intigriti.com
-
SQLi: The ultimate Bug Bounty guide to exploiting SQL injection vulnerabilitiesExplains basic and advanced SQL injection including blind, time-based and out-of-band techniques with payload tailoring advice.
Explainer yeswehack.com
-
Same Same But Different: Discovering SQL Injections Incrementally with Isomorphic SQL StatementsIntroduces isomorphic SQL statements to test injections across contexts while evading WAFs and sanitisation.
Technique spaceraccoon.dev
-
Cypher Injection ScannerA Burp extension that scans for Cypher injection in Neo4j backed applications and GraphQL endpoints.
portswigger.net
-
Getting rid of pre- and post-conditions in NoSQL injectionsSensePost shows how to remove pre and post conditions in MongoDB syntax injection to make payloads more reliable.
Technique sensepost.com
Highest paid
View allThe biggest public bounties for SQL injection.
-
SQL Injection in report_xml.php through countryFilter[] parameterCritical Valve HackerOne
$25,000 -
$20,000 -
$10,000 -
A great weekend hack(worth $8k)Write-up
$8,000 -
$6,400 -
SQLI Bug BountyWrite-up
$5,000 -
CVE-2021-38159: MOVEit Transfer SQL Injection AnalysisPalantir Public Write-up
$5,000 -
[www.zomato.com] SQLi - /php/██████████ - item_idCritical Eternal HackerOne
$4,500
Newest reports
All 1,659Most recently disclosed.
-
-
-
error based SQL injection on ████████Critical Essity HackerOne
-
SQL injection via includebanner array keys in zone-include.phpMedium Revive Adserver HackerOne
-
-
-
-
Metabase SQL Injection & UAFWrite-up
-
-
New SQL injection reports by email
Follow SQL injection and get each week's new disclosures in one short email.