Description
Versions of the package djangorestframework before 3.15.2 are vulnerable to Cross-site Scripting (XSS) via the break_long_headers template filter due to improper input sanitization before splitting and joining with <br> tags.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| — | djangorestframework | < 3.15.2 | 3.15.2 |
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 | djangorestframework | 3.15.2-1 | — |
| Debian 13 | djangorestframework | 3.15.2-1 | — |
| Debian 12 | djangorestframework | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 24.04 LTS | djangorestframework | No fix yet | — |
| Ubuntu 22.04 LTS | djangorestframework | No fix yet | — |
| Ubuntu 20.04 LTS | djangorestframework | No fix yet | — |
| Ubuntu 18.04 LTS | djangorestframework | No fix yet | — |
| Ubuntu 16.04 LTS | djangorestframework | No fix yet | — |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Red Hat Ansible Automation Platform 2 | automation-controller-venv-tower | 4.5.12-1.el8ap | RHSA-2024:7312 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-djangorestframework | 3.16.1-2.1 | openSUSE-SU-2026:10115-1 |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 1 repository
-
ch4n3-yoon/CVE-2024-21520-Demo ★ 0 · May 26, 2024
A demonstration of common XSS vulnerabilities in Django Rest Framework applications. This repository showcases intentionally vulnerable code to educate developers on identifying and mitigating XSS at…
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | djangorestframework | < 3.15.2 | 3.15.2 | GHSA-gw84-84pc-xp82 |
Advisories 3
- RHSA-2024:7312 Red Hat Security Advisory: Red Hat Ansible Automation Platform 2.4 Product Security and Bug Fix Update Red Hat Security Advisories (RHSA) · Oct 14, 2026
- openSUSE-SU-2026:10115-1 python311-djangorestframework-3.16.1-2.1 on GA media SUSE / openSUSE Security Updates · Mar 23, 2026
- WID-SEC-2024-2229 Red Hat Ansible Automation Platform: Mehrere Schwachstellen BSI CERT-Bund (WID) · Feb 8, 2026