Django REST framework XSS Vulnerability
Django REST framework (aka django-rest-framework) before 3.9.1 allows XSS because the default DRF Browsable API view templates disable autoescaping.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | django-rest-framework | < 3.9.1 | 3.9.1 |
References
- https://nvd.nist.gov/vuln/detail/CVE-2018-25045
- https://github.com/encode/django-rest-framework/pull/6191
- https://github.com/encode/django-rest-framework/pull/6330
- https://github.com/encode/django-rest-framework/commit/4bb9a3c48427867ef1e46f7dee945a4c25a4f9b8
- https://github.com/encode/django-rest-framework
- https://pypi.org/project/django-rest-framework
- https://github.com/advisories/GHSA-xqcf-hj92-967m
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N- Weakness (CWE)
CWE-79- Platform
- Python (PyPI)
- Package
django-rest-framework- Disclosed
- 24.07.2022
- Updated
- 11.10.2026 13:18
Sources and licenses
OSV / GitHub Advisory Database - PYSEC-2026-804 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-xqcf-hj92-967m - CC BY 4.0
Vulnerability history: django-rest-framework
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
This is the only known vulnerability of this package.
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.