VulnarioBlogDjango vulnerabilities
Django Vulnerabilities: The 10 Most Critical Django Security Bugs (CVEs)
Django vulnerabilities are security flaws in Django that attackers can abuse to steal data, take over a server or interrupt a service. Django is a high-level Python web framework. The National Vulnerability Database (NVD) lists 157 CVEs for Django, 13 of them rated critical, and 32 were published in the last 12 months. None of them is currently listed in CISA's Known Exploited Vulnerabilities (KEV) catalog for the product entries we checked.
This guide lists the 10 most critical Django security bugs, with the CVE number, CVSS score, affected versions and what to do about each one. It also covers Django security basics, the current end-of-life dates and a free way to be told about the next Django CVE as soon as it is published.
Key takeaways
- No Django CVE is currently in CISA's KEV catalog for the entries we checked, but critical flaws still get exploited quickly once details are public.
- 13 Django CVEs are rated critical (CVSS v3), and 32 new ones were published in the last 12 months.
- The newest CVE in this guide is CVE-2026-4277, published Apr 7, 2026.
- Supported Django releases today (per endoflife.date): 6.1, 6.0, 5.2. Releases not on the list are past their announced end of life.
- You can monitor Django for free. Vulnario emails you when a new CVE matches your version and the rest of your stack.
How we ranked these Django CVEs
We ranked CVEs first by whether CISA lists them as exploited, then by CVSS score (v3 scores before the older v2 scale, which is marked when used), then by publication date (newest first). When a technology has several product entries in NVD, we combined them and removed duplicates. This favors the bugs that matter most in practice, so the guide is a list of the most critical flaws we found, not a complete history.
Every CVE number, score, date and affected version below comes from the NVD record and the CISA KEV catalog, checked on Nov 3, 2026. Scores can change when NVD reanalyzes a record, so open the linked record if you need the current value.
The 10 most critical Django CVEs at a glance
| # | CVE | CVSS | Published | Type | CISA KEV |
|---|---|---|---|---|---|
| 1 | CVE-2026-4277 | 9.8 Critical | 2026-04-07 | Missing authorization | No |
| 2 | CVE-2025-59681 | 9.8 Critical | 2025-10-01 | SQL injection | No |
| 3 | CVE-2024-53908 | 9.8 Critical | 2024-12-06 | SQL injection | No |
| 4 | CVE-2023-31047 | 9.8 Critical | 2023-05-07 | Improper input validation | No |
| 5 | CVE-2022-34265 | 9.8 Critical | 2022-07-04 | SQL injection | No |
| 6 | CVE-2022-28346 | 9.8 Critical | 2022-04-12 | SQL injection | No |
| 7 | CVE-2022-28347 | 9.8 Critical | 2022-04-12 | SQL injection | No |
| 8 | CVE-2021-35042 | 9.8 Critical | 2021-07-02 | SQL injection | No |
| 9 | CVE-2020-7471 | 9.8 Critical | 2020-02-03 | SQL injection | No |
| 10 | CVE-2019-19844 | 9.8 Critical | 2019-12-18 | Critical security flaw | No |
Each Django CVE explained
1. CVE-2026-4277: Missing authorization
- What NVD says
- An issue was discovered in 6.0 before 6.0.4, 5.2 before 5.2.13, and 4.2 before 4.2.30. Add permissions on inline model instances were not validated on submission of forged `POST` data in `GenericInlineModelAdmin`. Earlier, unsupported Django series (such as 5.0.x, 4.1.x, and 3.2.x) were not evaluated and may also be affected. Django would like to thank N05ec@LZU-DSLab for reporting this issue.
- How it can be attacked
- Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
- Affected versions
- 4.2 to before 4.2.30; 5.2 to before 5.2.13; 6.0 to before 6.0.4
- What to do
- Upgrade to the fixed release for your branch (4.2.30, 5.2.13, 6.0.4) or a later one, then restart the service.
- Advisory
- Vendor advisory or patch (opens in a new tab)
2. CVE-2025-59681: SQL injection
- What NVD says
- An issue was discovered in Django 4.2 before 4.2.25, 5.1 before 5.1.13, and 5.2 before 5.2.7. QuerySet.annotate(), QuerySet.alias(), QuerySet.aggregate(), and QuerySet.extra() are subject to SQL injection in column aliases, when using a suitably crafted dictionary, with dictionary expansion, as the **kwargs passed to these methods (on MySQL and MariaDB).
- How it can be attacked
- Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
- Affected versions
- 4.2 to before 4.2.25; 5.1 to before 5.1.13; 5.2 to before 5.2.7
- What to do
- Upgrade to the fixed release for your branch (4.2.25, 5.1.13, 5.2.7) or a later one, then restart the service.
- Advisory
- Vendor advisory or patch (opens in a new tab)
3. CVE-2024-53908: SQL injection
- What NVD says
- An issue was discovered in Django 5.1 before 5.1.4, 5.0 before 5.0.10, and 4.2 before 4.2.17. Direct usage of the django.db.models.fields.json.HasKey lookup, when an Oracle database is used, is subject to SQL injection if untrusted data is used as an lhs value. (Applications that use the jsonfield.has_key lookup via __ are unaffected.)
- How it can be attacked
- Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
- Affected versions
- 4.2 to before 4.2.17; 5.0 to before 5.0.10; 5.1 to before 5.1.4
- What to do
- Upgrade to the fixed release for your branch (4.2.17, 5.0.10, 5.1.4) or a later one, then restart the service.
- Advisory
- Vendor advisory or patch (opens in a new tab)
4. CVE-2023-31047: Improper input validation
- What NVD says
- In Django 3.2 before 3.2.19, 4.x before 4.1.9, and 4.2 before 4.2.1, it was possible to bypass validation when using one form field to upload multiple files. This multiple upload has never been supported by forms.FileField or forms.ImageField (only the last uploaded file was validated). However, Django's "Uploading multiple files" documentation suggested otherwise.
- How it can be attacked
- Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
- Affected versions
- 3.2 to before 3.2.19; 4.0 to before 4.1.9; 4.2
- What to do
- Upgrade to the fixed release for your branch (3.2.19, 4.1.9) or a later one, then restart the service.
- Advisory
- Vendor advisory or patch (opens in a new tab)
5. CVE-2022-34265: SQL injection
- What NVD says
- An issue was discovered in Django 3.2 before 3.2.14 and 4.0 before 4.0.6. The Trunc() and Extract() database functions are subject to SQL injection if untrusted data is used as a kind/lookup_name value. Applications that constrain the lookup name and kind choice to a known safe list are unaffected.
- How it can be attacked
- Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
- Affected versions
- 3.2 to before 3.2.14; 4.0 to before 4.0.6
- What to do
- Upgrade to the fixed release for your branch (3.2.14, 4.0.6) or a later one, then restart the service.
- Advisory
- Vendor advisory or patch (opens in a new tab)
6. CVE-2022-28346: SQL injection
- What NVD says
- An issue was discovered in Django 2.2 before 2.2.28, 3.2 before 3.2.13, and 4.0 before 4.0.4. QuerySet.annotate(), aggregate(), and extra() methods are subject to SQL injection in column aliases via a crafted dictionary (with dictionary expansion) as the passed **kwargs.
- How it can be attacked
- Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
- Affected versions
- 2.2 to before 2.2.28; 3.2 to before 3.2.13; 4.0 to before 4.0.4
- What to do
- Upgrade to the fixed release for your branch (2.2.28, 3.2.13, 4.0.4) or a later one, then restart the service.
- Advisory
- Vendor advisory or patch (opens in a new tab)
7. CVE-2022-28347: SQL injection
- What NVD says
- A SQL injection issue was discovered in QuerySet.explain() in Django 2.2 before 2.2.28, 3.2 before 3.2.13, and 4.0 before 4.0.4. This occurs by passing a crafted dictionary (with dictionary expansion) as the **options argument, and placing the injection payload in an option name.
- How it can be attacked
- Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
- Affected versions
- 2.2 to before 2.2.28; 3.2 to before 3.2.13; 4.0 to before 4.0.4
- What to do
- Upgrade to the fixed release for your branch (2.2.28, 3.2.13, 4.0.4) or a later one, then restart the service.
- Advisory
- Vendor advisory or patch (opens in a new tab)
8. CVE-2021-35042: SQL injection
- What NVD says
- Django 3.1.x before 3.1.13 and 3.2.x before 3.2.5 allows QuerySet.order_by SQL injection if order_by is untrusted input from a client of a web application.
- How it can be attacked
- Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
- Affected versions
- 3.1 to before 3.1.13; 3.2 to before 3.2.5
- What to do
- Upgrade to the fixed release for your branch (3.1.13, 3.2.5) or a later one, then restart the service.
- Advisory
- Vendor advisory or patch (opens in a new tab)
9. CVE-2020-7471: SQL injection
- What NVD says
- Django 1.11 before 1.11.28, 2.2 before 2.2.10, and 3.0 before 3.0.3 allows SQL Injection if untrusted data is used as a StringAgg delimiter (e.g., in Django applications that offer downloads of data as a series of rows with a user-specified column delimiter). By passing a suitably crafted delimiter to a contrib.postgres.aggregates.StringAgg instance, it was possible to break escaping and inject malicious SQL.
- How it can be attacked
- Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
- Affected versions
- 1.11 to before 1.11.28; 2.2 to before 2.2.10; 3.0 to before 3.0.3
- What to do
- Upgrade to the fixed release for your branch (1.11.28, 2.2.10, 3.0.3) or a later one, then restart the service.
- Advisory
- Vendor advisory or patch (opens in a new tab)
10. CVE-2019-19844: Critical security flaw
- What NVD says
- Django before 1.11.27, 2.x before 2.2.9, and 3.x before 3.0.1 allows account takeover. A suitably crafted email address (that is equal to an existing user's email address after case transformation of Unicode characters) would allow an attacker to be sent a password reset token for the matched user account. (One mitigation in the new releases is to send password reset tokens only to the registered user email address.)
- How it can be attacked
- Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
- Affected versions
- before 1.11.27; 2.2 to before 2.2.9; 3.0
- What to do
- Upgrade to the fixed release for your branch (1.11.27, 2.2.9) or a later one, then restart the service.
- Advisory
- Vendor advisory or patch (opens in a new tab)
Django end of life: which versions still get security fixes
Running a release that still receives security fixes is the most effective way to avoid Django vulnerabilities. After a release reaches end of life, newly published CVEs stay unpatched. As of Nov 3, 2026 the supported Django releases are 6.1, 6.0, 5.2.
| Release | Released | End of life | Latest | Status |
|---|---|---|---|---|
| Django 6.1 | Aug 5, 2026 | Dec 31, 2027 | 6.1.2 | Supported |
| Django 6.0 | Dec 3, 2025 | Apr 30, 2027 | 6.0.9 | Supported |
| Django 5.2 (LTS) | Apr 2, 2025 | Apr 30, 2028 | 5.2.18 | Supported |
| Django 5.1 | Aug 7, 2024 | Dec 3, 2025 | 5.1.15 | End of life |
| Django 5.0 | Dec 4, 2023 | Apr 2, 2025 | 5.0.14 | End of life |
| Django 4.2 (LTS) | Apr 3, 2023 | Apr 7, 2026 | 4.2.30 | End of life |
| Django 4.1 | Aug 3, 2022 | Dec 1, 2023 | 4.1.13 | End of life |
| Django 4.0 | Dec 7, 2021 | Apr 1, 2023 | 4.0.10 | End of life |
Dates come from endoflife.date (opens in a new tab), which tracks each project's own support policy. Confirm them with the vendor before planning an upgrade.
How to check if your Django is vulnerable
Find the exact version first, then compare it with the affected and fixed versions in each CVE above.
python -m django --version
On Linux, Debian, Ubuntu and RHEL-based distributions often backport security fixes and keep the old version number, so a package that looks old can already be patched. Check your distribution's own security tracker or the package changelog before concluding that a server is exposed.
Django security checklist
- Update the core, themes, plugins and extensions as soon as security releases appear.
- Remove plugins, themes and modules you do not use.
- Give users the minimum role they need and enable two-factor authentication for administrators.
- Keep debug and development modes off in production.
- Back up files and database before every update.
- Put a web application firewall and rate limiting in front of login pages.
Where you run Django matters as much as how you patch it. Whether your site lives on a VPS, a dedicated server or shared hosting (opens in a new tab), check who is responsible for updating Django: on most plans the operating system and applications are yours to patch unless the plan says otherwise.
Your stack is bigger than Django. A flaw anywhere in the chain can be the way in, so also review our guides to Python vulnerabilities, PostgreSQL vulnerabilities and Flask vulnerabilities.
How to get alerted about new Django vulnerabilities
NVD received 32 new Django CVEs in the last twelve months, and critical ones can be exploited within days. Reading advisories by hand is easy to forget, so most teams automate it. You have three practical options:
- Follow the vendor's announcements and your distribution's security list. They are accurate but cover only one product and you read them manually.
- Query the NVD feed yourself. It is complete and needs scripting, filtering and a mail or chat integration to maintain.
- Use a stack-based alert service. You pick your technologies once and receive an email when a matching CVE appears.
Vulnario is the third option, and it is free to start. It scans the National Vulnerability Database, the CISA KEV catalog and GitHub Security Advisories every hour. You choose Django and the rest of your stack, confirm your email with a code, and the alerts begin. Each email includes the CVE number, the CVSS score, a marker when CISA lists the flaw as actively exploited, the attack vector, a patch or advisory link and a suggested time frame to fix it.
- Free: all technologies, alerts grouped at most every 12 hours.
- Pro ($29/month): alerts are sent on the next hourly scan, so you hear about a new CVE up to 12 hours earlier.
Related security guides
Few stacks run Django alone. These guides cover the technologies it is most often deployed with.
- Python vulnerabilities: Python is one of the most popular programming languages for web, data and automation.
- PostgreSQL vulnerabilities: PostgreSQL is a powerful open-source object-relational database.
- Flask vulnerabilities: Flask is a lightweight Python web framework.
- Nginx vulnerabilities: Nginx is a popular web server, reverse proxy and load balancer.
- FastAPI vulnerabilities: FastAPI is a modern Python web framework for building APIs.
- Angular vulnerabilities: Angular is Google's TypeScript web application framework (AngularJS is its legacy predecessor).
- Joomla vulnerabilities: Joomla is an open-source content management system.
Frequently asked questions about Django vulnerabilities
What are the most critical Django vulnerabilities?
Based on NVD scores and CISA's exploited-vulnerability catalog, the most critical Django CVEs include CVE-2026-4277 (CVSS 9.8), CVE-2025-59681 (CVSS 9.8), CVE-2024-53908 (CVSS 9.8). The guide above ranks the 10 most critical with affected versions and fixes.
Have Django vulnerabilities been exploited in real attacks?
For the Django product entries we checked, none of the CVEs is currently listed in CISA's Known Exploited Vulnerabilities (KEV) catalog. A CVE can still be exploited before it is added, so keep Django patched.
How many vulnerabilities does Django have?
As of Nov 3, 2026 the National Vulnerability Database lists 157 CVEs for Django, with 13 rated critical by CVSS v3. 32 were published in the previous twelve months.
Which Django versions are still supported?
As of Nov 3, 2026, endoflife.date lists these Django releases as supported: 6.1, 6.0, 5.2. Releases that are not listed are past their announced end of life.
How do I check which Django version I run?
Run python -m django --version on the server and compare the result with the fixed versions in each CVE. On Debian, Ubuntu and RHEL-based systems, fixes are often backported without changing the version number, so also check your distribution's security tracker.
How can I get alerted when a new Django CVE is published?
Add Django to a service that watches the National Vulnerability Database, CISA KEV and GitHub Security Advisories. Vulnario does this for free: choose Django and the rest of your stack, verify your email, and you receive an alert when a new CVE matches. Free alerts are grouped at most every 12 hours, and Pro sends them on the next hourly scan.
Is Django secure?
Django is as secure as its patch level. NVD published 32 new Django CVEs in the last twelve months, so running a current, supported release and applying security updates promptly is the most effective protection.
What is CVE-2026-4277?
CVE-2026-4277 is a critical Django vulnerability with a CVSS score of 9.8, published Apr 7, 2026. An issue was discovered in 6.0 before 6.0.4, 5.2 before 5.2.13, and 4.2 before 4.2.30. Add permissions on inline model instances were not validated on submission of forged `POST` data in `GenericInlineModelAdmin`.
Sources
- National Vulnerability Database (NVD) (opens in a new tab), CVE records, CVSS scores and CPE counts, checked Nov 3, 2026.
- CISA Known Exploited Vulnerabilities (KEV) catalog (opens in a new tab), checked Nov 3, 2026.
- endoflife.date: Django (opens in a new tab), release and support dates, checked Nov 3, 2026.
This article is informational and not a substitute for your own risk assessment. CVSS scores and affected versions may change when NVD updates a record.