CVE-2024-27351: Regular expression denial-of-service in Django
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 truncatewordshtml 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.
Published Mar 15, 2024 · Updated Nov 4, 2025
Affected packages
django
- Ecosystem
- PyPI
- Affected
- >= 3.2, < 3.2.25
- Fixed in
- 3.2.25
- Check
pip show django
django
- Ecosystem
- PyPI
- Affected
- >= 4.2, < 4.2.11
- Fixed in
- 4.2.11
- Check
pip show django
django
- Ecosystem
- PyPI
- Affected
- >= 5.0, < 5.0.3
- Fixed in
- 5.0.3
- Check
pip show django
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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.
Credited to MarkLee131.
References
- https://nvd.nist.gov/vuln/detail/CVE-2024-27351
- https://docs.djangoproject.com/en/5.0/releases/security
- https://groups.google.com/forum/#%21forum/django-announce
- https://www.djangoproject.com/weblog/2024/mar/04/security-releases
- https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2024-47.yaml
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/D2JIRXEDP4ZET5KFMAPPYSK663Q52NEX
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SN2PLJGYSAAG5KUVIUFJYKD3BLQ4OSN6
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZQJOMNRMVPCN5WMIZ7YSX5LQ7IR2NY4D
- https://github.com/django/django/commit/072963e4c4d0b3a7a8c5412bc0c7d27d1a9c3521
- https://github.com/django/django/commit/3394fc6132436eca89e997083bae9985fb7e761e
- https://github.com/django/django/commit/3c9a2771cc80821e041b16eb36c1c37af5349d4a
- https://lists.fedoraproject.org/archives/list/[email protected]/message/ZQJOMNRMVPCN5WMIZ7YSX5LQ7IR2NY4D
- https://lists.fedoraproject.org/archives/list/[email protected]/message/D2JIRXEDP4ZET5KFMAPPYSK663Q52NEX
- https://lists.fedoraproject.org/archives/list/[email protected]/message/SN2PLJGYSAAG5KUVIUFJYKD3BLQ4OSN6
- https://github.com/advisories/GHSA-vm8q-m57g-pff3
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-15830
Django GeoDjango vulnerable to denial of service through deeply nested geometry collections
medium5.3Aug 4, 2026CVE-2026-48588
Django: cache middleware may expose private responses when unrelated request cookies are present
low3.1Jul 7, 2026CVE-2026-53877
Django: GDALRaster may over-read heap memory when constructed from bytes
medium4.8Jul 7, 2026CVE-2026-53878
Django: DomainNameValidator permits newline characters that may enable HTTP header injection
medium6.1Jul 7, 2026CVE-2026-35193
Django: UpdateCacheMiddleware may disclose private cached responses by omitting Authorization from Vary
low3.1Jun 3, 2026CVE-2026-48587
Django: has_vary_header may expose cached responses when Vary values contain whitespace
low3.1Jun 3, 2026
