SQL Injection Vulnerability in Django Packages: CVE-2020-9402

py-django Updated 02 Oct 2025

Summary

05/03/2020
N/A
Yes i
High
8.8

ALPINE-CVE-2020-9402: Django 1.11 before 1.11.29, 2.2 before 2.2.11, and 3.0 before 3.0.4 allows SQL Injection if untrusted data is used as a tolerance parameter in GIS functions and aggregates on Oracle. Affects py-django versions < 1.11.29-r0. Fixed in 1.11.29-r0. 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 is widely used for building web applications and provides a robust set of features, including an ORM, authentication, and an admin interface. The vulnerability in question affects specific versions of Django, particularly those prior to 1.11.29, 2.2.11, and 3.0.4, which are susceptible to SQL injection attacks when untrusted data is used as a tolerance parameter in GIS functions and aggregates on Oracle databases.

Vulnerability Detail

The vulnerability, identified as CVE-2020-9402, allows for SQL injection if untrusted data is passed as a tolerance parameter in GIS functions and aggregates on Oracle. This flaw can lead to the execution of malicious SQL commands, potentially compromising the integrity and confidentiality of the database. The issue arises from improper handling of input data, which can break escaping mechanisms, allowing attackers to manipulate SQL queries.

How To Fix

Minimum fixed version

1.11.29-r0

This is the first release that contains the fix.

sudo apk add --upgrade py-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 untrusted data as tolerance parameters in GIS functions and aggregates on Oracle until the package can be updated. Implement input validation to sanitize user inputs and prevent SQL injection.

Conclusion

CVE-2020-9402 presents a significant risk to applications using vulnerable versions of Django, particularly in scenarios involving GIS functions with Oracle databases. It is crucial to update to the patched versions to mitigate the risk of SQL injection attacks. Regular monitoring and vulnerability management practices, such as using tools like Vulert, can help maintain application security.

See every vulnerability recorded for py-django →

Share this vulnerability

FAQ

CVE-2020-9402 is a vulnerability in Django that allows SQL injection through untrusted data in GIS functions and aggregates on Oracle.

Django versions prior to 1.11.29, 2.2.11, and 3.0.4 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 of CVE-2020-9402 is 8.8, indicating a high severity level.

If immediate updating is not possible, implement input validation and avoid using untrusted data in GIS functions as a temporary workaround.

Related vulnerabilities

Recent vulnerabilities recorded for py-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

1.11.29-r0

This is the first release that contains the fix.

sudo apk add --upgrade py-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