PyPI: djangorestframework

CVE-2024-21520

Safety vulnerability ID: SFTY-20240626-60446

Safety legacy ID: pyup.io-71849

Affected versions of the package djangorestframework 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.

Created at: Jul 5, 2026Updated at: Jul 5, 2026

Overview

Cross-site Scripting in djangorestframework

Advisory

Affected versions of the package djangorestframework 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 Package

Affecting djangorestframework package, versions<3.15.2

Also affects

---

How to Fix

Upgradedjangorestframeworkto3.15.2or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more