Critical HTTP Response Splitting Vulnerability in Python Django
Summary
CVE-2015-5144: Django before 1.4.21, 1.5.x through 1.6.x, 1.7.x before 1.7.9, and 1.8.x before 1.8.3 uses an incorrect regular expression, which allows remote attackers to inject arbitrary headers and conduct HTTP response splitting at... Affects python-django versions < 1.7.9-1. Fixed in 1.7.9-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 Django is a high-level web framework that encourages rapid development and clean, pragmatic design. It is widely used for building web applications and provides a robust set of features for developers, including an ORM, URL routing, and templating. However, certain versions of Django are vulnerable to an HTTP response splitting attack due to an incorrect regular expression used in its validation functions. This vulnerability can allow attackers to inject arbitrary headers, potentially leading to severe security implications.
Vulnerability Detail
The vulnerability, identified as CVE-2015-5144, affects Django versions before 1.4.21, 1.5.x through 1.6.x, 1.7.x before 1.7.9, and 1.8.x before 1.8.3. It arises from the use of an incorrect regular expression that fails to properly validate input, allowing remote attackers to inject newline characters into email messages, URLs, or other validation inputs. This can lead to HTTP response splitting attacks, where attackers can manipulate the response headers sent to users, potentially leading to session hijacking, cache poisoning, or cross-site scripting (XSS) attacks.
How To Fix
Minimum fixed version
1.7.9-1
This is the first release that contains the fix.
sudo apt-get install --only-upgrade python-django
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If upgrading is not immediately possible, consider implementing input validation on your own to filter out newline characters from user inputs before they reach the Django validators. This can help mitigate the risk of HTTP response splitting until a proper upgrade can be performed.
Conclusion
The CVE-2015-5144 vulnerability poses a significant risk to applications using affected versions of Django. It is crucial for developers to upgrade to a secure version to mitigate the risk of HTTP response splitting attacks. Additionally, utilizing tools like Vulert can help monitor and manage vulnerabilities effectively.
See every vulnerability recorded for python-django →
FAQ
CVE-2015-5144 is a vulnerability in Django that allows remote attackers to inject arbitrary headers due to improper input validation.
Django versions before 1.4.21, 1.5.x through 1.6.x, 1.7.x before 1.7.9, and 1.8.x before 1.8.3 are affected by this vulnerability.
The vulnerability can lead to HTTP response splitting attacks, which may result in session hijacking, cache poisoning, or XSS attacks.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check if your application is affected without needing to sign up.
Implement input validation to filter out newline characters from user inputs as a temporary workaround until you can upgrade Django.
Related vulnerabilities
Recent vulnerabilities recorded for python-django.