MEDIUM6.1
PYSEC-2026-804
Django REST framework XSS Vulnerability
Quick fix
PYSEC-2026-804 — django-rest-framework: upgrade to the fixed version with the command below.
pip install --upgrade 'django-rest-framework>=3.9.1'Details
Django REST framework (aka django-rest-framework) before 3.9.1 allows XSS because the default DRF Browsable API view templates disable autoescaping.
Are you affected?
Enter the version of the package you're using.
Affected packages
PyPI/django-rest-framework
Introduced in:
0Fixed in: 3.9.1Fix
pip install --upgrade 'django-rest-framework>=3.9.1'References
- https://nvd.nist.gov/vuln/detail/CVE-2018-25045[ADVISORY]
- https://github.com/encode/django-rest-framework/pull/6191[WEB]
- https://github.com/encode/django-rest-framework/pull/6330[WEB]
- https://github.com/encode/django-rest-framework/commit/4bb9a3c48427867ef1e46f7dee945a4c25a4f9b8[WEB]
- https://github.com/encode/django-rest-framework[PACKAGE]
- https://pypi.org/project/django-rest-framework[PACKAGE]
- https://github.com/advisories/GHSA-xqcf-hj92-967m[ADVISORY]