Ask your developer whether any code builds Django QuerySet filters (filter(), exclude(), get(), or Q()) using a dictionary that includes user-controlled keys, especially one expanded with ** into the call.
Check which Django version your site runs (ask your developer or hosting provider).
Upgrade to the fixed version for your branch: Django 4.2.26, 5.1.14, or 5.2.8.
If you're on an older unsupported series (5.0.x, 4.1.x, 3.2.x), ask your developer to move to a supported, patched version.
After upgrading, have your developer confirm the site still runs and queries work as expected.
An issue was discovered in 5.1 before 5.1.14, 4.2 before 4.2.26, and 5.2 before 5.2.8.
The methods `QuerySet.filter()`, `QuerySet.exclude()`, and `QuerySet.get()`, and the class `Q()`, are subject to SQL injection when using a suitably crafted dictionary, with dictionary expansion, as the `_connector` argument.
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 cyberstan for reporting this issue.
In plain language
Written by AI from the record
A serious flaw in the Django web framework can let an attacker manipulate your database if your site's code passes certain user-controlled data into Django's query filters; most Django sites using filter()/exclude()/get() with a dictionary-based _connector argument should update soon.
Django's QuerySet.filter()/exclude()/get() and Q() objects are vulnerable to SQL injection (CWE-89) when an attacker can control the _connector key via dictionary expansion passed into these query methods, allowing arbitrary SQL execution.
If you're affected
Database data theft
Customer data exposure
Data tampering or deletion
Full database compromise
What is it
Django is a popular toolkit many websites are built on to talk to their databases. This flaw is like a hidden backdoor in how some search/filter features are built: if a developer passes certain attacker-influenced data into Django's query functions, the attacker could sneak in their own database commands — similar to handing someone a form to fill out but they instead write instructions that make the filing clerk hand over or destroy records.
Who is affected
This matters to you if your website or application is built on Django, particularly versions in the 4.2, 5.1, or 5.2 series before the fixed releases. It also affects certain Red OS Linux distributions that bundle Django. The real risk depends on whether your developers wrote code that passes user-supplied dictionaries into Django's filter(), exclude(), get(), or Q() functions using dictionary expansion — if they didn't use this pattern, exposure is unlikely.
How urgent is it
There's no confirmed evidence yet of attackers actively exploiting this in real attacks, but a public proof-of-concept exploit already exists on GitHub and the flaw is rated critical, so the risk of exploitation is real and growing. Press attention on this issue is rising. You should plan to patch promptly rather than treat this as routine maintenance, but it does not require emergency, same-day action absent active exploitation.
What to do — in detail
Audit your codebase for calls to QuerySet.filter(), .exclude(), .get(), or Q() where a dictionary (especially one built from request data) is expanded with ** and could include a '_connector' key — this is the specific exploitable pattern.
Identify your Django branch and upgrade to the fixed release: 4.2.26 (LTS), 5.1.14, or 5.2.8. If on unsupported series (5.0.x, 4.1.x, 3.2.x), migrate to a supported, patched branch — these were not evaluated by the vendor but may share the flaw.
As a temporary mitigation if upgrading isn't immediate, audit and sanitize any user input that reaches query-building dictionaries, and avoid dynamically constructing filter kwargs from untrusted sources containing a '_connector' key.
Not in CISA KEV at this time, so no federal remediation deadline applies, but given the public PoC and critical severity, treat this as a priority patch within your normal security SLA.
After patching, monitor application logs for anomalous database errors or unusual query patterns that could indicate injection attempts.
Technical context
CVSS 9.1 (Critical, AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N) — unauthenticated, network-exploitable SQL injection (CWE-89) with high confidentiality and integrity impact but no availability impact. EPSS places this in a high percentile for predicted near-term exploitation, though no confirmed in-the-wild exploitation or CISA KEV listing exists yet. A public PoC is available on GitHub, indicating moderate exploit maturity. Fixed in Django 4.2.26, 5.1.14, and 5.2.8; unsupported branches (5.0.x, 4.1.x, 3.2.x) were not evaluated and should be assumed potentially vulnerable.
This is a general assessment based on public vulnerability data. It does not account for your specific infrastructure — when in doubt, consult a security specialist.
Not confirmed. Public exploit code exists (1 source), but CVE-2025-64459 is not in CISA KEV. EPSS puts the chance of exploitation in the next 30 days at 19%.
Which versions are affected by CVE-2025-64459?
Django: ≥ 5.2, < 5.2.8; ≥ 5.1, < 5.1.14; ≥ 4.2, < 4.2.26. Django: ≥ 5.2a1, < 5.2.8. RED OS: 7.3. 1 more product is listed in the record.
How do I fix or mitigate CVE-2025-64459?
Upgrade to a fixed build for your product branch: 5.2.8, 5.1.14, 4.2.26. The advisory is on docs.djangoproject.com.