Skip to content
OpenAdvisories
Medium · 6.1 Public exploit CVE-2024-21520 EUVD-2024-2061GHSA-gw84-84pc-xp82PYSEC-2026-1304

Cross-site Scripting in djangorestframework

Published Jun 26, 2024 · Updated Dec 31, 2024 · Assigned by snyk

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 products

VendorProductAffectedFixed
— djangorestframework < 3.15.2 3.15.2

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 djangorestframework 3.15.2-1 —
Debian 13 djangorestframework 3.15.2-1 —
Debian 12 djangorestframework No fix yet —
ReleasePackageFixed inAdvisory
Ubuntu 24.04 LTS djangorestframework No fix yet —
Ubuntu 22.04 LTS djangorestframework No fix yet —
Ubuntu 20.04 LTS djangorestframework No fix yet —
Ubuntu 18.04 LTS djangorestframework No fix yet —
Ubuntu 16.04 LTS djangorestframework No fix yet —
ReleasePackageFixed inAdvisory
Red Hat Ansible Automation Platform 2 automation-controller-venv-tower 4.5.12-1.el8ap RHSA-2024:7312
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed python-djangorestframework 3.16.1-2.1 openSUSE-SU-2026:10115-1

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

GitHub 1 repository

  • ch4n3-yoon/CVE-2024-21520-Demo ★ 0 · May 26, 2024

    A demonstration of common XSS vulnerabilities in Django Rest Framework applications. This repository showcases intentionally vulnerable code to educate developers on identifying and mitigating XSS at…

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI djangorestframework < 3.15.2 3.15.2 GHSA-gw84-84pc-xp82

Advisories 3

References