{"id":"CVE-2024-21520","aliases":["GHSA-gw84-84pc-xp82","PYSEC-2026-1304"],"title":"Cross-site Scripting in djangorestframework","summary":"Cross-site Scripting in djangorestframework","severity":"medium","cvss":6.1,"cvssVector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","vendor":"djangorestframework","product":"djangorestframework","ecosystem":"pip","affected":["djangorestframework < 3.15.2"],"patched":["djangorestframework 3.15.2"],"published":"2024-06-26","updated":"2026-07-07","source":"OSV","sourceUrl":"https://osv.dev/vulnerability/GHSA-gw84-84pc-xp82","references":[{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-21520"},{"url":"https://github.com/encode/django-rest-framework/pull/9435"},{"url":"https://github.com/encode/django-rest-framework/commit/3b41f0124194430da957b119712978fa2266b642"},{"url":"https://github.com/encode/django-rest-framework"},{"url":"https://github.com/encode/django-rest-framework/compare/3.15.1...3.15.2"},{"url":"https://security.snyk.io/vuln/SNYK-PYTHON-DJANGORESTFRAMEWORK-7252137"}],"tags":["osv","pip","exploit-available"],"epss":0.01133,"epssPercentile":0.65012,"ingestedAt":"2026-07-08T18:25:49.952Z","exploits":{"github":1,"githubRepos":["https://github.com/ch4n3-yoon/CVE-2024-21520-Demo"],"checkedAt":"2026-09-25T08:20:42.764Z"},"exploitAvailable":true,"slug":"CVE-2024-21520","body":"## Overview\n\nVersions 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.\n\n## Affected packages\n\n- `djangorestframework < 3.15.2`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `djangorestframework 3.15.2`","depth":"twilight","depthScore":46,"depthScoreParts":{"impact":33.6,"likelihood":0.2,"exploitation":12,"ransomware":0},"changes":[{"seq":4691,"id":"CVE-2024-21520","ts":1788887199870,"field":"exploit_available","old":"false","new":"true"},{"seq":3574,"id":"CVE-2024-21520","ts":1788886316359,"field":"exploit_available","old":"true","new":"false"},{"seq":2428,"id":"CVE-2024-21520","ts":1788882985107,"field":"exploit_available","old":"false","new":"true"},{"seq":1457,"id":"CVE-2024-21520","ts":1788882398383,"field":"exploit_available","old":"true","new":"false"},{"seq":571,"id":"CVE-2024-21520","ts":1788881834706,"field":"exploit_available","old":"false","new":"true"}]}