Diagnostic playbook
Open redirect via redirect parameter (scheme and allowlist substring bypasses)
Web / Open Redirect
Knowledge identity
Definition and taxonomy
Summary
A redirect parameter is passed directly to the Location header; partial filters on URL schemes and allowlist substrings can be bypassed to redirect to arbitrary external hosts.
Severity rationale
Demonstrated server-side Location redirect to attacker-controlled URLs: raw at low, protocol-relative // bypass at medium, and info.php-substring bypass at high. Redirects are a phishing/credential-theft vector in a real app. No external site was fetched during testing; only the Location header value was observed.
Aliases
Unvalidated redirect, Open HTTP redirect, URL redirection to untrusted site
Standards
CWE-601 CAPEC-38 A01:2021-Broken Access Control
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
1. First Signal
What should make an agent suspicious
Symptoms
The Location header equals the attacker-supplied redirect value; some values produce 500 (filtered); protocol-relative or allowlist-substring values still produce a Location header.
Prerequisites
Authorized lab session. The endpoint builds a Location header from user input.
2. Recognition Logic
How to recognize this next time
If a redirect parameter reaches header(location:), test full external schemes, then // protocol-relative, then backslashes. If an allowlist substring is required, inject the allowlist filename inside an external URL.
3. Diagnostic Procedure
Safe checks, in order
- Confirm authorized scope. 2. Send a full external URL and read the Location header (do not follow it). 3. If http/https is blocked, try //host and \\host. 4. If an allowlist substring is required, embed it in the URL. 5. Record the Location header values as evidence.
4. Proof
Evidence
DVWA open_redirect: low redirect=https://evil.example.invalid/phish -> Location set; medium https:// -> 500 but //evil.example.invalid -> Location set; high non-info 500 but https://evil.example.invalid/info.php -> Location set.
5. Controls
Negative checks
At medium, http/https URLs were rejected (500); at high, URLs without 'info.php' were rejected (500) - the filters fail only on the specific bypass forms.
6. Avoid Bad Memory
False positives and traps
A Location header to a same-origin path is not a vulnerability; only redirecting to attacker-controlled destinations counts. A 500 does not prove absence - test bypass forms.
7. Why It Matters
Impact
Phishing and credential theft: a trusted-looking link redirects victims to a malicious site.
8. Why It Happened
Root cause
User input used to build the Location header without validating the target host or scheme; filters are pattern-based and miss protocol-relative URLs and allowlist-substring injection.
9. Fix
Remediation and prevention
Validate redirect targets against an explicit allowlist of internal paths/hosts; reject open URLs. Never reflect user input into Location without validation. Use relative-path-only redirects.
10. Re-test
Verification steps
- After fix, send external, protocol-relative, and substring-injection redirects and confirm no Location to external hosts. 2. Confirm allowed internal redirects still work. 3. Regression tests.
Reference
Tools and sources
Tools used
curl for header observation, docker exec for read-only source review
References
OWASP Unvalidated Redirects Cheat Sheet; CWE-601; CAPEC-38
Intelligence
Products and history
Technologies
PHP, HTTP headers
Affected products / versions
DVWA (Damn Vulnerable Web Application) current master
History
First documented in DVWA open_redirect module in the 2026-08 benchmark run.
Exploit knowledge
Variants and references
Attack surface
redirect GET parameter echoed into the Location header of a 3xx response
Exploit maturity
proof-of-concept
Known variants
Full external scheme (low), protocol-relative // and backslash bypasses (medium), allowlist-substring injection like https://evil.example.invalid/info.php (high)
Defensive signatures
Location headers built from query parameter values, 500 responses for http/https at medium and for non-info.php at high, redirect values containing // or an allowlist filename plus an external host
Reproduction commands
Low (raw): curl -s -D - -o /dev/null -b $JAR "http://127.0.0.1:4280/vulnerabilities/open_redirect/source/low.php?redirect=https://evil.example.invalid/phish" Medium (blocks http/https; protocol-relative bypass): curl -s -D - -o /dev/null -b $JAR "http://127.0.0.1:4280/vulnerabilities/open_redirect/source/medium.php?redirect=//evil.example.invalid" High (requires 'info.php' substring): curl -s -D - -o /dev/null -b $JAR "http://127.0.0.1:4280/vulnerabilities/open_redirect/source/high.php?redirect=https://evil.example.invalid/info.php"
Exploit references
No external references stored; all evidence from the authorized local lab.
Case provenance