Critical Vulnerabilities in Python-Django: SQL Injection and Header Injection Risks

python-django Updated 03 Oct 2025

Summary

11/04/2022
N/A
Yes i
Unrated
Not published

USN-5373-2: python-django vulnerabilities. Affects python-django versions < 1.6.11-0ubuntu1.3+esm5. Fixed in 1.6.11-0ubuntu1.3+esm5. 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 high-level Python web framework that encourages rapid development and clean, pragmatic design. It is widely used for building web applications and provides features such as an ORM, routing, and templating. However, recent vulnerabilities have been identified that could compromise the security of applications built using this framework, particularly in versions 1.6.11 and 1.8.7.

Vulnerability Detail

Two significant vulnerabilities have been discovered in Django. The first, identified as CVE-2022-28346, involves improper handling of column aliases in the QuerySet.annotate(), aggregate(), and extra() methods, potentially allowing remote attackers to execute SQL injection attacks. The second, CVE-2021-32052, relates to the URLValidator function, which fails to properly handle newlines and tabs, enabling header injection attacks. Both vulnerabilities pose serious risks to web applications, potentially leading to unauthorized data access or manipulation.

How To Fix

Minimum fixed version

1.6.11-0ubuntu1.3+esm5

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 measure, you can implement input validation and sanitization in your application to mitigate the risk of SQL injection and header injection attacks. Ensure that user inputs are properly escaped and validated before processing.

Conclusion

In summary, critical vulnerabilities have been identified in Python-Django that could expose applications to SQL injection and header injection attacks. It is essential to update to the patched versions of the affected packages to mitigate these risks. Implementing input validation can serve as a temporary workaround while updates are applied.

See every vulnerability recorded for python-django →

Share this vulnerability

FAQ

The vulnerabilities affect Python-Django versions 1.6.11 and 1.8.7.

The vulnerabilities could lead to SQL injection attacks and header injection attacks, potentially compromising sensitive data and application integrity.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. You can check your application using the Vulert playground without any signup.

While updating is the best solution, you can implement input validation and sanitization as a temporary workaround.

More details can be found in the original advisory and on the Ubuntu security notices page.

Related vulnerabilities

Recent vulnerabilities recorded for python-django.

How To Fix

Minimum fixed version

1.6.11-0ubuntu1.3+esm5

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