# CVE-2024-21520: Cross-site Scripting in djangorestframework

- Severity: Medium 5.3 (CVSS:4.0, scored by snyk) `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N/E:P`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.13%, higher than 67% of CVEs (2026-12-01)
- Published: 2024-06-26T05:00:02.490Z
- Modified: 2026-07-07T17:57:11.525Z
- Also known as: GHSA-gw84-84pc-xp82, PYSEC-2026-1304
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: snyk

## 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.

(As written by CVE List.)

## Affected

- djangorestframework: before 3.15.2
- django-rest-framework django_rest_framework: before 3.15.2
- djangorestframework (PyPI): before 3.15.2

## Every score

- snyk: CVSS:4.0 5.3 Medium `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N/E:P`
- snyk: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N/E:P`
- GitHub: CVSS:3.1 6.1 Low `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- GitHub: CVSS:4.0 Low `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N/E:P`
- PyPA Advisory Database: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- PyPA Advisory Database: CVSS:4.0 `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N/E:P`

## References

- <https://security.snyk.io/vuln/SNYK-PYTHON-DJANGORESTFRAMEWORK-7252137> (web)
- <https://github.com/encode/django-rest-framework/pull/9435> (web)
- <https://github.com/encode/django-rest-framework/commit/3b41f0124194430da957b119712978fa2266b642> (web)
- <https://github.com/encode/django-rest-framework/compare/3.15.1...3.15.2> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-21520> (advisory)
- <https://github.com/encode/django-rest-framework> (package)
- <https://pypi.org/project/djangorestframework> (package)
- <https://github.com/advisories/GHSA-gw84-84pc-xp82> (advisory)

## Sources

- CVE List: [CVE-2024-21520](https://www.cve.org/CVERecord?id=CVE-2024-21520), CVE Terms of Use, modified 2024-12-31
- GitHub Advisory Database: [GHSA-gw84-84pc-xp82](https://github.com/advisories/GHSA-gw84-84pc-xp82), CC-BY-4.0, modified 2026-07-07
- NVD: [CVE-2024-21520](https://nvd.nist.gov/vuln/detail/CVE-2024-21520), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-1304](https://osv.dev/vulnerability/PYSEC-2026-1304), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2024-21520 · Whole record: https://cve.day/CVE-2024-21520.json · Rebuilt by cve.day 2026-11-25T22:58:42.250Z
