WSTG-v42-INPV-05 / GUIDANCE

Testing for SQL Injection

SQL injection testing checks if it is possible to inject data into the application so that it executes a user-controlled SQL query in the database. Testers find a SQL injection vulnerability if the application uses user input to create SQL queries without proper input validation. A successful exploitation of this class of vulnerability allows an unauthorized user to access or manipulate data in the database. An SQL injection attack consists of insertion or "injection" of either a partial or complete SQL query via the data input or transmitted from the client (browser) to the web application. A successful SQL injection attack can read sensitive data from the database, modify database data (insert/update/delete), execute administration operations on the database (such as shutdown the DBMS), recover the content of a given file existing on the DBMS file system or write files into the file system, and, in some cases, issue commands to the operating system. SQL injection attacks are a type of injection attack, in which SQL commands are injected into data-plane input in order to affect the execution of predefined SQL commands. In general the way web applications construct SQL statements involving SQL syntax written by the programmers is mixed with user-supplied data. Example: select title, text from news where id=$id In the example above the variable $id contains user-supplied data, while the remainder is the SQL static part supplied by the programmer; making the SQL statement dynamic. Because the way it was constructed, the user can supply crafted input trying to make the […]

Category
OWASP assurance
Version / scope
OWASP WSTG pinned commit dd33419
Affected / relevant technologies
Web applications
Evidence
Documentation: pinned-source excerpt checked. Execution: not tested. Editorial: curated reference.

Defensive analysis and explicitly authorized assessment only. This website performs no scans, exploitation, model calls or infrastructure changes. Indicators below are investigation opportunities, not proof of compromise or guaranteed detectors.

Mechanism and prerequisites

Apply only to authorized systems and select the relevant scope and verification level. This publisher reference is not evidence of a completed assessment.

Potential impact

The publisher describes a verification objective; applicability does not establish a local defect or a compliance result.

Versioned source scope

This record contains normalized, sometimes shortened source excerpts with editorial safety context. Markup and executable example blocks are omitted. Source-field verification does not establish device testing, a working detector or local applicability.

Publisher: OWASP. Release: OWASP WSTG pinned commit dd33419. Source checked: 2026-11-18.

Source object: document/4-Web_Application_Security_Testing/07-Input_Validation_Testing/05-Testing_for_SQL_Injection.md.

Attribution and source terms (OWASP contributors · CC BY-SA 4.0)

Detection and investigation

Preserve source timestamps, asset identity and collection context. Correlate independent evidence before attributing malicious intent. In OT, review passive evidence with the process owner; do not induce failures, replay commands or write to controllers to test a hypothesis.

Mitigation and response

Apply changes through the asset owner's approved change and recovery process. Documentation review is separate from successful testing or verified production protection.

Related technical context

No protocol-specific mapping is asserted for this entry.

Authoritative sources and attribution

Identifiers and source titles belong to OWASP, MITRE, the CVE Program, CISA, NIST or the cited vendor. Source excerpts are attributed and adapted under the linked publisher license; editorial context is separate. This is not an official framework mirror. Review baseline: 2026-11-18. Live documents can change; check exact current applicability.

Source review supports bounded reference text. It is not execution evidence, a completeness claim, a CVSS assessment, a compliance certification or verification of production security.