---
id: "CVE-2025-64459"
kind: "vulnerability"
aliases: ["CVE-2025-64459"]
title: "Django: crafted dictionaries let attackers inject SQL into queries"
severity: "critical"
cvss: 9.1
epss: 0.19257
exploited: false
status: "open"
category: "runtime"
products: [{"name": "djangoproject django", "fixed": ["4.2.26"], "affected": ">= 4.2, < 4.2.26", "ecosystem": "vendor"}, {"name": "djangoproject django", "fixed": ["5.1.14"], "affected": ">= 5.1, < 5.1.14", "ecosystem": "vendor"}, {"name": "djangoproject django", "fixed": ["5.2.8"], "affected": ">= 5.2, < 5.2.8", "ecosystem": "vendor"}]
ecosystems: ["vendor"]
tags: ["cloudflare", "django", "lab-disclosure", "python", "runtime", "web-apps"]
not_affected_if: ["patched-versions"]
published_at: "2025-11-05T15:15:41+00:00"
first_seen_at: "2026-10-24T19:28:15+00:00"
updated_at: "2026-10-25T12:38:49+00:00"
sources: [{"source": "lab", "url": "https://developers.cloudflare.com/changelog/post/2026-02-02-waf-release/", "first_seen_at": "2026-10-24T19:28:15+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-64459", "first_seen_at": "2026-10-24T20:15:27+00:00"}, {"source": "epss", "url": "https://api.first.org/data/v1/epss?cve=CVE-2025-64459", "first_seen_at": "2026-10-25T12:38:49+00:00"}]
---

# Django: crafted dictionaries let attackers inject SQL into queries

Django versions before 4.2.26, 5.1.14 and 5.2.8 let crafted dictionaries passed to QuerySet methods and the Q() class inject SQL. An attacker who can send such input to a vulnerable view can read or change database contents.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- vendor:djangoproject django affected >= 4.2, < 4.2.26 fixed 4.2.26
- vendor:djangoproject django affected >= 5.1, < 5.1.14 fixed 5.1.14
- vendor:djangoproject django affected >= 5.2, < 5.2.8 fixed 5.2.8

## How to check

- Run `python -m django --version` and compare against `4.2.26`, `5.1.14` and `5.2.8`.
- Search the codebase for QuerySet filter calls and `Q()` built from request data, such as `request.GET` or `request.POST` dictionaries.
- Check whether Cloudflare's managed ruleset 'Django SQLI - CVE:CVE-2025-64459' is set to Block for your zone.

## Fix

- Upgrade Django to `4.2.26`, `5.1.14` or `5.2.8`, matching your release line.
- Until upgraded, set the Cloudflare WAF rule 'Django SQLI - CVE:CVE-2025-64459' to Block; it was Log before the 2026-02-02 release.

## Timeline

- 2026-10-24T19:28:15+00:00 lab https://developers.cloudflare.com/changelog/post/2026-02-02-waf-release/ — Cloudflare: WAF Release - 2026-02-02 · Changelog
- 2026-10-24T20:15:27+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2025-64459
- 2026-10-25T12:38:49+00:00 epss https://api.first.org/data/v1/epss?cve=CVE-2025-64459

## Documents

- [advisory] Cloudflare: WAF Release - 2026-02-02 · Changelog https://developers.cloudflare.com/changelog/post/2026-02-02-waf-release/

## From the sources

WAF Release - 2026-02-02 · Changelog

# Changelog

New updates and improvements at Cloudflare.

February 2, 2026

## WAF Release - 2026-02-02

This week’s release introduces new detections for CVE-2025-64459 and CVE-2025-24893.

Key Findings

- CVE-2025-64459: Django versions prior to 5.1.14, 5.2.8, and 4.2.26 are vulnerable to SQL injection via crafted dictionaries passed to QuerySet methods and the `Q()` class.
- CVE-2025-24893: XWiki allows unauthenticated remote code execution through crafted requests to the SolrSearch endpoint, affecting the entire installation.

| Ruleset | Rule ID | Legacy Rule ID | Description | Previous Action | New Action | Comments |
| --- | --- | --- | --- | --- | --- | --- |
| Cloudflare Managed Ruleset | ...30698ff3 | N/A | XWiki - Remote Code Execution - CVE:CVE-2025-24893 2 | Log | Block | This is a new detection. |
| Cloudflare Managed Ruleset | ...da8ba7e6 | N/A | Django SQLI - CVE:CVE-2025-64459 | Log | Block | This is a new detection. |
| Cloudflare Managed Ruleset | ...8d667511 | N/A | NoSQL, MongoDB - SQLi - Comparison - 2 | Block | Block | Rule metadata description refined. Detection unchanged. |

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
