WebOTG Security Testing Library ● Public reference
WebOTG
WEBOTG SECURITY TESTING PROCEDURE

WebOTG-ID-001 — Injection Security Review

A structured procedure for identifying, reproducing and remediating injection weaknesses where untrusted input is interpreted as commands, queries or instructions by an interpreter, parser or backend component.

WebOTG ID ID-001 OWASP A05:2025 Type Injection Review Method Manual + Tool-Assisted Version 1.0
01 / OBJECTIVE

Objective

What are we verifying?

Verify that untrusted input cannot alter the intended structure or meaning of commands, queries or instructions interpreted by application components.

Injection occurs when application-controlled data is incorporated into an interpreter or execution context in a way that allows the supplied data to influence the intended operation.

The vulnerability is not limited to SQL. Depending on the application architecture, injection can affect database queries, operating-system commands, directory services, template engines, expression languages, XML processors, interpreters and other execution contexts.

Input validation alone is not a universal injection defense

Allowlisting and input validation can reduce attack surface, but they should not be treated as the primary defense where a safer parameterized or structured API exists. The application should keep data separate from executable instructions.

02 / SCOPE

Scope

Review all application-controlled input that reaches an interpreter or parser, including:

URL parameters and query strings
Form fields and request bodies
HTTP headers and cookies
API parameters and JSON/XML input
File names and uploaded-file metadata
Search and filtering functionality
Database queries
Operating-system command execution
LDAP and directory-service queries
Server-side template processing
XML and expression processing
Administrative and internal interfaces
03 / PREREQUISITES

Prerequisites

Authorization Confirm authorization to test the target application and associated interfaces.
Application map Identify relevant endpoints, forms, APIs, background jobs and administrative functions.
Test account Use an appropriately authorized test account where authentication is required.
Technology information Identify databases, frameworks, template engines, operating-system interfaces and other interpreters used by the application.
Test environment Prefer a controlled non-production environment for active injection testing.
04 / METHODOLOGY

Methodology

Injection testing should establish the complete path from an attacker-controlled input to the interpreter that consumes that input.

Review stage Primary question
Source Where can an untrusted value originate?
Processing Is the value transformed, decoded, concatenated or otherwise processed?
Sink Does the value reach an interpreter, parser or execution API?
Separation Does the implementation keep data separate from executable instructions?
Runtime behavior Can controlled input alter the intended operation?
05 / PROCEDURE

Test procedure

01
Map application entry points Identify forms, API endpoints, parameters, headers, cookies and other user-controlled inputs.
02
Identify interpreter sinks Determine where application-controlled values are passed to databases, commands, templates, directory services or other interpreters.
03
Trace input flow Follow the input from its source through validation and transformation until it reaches its final execution context.
04
Review the implementation Inspect whether the application uses safe parameterization, structured APIs or other context-appropriate protections.
05
Perform controlled input testing Use non-destructive test values designed to determine whether input can change the intended interpretation of the operation.
06
Compare application behavior Compare baseline and test responses using status codes, response content, timing and other safe observable differences.
07
Confirm exploitability Determine whether the observed behavior demonstrates actual interpreter manipulation rather than a generic application error.
08
Document the result Record the affected input, execution context, evidence, impact and remediation requirement.
06 / INPUT MAPPING

Input and sink mapping

A professional assessment should maintain a traceable relationship between an input source and the interpreter that ultimately consumes it.

Source Potential sink
search parameter Database query
filename parameter Operating-system command or file-processing operation
User search/filter input SQL, NoSQL or search-engine query
User-controlled template value Server-side template engine
Directory search field LDAP or directory query
XML input XML parser or expression processor
The sink determines the defense

There is no single generic "sanitize the input" solution for injection. SQL parameterization, OS command APIs, LDAP escaping, template isolation and XML parser configuration address different execution contexts.

07 / INJECTION TYPES

Injection classes

SQL INJECTION

Untrusted input changes the structure or behavior of a relational database query.

NOSQL INJECTION

Application input changes the structure or semantics of a NoSQL database operation.

OS COMMAND INJECTION

Application-controlled input influences an operating-system command or shell execution context.

LDAP INJECTION

Untrusted values alter the structure or semantics of a directory-service query.

TEMPLATE INJECTION

Attacker-controlled data is interpreted as template instructions rather than ordinary data.

EXPRESSION INJECTION

User-controlled content reaches an expression language or interpreter that can evaluate unintended instructions.

XML / PARSER INJECTION

Crafted input manipulates a parser or structured processing context in an unintended manner.

OTHER INTERPRETERS

Any execution context where untrusted data can cross the boundary between data and instructions.

08 / REPRODUCTION

Controlled reproduction

Reproduction should demonstrate the security property being violated without causing unnecessary damage to the target system or its data.

Baseline request

HTTP request BASELINE
GET /products?search=example HTTP/1.1
Host: application.example
Accept: application/json

Controlled test input

Test concept NON-DESTRUCTIVE
GET /products?search=[controlled-test-value]
HTTP/1.1

Observe:

- HTTP status
- Response structure
- Error behavior
- Result-set changes
- Timing differences
- Application logs, where authorized
Do not use destructive payloads against production systems

WebOTG procedures should prioritize controlled, non-destructive verification. Do not delete data, alter production records, execute arbitrary commands, extract unrelated information or intentionally disrupt availability merely to demonstrate a finding.

Confirming the finding

A reliable injection finding normally requires more than seeing a database error. The tester should establish that the input changes interpreter behavior in a way that is attributable to the tested parameter.

Baseline behavior has been recorded.
Test input reaches the suspected execution context.
A repeatable behavioral difference is observed.
The difference is attributable to interpreter manipulation rather than a generic application error.
The test can be reproduced safely.
09 / ASSESSMENT

Assessment

Condition Assessment consideration
Safe parameterization User-controlled values remain data and cannot alter interpreter structure.
Unsafe concatenation User input is directly combined with an executable query or command.
Incomplete validation Validation can be bypassed or is not appropriate for the execution context.
Unsafe interpreter API The application uses an execution API that unnecessarily interprets user-controlled content.
Confirmed manipulation Controlled input demonstrably changes the intended interpreter behavior.
Error messages are evidence, not proof by themselves

A verbose database or interpreter error may indicate an injection risk, but it does not automatically prove that attacker-controlled input can alter execution. Reproducibility and causal evidence are required.

10 / FAILURE CRITERIA

Failure criteria

Untrusted input can alter the structure of a database query.
Untrusted input can modify the semantics of a NoSQL query or filter.
User-controlled input reaches an operating-system command execution context without appropriate separation.
User-controlled data can become executable template or expression instructions.
Directory-service queries are constructed in a manner that permits query manipulation.
Structured input is processed by an unsafe parser or interpreter in a way that permits unintended execution or interpretation.
The application relies solely on weak blacklist filtering where a safer context-specific defense is available.
Example finding INJECTION

A user-controlled search parameter is incorporated into a database query through unsafe string construction. Controlled test input produces a repeatable change in query behavior, demonstrating that the parameter can influence the structure of the database operation.

11 / REMEDIATION

Remediation

The preferred remediation is to eliminate the interpreter boundary where possible or use an API that maintains strict separation between data and executable instructions.

General controls

  1. Use parameterized queries for relational database operations.
  2. Use safe, structured APIs for NoSQL databases.
  3. Avoid shell invocation when an equivalent direct API exists.
  4. If command execution is unavoidable, use a restricted argument interface and strict allowlisting appropriate to the application.
  5. Use context-specific encoding or escaping where required by the interpreter.
  6. Apply allowlist validation to values with a clearly defined business format.
  7. Avoid dynamically constructing executable template or expression content from untrusted input.
  8. Use safe parser configurations for structured formats.
  9. Apply least privilege to database and service accounts so that an injection flaw has reduced impact.
  10. Do not rely on client-side validation as a security boundary.

SQL parameterization example

PHP / mysqli SAFE PATTERN
$stmt = $db->prepare(
    "SELECT id, name
     FROM products
     WHERE name = ?"
);

$stmt->bind_param("s", $search);

$stmt->execute();
Do not escape SQL strings as a substitute for parameterization

Manual escaping is error-prone and context-dependent. Where parameterized queries are supported, they should be the default approach.

12 / VERIFICATION

Post-remediation verification

01
Reproduce the original condition Repeat the same controlled test that previously demonstrated the injection behavior.
02
Confirm interpreter separation Verify through source review, runtime behavior or both that user input is treated as data rather than executable instructions.
03
Repeat relevant variations Test appropriate equivalent inputs to ensure the fix is not limited to a single observed payload or request format.
04
Verify authorization boundaries Confirm that the database, command or service account still operates with the intended minimum privileges.
05
Verify application functionality Confirm that legitimate application behavior continues to work after the remediation.
PASS

Controlled input remains data and cannot alter the intended interpreter operation.

FAIL

Controlled input can still influence interpreter structure or execution.

NOT TESTED

The injection behavior could not be adequately evaluated with the available access or evidence.

13 / EVIDENCE

Evidence requirements

Affected endpoint or application function
Input parameter or data source
Baseline request and response
Controlled test request and response
Relevant source-code or configuration evidence
Interpreter or backend technology involved
Reproducibility evidence
Security impact
Remediation evidence
Post-remediation verification
Evidence must not contain unrelated sensitive data

Redact authentication tokens, passwords, personal information, database credentials, private records and other unrelated sensitive information from screenshots, HTTP captures and source-code excerpts.

14 / CLASSIFICATION

Classification

WebOTG procedure WebOTG-ID-001
OWASP category A05:2025 — Injection
Procedure type Injection vulnerability assessment
Assessment result PASS / FAIL / NOT TESTED
Finding severity Determine according to the affected interpreter, privileges available, accessible data or functionality, exploitability and resulting impact.
WebOTG classification notice

WebOTG-ID-001 is a WebOTG-defined verification procedure. The identifier is not an OWASP-defined test identifier.

15 / REFERENCES

References

Source Relevance
OWASP Top 10:2025 — A05 Primary category definition for Injection.
OWASP Web Security Testing Guide Testing guidance for injection and interpreter-related vulnerabilities.
OWASP Application Security Verification Standard Verification requirements relating to input handling and injection prevention.
CWE-89 Improper Neutralization of Special Elements used in an SQL Command.
CWE-78 Improper Neutralization of Special Elements used in an OS Command.
CWE-90 Improper Neutralization of Special Elements used in an LDAP Query.

WebOTG should maintain the authoritative source references, document versions and review dates through its content management system rather than embedding mutable reference information into application logic.