Vulnerability · Published Jun 26, 2024 · Assigned by snyk
CVE-2024-21520
Medium 6.1
In plain English
A medium-severity cross-site scripting in djangorestframework. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 1.1% (higher than 67% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.
Severity (CVSS 3.1)6.1Medium
Exploit odds (30 days)1.1%top 33.4% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack tooling1Public PoC
Official 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 packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | djangorestframework | no fix listed | DEBIAN-CVE-2024-21520 |
| Debian:13 | djangorestframework | 3.15.2-1 | DEBIAN-CVE-2024-21520 |
| Debian:14 | djangorestframework | 3.15.2-1 | DEBIAN-CVE-2024-21520 |
| PyPI | djangorestframework | 3.15.2 | PYSEC-2026-1304 |
| PyPI | djangorestframework | 3.15.2 | GHSA-gw84-84pc-xp82 |
| Ubuntu:22.04:LTS | djangorestframework | no fix listed | UBUNTU-CVE-2024-21520 |
| Ubuntu:24.04:LTS | djangorestframework | no fix listed | UBUNTU-CVE-2024-21520 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| n/a | djangorestframework | 0 – before 3.15.2 |
Weakness: CWE-79 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N/E:P
References
- https://security.snyk.io/vuln/SNYK-PYTHON-DJANGORESTFRAMEWORK-7252137
- 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/compare/3.15.1...3.15.2 x_transferred