Description
An issue was discovered in Django 5.1 before 5.1.7, 5.0 before 5.0.13, and 4.2 before 4.2.20. The django.utils.text.wrap() method and wordwrap template filter are subject to a potential denial-of-service attack when used with very long strings.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| djangoproject | Django | 4.2 – < 4.2.20, 5.0 – < 5.0.13, 5.1 – < 5.1.7 | 4.2.20 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | python-django | 3:4.2.20-1 | — |
| Debian 13 | python-django | 3:4.2.20-1 | — |
| Debian 12 | python-django | 3:3.2.25-0+deb12u1 | DSA-6136-1 |
| Debian 11 | python-django | 2:2.2.28-1~deb11u6 | DLA-4086-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 25.10 | python-django | 3:4.2.18-1ubuntu1 | — |
| Ubuntu 24.04 LTS | python-django | 3:4.2.11-1ubuntu1.6 | USN-7335-1 |
| Ubuntu 22.04 LTS | python-django | 2:3.2.12-2ubuntu1.17 | USN-7335-1 |
| Ubuntu 20.04 LTS | python-django | 2:2.2.12-1ubuntu0.28 | USN-7335-1 |
Show 3 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 18.04 LTS | python-django | 1:1.11.11-1ubuntu1.21+esm10 | USN-7335-1 |
| Ubuntu Pro 16.04 LTS | python-django | No fix yet | — |
| Ubuntu Pro 14.04 LTS | python-django | No fix yet | — |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Red Hat Ansible Automation Platform Inside 2 | python3.11-jinja2 | 3.1.6-1.el8ap | RHSA-2025:3160 |
| Red Hat Ansible Automation Platform Developer 2 | python3.11-django | 4.2.20-1.el8ap | RHSA-2025:3160 |
| Red Hat Ansible Automation Platform Developer 2 | python3.11-jinja2 | 3.1.6-1.el8ap | RHSA-2025:3160 |
| Red Hat Ansible Automation Platform 2 | automation-controller-venv-tower | 4.6.10-1.el8ap | RHSA-2025:4553, RHSA-2025:3160 |
| Red Hat Ansible Automation Platform 2 | python-django +1 | 4.2.21-1.el9ap | RHSA-2025:8609 |
| Red Hat Ansible Automation Platform 2 | python3.11-django | 4.2.20-1.el8ap | RHSA-2025:3160 |
| Red Hat Ansible Automation Platform 2 | python3.11-jinja2 | 3.1.6-1.el8ap | RHSA-2025:3160 |
| Red Hat Ansible Automation Platform 2 | python39-django +1 | 4.2.21-1.el8ap | RHSA-2025:8609 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP6 | python-Django | 4.2.11-150600.3.18.1 | SUSE-SU-2025:0959-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-Django | 5.1.7-1.1 | openSUSE-SU-2025:14913-1 |
| openSUSE Tumbleweed | python-Django4 | 4.2.20-1.1 | openSUSE-SU-2025:14908-1 |
| openSUSE Tumbleweed | python-Django5 | 5.2.16-1.1 | openSUSE-SU-2026:11270-1 |
| openSUSE Tumbleweed | python-Django6 | 6.0-1.1 | openSUSE-SU-2026:10005-1 |
| openSUSE Leap 15.6 | python-Django | 4.2.11-150600.3.18.1 | SUSE-SU-2025:0959-1 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | py3-django | 4.2.20-r0 | — |
| Alpine v3.23 | py3-django | 4.2.20-r0 | — |
| Alpine v3.22 | py3-django | 4.2.20-r0 | — |
| Alpine v3.21 | py3-django | 4.2.20-r0 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | django | >= 4.2, < 4.2.20 | 4.2.20 | GHSA-p3fp-8748-vqfq |
| PyPI | django | >= 5.0, < 5.0.13 | 5.0.13 | GHSA-p3fp-8748-vqfq |
| PyPI | django | >= 5.1, < 5.1.7 | 5.1.7 | GHSA-p3fp-8748-vqfq |
| PyPI | django | >= 5.1, < 5.1.7 · >= 5.0, < 5.0.13 · >= 4.2, < 4.2.20 | 5.1.7, 5.0.13, 4.2.20 | PYSEC-2025-13 |
Advisories 12
- RHSA-2025:3160 Red Hat Security Advisory: Red Hat Ansible Automation Platform 2.5 Product Security and Bug Fix Update Red Hat Security Advisories (RHSA) · Oct 17, 2026
- RHSA-2025:8609 Red Hat Security Advisory: Red Hat Ansible Automation Platform 2.4 Product Security and Bug Fix Update Red Hat Security Advisories (RHSA) · Jul 19, 2026
- RHSA-2025:4553 Red Hat Security Advisory: Red Hat Ansible Automation Platform 2.5 Product Security and Bug Fix Update Red Hat Security Advisories (RHSA) · Jul 19, 2026
- openSUSE-SU-2026:11270-1 python313-Django5-5.2.16-1.1 on GA media SUSE / openSUSE Security Updates · Jul 15, 2026
- USN-7335-1 python-django vulnerability Ubuntu Security Notices (USN) · Apr 27, 2026
- openSUSE-SU-2026:10005-1 python312-Django6-6.0-1.1 on GA media SUSE / openSUSE Security Updates · Mar 23, 2026
- DLA-4086-1 python-django - security update Debian Security (DSA / DLA) · Mar 9, 2026
- WID-SEC-2025-0500 Django: Schwachstelle ermöglicht Denial of Service BSI CERT-Bund (WID) · Feb 15, 2026
- DSA-6136-1 python-django - security update Debian Security (DSA / DLA) · Feb 15, 2026
- openSUSE-SU-2025:14908-1 python311-Django4-4.2.20-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2025:0959-1 Security update for python-Django SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2025:14913-1 python311-Django-5.1.7-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026