CVE-2023-43665: Django: CVE-2023-43665: Denial-of-service possibility in django.utils.text.Truncator

Published Sep 27, 2023
·
Updated

Following the fix for CVE-2019-14232, the regular expressions used in the implementation of django.utils.text.Truncator’s chars() and words() methods (with html=True) were revised and improved. However, these regular expressions still exhibited linear backtracking complexity, so when given a very long, potentially malformed HTML input, the evaluation would still be slow, leading to a potential denial of service vulnerability.

The chars() and words() methods are used to implement the truncatecharshtml and truncatewordshtml template filters, which were thus also vulnerable.

The input processed by Truncator, when operating in HTML mode, has been limited to the first five million characters in order to avoid potential performance and memory issues.

Other sources

In Django 3.2 before 3.2.22, 4.1 before 4.1.12, and 4.2 before 4.2.6, the django.utils.text.Truncator chars() and words() methods (when used with html=True) are subject to a potential DoS (denial of service) attack via certain inputs with very long, potentially malformed HTML text. The chars() and words() methods are used to implement the truncatecharshtml and truncatewordshtml template filters, which are thus also vulnerable. NOTE: this issue exists because of an incomplete fix for CVE-2019-14232.

— Ubuntu

Affected Software

24 affected componentsFixes available
ubuntu/python-django<4.2.6, <4.1.12, <3.2.22
4.2.64.1.123.2.22
ubuntu/python-django<2:2.2.12-1ubuntu0.20
2:2.2.12-1ubuntu0.20
ubuntu/python-django<2:3.2.12-2ubuntu1.9
2:3.2.12-2ubuntu1.9
ubuntu/python-django<3:3.2.18-1ubuntu0.5
3:3.2.18-1ubuntu0.5
ubuntu/python-django<1:1.11.11-1ubuntu1.21+
1:1.11.11-1ubuntu1.21+
ubuntu/python-django<3:4.2.4-1ubuntu2
3:4.2.4-1ubuntu2
pip/django>=4.2a1<4.2.6
4.2.6
pip/django>=4.1a1<4.1.12
4.1.12
pip/django>=3.2a1<3.2.22
3.2.22
djangoproject Django>=3.2<3.2.22
djangoproject Django>=4.1<4.1.12
djangoproject Django>=4.2<4.2.6
Fedoraproject Fedora=39
redhat/python-django<3.2.22
3.2.22
redhat/python-django<4.1.12
4.1.12
redhat/python-django<4.2.6
4.2.6
alpine/py3-django<4.2.6-r0
4.2.6-r0
alpine/py3-django<4.2.6-r0
4.2.6-r0
alpine/py3-django<4.2.6-r0
4.2.6-r0
alpine/py3-django<4.2.6-r0
4.2.6-r0
alpine/py3-django<4.2.6-r0
4.2.6-r0
alpine/py3-django<4.2.6-r0
4.2.6-r0
alpine/py3-django<4.2.6-r0
4.2.6-r0
debian/python-django
2:2.2.28-1~deb11u73:3.2.25-0+deb12u13:4.2.6-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade ubuntu/python-django to a version that resolves this vulnerability.

    Fixed in 4.2.6Fixed in 4.1.12Fixed in 3.2.22
  2. Upgrade

    Upgrade ubuntu/python-django to a version that resolves this vulnerability.

    Fixed in 2:2.2.12-1ubuntu0.20
  3. Upgrade

    Upgrade ubuntu/python-django to a version that resolves this vulnerability.

    Fixed in 2:3.2.12-2ubuntu1.9
  4. Upgrade

    Upgrade ubuntu/python-django to a version that resolves this vulnerability.

    Fixed in 3:3.2.18-1ubuntu0.5
  5. Upgrade

    Upgrade ubuntu/python-django to a version that resolves this vulnerability.

    Fixed in 1:1.11.11-1ubuntu1.21+
  6. Upgrade

    Upgrade ubuntu/python-django to a version that resolves this vulnerability.

    Fixed in 3:4.2.4-1ubuntu2
  7. Upgrade

    Upgrade pip/Django to a version that resolves this vulnerability.

    Fixed in 4.2.6
  8. Upgrade

    Upgrade pip/Django to a version that resolves this vulnerability.

    Fixed in 4.1.12
  9. Upgrade

    Upgrade pip/Django to a version that resolves this vulnerability.

    Fixed in 3.2.22
  10. Upgrade

    Upgrade redhat/python-django to a version that resolves this vulnerability.

    Fixed in 3.2.22
  11. Upgrade

    Upgrade redhat/python-django to a version that resolves this vulnerability.

    Fixed in 4.1.12
  12. Upgrade

    Upgrade redhat/python-django to a version that resolves this vulnerability.

    Fixed in 4.2.6
  13. Upgrade

    Upgrade alpine/py3-django to a version that resolves this vulnerability.

    Fixed in 4.2.6-r0
  14. Upgrade

    Upgrade debian/python-django to a version that resolves this vulnerability.

    Fixed in 2:2.2.28-1~deb11u7Fixed in 3:3.2.25-0+deb12u1Fixed in 3:4.2.6-1
  15. Upgrade

    Upgrade Django to a version that resolves this vulnerability.

    Fixed in 3.2.22

Event History

Sep 27, 2023
Data Sourced
08:01 PM
DescriptionSeverityAffected Software
Oct 4, 2023
CVE Published
12:00 AM
Data Sourced
12:00 AM
Remedy
Data Sourced
via Ubuntu·12:00 AM
RemedyDescriptionSeverityAffected Software
Nov 3, 2023
CVE Published
via MITRE·12:00 AM
Data Sourced
via OSV·12:00 AM
Description
Advisory Published
06:36 AM
Advisory Published
07:35 PM
Nov 13, 2023
Data Sourced
03:29 PM
Weakness
Updated
03:29 PM
Affected Software
Nov 14, 2023
Data Sourced
via Red Hat·12:34 PM
DescriptionSeverityAffected Software
Updated
09:48 PM
Weakness
Dec 21, 2023
Updated
10:15 PM
Affected Software
Apr 20, 2024
Data Sourced
via MITRE·03:06 AM
Description
Data Sourced
via NVD·03:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Updated
via NVD·03:15 AM
Affected Software
May 1, 2024
Updated
via NVD·05:15 PM
Affected Software
May 2, 2024
Data Sourced
via GitHub·05:04 AM
DescriptionSeverityWeaknessAffected Software
Sep 20, 2024
Updated
via GitHub·03:42 PM
Affected Software
Nov 4, 2025
Updated
via NVD·06:15 PM
RemedyAffected Software
Jun 17, 2026
Updated
via NVD·06:26 AM
RemedyAffected Software
Nov 3, 2026
Data Sourced
via OSV·06:32 AM
SeverityAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the vulnerability ID of this security issue?

The vulnerability ID of this security issue is CVE-2023-43665.

2

What is the title of this vulnerability?

The title of this vulnerability is "Django: CVE-2023-43665: Denial-of-service possibility in django.utils.text.Truncator".

3

What is the description of this vulnerability?

The description of this vulnerability is "Denial-of-service possibility in django.utils.text.Truncator".

4

What software is affected by this vulnerability?

The affected software is python-django version 4.2.6, 4.1.12, and 3.2.22 on Ubuntu, version 2:2.2.12-1ubuntu0.20 on Ubuntu Focal, version 2:3.2.12-2ubuntu1.9 on Ubuntu Jammy, version 3:3.2.18-1ubuntu0.5 on Ubuntu Lunar, and version 1:1.11.11-1ubuntu1.21+ on Ubuntu Bionic.

5

How can I fix this vulnerability?

To fix this vulnerability, update your python-django package to the recommended version provided by your operating system vendor or follow the instructions in the official security release from Django.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203