Skip to main content
Mallory
MediumPublic exploitVulnerability

CVE-2025-13372: SQL Injection in Django FilteredRelation Column Aliases

Published Dec 2, 2025 · Updated 2 months ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
CVSS4.3Medium · v3.1
EPSS0.55%40th percentile
CISA KEVNoNot listed
In the wildNonePublic exploit, no exploitation reported
Vendor
Djangoproject
IdentifiersCVE-2025-13372CWE-89 · Improper Neutralization of Special…

CVE-2025-13372 is an SQL injection vulnerability in Django's FilteredRelation support when used with PostgreSQL. Django versions 5.2 before 5.2.9, 5.1 before 5.1.15, and 4.2 before 4.2.27 permit injection through column aliases when a suitably crafted dictionary is expanded as **kwargs and passed to QuerySet.annotate() or QuerySet.alias(). Unsupported Django branches, including 5.0.x, 4.1.x, and 3.2.x, were not evaluated and may also be affected.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation enables SQL injection in affected Django applications using PostgreSQL. Depending on the application context and database privileges, this can permit unauthorized query manipulation, exposure of database data, modification of records, or other database-level effects.

Mitigation

If you can’t patch tonight, do this now.

No workaround is provided. Before upgrading, avoid expanding untrusted or user-controlled dictionaries as **kwargs into QuerySet.annotate() or QuerySet.alias() where FilteredRelation and PostgreSQL are used. Review code paths that dynamically construct column aliases.

Remediation

Patch, then assume compromise.

Upgrade Django to a fixed release: 5.2.9 or later for the 5.2 series, 5.1.15 or later for the 5.1 series, or 4.2.27 or later for the 4.2 series. Earlier unsupported Django series were not evaluated and may also be affected; migrate them to a supported, fixed release.

Public exploits

Exploits

2 exploits validated by Mallory's analysis.

View more in app →
Ashwesker-CVE-2025-13372This repository contains a proof-of-concept (PoC) exploit for CVE-2025-13372, a high-severity SQL injection vulnerability in Django (versions <= 5.2.8, <= 5.1.14, <= 4.2.26) when using PostgreSQL and dynamic aliasing in ORM queries. The main file, 'CVE-2025-13372.py', is a Python script that automates the process of testing for the vulnerability by sending crafted SQL injection payloads to common web application endpoints and parameters that are likely to be affected (such as 'alias', 'col', 'field', 'column', 'sort', 'q', and 'order'). The script checks for PostgreSQL error messages or time delays to determine if the target is vulnerable. The README.md provides a comprehensive technical breakdown, affected versions, mitigation steps, and usage instructions. The exploit is a network-based PoC and does not provide a weaponized or post-exploitation payload, but it can confirm the presence of the vulnerability and could be adapted for more advanced attacks if a vulnerable endpoint is found.Ashwesker · Disclosed Dec 3, 2025 · python · markdown · networkPoCBlackash-CVE-2025-13372This repository contains a proof-of-concept (PoC) exploit for CVE-2025-13372, a high-severity SQL injection vulnerability in Django (versions <= 5.2.8, <= 5.1.14, <= 4.2.26) when used with PostgreSQL and dynamic aliasing in ORM queries. The exploit is implemented in a single Python script (CVE-2025-13372.py) that automates the process of testing for SQL injection by injecting crafted payloads into various likely-vulnerable query parameters (such as alias, col, field, column, sort, q, order) across common endpoints. The script detects vulnerability by looking for PostgreSQL error messages or time-based delays (using pg_sleep). The README.md provides a comprehensive technical breakdown, affected versions, mitigation steps, and usage instructions. The exploit is a network-based PoC and does not provide a post-exploitation payload, but confirms the presence of the vulnerability by observing server responses. No hardcoded IPs or domains are present; the script takes a user-supplied target URL and appends test paths and parameters. The repository is well-structured for research and testing purposes.Ashwesker · Disclosed Dec 3, 2025 · python · markdown · networkPoC
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
DjangoprojectDjangoapplication
FAQ

Frequently asked questions

Is CVE-2025-13372 exploited in the wild?
As of Oct 2, 2026, Mallory has no reports of CVE-2025-13372 being exploited in the wild. It is not listed in CISA KEV.
Is there a public exploit for CVE-2025-13372?
Yes. Mallory tracks 2 public exploits or proofs of concept for CVE-2025-13372, the earliest disclosed Dec 3, 2025.
Is there a patch for CVE-2025-13372?
Upgrade Django to a fixed release: 5.2.9 or later for the 5.2 series, 5.1.15 or later for the 5.1 series, or 4.2.27 or later for the 4.2 series. Earlier unsupported Django series were not evaluated and may also be affected; migrate them to a supported, fixed release.
What products are affected by CVE-2025-13372?
Djangoproject Django.
How severe is CVE-2025-13372?
CVE-2025-13372 has a CVSS v3.1 score of 4.3 (Medium) and an EPSS score of 0.55% (40th percentile) as of Oct 2, 2026.
Activity feed

Recent activity

10 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidenceEvery report linking this CVE to a named adversary.
Associated malwareMalware families linked to this CVE, with evidence and IOCs.
Detection signaturesYARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity5Community discussion across Reddit, Mastodon, and other social sources.