CVE-2024-21520: Cross-site Scripting in djangorestframework
Versions of the package djangorestframework before 3.15.2 are vulnerable to Cross-site Scripting (XSS) via the breaklongheaders template filter due to improper input sanitization before splitting and joining with tags.
Published Jun 26, 2024 · Updated Dec 31, 2024
Affected packages
djangorestframework
- Ecosystem
- PyPI
- Affected
- < 3.15.2
- Fixed in
- 3.15.2
- Check
pip show djangorestframework
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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 tags.
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://security.snyk.io/vuln/SNYK-PYTHON-DJANGORESTFRAMEWORK-7252137
- https://github.com/encode/django-rest-framework/compare/3.15.1...3.15.2
- https://github.com/advisories/GHSA-gw84-84pc-xp82
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-114136
Django REST framework: JSONParser applies an attacker-named codec to the request stream
high7.5Oct 22, 2026CVE-2026-114137
Django REST framework: TokenProxy.delete() reports success and revokes nothing
high7.4Oct 22, 2026CVE-2026-114138
Django REST framework: Accept header with many large quoted parameters burns ~19s of CPU per request in content negotiation
high7.5Oct 22, 2026CVE-2026-73228
Django REST framework: Potential bypass of Django `DATA_UPLOAD_MAX_MEMORY_SIZE` when parsing oversized JSON and urlencoded request bodies via DRF `request.data`
medium5.3Sep 1, 2026CVE-2026-73229
Django REST framework: AdminRenderer may disclose GET-protected data when rendering invalid write requests
medium4.3Sep 1, 2026
