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 break_long_headers template filter due to improper input sanitization before splitting and joining with <br> tags.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Passive
What an attacker can affect
- Confidentiality
- None
- Integrity
- Low
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
5.3
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.
- Record
CVE-2024-21520- 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 - 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 - Weakness
- CWE-79
- Updated
- 2026-11-02
EUVDEUVD-2024-2061
5.3
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.
- Record
EUVD-2024-2061- 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 - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-gw84-84pc-xp82
2.1
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.
- Record
GHSA-gw84-84pc-xp82- CVSS 4.0
- 2.1 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 - 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 - Weakness
- CWE-79
- Updated
- 2026-11-02
NVD
2.1
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.
- Record
CVE-2024-21520- CVSS 4.0
- 2.1 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/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - 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 - Weakness
- CWE-79
- Updated
- 2026-11-02
OSV
2.1
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.
- Record
CVE-2024-21520- CVSS 4.0
- 2.1 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 - Weakness
- CWE-79
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2024-21520
2.1
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.
- Record
DEBIAN-CVE-2024-21520- CVSS 4.0
- 2.1 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/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Updated
- 2026-11-02
Show 6 moreShow less
OSVGHSA-gw84-84pc-xp82
2.1
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.
- Record
GHSA-gw84-84pc-xp82- CVSS 4.0
- 2.1 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 - 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 - Weakness
- CWE-79
- Updated
- 2026-11-02
OSVPYSEC-2026-1304
2.1
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.
- Record
PYSEC-2026-1304- CVSS 4.0
- 2.1 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 - 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 - Updated
- 2026-11-02
OSVRHSA-2024:7312
6.1
Red Hat Security Advisory: Red Hat Ansible Automation Platform 2.4 Product Security and Bug Fix Update
- Record
RHSA-2024:7312- 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 - Updated
- 2026-11-02
OSVUBUNTU-CVE-2024-21520
2.1
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.
- Record
UBUNTU-CVE-2024-21520- CVSS 4.0
- 2.1 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 - 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 - Updated
- 2026-11-02
OSVopenSUSE-SU-2026:10115-1 No score
python311-djangorestframework-3.16.1-2.1 on GA media
These are all security issues fixed in the python311-djangorestframework-3.16.1-2.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2026:10115-1- Updated
- 2026-11-02
OSVROOT-APP-PYPI-CVE-2024-21520 No score
CVE-2024-21520 in djangorestframework - Patched by Root
Root has patched CVE-2024-21520 in the djangorestframework package for Root:PyPI. Multiple fixed versions available.
- Record
ROOT-APP-PYPI-CVE-2024-21520- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
djangorestframeworkPyPI |
before 3.15.2 | 3.15.2 |
djangorestframeworkDebian:12 |
All versions, plus listed versions 3.14.0-23.14.0-2+deb12u13.15.1-13.15.1-23.15.2-1 Show 9 moreShow less3.15.2-23.16.0-13.16.1-13.16.1-33.16.1-43.17.1+ds1-13.17.1-13.18.1+ds1-13.18.3+ds1-1 |
None known |
djangorestframeworkDebian:13 |
before 3.15.2-1 | 3.15.2-1 |
djangorestframeworkDebian:14 |
before 3.15.2-1 | 3.15.2-1 |
djangorestframeworkPyPI |
before 3.15.2, plus listed versions 0.10.1.10.2.00.2.10.2.2 Show 45 moreShow less0.2.30.2.40.3.00.3.10.3.20.3.30.4.02.0.02.0.12.0.22.1.02.1.12.1.102.1.112.1.122.1.132.1.142.1.152.1.162.1.172.1.22.1.32.1.42.1.52.1.62.1.72.1.82.1.92.2.02.2.12.2.22.2.32.2.42.2.52.2.62.2.72.3.02.3.12.3.102.3.112.3.122.3.132.3.142.3.22.3.3 |
3.15.2 |
automation-controller-venv-towerRed Hat:ansible_automation_platform:2.4::el8 From an advisory covering 3 CVEs |
before 0:4.5.12-1.el8ap | 0:4.5.12-1.el8ap |
automation-controller-venv-towerRed Hat:ansible_automation_platform:2.4::el9 From an advisory covering 3 CVEs |
before 0:4.5.12-1.el9ap | 0:4.5.12-1.el9ap |
djangorestframeworkRoot:PyPI |
before 3.14.0+aikido.1 | 3.14.0+aikido.13.12.4+aikido.13.12.4+aikido.23.14.0+aikido.2 |
djangorestframeworkUbuntu:16.04:LTS |
All versions, plus listed versions 2.4.3-23.3.1-13.3.2-13.3.2-2 |
None known |
djangorestframeworkUbuntu:18.04:LTS |
All versions, plus listed versions 3.4.0-23.7.7-1 |
None known |
Show 4 moreShow less
| Package | Affected | Fixed |
|---|---|---|
djangorestframeworkUbuntu:20.04:LTS |
All versions, plus listed versions 3.9.0-23.10.2-1 |
None known |
djangorestframeworkUbuntu:22.04:LTS |
All versions, plus listed versions 3.12.1-13.12.4-13.12.4-23.12.4-2ubuntu13.12.4-2.1ubuntu1 |
None known |
djangorestframeworkUbuntu:24.04:LTS |
All versions, plus listed versions 3.14.0-2 |
None known |
python-djangorestframeworkopenSUSE:Tumbleweed |
before 3.16.1-2.1 | 3.16.1-2.1 |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| PoC in GitHub | ch4n3-yoon/CVE-2024-21520-Demo | 2024-05-26 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| aliases, published | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2024-21520 is a medium vulnerability (CVSS 5.3) in Django-rest-framework Django Rest Framework, published June 26, 2024. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 1.13%, the 66th percentile. Fixed in djangorestframework 3.15.2.
References
security.snyk.io/vuln/SNYK-PYTHON-DJANGORESTFRAMEWORK-7252137
github.com/encode/django-rest-framework/pull/9435
github.com/encode/django-rest-framework/commit/3b41f0124194430da957b119712978fa2266b642
github.com/encode/django-rest-framework/compare/3.15.1...3.15.2
nvd.nist.gov/vuln/detail/CVE-2024-21520
github.com/advisories/GHSA-gw84-84pc-xp82
Show 22 moreShow less
github.com/CVEProject/cvelistV5/tree/main/cves/2024/21xxx/CVE-2024-21520.json
security-tracker.debian.org/tracker/CVE-2024-21520
github.com/encode/django-rest-framework
pypi.org/project/djangorestframework
access.redhat.com/errata/RHSA-2024:7312
access.redhat.com/security/updates/classification
bugzilla.redhat.com/show_bug.cgi?id=2292788
bugzilla.redhat.com/show_bug.cgi?id=2294457
bugzilla.redhat.com/show_bug.cgi?id=2300497
security.access.redhat.com/data/csaf/v2/advisories/2024/rhsa-2024_7312.json
access.redhat.com/security/cve/CVE-2024-21520
cve.org/CVERecord?id=CVE-2024-21520
access.redhat.com/security/cve/CVE-2024-37891
cve.org/CVERecord?id=CVE-2024-37891
nvd.nist.gov/vuln/detail/CVE-2024-37891
access.redhat.com/security/cve/CVE-2024-41810
cve.org/CVERecord?id=CVE-2024-41810
nvd.nist.gov/vuln/detail/CVE-2024-41810
github.com/twisted/twisted/commit/046a164f89a0f08d3239ecebd750360f8914df33
github.com/twisted/twisted/security/advisories/GHSA-cf56-g6w6-pqq2
ubuntu.com/security/CVE-2024-21520
suse.com/security/cve/CVE-2024-21520
Left out here: 86 versions. The JSON record has them.