CVE-2014-0473
NoneCVSS
—
EPSS
2.0%
Published
Apr 23, 2014
CISA due date
—
Cloudanix analysis
A flaw in the web application framework could allow an attacker to trick users into performing actions they did not intend, such as changing their account details or making purchases.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Other
- Component
- Web Framework
- Class
- CSRF
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The vulnerability in the Django caching framework causes the same Cross-Site Request Forgery (CSRF) token to be reused for all anonymous users. This allows an attacker to obtain a valid token by visiting the site and then use it to craft malicious requests. When a legitimate, authenticated user is tricked into executing this request, the application accepts it, completely bypassing the CSRF protection mechanism for state-changing operations.
Why it matters to the business
An attacker can trick authenticated users, such as customers or employees, into performing unintended actions on the web application. This could lead to unauthorized data modification, fraudulent transactions, or account compromise, depending on the application's functionality. Such incidents can result in direct financial loss, reputational damage, and erosion of customer trust.
How an attack unfolds
An attacker first visits the vulnerable Django application as an anonymous user to obtain the shared, cached CSRF token. The attacker then crafts a malicious request (e.g., a URL or a hidden form) for a sensitive action, such as changing an email address or transferring funds, and embeds the stolen CSRF token. This payload is delivered to a victim who is authenticated to the application, typically through a phishing email or a compromised website. When the victim's browser executes the request, it includes their valid session cookie. The server sees a valid session and a valid CSRF token, and processes the malicious action on behalf of the victim without their knowledge or consent.
How to fix it
Upgrade the Django framework to a patched version. According to the advisory, users should upgrade to Django 1.4.11 or later, 1.5.6 or later, 1.6.3 or later, or 1.7 beta 2 or later. It is strongly recommended to upgrade to a modern, supported version of Django to benefit from all security improvements. If an immediate upgrade is not feasible, consider disabling caching for views that provide CSRF tokens to anonymous users as a temporary mitigation, but be aware of potential performance impacts.
How to confirm the fix worked
To confirm remediation, verify that the installed Django version is a patched version (e.g., 1.4.11+, 1.5.6+, 1.6.3+). To test for the vulnerability's absence, use two separate browser sessions (e.g., different browsers or incognito windows) to visit a page with a CSRF-protected form as an anonymous user. Extract the CSRF token provided to each session. On a patched system, the tokens must be different. On a vulnerable system, they will be identical.
Typical attack path
- Attacker visits the public-facing Django application as an anonymous user.
- The server responds with a page containing a CSRF token that is cached and shared among all anonymous users.
- Attacker extracts this shared CSRF token.
- Attacker crafts a malicious URL or HTML form that targets a state-changing function within the application.
- Attacker embeds the stolen CSRF token into the malicious payload.
- Attacker uses social engineering to trick a logged-in victim into clicking a link or visiting a page that triggers the malicious request.
- The victim's browser sends the request to the application, including their session cookies and the attacker-provided CSRF token.
- The application validates the request and executes the sensitive action on behalf of the victim.
How to detect it
Detecting historical exploitation of this CSRF vulnerability is challenging because a successful attack looks very similar to a legitimate user action in server logs. There are no unique on-server artifacts. Analysts should review web server and application logs for anomalous state-changing requests (e.g., POST, PUT, DELETE). Suspicious indicators could include a sensitive action being performed without a preceding visit to the form page (i.e., a missing HTTP referrer or a referrer from an unrelated domain), or an unusual sequence of actions within a user session that deviates from normal application workflow.
What your security team should do
- Immediately prioritize upgrading all applications using vulnerable Django versions to a patched release (1.4.11+, 1.5.6+, 1.6.3+, or newer).
- Use a software composition analysis (SCA) tool to scan your codebase and dependencies to identify all instances of vulnerable Django versions.
- Review developer guidelines to ensure CSRF protection is implemented according to Django's best practices, especially in custom caching scenarios.
- Since this is a logic flaw, ensure web application firewalls (WAFs) are not the sole defense and that the underlying application code is fixed.
The record
The caching framework in Django before 1.4.11, 1.5.x before 1.5.6, 1.6.x before 1.6.3, and 1.7.x before 1.7 beta 2 reuses a cached CSRF token for all anonymous users, which allows remote attackers to bypass CSRF protections by reading the CSRF cookie for anonymous users.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| PyPI | django | 0 | 1.4.11 |
| PyPI | django | 1.5 | 1.5.6 |
| PyPI | django | 1.5.0 | 1.5.6 |
| PyPI | django | 1.6 | 1.6.3 |
| PyPI | django | 1.6.0 | 1.6.3 |
| Debian:11 | python-django | 0 | 1.6.3-1 |
| Debian:12 | python-django | 0 | 1.6.3-1 |
| Debian:13 | python-django | 0 | 1.6.3-1 |
| Debian:6.0 | python-django | 0 | 1.2.3-3+squeeze10 |
| Debian:7 | python-django | 0 | 1.4.5-1+deb7u7 |
| Mageia:3 | python-django | 0 | 1.4.11-1.1.mga3 |
| Mageia:4 | python-django | 0 | 1.5.6-1.1.mga4 |
| Mageia:4 | python-django14 | 0 | 1.4.11-1.1.mga4 |
| Red Hat:openstack:3::el6 | Django14 | 0 | 0:1.4.11-1.el6ost |
| Red Hat:openstack:3::el6 | Django14-doc | 0 | 0:1.4.11-1.el6ost |
| Red Hat:openstack:4::el6 | Django14 | 0 | 0:1.4.11-1.el6ost |
| Red Hat:openstack:4::el6 | Django14-doc | 0 | 0:1.4.11-1.el6ost |
| Ubuntu:14.04:LTS | python-django | 0 | 1.6.1-2ubuntu0.1 |
| pypi | Django | 1.5 | No fix |
| pypi | Django | 1.6 | No fix |
Related vulnerabilities
- GHSA-8p8v-wh79-9r56 Django vulnerable to Uncontrolled Resource Consumption Also affects django
- GHSA-mjgh-79qc-68w3 Django has a Race Condition vulnerability Also affects django
- CVE-2026-25673 An issue was discovered in 6.0 before 6.0.3, 5.2 before 5.2.12, and 4.2 before 4.2.29. Also affects django
- CVE-2026-25674 An issue was discovered in 6.0 before 6.0.3, 5.2 before 5.2.12, and 4.2 before 4.2.29. Also affects django
- GHSA-6426-9fv3-65x8 Django has an SQL Injection issue Also affects django
- GHSA-gvg8-93h5-g6qq Django has an SQL Injection issue Also affects django
- GHSA-2mcm-79hx-8fxw Django has Observable Timing Discrepancy Also affects django
- GHSA-33mw-q7rj-mjwj Django has Inefficient Algorithmic Complexity Also affects django