Denial of Service Vulnerability in Django File Upload Handling

python-django Updated 02 Oct 2025

Summary

26/08/2014
N/A
Yes i
Unrated
Not published

CVE-2014-0481: The default configuration for the file upload handling system in Django before 1.4.14, 1.5.x before 1.5.9, 1.6.x before 1.6.6, and 1.7 before release candidate 3 uses a sequential file name generation process when a file... Affects python-django versions < 1.6.6-1. Fixed in 1.6.6-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

Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. It provides a robust set of features for web development, including an ORM, URL routing, and a templating engine. However, prior to certain versions, Django's file upload handling system had a vulnerability that allowed attackers to exploit the sequential file name generation process, leading to potential denial of service.

Vulnerability Detail

The vulnerability, identified as CVE-2014-0481, arises from the default configuration of Django's file upload handling system. In versions before 1.4.14, 1.5.x before 1.5.9, 1.6.x before 1.6.6, and 1.7 before release candidate 3, the system generates file names sequentially when a file with a conflicting name is uploaded. This allows remote attackers to upload multiple files with the same name, causing excessive CPU consumption and potentially leading to a denial of service.

How To Fix

Minimum fixed version

1.6.6-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 implement a custom file naming strategy that avoids sequential naming conflicts. This can be done by appending a unique identifier (such as a timestamp or a random string) to the file names before saving them. For example, you can modify your file upload handling code as follows:

import os
import uuid

def handle_uploaded_file(f):
    unique_filename = f'{uuid.uuid4()}_{f.name}'
    with open(os.path.join('uploads/', unique_filename), 'wb+') as destination:
        for chunk in f.chunks():
            destination.write(chunk)

Conclusion

CVE-2014-0481 is a significant vulnerability in Django's file upload handling system that can lead to denial of service. It is crucial for developers using affected versions to upgrade to a secure version or implement workarounds to mitigate the risk. Utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.

See every vulnerability recorded for python-django →

Share this vulnerability

FAQ

CVE-2014-0481 is a vulnerability in Django's file upload handling system that allows attackers to cause denial of service by uploading multiple files with the same name.

Django versions before 1.4.14, 1.5.x before 1.5.9, 1.6.x before 1.6.6, and 1.7 before release candidate 3 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 main consequence is denial of service due to excessive CPU consumption when multiple files with the same name are uploaded.

Yes, implementing a custom file naming strategy to avoid name conflicts can serve as a temporary workaround.

Related vulnerabilities

Recent vulnerabilities recorded for python-django.

How To Fix

Minimum fixed version

1.6.6-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