Key Collision Vulnerability in Django Cache Mechanism

python-django Updated 02 Oct 2025

Summary

03/06/2020
N/A
Yes i
Medium
5.9

CVE-2020-13254: An issue was discovered in Django 2.2 before 2.2.13 and 3.0 before 3.0.7. Affects python-django across 2 version ranges.

< 2:2.2.13-1 >= 635d53a86a36cde7866b9caefeb64d809e6bfcd9, < 8093aaa8ff9dd7386a069c6eb49fcc1c5980c033

Fixed in 2:2.2.13-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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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, routing, authentication, and caching mechanisms. This vulnerability affects versions 2.2 before 2.2.13 and 3.0 before 3.0.7, where improper key validation in the memcached backend can lead to key collisions and potential data leakage.

Vulnerability Detail

The vulnerability, identified as CVE-2020-13254, arises from the lack of key validation in the memcached backend of Django. When malformed cache keys are passed, they can collide with existing keys, leading to unintended data exposure. This could allow an attacker to access sensitive data stored in the cache, which may include user information or application state. The issue is particularly concerning in multi-tenant environments where data isolation is critical.

How To Fix

Minimum fixed version

2:2.2.13-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, avoid using memcached as a caching backend until the upgrade can be applied. Alternatively, validate cache keys manually to ensure they do not contain malformed data.

Conclusion

CVE-2020-13254 presents a significant risk to applications using Django's memcached backend due to potential data leakage from key collisions. It is crucial to upgrade to the patched versions to mitigate this vulnerability effectively.

See every vulnerability recorded for python-django →

Share this vulnerability

FAQ

CVE-2020-13254 is a vulnerability in Django that allows for key collisions in the memcached backend due to improper key validation, potentially leading to data leakage.

Django versions 2.2 before 2.2.13 and 3.0 before 3.0.7 are affected by this vulnerability.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

The CVSS score for CVE-2020-13254 is 5.9, indicating a moderate level of severity.

If an immediate upgrade is not possible, consider using a different caching backend or implementing manual key validation as a temporary measure.

Related vulnerabilities

Recent vulnerabilities recorded for python-django.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

2:2.2.13-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