CVE-2018-7537 Django Denial-of-service possibility in truncatechars_html and truncatewords_html template filters

Medium 5.3 Published Updated

Attackers can cause denial of service in Django applications using specific HTML truncation filters due to catastrophic regex backtracking.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2018-7537?

CVE-2018-7537 is a medium-severity denial of service vulnerability in Canonical Ubuntu Linux, published on 9 Mar 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

An issue was discovered in Django 2.0 before 2.0.3, 1.11 before 1.11.11, and 1.8 before 1.8.19. If django.utils.text.Truncator's chars() and words() methods were passed the html=True argument, they were extremely slow to evaluate certain inputs due to a catastrophic backtracking vulnerability in a regular expression. The chars() and words() methods are used to implement the truncatechars_html and truncatewords_html template filters, which were thus vulnerable.

Weakness: CWE-185

Which versions are affected by CVE-2018-7537?

7 open source packages ship an affected version, including django and Django. It affects 3 products.

PackageAffectedFixed in
django PyPIFrom 1.111.11.11
django PyPIFrom 1.81.8.19, 1.11.11, 2.0.3
django PyPIFrom 1.81.8.19
django PyPIFrom 2.02.0.3
Django PyPIFrom 1.111.11.11
Django PyPIFrom 1.81.8.19
1 more packages
Django PyPIFrom 2.02.0.3

Products include Canonical Ubuntu Linux, Debian Debian Linux, Djangoproject Django.

How do I fix CVE-2018-7537?

Upgrade django to a fixed version for your release line: 1.11.11, 1.8.19 or 2.0.3.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2018-7537 being exploited?

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

All Canonical Ubuntu Linux vulnerabilities

Sources

Also known as ALPINE-CVE-2018-7537, DEBIAN-CVE-2018-7537, GHSA-2f9x-5v75-3qv4, PYSEC-2018-6, UBUNTU-CVE-2018-7537.

Is CVE-2018-7537 in your software?

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

Check your SBOMs for free