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

WebOTG-CI-001 — Injection Security Review

A structured procedure for identifying, reproducing, remediating and verifying injection vulnerabilities where untrusted data is interpreted as part of a command, query, expression or instruction by a downstream interpreter.

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

Objective

What are we verifying?

Verify that untrusted application input cannot alter the intended structure or meaning of commands, queries, expressions or instructions executed by downstream interpreters.

Injection occurs when an application constructs an interpreter-facing instruction from data that is not adequately separated from the instruction itself.

The assessment therefore focuses on the boundary between data and instructions. A vulnerability exists when attacker-controlled data can cross that boundary and influence the structure or execution of the interpreted operation.

02 / SCOPE

Scope

Review application inputs that reach interpreters or interpreter-like components, including:

SQL queries and database filters
NoSQL queries and database operators
Operating-system commands
LDAP queries
XPath and XML query expressions
Template and expression languages
Dynamic evaluation mechanisms
Search and filtering languages
Application-specific interpreters
API parameters passed to downstream services
03 / PREREQUISITES

Prerequisites

Authorization Confirm authorization to perform active security testing against the application and its dependent services.
Application map Identify forms, APIs, parameters, headers, cookies, uploads and other user-controlled inputs.
Test accounts Prepare authorized accounts and test data appropriate to the application's roles and workflows.
Technology inventory Identify relevant database engines, operating-system interfaces, frameworks, templating engines and external services.
Test environment Prefer a controlled environment for injection testing, particularly where successful execution could modify data or invoke operating-system functionality.
04 / METHODOLOGY

Methodology

Injection testing should begin by identifying where application-controlled data crosses into an interpreter. Testing should then determine whether the application's construction method preserves the intended separation between data and instructions.

Review stage Primary question
Input discovery Which attacker-controlled values reach interpreter-facing functionality?
Sink identification Which database, command processor, expression engine or parser consumes the value?
Construction analysis Is data safely separated from the interpreter instruction?
Behavioral testing Does controlled input change the intended behavior of the operation?
Impact analysis What security boundary or data integrity property could be affected?
Remediation verification Does the fix eliminate the interpreter influence rather than merely blocking one known payload?
05 / PROCEDURE

Test procedure

01
Discover input surfaces Identify query parameters, request bodies, headers, cookies, path segments, file metadata and other attacker-controlled values.
02
Identify interpreter sinks Determine whether input reaches a database, operating-system command, template engine, expression evaluator or another parser.
03
Establish a safe baseline Record normal application behavior using valid, authorized input.
04
Apply controlled input variations Modify one input at a time using non-destructive test values appropriate to the suspected interpreter.
05
Compare application behavior Compare responses, status codes, timing, errors, result sets and other observable behavior against the baseline.
06
Confirm interpreter influence Establish that the observed difference is caused by interpretation of attacker-controlled data and not merely by ordinary input validation.
07
Determine security impact Assess whether the behavior permits unauthorized data access, modification, authentication bypass, command execution or another security-impacting outcome.
08
Document and reproduce Record the smallest reliable test case that demonstrates the issue without causing unnecessary impact to the target system.
06 / INPUT MAPPING

Input and sink mapping

Do not test every parameter blindly. First determine whether the value actually reaches an interpreter-sensitive operation.

Input source Potential sink Review focus
Search parameter Database query Query construction and parameter binding
File name OS command Shell invocation and argument separation
Filter object NoSQL query Operator injection and type handling
Template value Template engine Context and evaluation behavior
Directory or lookup field LDAP / XPath Query construction and escaping strategy
07 / SQL INJECTION

SQL injection

SQL injection should be assessed wherever user-controlled data is incorporated into SQL statements without reliable parameterization or equivalent safe query construction.

Identify database-backed input parameters.
Establish the normal query behavior.
Test controlled syntax-sensitive input.
Compare response behavior with a safe baseline.
Determine whether the application is constructing SQL from untrusted data.
Verify parameterized queries or an equivalent safe query mechanism where appropriate.

Preferred construction model

Conceptual example SAFE PATTERN
SELECT id, name
FROM users
WHERE username = ?
Escaping alone is not the preferred general defense

Character escaping is context-sensitive and easy to implement incorrectly. Parameterized queries should normally be preferred because they preserve the separation between query structure and data.

08 / NOSQL INJECTION

NoSQL injection

NoSQL injection can occur when untrusted input is interpreted as query operators, expressions or other database-specific structures instead of being treated strictly as application data.

TYPE CONFUSION

Determine whether an input expected to be a scalar value can instead be supplied as an object, array or other unexpected type.

QUERY OPERATORS

Determine whether user input can introduce database-specific operators into a query.

FILTER CONSTRUCTION

Verify that application-controlled query structure is separated from user-controlled values.

OBJECT BINDING

Verify that request objects are explicitly mapped to permitted fields rather than directly passed to query APIs.

09 / OS COMMAND INJECTION

Operating-system command injection

Command injection occurs when attacker-controlled data can influence an operating-system command executed by the application.

Identify application functionality that invokes operating-system processes.
Determine whether a shell is unnecessarily involved.
Determine whether user input is passed as a command argument.
Verify that commands and arguments are structurally separated.
Test using harmless, controlled behavior only.
Never validate command injection with destructive commands

A proof of vulnerability does not require deleting files, changing system configuration, creating persistence or accessing unrelated data. Use a controlled, non-destructive verification method.

Preferred design

Where possible, replace shell-based operations with direct library or operating-system APIs. If process execution is unavoidable, use APIs that accept a command and arguments as separate structured values and apply strict allowlists to permitted operations.

10 / OTHER INTERPRETERS

Other injection classes

LDAP

Review directory-search filters and distinguished names constructed from untrusted input.

XPATH / XML

Review dynamically constructed XPath expressions and XML processing operations.

EXPRESSION LANGUAGES

Determine whether user-controlled expressions can be evaluated rather than treated as ordinary data.

TEMPLATE ENGINES

Determine whether untrusted input is placed into an executable template context.

GRAPH / SEARCH QUERIES

Review query construction for GraphQL, search engines and other query languages.

CUSTOM DSL

Review application-specific parsers and domain languages for unsafe interpretation of user data.

11 / REPRODUCTION

Controlled reproduction

Reproduction should demonstrate a measurable change in interpreter behavior using the smallest possible non-destructive test case.

Baseline

Normal request BASELINE
GET /search?q=normal-value HTTP/1.1
Host: application.example

Controlled variation

Test request CONTROLLED
GET /search?q=<controlled-test-input> HTTP/1.1
Host: application.example

Compare the result with the baseline. A difference alone is not sufficient to establish injection. The tester must determine that the input influenced the interpreter rather than simply triggering normal validation or application error handling.

Avoid payload-driven testing

Do not define a finding merely because a known injection string produces an error. The professional test is to establish the data-to-instruction boundary, demonstrate interpreter influence and assess the resulting security impact.

12 / ASSESSMENT

Assessment

Condition Assessment consideration
Safe separation Untrusted input remains data and cannot alter interpreter structure.
Suspected injection Input produces interpreter-sensitive behavior requiring further confirmation.
Confirmed injection Attacker-controlled data demonstrably influences the interpreter's instruction or query structure.
Exploitable injection The injection permits a security-impacting outcome such as unauthorized data access, modification or command execution.
False positive The observed behavior is caused by normal validation, error handling or another mechanism and does not demonstrate interpreter injection.
13 / FAILURE CRITERIA

Failure criteria

User-controlled data can alter the structure of an interpreter instruction.
SQL queries are constructed through unsafe string concatenation involving untrusted data.
NoSQL query operators can be introduced through uncontrolled request objects.
User input can alter an operating-system command.
An expression or template supplied by an untrusted party is evaluated with excessive privileges.
A downstream parser interprets user-controlled syntax without adequate contextual controls.
Example finding INJECTION

The application constructs a database query by incorporating user-controlled search input directly into the query structure. Controlled testing demonstrates that specially constructed input changes the database operation beyond the intended search value, confirming that attacker-controlled data is being interpreted as part of the query.

14 / REMEDIATION

Remediation

  1. Prefer parameterized queries or prepared statements for SQL database operations.
  2. Use structured database APIs that keep query operators separate from user-controlled values.
  3. Avoid invoking a shell when a direct operating-system or library API can perform the required operation.
  4. When process execution is unavoidable, pass command arguments using structured process APIs rather than concatenating shell commands.
  5. Apply strict allowlists to operations that must be selected from a finite set of permitted actions.
  6. Use context-specific escaping only where the relevant interpreter requires it and where parameterization is unavailable.
  7. Do not rely on generic input filtering as the primary defense against injection.
  8. Validate input types and expected structure before constructing downstream operations.
  9. Apply least privilege to database accounts and operating-system processes so that a successful injection has limited impact.
  10. Centralize secure data-access patterns and prohibit unsafe query construction through development standards and code review.
Input validation is not a substitute for parameterization

A blocklist containing known metacharacters or previously observed payloads is not a robust general defense. Injection prevention should primarily preserve the structural separation between trusted instructions and untrusted data.

15 / VERIFICATION

Post-remediation verification

01
Reproduce the original condition Repeat the smallest controlled test case that previously demonstrated interpreter influence.
02
Confirm data remains data Verify that the same input is treated solely as application data and cannot modify interpreter structure.
03
Test alternate input locations Review equivalent parameters, APIs, headers, batch functions and other paths that may use the same vulnerable sink.
04
Verify negative cases Confirm that malformed and unexpected input is handled safely without producing interpreter execution.
05
Verify least privilege Confirm that database and operating-system privileges remain appropriately restricted.
06
Verify legitimate functionality Confirm that normal application searches, transactions and workflows continue to function.
PASS

User-controlled input remains data and cannot alter the structure or execution of the relevant interpreter operation.

FAIL

The original injection or an equivalent interpreter influence remains reproducible.

NOT TESTED

The relevant interpreter sink or remediation could not be adequately evaluated.

16 / EVIDENCE

Evidence requirements

Affected endpoint or application function
Affected parameter or input source
Interpreter or downstream component
Normal baseline request and response
Controlled reproduction request and response
Evidence demonstrating interpreter influence
Security impact assessment
Remediation implementation evidence
Post-remediation reproduction attempt
Final PASS / FAIL determination
Minimize injection evidence

Evidence should demonstrate the vulnerability without unnecessarily extracting data, modifying records, executing destructive commands or accessing unrelated systems.

17 / CLASSIFICATION

Classification

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

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

18 / REFERENCES

References

Source Relevance
OWASP Top 10:2025 — A05 Primary category definition for Injection.
OWASP Web Security Testing Guide Injection testing methodology and application security testing guidance.
OWASP SQL Injection Prevention Cheat Sheet Guidance for preventing SQL injection through parameterized queries and safe database access patterns.
OWASP Command Injection Defense Guidance for preventing operating-system command injection.
CWE Common weakness classifications for injection-related vulnerabilities.

WebOTG should maintain authoritative source references, document versions and review dates through its content management system so that this procedure can be updated independently from application code.