CVE-2025-13372 is a SQL injection vulnerability in Django’s ORM affecting FilteredRelation when used with PostgreSQL. The issue affects Django 5.2 before 5.2.9, 5.1 before 5.1.15, and 4.2 before 4.2.27; unsupported earlier series such as 5.0.x, 4.1.x, and 3.2.x were not evaluated and may also be affected. The flaw arises from improper handling of column aliases when a suitably crafted dictionary is expanded as **kwargs into QuerySet.annotate() or QuerySet.alias(). In this code path, dictionary expansion can be used to inject malicious SQL through alias construction in FilteredRelation queries, bypassing the intended ORM query-safety guarantees on PostgreSQL.
Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.
What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
If you can’t patch tonight, do this now.
Patch, then assume compromise.
2 valid exploits after Mallory filtered fakes, detection scripts, and README-only repos.
This 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.
This 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.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.
9 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.
A SQL injection vulnerability in Django's FilteredRelation feature when used with PostgreSQL, allowing attackers to manipulate database queries.
High-severity SQL injection in Django’s ORM FilteredRelation (PostgreSQL) via crafted keyword-argument dictionary expansion in QuerySet.annotate()/alias(), enabling arbitrary SQL execution and potential data modification/deletion.
Unknown (only referenced in navigation text; described as SQL injection in PostgreSQL FilteredRelation, but no further details provided).
Query your assets running an affected version, and investigate the blast radius.
Every observed campaign linking this CVE to a named adversary.
Malware families riding this exploit, with evidence and IOCs.
YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Cross-references every affected SKU, including bundled OEM variants.
Community discussion across Reddit, Mastodon, and other social sources.