Input validation is the most critical defense in web application security. This category contains 19 tests covering every major injection attack class, from cross-site scripting and SQL injection to server-side request forgery and template injection. Each test examines a different way that untrusted user input can be weaponized to compromise the application, its users, or its underlying infrastructure. Input validation vulnerabilities consistently dominate real-world breach reports because they can lead to data theft, code execution, and complete system compromise. For penetration testers and bug bounty hunters, mastering these techniques is essential since injection vulnerabilities typically command the highest severity ratings and payouts. Cert candidates will encounter these concepts heavily in CEH, OSCP, and GWAPT examinations.
OWASP Top 10 Mapping
This testing category relates to the following OWASP Top 10 2021 categories:
Quick Reference
| Test ID | Name | CWEs | Difficulty |
|---|---|---|---|
| WSTG-INPV-01 | Reflected XSS | CWE-79 | Advanced |
| WSTG-INPV-02 | Stored XSS | CWE-79 | Advanced |
| WSTG-INPV-03 | HTTP Verb Tampering | CWE-288 | Advanced |
| WSTG-INPV-04 | HTTP Parameter Pollution | CWE-235 | Advanced |
| WSTG-INPV-05 | SQL Injection | CWE-89 | Advanced |
| WSTG-INPV-06 | LDAP Injection | CWE-90 | Advanced |
| WSTG-INPV-07 | XML Injection | CWE-611, CWE-91 | Advanced |
| WSTG-INPV-08 | SSI Injection | CWE-97 | Advanced |
| WSTG-INPV-09 | XPath Injection | CWE-643 | Advanced |
| WSTG-INPV-10 | IMAP/SMTP Injection | CWE-93 | Advanced |
| WSTG-INPV-11 | Code Injection | CWE-94 | Advanced |
| WSTG-INPV-12 | Command Injection | CWE-78 | Advanced |
| WSTG-INPV-13 | Format String Injection | CWE-134 | Advanced |
| WSTG-INPV-14 | Incubated Vulnerability | CWE-79, CWE-89 | Advanced |
| WSTG-INPV-15 | HTTP Splitting/Smuggling | CWE-113, CWE-444 | Advanced |
| WSTG-INPV-16 | HTTP Incoming Requests | CWE-20 | Advanced |
| WSTG-INPV-17 | Host Header Injection | CWE-644 | Advanced |
| WSTG-INPV-18 | SSTI | CWE-94, CWE-1336 | Advanced |
| WSTG-INPV-19 | SSRF | CWE-918 | Advanced |
Detailed Test Cases
WSTG-INPV-01: Reflected XSS
AdvancedReflected XSS testing checks if user input is immediately returned in the server's response without proper encoding. An attacker crafts a malicious URL containing JavaScript that executes in the victim's browser when they click the link, potentially stealing session tokens or performing actions on their behalf.
What to Check
- Test all URL parameters with basic XSS payloads (<script>alert(1)</script>)
- Check search fields, error messages, and any reflected input for encoding
- Test for XSS in different HTML contexts (attribute, JavaScript, CSS, URL)
- Try encoding bypass techniques (HTML entities, URL encoding, Unicode)
- Verify that Content-Type headers and Content-Security-Policy prevent execution
WSTG-INPV-02: Stored XSS
AdvancedStored XSS testing checks if user input is saved by the application (in a database, file, or cache) and later displayed to other users without proper encoding. Unlike reflected XSS, stored XSS does not require victim interaction with a malicious link since the payload is served from the application itself.
What to Check
- Test all user-input fields that store and display data (comments, profiles, messages)
- Check file upload names and metadata for XSS in filenames displayed on the page
- Test rich text editors for XSS through HTML/Markdown input
- Verify that stored data is encoded when displayed in all contexts
- Check administrative panels that display user-submitted data
WSTG-INPV-03: HTTP Verb Tampering
AdvancedHTTP verb tampering tests whether changing the HTTP method (GET, POST, PUT, HEAD, etc.) on a request can bypass security controls. Some applications and middleware only enforce authentication or authorization on specific HTTP methods, leaving others unprotected.
What to Check
- Replay protected requests using different HTTP methods (GET, POST, PUT, PATCH, DELETE)
- Test if changing the method bypasses authentication or authorization checks
- Check if the application responds differently to unexpected HTTP methods
- Test for method override using X-HTTP-Method-Override header
- Verify that security controls apply uniformly across all HTTP methods
WSTG-INPV-04: HTTP Parameter Pollution
AdvancedHTTP Parameter Pollution (HPP) testing checks how the application handles duplicate parameters in the same request. Different web servers and frameworks handle duplicate parameters differently (first value, last value, concatenated, or array), which can be exploited to bypass validation or manipulate application logic.
What to Check
- Submit duplicate parameters with the same name but different values
- Test how the application and server handle duplicate parameters (first wins, last wins, concat)
- Try splitting injection payloads across duplicate parameters
- Test HPP in query strings, POST body, and cookies simultaneously
- Check if WAF rules can be bypassed through parameter pollution
WSTG-INPV-05: SQL Injection
AdvancedSQL injection testing checks whether user input is incorporated into SQL queries without proper parameterization or sanitization. Successful SQL injection can read, modify, or delete database contents, bypass authentication, and in some cases execute operating system commands.
What to Check
- Test all input parameters with SQL metacharacters (single quote, double quote, semicolon)
- Check for error-based, union-based, blind, and time-based SQL injection techniques
- Test numeric, string, and wildcard parameter types
- Look for second-order SQL injection where stored input is used in later queries
- Test for SQL injection in HTTP headers, cookies, and JSON/XML request bodies
WSTG-INPV-06: LDAP Injection
AdvancedLDAP injection testing checks whether user input is used in LDAP queries without proper sanitization. LDAP (Lightweight Directory Access Protocol) is commonly used for authentication and directory lookups in enterprise environments, and injection can bypass authentication or extract directory data.
What to Check
- Test login and search fields with LDAP metacharacters (*, (, ), \, NUL)
- Try authentication bypass using LDAP injection (e.g., user=*)(uid=*)(&password=anything)
- Test for information extraction by manipulating LDAP filter expressions
- Check if the application uses parameterized LDAP queries or string concatenation
- Test for both AND-based and OR-based LDAP injection techniques
WSTG-INPV-07: XML Injection
AdvancedXML injection testing checks whether user input is embedded in XML documents without proper encoding, allowing attackers to modify XML structure. This includes XML External Entity (XXE) attacks that can read files, perform SSRF, or cause denial of service.
What to Check
- Test for XML External Entity (XXE) injection to read local files
- Check for blind XXE using out-of-band data exfiltration techniques
- Test XML input for entity expansion denial of service (billion laughs)
- Verify that XML parsers have external entity processing disabled
- Test SOAP endpoints for XML injection in parameters
WSTG-INPV-08: SSI Injection
AdvancedServer-Side Includes (SSI) injection testing checks whether user input is processed by the SSI engine, allowing attackers to inject SSI directives that execute commands, include files, or display server information. SSI is a legacy technology still found in some web servers.
What to Check
- Test input fields with SSI directives (<!--#exec cmd="command" -->)
- Check if .shtml or .stm file extensions are processed for SSI
- Test for SSI injection in file upload names and content
- Verify that the web server is configured to only process SSI in designated file types
- Check error pages and dynamic content for SSI processing
WSTG-INPV-09: XPath Injection
AdvancedXPath injection testing checks whether user input is used in XPath queries against XML data stores without proper sanitization. Similar to SQL injection but targeting XML databases, XPath injection can bypass authentication and extract data from XML documents.
What to Check
- Test input fields with XPath metacharacters (single quote, double quote, //, ..)
- Try authentication bypass with tautology-based XPath injection (1=1)
- Test for blind XPath injection using boolean conditions and substring extraction
- Check if the application uses XML databases or XPath for data retrieval
- Verify that XPath queries use parameterized expressions rather than concatenation
WSTG-INPV-10: IMAP/SMTP Injection
AdvancedIMAP/SMTP injection testing checks whether user input is incorporated into email-related commands without sanitization. This can allow attackers to inject email commands through webmail interfaces, contact forms, or password reset functions that interact with mail servers.
What to Check
- Test contact forms and feedback features for email header injection (\r\n)
- Check if user input is used in IMAP commands for webmail applications
- Test for SMTP injection through newline characters in email fields
- Verify that email addresses are validated before use in mail commands
- Test password reset and notification features for email injection
WSTG-INPV-11: Code Injection
AdvancedCode injection testing checks whether user input is evaluated as code by the application's runtime environment. This includes injection into interpreted languages like PHP, Python, Ruby, and JavaScript where functions like eval(), exec(), or system() process user-supplied data.
What to Check
- Test parameters for server-side code injection (PHP, Python, Ruby, Node.js)
- Look for eval(), exec(), system(), or similar dangerous functions processing user input
- Test for code injection through deserialization of untrusted data
- Check for expression language injection in framework-specific contexts
- Verify that dynamic code evaluation is not used with user-controlled input
WSTG-INPV-12: Command Injection
AdvancedCommand injection (OS command injection) testing checks whether user input is passed to operating system commands without proper sanitization. Successful exploitation allows attackers to execute arbitrary commands on the server with the privileges of the web application.
What to Check
- Test parameters with command separator characters (;, |, &&, ||, `, $())
- Look for application features that interact with the OS (ping, traceroute, file operations)
- Test for blind command injection using time delays (sleep, ping -c)
- Try out-of-band data exfiltration through DNS or HTTP callbacks
- Check for command injection in file upload names and processing pipelines
WSTG-INPV-13: Format String Injection
AdvancedFormat string injection testing checks whether user input is used as a format string parameter in functions like printf() in C/C++ applications. This can be exploited to read from and write to memory, crash the application, or achieve code execution.
What to Check
- Test input parameters with format string specifiers (%s, %x, %n, %p)
- Look for applications with C/C++ backends that use printf-family functions
- Test for information leakage through %x or %p reading stack memory
- Check CGI applications and native code web services for format string issues
- Verify that user input is never used as the format string argument
WSTG-INPV-14: Incubated Vulnerability
AdvancedIncubated vulnerability testing checks for attacks where malicious input is stored in one part of the application and triggered later in a different context. This includes second-order injection attacks where stored data is used in SQL queries, file operations, or displayed to other users.
What to Check
- Trace how stored user input is used in subsequent application operations
- Test for second-order SQL injection in stored data processed by backend jobs
- Check if uploaded files or data trigger processing pipelines that may be vulnerable
- Look for stored input used in email templates, report generation, or data exports
- Test registration data that might be used in administrative interfaces without encoding
WSTG-INPV-15: HTTP Splitting/Smuggling
AdvancedHTTP splitting and smuggling testing checks whether user input can inject headers or manipulate request boundaries in HTTP traffic. HTTP request smuggling exploits differences in how front-end and back-end servers parse HTTP requests to bypass security controls.
What to Check
- Test for HTTP response splitting by injecting CRLF characters in parameters
- Check for HTTP request smuggling using Content-Length/Transfer-Encoding conflicts
- Test for CL.TE and TE.CL smuggling variants
- Verify that the application rejects requests with ambiguous Content-Length/Transfer-Encoding
- Check if user input can inject HTTP headers through CRLF injection
WSTG-INPV-16: HTTP Incoming Requests
AdvancedThis test examines how the application handles and validates incoming HTTP requests, including unusual or malformed requests. It checks whether the application properly validates request structure, encoding, and content before processing.
What to Check
- Test how the application handles malformed HTTP requests
- Check processing of requests with unusual encodings (UTF-7, double URL encoding)
- Verify that the application validates Content-Type headers match actual content
- Test for request body processing differences between content types
- Check how the application handles oversized requests and headers
WSTG-INPV-17: Host Header Injection
AdvancedHost header injection testing checks whether the application trusts the Host header from user requests for security-sensitive operations like password reset links, cache keys, or server-side redirects. An attacker can manipulate the Host header to poison web caches or steal password reset tokens.
What to Check
- Modify the Host header in password reset requests to an attacker-controlled domain
- Test for web cache poisoning by changing the Host header and checking cached responses
- Check for SSRF through absolute URL handling with a modified Host header
- Test X-Forwarded-Host and X-Host headers that may override the original Host
- Verify that the application validates the Host header against a whitelist
WSTG-INPV-18: SSTI
AdvancedServer-Side Template Injection (SSTI) testing checks whether user input is embedded in server-side templates (Jinja2, Twig, Freemarker, etc.) without proper sanitization. SSTI can escalate from information disclosure to remote code execution depending on the template engine.
What to Check
- Test input fields with template syntax for common engines ({{7*7}}, ${7*7}, #{7*7})
- Identify the template engine from error messages or expression evaluation
- Test for code execution through template engine-specific object chains
- Check if user input is rendered in templates for emails, reports, or dynamic pages
- Verify that user input is always placed in template data context, never in template code
WSTG-INPV-19: SSRF
AdvancedServer-Side Request Forgery (SSRF) testing checks whether the application can be tricked into making HTTP requests to unintended destinations, particularly internal services. SSRF exploits server-side functionality that fetches URLs, imports data, or processes webhooks to access internal resources.
What to Check
- Test URL input parameters with internal IP addresses (127.0.0.1, 169.254.169.254, 10.x.x.x)
- Check for cloud metadata endpoint access (AWS, GCP, Azure metadata services)
- Test for SSRF through file import, URL preview, webhook, and PDF generation features
- Try bypass techniques for SSRF filters (DNS rebinding, URL encoding, IPv6, redirects)
- Test for blind SSRF using out-of-band callbacks to attacker-controlled servers
Relevant Certifications
The following certifications cover input validation testing concepts:
Frequently Asked Questions
What is the difference between input validation and output encoding?
Input validation checks that incoming data conforms to expected formats and rejects anything that does not match. Output encoding transforms data so it is safe for the specific context where it is rendered (HTML, SQL, JavaScript, etc.). Both are necessary: input validation reduces the attack surface, while output encoding prevents exploitation even if validation is bypassed. A defense-in-depth approach uses both.
Why is SQL injection still one of the most common web vulnerabilities?
SQL injection persists because many applications still construct SQL queries by concatenating user input rather than using parameterized queries. Legacy applications, custom ORM layers, and stored procedures with dynamic SQL all create opportunities for injection. Additionally, complex query logic and developer shortcuts under time pressure continue to introduce new injection points even in modern applications.
What is Server-Side Request Forgery (SSRF) and why has it become more important?
SSRF occurs when an attacker can make the server send requests to unintended destinations, typically internal services or cloud metadata endpoints. It has become more important with cloud adoption because SSRF can access cloud metadata services (like AWS IMDSv1 at 169.254.169.254) to steal credentials and pivot to other cloud resources. SSRF was added to the OWASP Top 10 in 2021 as A10.
CyberFolio
Mastering web security testing? Showcase your skills.
Build a free, shareable cybersecurity portfolio that highlights your certifications, projects, and skills.
Build Your Portfolio →