CVE-2024-27351: django · ReDoS
Affects djangoSource CVE Database V5
Mentioned vulnerabilities
Not known to be exploited · CVSS 5.3 Medium · fixed in 5.0.3 : update django when convenient.
Data as of 26 Oct 2026, 17:16 UTC
- EPSS
- 1.8% chance of exploitation in 30 days – higher than 79% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 5.0.3, 5.0, 4.2.11 +2
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:HExploitation evidence
Disclosed: evidence found.
CVE published 15 Mar 2024
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.
What to do
Upgrade to a fixed release listed under Affected software.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
PyPIdjangopkg:pypi/djangoOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
The most effective mitigation is to upgrade Django to versions 3.2.25, 4.2.11, or 5.0.3 or later, where the vulnerability is fully addressed. Organizations should audit their codebases to identify usage of django.utils.text.Truncator.words() with html=true and the truncatewords_html template filter, especially in contexts processing untrusted input. Input validation and sanitization should be enhanced to reject or safely handle suspiciously crafted strings that might trigger ReDoS. Implementing web application firewalls (WAFs) with rules to detect and block malicious payloads targeting regular expression engines can provide additional protection. Monitoring application performance metrics and logs for unusual CPU spikes or slowdowns can help detect exploitation attempts early. For critical services, consider rate limiting and user interaction controls to reduce exposure. Finally, educating developers about secure use of regular expressions and avoiding complex patterns on untrusted input is recommended to prevent similar issues.
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.
References
- groups.google.com/forum/ (opens in a new tab)
- docs.djangoproject.com/en/5.0/releases/security/ (opens in a new tab)
- djangoproject.com/weblog/2024/mar/04/security-releases/ (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/D2JIRXEDP4ZET5KFMAPPYSK663Q52NEX/ (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SN2PLJGYSAAG5KUVIUFJYKD3BLQ4OSN6/ (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZQJOMNRMVPCN5WMIZ7YSX5LQ7IR2NY4D/ (opens in a new tab)
- openwall.com/lists/oss-security/2024/03/04/1 (opens in a new tab)
- github.com/django/django/commit/3394fc6132436eca89e997083bae9985fb7e761e (opens in a new tab)
- github.com/django/django/commit/3c9a2771cc80821e041b16eb36c1c37af5349d4a (opens in a new tab)
- github.com/django/django/commit/072963e4c4d0b3a7a8c5412bc0c7d27d1a9c3521 (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZQJOMNRMVPCN5WMIZ7YSX5LQ7IR2NY4D/ (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SN2PLJGYSAAG5KUVIUFJYKD3BLQ4OSN6/ (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/D2JIRXEDP4ZET5KFMAPPYSK663Q52NEX/ (opens in a new tab)