PyPI: djangorestframework

CVE-2020-25626

Safety vulnerability ID: SFTY-20200930-57085

Safety legacy ID: pyup.io-38841

A flaw was found in Django REST Framework versions before 3.12.0 and before 3.11.2. When using the browseable API viewer, Django REST Framework fails to properly escape certain strings that can come from user input. This allows a user who can control those strings to inject malicious <script> tags, leading to a cross-site-scripting (XSS) vulnerability.

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

Overview

Cross-site Scripting (XSS) in Django REST Framework

Advisory

A flaw was found in Django REST Framework versions before 3.12.0 and before 3.11.2. When using the browseable API viewer, Django REST Framework fails to properly escape certain strings that can come from user input. This allows a user who can control those strings to inject malicious <script> tags, leading to a cross-site-scripting (XSS) vulnerability.

Affected Package

Affecting djangorestframework package, versions<3.11.2

Also affects

---

How to Fix

Upgradedjangorestframeworkto3.11.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