CVE-2021-32740 Regular Expression Denial of Service in Addressable templates

High 7.5 Published Updated

Attackers can cause denial of service in the Addressable Ruby library by providing maliciously crafted URI templates that trigger excessive resource consumption.

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

What is CVE-2021-32740?

CVE-2021-32740 is a high-severity denial of service vulnerability in Fedoraproject Fedora, published on 6 Jul 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Addressable is an alternative implementation to the URI implementation that is part of Ruby's standard library. An uncontrolled resource consumption vulnerability exists after version 2.3.0 through version 2.7.0. Within the URI template implementation in Addressable, a maliciously crafted template may result in uncontrolled resource consumption, leading to denial of service when matched against a URI. In typical usage, templates would not normally be read from untrusted user input, but nonetheless, no previous security advisory for Addressable has cautioned against doing this. Users of the parsing capabilities in Addressable but not the URI template capabilities are unaffected. The vulnerability is patched in version 2.8.0. As a workaround, only create Template objects from trusted sources that have been validated not to produce catastrophic backtracking.

Weakness: CWE-400

Which versions are affected by CVE-2021-32740?

2 open source packages ship an affected version, including addressable. It affects 2 products.

PackageAffectedFixed in
addressable RubyGemsFrom 2.3.02.8.0
addressable RubyGemsFrom 2.3.02.8.0
Linux distribution packages (4)
rubygem-addressable SUSE:OpenStack Cloud Crowbar 8All versions2.3.6-3.3.3
rubygem-addressable SUSE:OpenStack Cloud Crowbar 9All versions2.3.6-4.3.3
ruby3.2-rubygem-http openSUSE:TumbleweedAll versions5.1.0-1.4
rubygem-http openSUSE:TumbleweedAll versions5.1.0-1.1

Products include Addressable Project Addressable, Fedoraproject Fedora.

How do I fix CVE-2021-32740?

Upgrade addressable to 2.8.0 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-2021-32740 being exploited?

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

All Fedoraproject Fedora vulnerabilities

Sources

Also known as DEBIAN-CVE-2021-32740, GHSA-jxhc-q857-3j6g, MGASA-2021-0417, OESA-2021-1278, SUSE-SU-2021:2927-1, SUSE-SU-2021:2928-1 and 4 more.

Is CVE-2021-32740 in your software?

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

Check your SBOMs for free