CVE Vulnerabilities

CVE-2024-27351

Inefficient Regular Expression Complexity

Published: Mar 15, 2024 | Modified: Nov 04, 2025
CVSS 3.x
N/A
Source:
NVD
CVSS 2.x
RedHat/V2
RedHat/V3
7.5 MODERATE
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Ubuntu
MEDIUM
root.io logo minimus.io logo echo.ai logo

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.

Weakness

The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles.

Affected Software

NameVendorStart VersionEnd Version
DjangoDjangoproject3.2 (including)3.2.25 (excluding)
DjangoDjangoproject4.2 (including)4.2.11 (excluding)
DjangoDjangoproject5.0 (including)5.0.3 (excluding)
Red Hat Ansible Automation Platform 2.4 for RHEL 8RedHatpython3x-django-0:4.2.11-1.el8ap*
Red Hat Ansible Automation Platform 2.4 for RHEL 8RedHatautomation-controller-0:4.5.7-1.el8ap*
Red Hat Ansible Automation Platform 2.4 for RHEL 9RedHatpython-django-0:4.2.11-1.el9ap*
Red Hat Ansible Automation Platform 2.4 for RHEL 9RedHatautomation-controller-0:4.5.7-1.el9ap*
Red Hat OpenStack Platform 17.1 for RHEL 9RedHatpython-django-0:2.2.24-9.el9ost*
Red Hat Satellite 6.15 for RHEL 8RedHatpython-django-0:4.2.14-1.el8pc*
Red Hat Satellite 6.15 for RHEL 8RedHatpython-django-0:4.2.14-1.el8pc*
RHUI 4 for RHEL 8RedHatpython-django-0:4.2.11-1.el8ui*
Python-djangoUbuntubionic*
Python-djangoUbuntudevel*
Python-djangoUbuntuesm-infra/bionic*
Python-djangoUbuntuesm-infra/focal*
Python-djangoUbuntufocal*
Python-djangoUbuntujammy*
Python-djangoUbuntumantic*
Python-djangoUbuntunoble*
Python-djangoUbuntuoracular*
Python-djangoUbuntuplucky*
Python-djangoUbuntuquesting*
Python-djangoUbuntutrusty*
Python-djangoUbuntutrusty/esm*
Python-djangoUbuntuupstream*
Python-djangoUbuntuxenial*

Extended Description

	  Attackers can create crafted inputs that
	  intentionally cause the regular expression to use
	  excessive backtracking in a way that causes the CPU
	  consumption to spike.

Potential Mitigations

References