Arbitrary Cookie Setting Vulnerability in python-django

python-django Updated 02 Oct 2025

Summary

03/10/2016
N/A
Yes i
High
7.5

CVE-2016-7401: The cookie parsing code in Django before 1.8.15 and 1.9.x before 1.9.10, when used on a site with Google Analytics, allows remote attackers to bypass an intended CSRF protection mechanism by setting arbitrary cookies. Affects python-django across 11 version ranges.

< 1:1.10-1 < 6e749c21e77dc74af068c8e943a6e6850ae0bb24 < 8a2a3a63b83375d9322c077b6356007e0bef5939 < 9fbdc48c493f43961173bab8f23d633ab41a9608 < 2234d1f08d079a3e4be4f1a89847dc294a4a5c1a < 37935743edbf60201adb1b53b56b8cafa754c69a < b29316c54bb3465265ff931e807229f13349457d < c00335997744196738368f46c30ef2eeaa0ac849 < dafddb6b8c0eb778072bec1ccd536bafad0eb936 < e8bb7464c562388da48bca04c5996fe16a0c3619 < e70a309c428cfd4e600dc9fa0c7269b1e7a8efcd

Fixed in 1:1.10-1. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

python-django is a popular web framework for building web applications using the Python programming language. It provides a robust set of tools and features for developing secure and scalable web applications. However, a vulnerability has been discovered in python-django versions before 1.8.15 and 1.9.x before 1.9.10. This vulnerability allows remote attackers to bypass the Cross-Site Request Forgery (CSRF) protection mechanism by setting arbitrary cookies. This can lead to unauthorized access and potential security breaches.

Vulnerability Detail

The vulnerability arises from the cookie parsing code in python-django. When used on a site with Google Analytics, an attacker can exploit this vulnerability by setting arbitrary cookies. By doing so, they can bypass the intended CSRF protection mechanism, which is designed to prevent unauthorized actions on behalf of a user. This vulnerability can be exploited remotely, allowing attackers to perform actions on behalf of unsuspecting users without their consent or knowledge.

How To Fix

Minimum fixed version

1:1.10-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

As a temporary workaround, you can disable Google Analytics on your site. This will prevent the vulnerability from being exploited. However, this may impact your ability to gather analytics data. It is strongly recommended to upgrade to the patched versions of python-django as soon as possible.

Conclusion

The arbitrary cookie setting vulnerability in python-django can lead to unauthorized access and potential security breaches. It is crucial to upgrade to the patched versions of python-django (1.8.15 or 1.9.10) to mitigate the risk. Disabling Google Analytics temporarily can serve as a workaround, but it is recommended to upgrade as soon as possible. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for python-django →

Share this vulnerability

FAQ

python-django is a web framework for building web applications using the Python programming language. It provides a set of tools and features to simplify the development process.

Cross-Site Request Forgery (CSRF) is an attack that tricks the victim into submitting a malicious request. It occurs when a malicious website, email, or other malicious source causes a user's web browser to perform an unwanted action on a trusted site where the user is authenticated.

This vulnerability allows remote attackers to bypass the CSRF protection mechanism in python-django. If your application is affected, it can lead to unauthorized actions being performed on behalf of your users, potentially compromising their data and the security of your application.

No, only python-django versions before 1.8.15 and 1.9.x before 1.9.10 are affected by this vulnerability. It is recommended to upgrade to the latest patched version to ensure the security of your application.

You can use the Vulert Playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. It provides real-time monitoring and alerts for open-source vulnerabilities in software, without requiring access to the code or installation.

Related vulnerabilities

Recent vulnerabilities recorded for python-django.

How To Fix

Minimum fixed version

1:1.10-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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback