CVE-2024-24808
Open redirect vulnerability due to incorrect URL validation in pyLoad.
- CVSS 6.1
- CWE-601
- Input Validation and Sanitization
- Remote
pyLoad is an open-source Download Manager written in pure Python. There is an open redirect vulnerability due to incorrect validation of input values when redirecting users after login. pyLoad is validating URLs via the `get_redirect_url` function when redirecting users at login. This vulnerability has been patched with commit fe94451.
- CWE
- CWE-601
- CVSS base score
- 6.1
- Published
- 2024-02-06
- OWASP
- A10 Insufficient Logging & Monitoring
- Orthogonal defect classification
- Checking
- Code defect classification
- Incorrect Check
- Category
- Input Validation and Sanitization
- Subcategory
- Open Redirects
- Accessibility scope
- Remote
- Impact
- Unauthorized Access
- Affected component
- pyLoad
- Fixed by upgrading
- Yes
Solution
Upgrade to the latest version of pyLoad that includes the patch from commit fe94451 to fix the open redirect vulnerability.
Vulnerable code sample
def get_redirect_url(redirect_url):
return redirect_url
redirect = get_redirect_url("https://example.com/dashboard")
print("Redirecting to:", redirect)Patched code sample
from urllib.parse import urlparse, urljoin
def get_redirect_url(base_url, redirect_url):
base_parsed = urlparse(base_url)
redirect_parsed = urlparse(redirect_url)
if redirect_parsed.scheme in ["http", "https"] and redirect_parsed.netloc != base_parsed.netloc:
raise ValueError("Invalid redirect URL")
return urljoin(base_url, redirect_url)
try:
redirect = get_redirect_url("https://example.com/dashboard", "/home")
print("Redirecting to:", redirect)
except ValueError as e:
print(e)Cite this entry
@misc{vaitp:cve202424808,
title = {{Open redirect vulnerability due to incorrect URL validation in pyLoad.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2024},
note = {VAITP Python Vulnerability Dataset, entry CVE-2024-24808},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2024-24808/}}
}
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 ::
