CVE-2020-28493 Regular Expression Denial of Service (ReDoS)

Medium 5.3 Published Updated

Attackers can cause denial of service in applications using Jinja2 by exploiting a regular expression vulnerability in the urlize filter.

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

What is CVE-2020-28493?

CVE-2020-28493 is a medium-severity denial of service vulnerability in Fedoraproject Fedora, published on 1 Feb 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

This affects the package jinja2 from 0.0.0 and before 2.11.3. The ReDoS vulnerability is mainly due to the `_punctuation_re regex` operator and its use of multiple wildcards. The last wildcard is the most exploitable as it searches for trailing punctuation. This issue can be mitigated by Markdown to format user content instead of the urlize filter, or by implementing request timeouts and limiting process memory.

Weakness: CWE-400

Which versions are affected by CVE-2020-28493?

3 open source packages ship an affected version, including jinja2 and Jinja2. It affects 2 products.

PackageAffectedFixed in
jinja2 PyPIAll versions2.11.3
jinja2 PyPIAll versions2.11.3
Jinja2 PyPIAll versions2.11.3
Linux distribution packages (32)
python3-jinja2 AlmaLinux:8All versions2.10.1-3.el8
python-jinja2 Red Hat:enterprise_linux:8::appstreamAll versions0:2.10.1-3.el8
python3-jinja2 Red Hat:enterprise_linux:8::appstreamAll versions0:2.10.1-3.el8
python-jinja2 Rocky Linux:8All versions0:2.10.1-3.el8
python-Jinja2 SUSE:Enterprise Storage 6All versions2.10.1-3.10.2
python-Jinja2 SUSE:HPE Helion OpenStack 8All versions2.9.6-3.6.1
python-Jinja2 SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOSAll versions2.10.1-3.10.2
python-Jinja2 SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSSAll versions2.10.1-3.10.2
python-Jinja2 SUSE:Linux Enterprise High Performance Computing 15-ESPOSAll versions2.10.1-3.10.2
python-Jinja2 SUSE:Linux Enterprise High Performance Computing 15-LTSSAll versions2.10.1-3.10.2
python-Jinja2 SUSE:Linux Enterprise Module for Advanced Systems Management 12All versions2.8-19.23.1
python-Jinja2 SUSE:Linux Enterprise Module for Basesystem 15 SP2All versions2.10.1-3.10.2
python-Jinja2 SUSE:Linux Enterprise Module for Public Cloud 12All versions2.8-19.23.1
python-Jinja2 SUSE:Linux Enterprise Module for Python 2 15 SP2All versions2.10.1-3.10.2
python-Jinja2 SUSE:Linux Enterprise Point of Sale 12 SP2All versions2.8-22.11.1
python-Jinja2 SUSE:Linux Enterprise Server 11 SP3-CLIENT-TOOLSAll versions2.6-2.19.5.1
python-Jinja2 SUSE:Linux Enterprise Server 11 SP4-CLIENT-TOOLSAll versions2.6-2.19.5.1
python-Jinja2 SUSE:Linux Enterprise Server 11-PUBCLOUDAll versions2.6-2.19.5.1
python-Jinja2 SUSE:Linux Enterprise Server 15 SP1-BCLAll versions2.10.1-3.10.2
python-Jinja2 SUSE:Linux Enterprise Server 15 SP1-LTSSAll versions2.10.1-3.10.2
python-Jinja2 SUSE:Linux Enterprise Server 15-LTSSAll versions2.10.1-3.10.2
python-Jinja2 SUSE:Linux Enterprise Server for SAP Applications 15All versions2.10.1-3.10.2
python-Jinja2 SUSE:Linux Enterprise Server for SAP Applications 15 SP1All versions2.10.1-3.10.2
python-Jinja2 SUSE:Manager Client Tools 12All versions2.8-19.23.1
python-Jinja2 SUSE:Manager Proxy 4.0All versions2.10.1-3.10.2
python-Jinja2 SUSE:Manager Retail Branch Server 4.0All versions2.10.1-3.10.2
python-Jinja2 SUSE:Manager Server 4.0All versions2.10.1-3.10.2
python-Jinja2 SUSE:OpenStack Cloud 7All versions2.8-22.11.1
python-Jinja2 SUSE:OpenStack Cloud 8All versions2.9.6-3.6.1
python-Jinja2 SUSE:OpenStack Cloud 9All versions2.10.1-3.6.1
python-Jinja2 SUSE:OpenStack Cloud Crowbar 8All versions2.9.6-3.6.1
python-Jinja2 SUSE:OpenStack Cloud Crowbar 9All versions2.10.1-3.6.1

Products include Fedoraproject Fedora, Palletsprojects Jinja.

How do I fix CVE-2020-28493?

Upgrade jinja2 to 2.11.3 or later.

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-2020-28493 being exploited?

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

All Fedoraproject Fedora vulnerabilities

Sources

Also known as ALPINE-CVE-2020-28493, ALSA-2021:4161, AZL-40857, AZL-75813, DEBIAN-CVE-2020-28493, GHSA-g3rq-g295-4j3m and 14 more.

Is CVE-2020-28493 in your software?

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

Check your SBOMs for free