{"id":"CVE-2024-21520","aliases":["CVE-2024-21520","GHSA-gw84-84pc-xp82","PYSEC-2026-1304"],"related":[],"kind":"vulnerability","state":"published","title":"Cross-site Scripting in djangorestframework","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"es","text":"Las versiones del paquete djangorestframework anteriores a la 3.15.2 son vulnerables a Cross-site Scripting (XSS) a través del filtro de plantilla break_long_headers debido a una sanitización inadecuada de la entrada antes de dividir y unir con etiquetas <br>.","source":"nvd"}],"published":"2024-06-26T05:00:02.490Z","modified":"2026-07-07T17:57:11.525Z","severity":{"scorer":"snyk","scheme":"CVSS:4.0","vector":"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","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"snyk","scheme":"CVSS:4.0","vector":"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","score":5.3,"rating":"MEDIUM"},{"scorer":"snyk","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N/E:P","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"LOW"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"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"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"3.15.2","status":"affected"}],"product":"djangorestframework","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0","fixed":"3.15.2","status":"affected"}],"vendor":"django-rest-framework","product":"django_rest_framework","cpe":"cpe:2.3:a:django-rest-framework:django_rest_framework:3.15.2:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.15.2"}],"ecosystem":"PyPI","package":"djangorestframework","purl":"pkg:pypi/djangorestframework","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.15.2"}],"ecosystem":"PyPI","package":"djangorestframework","purl":"pkg:pypi/djangorestframework","source":"pysec"}],"references":[{"url":"https://security.snyk.io/vuln/SNYK-PYTHON-DJANGORESTFRAMEWORK-7252137","tags":["web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/encode/django-rest-framework/pull/9435","tags":["web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/encode/django-rest-framework/commit/3b41f0124194430da957b119712978fa2266b642","tags":["web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/encode/django-rest-framework/compare/3.15.1...3.15.2","tags":["web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-21520","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/encode/django-rest-framework","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/djangorestframework","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-gw84-84pc-xp82","tags":["advisory"],"sources":["pysec"]}],"credits":["ch4n3-yoon"],"assigner":"snyk","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2024-06-26T13:25:31.230Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-21520","url":"https://www.cve.org/CVERecord?id=CVE-2024-21520","licence":"CVE Terms of Use","modified":"2024-12-31T10:10:34.187Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-gw84-84pc-xp82","url":"https://github.com/advisories/GHSA-gw84-84pc-xp82","licence":"CC-BY-4.0","modified":"2026-07-07T17:57:11.525Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-21520","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-21520","licence":"Public domain","modified":"2026-06-17T07:09:40.073Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1304","url":"https://osv.dev/vulnerability/PYSEC-2026-1304","licence":"CC-BY-4.0","modified":"2026-07-07T17:46:38.015Z"}],"updatedAt":"2026-11-25T22:58:42.250Z","epss":{"score":0.01133,"percentile":0.67378,"date":"2026-12-01T12:00:22.000Z"}}