CVE Tools

CVE-2025-64459

Potential SQL injection via _connector keyword argument in QuerySet and Q objects

CVE-2025-64459 is an SQL injection in Djangoproject Django (CVSS 9.1, Critical).

Public exploit available. Not confirmed exploited in the wild yet. Fixed versions are out.

Check it yourself

OpenVAS · 22 checks

e.g. OID 1.3.6.1.4.1.25623.1.0.155711

Run the check

Published Updated Sources: CVE.org, NVD, GitHub, BDU

What to do

Find your product and version, then upgrade to the build on the right.

  • djangoproject DjangoAffected: ≥ 5.2, < 5.2.8Upgrade to: 5.2.8Affected: ≥ 5.1, < 5.1.14Upgrade to: 5.1.14Affected: ≥ 4.2, < 4.2.26Upgrade to: 4.2.26Stated by: CVE record
  • PyPI djangoAffected: ≥ 5.2a1, < 5.2.8Upgrade to: 5.2.8Stated by: GitHub advisory
  • RED SOFT RED OSAffected: 7.3Upgrade to: not statedStated by: BDU
  • Django Software Foundation DjangoAffected: 6.0Upgrade to: not statedStated by: BDU

Versions as the sources state them. Full version matrix after sign-in

Steps

Written by AI from the record
  1. 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.
  2. Check which Django version your site runs (ask your developer or hosting provider).
  3. Upgrade to the fixed version for your branch: Django 4.2.26, 5.1.14, or 5.2.8.
  4. 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.
  5. After upgrading, have your developer confirm the site still runs and queries work as expected.
pip install --upgrade django>=5.2.8

What it is

From the CVE record

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

Exploitation

Where each signal puts this CVE on the scale from published to confirmed exploited.

EPSS98th
Public exploit
CISA KEV

Not in the catalog. CISA has not confirmed exploitation.

Public exploits

1 source with a proof of concept or module.

Exploit links, PoCs and Metasploit modules after sign-in
EPSS

19% chance of exploitation activity in the next 30 days, which ranks it in the 98th percentile of scored CVEs.

Exploit Prediction Scoring System, FIRST.org. A probability, not a confirmation.

Attention now

unknown.

Real risk signals with little public attention so far.

Lifecycle

The patch came 116 days before any public exploit.

  1. EPSS band changelow → moderateepss band change
  2. EPSS band changemoderate → lowepss band change
  3. OpenVAS check added
  4. EPSS band changelow → moderate
  5. Public exploit / PoCsource: github-poc
  6. Patch availablerecord updated

Affected products

And 1 more affected product. See all after sign-in

Scale

How widely the affected products are used. This is not a count of vulnerable hosts.

Estimate Public sources, each figure dated. How much of it is already patched is not known.

Django

Library
  • 52.4Mdownloads / month

    PyPI downloads, last 30 days (pypistats, mirrors excluded).

    PyPI ↗ · as of 2 Dec 2026 · High confidence

Version split: unknown. No public source for this product.

Technical detail

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Scored 9.1 by NVD.

How it is reached

  • Attack Vector NetworkExploitable remotely over the network without any special conditions
  • Attack Complexity LowNo special conditions — the attack can be reliably reproduced
  • Privileges Required NoneNo authentication required — anyone can exploit this
  • User Interaction NoneNo user interaction needed — fully automated exploitation

Scope

  • Scope UnchangedImpact is limited to the vulnerable component itself

Impact if exploited

  • Confidentiality HighTotal information disclosure — all data in the component is compromised
  • Integrity HighTotal loss of integrity — attacker can modify any data in the component
  • Availability NoneNo availability impact

Weaknesses

ATT&CK techniques

Mapped from the weaknesses above (CWE to ATT&CK), not observed in attacks.

Sources

Questions about CVE-2025-64459

Is CVE-2025-64459 being exploited?
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.

Last updated

Related articles

All articles

Watch the software you run.

My Stack ranks new CVEs for your products by real-world exploitation, so the next serious one reaches you without reading every advisory.

We'll flag the next CVE, public exploit or patch for Django, not every advisory. This one: public exploit.