CVE-2008-0981
Open redirect vulnerability in Spyce 2.1.3 allows phishing via a malicious "url" parameter
- CVSS 6.4
- CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
- Configuration Issues
- Remote
Open redirect vulnerability in spyce/examples/redirect.spy in Spyce – Python Server Pages (PSP) 2.1.3 allows remote attackers to redirect users to arbitrary web sites and conduct phishing attacks via a URL in the url parameter.
- CVSS base score
- 6.4
- Published
- 2008-02-25
- OWASP
- A10 Server-Side Request Forgery (SSRF)
- Orthogonal defect classification
- Function
- Code defect classification
- Incorrect Functionality
- Category
- Configuration Issues
- Subcategory
- Open Redirects
- Accessibility scope
- Remote
- Impact
- Unauthorized Access
- Affected component
- Spyce
- Fixed by upgrading
- Yes
Solution
Update Spyce to version 2.1.4 or higher.
Vulnerable code sample
def unsafe_redirect(url):
# Directly redirecting to the provided URL without validation
return f"Redirecting to: {url}"
# Example usage
redirect_url = "https://malicious-site.com" # This could be an attacker-controlled URL
redirect_target = unsafe_redirect(redirect_url)
print(redirect_target)Patched code sample
from urllib.parse import urlparse, urljoin
def safe_redirect(base_url, redirect_url):
# Parse the base URL to ensure it is a safe domain
parsed_base = urlparse(base_url)
# Parse the redirect URL
parsed_redirect = urlparse(redirect_url)
# Check if the redirect URL is a valid absolute URL and belongs to the same domain
if parsed_redirect.scheme in ['http', 'https'] and parsed_redirect.netloc == parsed_base.netloc:
return redirect_url
else:
# If not valid, redirect to a safe default page
return urljoin(base_url, '/safe-default-page')
# Example usage
base_url = "https://example.com"
redirect_url = "https://example.com/some-page" # This would be a valid redirect
# redirect_url = "https://malicious-site.com" # This would be an invalid redirect
redirect_target = safe_redirect(base_url, redirect_url)
print("Redirecting to:", redirect_target)Cite this entry
@misc{vaitp:cve20080981,
title = {{Open redirect vulnerability in Spyce 2.1.3 allows phishing via a malicious "url" parameter}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2008},
note = {VAITP Python Vulnerability Dataset, entry CVE-2008-0981},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2008-0981/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
