CVE-2020-9402

8.8 HIGH

📋 TL;DR

This CVE allows SQL injection in Django when untrusted data is used as the tolerance parameter in GIS functions and aggregates on Oracle databases. Attackers can inject malicious SQL by crafting a tolerance value, potentially leading to data theft, modification, or deletion. Affected are Django applications using Oracle database backends with untrusted tolerance inputs.

💻 Affected Systems

Products:
  • Django
Versions: 1.11 before 1.11.29, 2.2 before 2.2.11, 3.0 before 3.0.4
Operating Systems: All operating systems running Django
Default Config Vulnerable: ✅ No
Notes: Only affects Django applications using Oracle database backend with untrusted tolerance parameters in GIS functions/aggregates.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full database compromise including data exfiltration, modification, or deletion, and potential privilege escalation to execute arbitrary SQL commands.

🟠

Likely Case

Data leakage or manipulation of database contents accessible to the application's database user.

🟢

If Mitigated

No impact if tolerance parameters are properly validated or if Oracle database is not used.

🌐 Internet-Facing: HIGH if application accepts user input for tolerance parameters and uses Oracle backend.
🏢 Internal Only: MEDIUM if internal applications use Oracle with untrusted tolerance inputs.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires application to use Oracle database and accept untrusted tolerance parameters. No public exploit code identified.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Django 1.11.29, 2.2.11, 3.0.4 or later

Vendor Advisory: https://docs.djangoproject.com/en/3.0/releases/security/

Restart Required: Yes

Instructions:

1. Upgrade Django to patched version using pip: 'pip install Django==1.11.29' or appropriate version. 2. Restart Django application server. 3. Test application functionality.

🔧 Temporary Workarounds

Input Validation

all

Validate and sanitize all tolerance parameter inputs before passing to GIS functions.

Database Backend Switch

all

Temporarily switch from Oracle to another supported database backend if possible.

🧯 If You Can't Patch

  • Implement strict input validation for all tolerance parameters in GIS functions.
  • Apply network segmentation to isolate Oracle database from untrusted networks.

🔍 How to Verify

Check if Vulnerable:

Check Django version and if using Oracle backend with GIS functions accepting tolerance parameters.

Check Version:

python -m django --version

Verify Fix Applied:

Verify Django version is 1.11.29+, 2.2.11+, or 3.0.4+ using 'python -m django --version'.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in Django/Oracle logs
  • Errors from malformed tolerance parameters

Network Indicators:

  • Unusual database query patterns from application servers

SIEM Query:

source="django.logs" AND ("tolerance" OR "gis_" OR "oracle") AND (sql OR injection OR error)

🔗 References

📤 Share & Export