CVE-2024-27351 in Django-Rest-Framework Django Rest Framework and 1 more product
In Django 3.2 before 3.2.25, 4.2 before 4.2.11, and 5.0 before 5.0.3, the django.utils.text.Truncator.words() method (with html=True) and the truncatewords_html template filter are subject to a potential regular expression denial-of-service attack via a crafted string. NOTE: this issue exists because of an incomplet...
Affects 2 products from 2 vendors. Facts below cite their sources.
Remotely exploitable over the network, high complexity, no authentication required, requires user interaction, impact contained to the vulnerable component, no confidentiality impact, no integrity impact, full availability impact.
Affected products and versions
| Vendor | Product | Affected versions |
|---|---|---|
| Django-Rest-Framework | Django Rest Framework | ≥ 5.0, < 5.0.3 |
| Djangoproject | Django | ≥ 3.2, < 3.2.25 ≥ 4.2, < 4.2.11 ≥ 5.0, < 5.0.3 |
A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.
Fix and vendor advisory
Vendor PSIRT: [email protected]
Exploitation
| CISA known-exploited | Not in the CISA KEV catalog |
|---|---|
| Public exploit | Not confirmed |
Official description
In Django 3.2 before 3.2.25, 4.2 before 4.2.11, and 5.0 before 5.0.3, the django.utils.text.Truncator.words() method (with html=True) and the truncatewords_html template filter are subject to a potential regular expression denial-of-service attack via a crafted string. NOTE: this issue exists because of an incomplete fix for CVE-2019-14232 and CVE-2023-43665.
Source: NIST NVD / MITRE CVE.
Record details
| CVE ID | CVE-2024-27351 |
|---|---|
| BreachSpider ID | BS-2024-GLOBAL-205709-M |
| CVSS vector | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H |
| Published | 2024-03-15 |
| Last modified | 2026-06-17 |
| Weakness (CWE) | |
| Source | NVD |
Weakness definitions
CWE-1333: CWE-1333
Related attack patterns (CAPEC)
CAPEC-492 Regular Expression Exponential Blowup via CWE-1333
Mapping is CWE to CAPEC per MITRE CAPEC 3.9.
Analysis AI-written, not human-reviewed
A potential regular expression denial-of-service (DoS) attack exists in Django versions 3.2 before 3.2.25, 4.2 before 4.2.11, and 5.0 before 5.0.3 due to the django.utils.text.Truncator.words() method and the truncatewords_html template filter when html=True is used. This issue arises from an incomplete fix for previous vulnerabilities CVE-2019-14232 and CVE-2023-43665.
An attacker can craft a specific string input to the django.utils.text.Truncator.words() method or the truncatewords_html template filter, which, when processed, can cause excessive CPU and memory usage, leading to a denial-of-service condition.
Questions
What is CVE-2024-27351?
A potential regular expression denial-of-service (DoS) attack exists in Django versions 3.2 before 3.2.25, 4.2 before 4.2.11, and 5.0 before 5.0.3 due to the django.utils.text.Truncator.words() method and the truncatewords_html template filter when html=True is used. This issue arises from an incomplete fix for previous vulnerabilities CVE-2019-14232 and CVE-2023-43665.
What is the CVSS score for CVE-2024-27351?
CVE-2024-27351 has CVSS 5.3 (Medium). Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H. EPSS: 2.4%.
Is CVE-2024-27351 actively exploited?
No confirmed active exploitation of CVE-2024-27351 as of 2026-09-25.
How do I remediate CVE-2024-27351?
Priority: HIGH. Advisory: https://docs.djangoproject.com/en/5.0/releases/security/ PSIRT: [email protected]
What systems are affected by CVE-2024-27351?
CVE-2024-27351 affects Django-Rest-Framework Django Rest Framework; Djangoproject Django.
For developers and AI agents
Run this check from your own code or agent
REST API
curl -s https://breachspider.com/api/v1/assets/correlate-cves \
-H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"assets":[{"asset_id":"dev-1","vendor":"Django-Rest-Framework","product":"Django Rest Framework","version":"1.0"}]}'
MCP for AI agents
# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp
Free trial: 14 days, 750 device checks, no card.
Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2026-06-17.