Open Redirect Vulnerability in Python Werkzeug: CVE-2020-28724
Summary
CVE-2020-28724: Open redirect vulnerability in werkzeug before 0.11.6 via a double slash in the URL. Affects python-werkzeug across 2 version ranges.
< 0.11.9+dfsg1-1
< e6d0e510738952788fdd01bbfe5dfb2d8cff0ba4
Fixed in 0.11.9+dfsg1-1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Python Werkzeug is a comprehensive WSGI (Web Server Gateway Interface) utility library for Python that aids in building web applications. It provides essential tools for request and response handling, debugging, and more. The library is widely used in various Python web frameworks, making it crucial for developers to ensure its security. The vulnerability CVE-2020-28724 arises from an open redirect flaw that can be exploited through a specific URL structure, potentially leading to security breaches.
Vulnerability Detail
The vulnerability CVE-2020-28724 is an open redirect issue found in Werkzeug versions prior to 0.11.6. It allows attackers to manipulate URLs with a double slash, which can redirect users to malicious sites without their consent. This flaw can be exploited to perform phishing attacks or to redirect users to harmful content, compromising the integrity of web applications that rely on Werkzeug for handling requests. The technical aspect of this vulnerability lies in the improper validation of URL paths, which fails to adequately handle double slashes.
How To Fix
Minimum fixed version
0.11.9+dfsg1-1
This is the first release that contains the fix.
sudo apt-get install --only-upgrade python-werkzeug
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If immediate upgrading is not feasible, consider implementing URL validation in your application to prevent double slashes in URLs. This can be done by adding a check in your routing logic to reject or sanitize URLs containing double slashes.
Conclusion
The CVE-2020-28724 vulnerability in Python Werkzeug poses a significant risk due to its potential for open redirects. It is crucial for developers to upgrade to the fixed version to safeguard their applications. Implementing URL validation can serve as a temporary measure until an upgrade is possible.
See every vulnerability recorded for python-werkzeug →
FAQ
CVE-2020-28724 is an open redirect vulnerability in the Werkzeug library that allows attackers to redirect users to malicious sites via manipulated URLs.
You can check if your application is affected by using the Vulert playground at Vulert Scanner, which analyzes your manifest file for vulnerabilities.
Exploitation of this vulnerability can lead to phishing attacks, user redirection to harmful sites, and a loss of trust in your application.
You can upgrade Werkzeug using pip with the command 'pip install --upgrade Werkzeug' or through your package manager for Debian systems.
Yes, you can implement URL validation in your application to reject or sanitize URLs containing double slashes as a temporary workaround.
Related vulnerabilities
Recent vulnerabilities recorded for python-werkzeug.