CVE-2021-43307 Exponential ReDoS in semver-regex

Medium 5.9 Published Updated

An attacker can cause a denial of service in applications using the semver-regex library by supplying malicious input to the test method.

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-43307?

CVE-2021-43307 is a medium-severity denial of service vulnerability in semver-regex, published on 1 Jun 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

An exponential ReDoS (Regular Expression Denial of Service) can be triggered in the semver-regex npm package, when an attacker is able to supply arbitrary input to the test() method

Weakness: CWE-1333

Which versions are affected by CVE-2021-43307?

4 open source packages ship an affected version, including semver-regex. It affects 1 product.

PackageAffectedFixed in
semver-regex npmAll versions3.1.4
semver-regex npmAll versions3.1.4
semver-regex npmFrom 4.0.04.0.3
semver-regex npmFrom 4.0.04.0.3

Products include Semver-Regex Project Semver-Regex.

How do I fix CVE-2021-43307?

Upgrade semver-regex to a fixed version for your release line: 3.1.4 or 4.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-2021-43307 being exploited?

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

Sources

Also known as GHSA-4x5v-gmq8-25ch, ROOT-APP-NPM-CVE-2021-43307.

Is CVE-2021-43307 in your software?

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

Check your SBOMs for free