CVE-2018-25045 Django REST framework XSS Vulnerability

Medium 6.1 Published Updated

Cross-site scripting vulnerability in Django REST framework allows attackers to execute arbitrary scripts via the Browsable API.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2018-25045?

CVE-2018-25045 is a medium-severity cross-site scripting vulnerability in n/a, published on 23 Jul 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

Django REST framework (aka django-rest-framework) before 3.9.1 allows XSS because the default DRF Browsable API view templates disable autoescaping.

Weakness: CWE-79

Which versions are affected by CVE-2018-25045?

3 open source packages ship an affected version, including django-rest-framework. It affects 1 product.

PackageAffectedFixed in
django-rest-framework PyPIAll versions3.9.1
django-rest-framework PyPIAll versions3.9.1
django-rest-framework PyPIAll versions3.9.1

Products include Django-Rest-Framework Django Rest Framework.

How do I fix CVE-2018-25045?

Upgrade django-rest-framework to 3.9.1 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2018-25045 being exploited?

There is no known exploitation of CVE-2018-25045 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2018-25045, GHSA-xqcf-hj92-967m, PYSEC-2026-804, UBUNTU-CVE-2018-25045.

Is CVE-2018-25045 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free