Cache Poisoning Vulnerability in Django - CVE-2011-4139
Summary
CVE-2011-4139: Django before 1.2.7 and 1.3.x before 1.3.1 uses a request's HTTP Host header to construct a full URL in certain circumstances, which allows remote attackers to conduct cache poisoning attacks via a crafted request. Affects python-django versions < 1.3.1-1. Fixed in 1.3.1-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
Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. It provides a robust set of features for building web applications, including an ORM, authentication, and an admin interface. However, certain versions of Django are susceptible to a vulnerability that allows attackers to exploit the HTTP Host header, potentially leading to cache poisoning attacks.
Vulnerability Detail
CVE-2011-4139 is a vulnerability present in Django versions prior to 1.2.7 and in the 1.3.x series before 1.3.1. The issue arises from the way Django constructs full URLs using the HTTP Host header from incoming requests. Attackers can craft malicious requests that manipulate the Host header, leading to cache poisoning. This can result in users receiving incorrect or malicious content, undermining the integrity of the application and potentially exposing sensitive data.
How To Fix
Minimum fixed version
1.3.1-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 a reverse proxy that sanitizes the Host header before it reaches your Django application. This can help mitigate the risk of cache poisoning by ensuring that only valid Host headers are processed.
Conclusion
CVE-2011-4139 is a significant vulnerability in Django that can lead to cache poisoning attacks. It is crucial for developers using affected versions to upgrade to at least version 1.3.1 to ensure the security of their applications. Implementing workarounds can provide temporary relief, but upgrading is the best long-term solution.
See every vulnerability recorded for python-django →
FAQ
CVE-2011-4139 is a vulnerability in Django that allows attackers to exploit the HTTP Host header, potentially leading to cache poisoning attacks.
Django versions before 1.2.7 and 1.3.x before 1.3.1 are affected by this vulnerability.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
Exploiting this vulnerability can lead to cache poisoning, where users may receive incorrect or malicious content, potentially compromising sensitive information.
If an immediate upgrade is not feasible, consider implementing a reverse proxy to sanitize the Host header as a temporary workaround.
Related vulnerabilities
Recent vulnerabilities recorded for python-django.