{"id":"UBUNTU-CVE-2024-21520","details":"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 \u003cbr\u003e tags.","modified":"2025-10-24T05:06:51Z","published":"2024-06-26T05:15:00Z","upstream":["CVE-2024-21520"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2024-21520"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2024-21520"},{"type":"REPORT","url":"https://github.com/encode/django-rest-framework/pull/9435"},{"type":"REPORT","url":"https://github.com/encode/django-rest-framework/commit/3b41f0124194430da957b119712978fa2266b642"},{"type":"REPORT","url":"https://security.snyk.io/vuln/SNYK-PYTHON-DJANGORESTFRAMEWORK-7252137"}],"affected":[{"package":{"name":"djangorestframework","ecosystem":"Ubuntu:16.04:LTS","purl":"pkg:deb/ubuntu/djangorestframework@3.3.2-2?arch=source&distro=xenial"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.4.3-2","3.3.1-1","3.3.2-1","3.3.2-2"],"ecosystem_specific":{"binaries":[{"binary_name":"python-djangorestframework","binary_version":"3.3.2-2"},{"binary_name":"python3-djangorestframework","binary_version":"3.3.2-2"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-21520.json"}},{"package":{"name":"djangorestframework","ecosystem":"Ubuntu:18.04:LTS","purl":"pkg:deb/ubuntu/djangorestframework@3.7.7-1?arch=source&distro=bionic"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.4.0-2","3.7.7-1"],"ecosystem_specific":{"binaries":[{"binary_version":"3.7.7-1","binary_name":"python-djangorestframework"},{"binary_name":"python3-djangorestframework","binary_version":"3.7.7-1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-21520.json"}},{"package":{"name":"djangorestframework","ecosystem":"Ubuntu:20.04:LTS","purl":"pkg:deb/ubuntu/djangorestframework@3.10.2-1?arch=source&distro=focal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.9.0-2","3.10.2-1"],"ecosystem_specific":{"binaries":[{"binary_version":"3.10.2-1","binary_name":"python3-djangorestframework"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-21520.json"}},{"package":{"name":"djangorestframework","ecosystem":"Ubuntu:22.04:LTS","purl":"pkg:deb/ubuntu/djangorestframework@3.12.4-2.1ubuntu1?arch=source&distro=jammy"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.12.1-1","3.12.4-1","3.12.4-2","3.12.4-2ubuntu1","3.12.4-2.1ubuntu1"],"ecosystem_specific":{"binaries":[{"binary_version":"3.12.4-2.1ubuntu1","binary_name":"python3-djangorestframework"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-21520.json"}},{"package":{"name":"djangorestframework","ecosystem":"Ubuntu:24.04:LTS","purl":"pkg:deb/ubuntu/djangorestframework@3.14.0-2?arch=source&distro=noble"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.14.0-2"],"ecosystem_specific":{"binaries":[{"binary_name":"python3-djangorestframework","binary_version":"3.14.0-2"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-21520.json"}}],"schema_version":"1.7.3","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"},{"type":"CVSS_V4","score":"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"},{"type":"Ubuntu","score":"medium"}]}