CVE-2022-25858 Regular Expression Denial of Service (ReDoS)

Medium 5.3 Published Updated

Attackers can cause denial of service in applications using the terser library by providing specially crafted input that triggers inefficient regular expression processing.

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

What is CVE-2022-25858?

CVE-2022-25858 is a medium-severity denial of service vulnerability in terser, published on 15 Jul 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

The package terser before 4.8.1, from 5.0.0 and before 5.14.2 are vulnerable to Regular Expression Denial of Service (ReDoS) due to insecure usage of regular expressions.

Weakness: CWE-1333

Which versions are affected by CVE-2022-25858?

4 open source packages ship an affected version, including terser. It affects 1 product.

PackageAffectedFixed in
terser npmAll versions4.8.1
terser npmAll versions4.8.1
terser npmFrom 5.0.05.14.2
terser npmFrom 5.0.05.14.2

Products include Terser Terser.

How do I fix CVE-2022-25858?

Upgrade terser to a fixed version for your release line: 4.8.1 or 5.14.2.

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-2022-25858 being exploited?

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

Sources

Also known as AZL-44460, AZL-44553, CLSA-2026-1773793047, CLSA-2026-1775089645, CLSA-2026-1775089646, CLSA-2026-1775089649 and 8 more.

Is CVE-2022-25858 in your software?

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

Check your SBOMs for free