Cross-site Scripting in djangorestframework
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 software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | djangorestframework | < 3.15.2 | 3.15.2 |
References
- https://nvd.nist.gov/vuln/detail/CVE-2024-21520
- https://github.com/encode/django-rest-framework/pull/9435
- https://github.com/encode/django-rest-framework/commit/3b41f0124194430da957b119712978fa2266b642
- https://github.com/encode/django-rest-framework
- https://github.com/encode/django-rest-framework/compare/3.15.1...3.15.2
- https://security.snyk.io/vuln/SNYK-PYTHON-DJANGORESTFRAMEWORK-7252137
- https://pypi.org/project/djangorestframework
- https://github.com/advisories/GHSA-gw84-84pc-xp82
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N- Weakness (CWE)
CWE-79- Platform
- Python (PyPI)
- Package
djangorestframework- Disclosed
- 26.06.2024
- Updated
- 11.10.2026 13:19
Sources and licenses
OSV / GitHub Advisory Database - PYSEC-2026-1304 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-gw84-84pc-xp82 - CC BY 4.0
Vulnerability history: djangorestframework
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 4
- First → latest
- 09.2020 09.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- Medium 3
- Low 1
Disclosures per year
- 2020: 1
- 2021: 0
- 2022: 0
- 2023: 0
- 2024: 1
- 2025: 0
- 2026: 2
-
Cross-site Scripting in djangorestframework this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.