← Back
CVE-2020-9402
SQL Injection in Django (CVE-2020-9402)
Summary
SQL injection in Django (CVE-2020-9402). Successful exploitation can lead to full system takeover. Mitigation: upgrade to `3.0.4` or later.
AI summary snake-internal / snake-material-v2
A vulnerability tracked as **CVE-2020-9402** has been found in Django.
Successful exploitation can lead to full system takeover. CVSS score: ?/10.
What to do: upgrade Django to **3.0.4** or later.
If unsure, ask your IT team or search "Django CVE-2020-9402" on the vendor's site.
CVE-2020-9402 (Django) — CWE-89 /
Attack vector: remote (network-reachable) / no user interaction
Patched: `3.0.4` — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
❓ What is the problem
**SQL injection** (CWE-89) exists in Django.
📍 Affected scope
Django — .
🔥 Severity
Severity: ?. Successful exploitation can lead to full system takeover
🔧 How to fix
Update to **3.0.4**.
🛡️ Workaround
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
🔍 Detection
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run `grep -r 'Django' .` against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response Actions (7 steps)
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'Django' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で `Django` を grep し、稼働しているサービス・バージョンを把握する。
-
6Apply patch patch
Upgrade Django to 3.0.4ステージング環境で 3.0.4 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスと、Step 3 で見つけた異常検知の続報チェックを含めること。
-
7Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番では Step 3 と同じログクエリでアラート再発が無いか継続監視。
Affected packages
pip
Django
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.0.4"}]}]
Bitnami
django
[{"type":"SEMVER","events":[{"introduced":"1.11.0"},{"fixed":"1.11.29"},{"introduced":"2.2.0"},{"fixed":"2.2.11"},{"introduced":"3.0.0"},{"fixed":"3.0.4"}]}]
PyPI
django
[{"type":"ECOSYSTEM","events":[{"introduced":"3.0"},{"fixed":"3.0.4"}]}]
References
- advisory https://nvd.nist.gov/vuln/detail/CVE-2020-9402
- advisory https://github.com/advisories/GHSA-3gh2-xw74-jmcw
- advisory https://security.netapp.com/advisory/ntap-20200327-0004/
- advisory https://usn.ubuntu.com/4296-1/
- package https://github.com/django/django
- patch https://docs.djangoproject.com/en/3.0/releases/security/
- patch https://www.djangoproject.com/weblog/2020/mar/04/security-releases/
- web https://groups.google.com/forum/#!topic/django-announce/fLUh_pOaKrY
- web https://security.gentoo.org/glsa/202004-17
- web https://www.debian.org/security/2020/dsa-4705
- web https://lists.debian.org/debian-lts-announce/2022/05/msg00035.html
- web https://github.com/django/django/commit/6695d29b1c1ce979725816295a26ecc64ae0e927
- web https://docs.djangoproject.com/en/3.0/releases/security
- web https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4A2AP4T7RKPBCLTI2NNQG3T6MINDUUMZ
- web https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UZMN2NKAGTFE3YKMNM2JVJG7R2W7LLHY
- web https://security.netapp.com/advisory/ntap-20200327-0004
- web https://usn.ubuntu.com/4296-1
- web https://www.djangoproject.com/weblog/2020/mar/04/security-releases
- web https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2020-36.yaml
- web https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UZMN2NKAGTFE3YKMNM2JVJG7R2W7LLHY
- web https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/4A2AP4T7RKPBCLTI2NNQG3T6MINDUUMZ
- web https://groups.google.com/forum/#%21topic/django-announce/fLUh_pOaKrY
- web https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2020-345.yaml
- web https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/4A2AP4T7RKPBCLTI2NNQG3T6MINDUUMZ/
- web https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UZMN2NKAGTFE3YKMNM2JVJG7R2W7LLHY/
- web https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4A2AP4T7RKPBCLTI2NNQG3T6MINDUUMZ/