Vulnerability · Published Mar 8, 2022 · Assigned by GitHub_M

CVE-2022-24713Regular expression denial of service in Rust's regex crate

High 7.5

In plain English

A high-severity uncontrolled resource consumption in regex from rust-lang. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 14.5% (higher than 97% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.5High
Exploit odds (30 days)14.5%top 3.4% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack tooling1Public PoC

Official description

regex is an implementation of regular expressions for the Rust language. The regex crate features built-in mitigations to prevent denial of service attacks caused by untrusted regexes, or untrusted input matched by trusted regexes. Those (tunable) mitigations already provide sane defaults to prevent attacks. This guarantee is documented and it's considered part of the crate's API. Unfortunately a bug was discovered in the mitigations designed to prevent untrusted regexes to take an arbitrary amount of time during parsing, and it's possible to craft regexes that bypass such mitigations. This makes it possible to perform denial of service attacks by sending specially crafted regexes to services accepting user-controlled, untrusted regexes. All versions of the regex crate before or equal to 1.5.4 are affected by this issue. The fix is include starting from regex 1.5.5. All users accepting user-controlled regexes are recommended to upgrade immediately to the latest version of the regex crate. Unfortunately there is no fixed set of problematic regexes, as there are practically infinite regexes that could be crafted to exploit this vulnerability. Because of this, it us not recommend to deny known problematic regexes.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:8firefox91.8.0-1.el8_5.almaALSA-2022:1287
AlmaLinux:8thunderbird91.8.0-1.el8_5.almaALSA-2022:1301
AlmaLinux:8thunderbird91.8.0-1.el8_5.alma.plusALSA-2022:1301
Alpine:v3.20bat0.21.0-r0ALPINE-CVE-2022-24713
Alpine:v3.21bat0.21.0-r0ALPINE-CVE-2022-24713
Alpine:v3.22bat0.21.0-r0ALPINE-CVE-2022-24713
Alpine:v3.23bat0.21.0-r0ALPINE-CVE-2022-24713
Alpine:v3.24bat0.21.0-r0ALPINE-CVE-2022-24713
Alpine:v3.20delta0.13.0-r0ALPINE-CVE-2022-24713
Alpine:v3.21delta0.13.0-r0ALPINE-CVE-2022-24713
Alpine:v3.22delta0.13.0-r0ALPINE-CVE-2022-24713
Alpine:v3.23delta0.13.0-r0ALPINE-CVE-2022-24713
Alpine:v3.24delta0.13.0-r0ALPINE-CVE-2022-24713
Alpine:v3.20firefox99.0-r0ALPINE-CVE-2022-24713
Alpine:v3.21firefox99.0-r0ALPINE-CVE-2022-24713
Alpine:v3.22firefox99.0-r0ALPINE-CVE-2022-24713
Alpine:v3.23firefox99.0-r0ALPINE-CVE-2022-24713
Alpine:v3.20firefox-esr91.8.0-r0ALPINE-CVE-2022-24713
Alpine:v3.21firefox-esr91.8.0-r0ALPINE-CVE-2022-24713
Alpine:v3.22firefox-esr91.8.0-r0ALPINE-CVE-2022-24713
Alpine:v3.23firefox-esr91.8.0-r0ALPINE-CVE-2022-24713
Alpine:v3.21librewolf99.0-r0ALPINE-CVE-2022-24713
Alpine:v3.22librewolf99.0-r0ALPINE-CVE-2022-24713
Alpine:v3.23librewolf99.0-r0ALPINE-CVE-2022-24713
Alpine:v3.24librewolf99.0-r0ALPINE-CVE-2022-24713
Alpine:v3.20swayr0.16.1-r0ALPINE-CVE-2022-24713
Alpine:v3.21swayr0.16.1-r0ALPINE-CVE-2022-24713
Alpine:v3.22swayr0.16.1-r0ALPINE-CVE-2022-24713
Alpine:v3.23swayr0.16.1-r0ALPINE-CVE-2022-24713
Alpine:v3.24swayr0.16.1-r0ALPINE-CVE-2022-24713
Alpine:v3.20thunderbird91.8.0-r0ALPINE-CVE-2022-24713
Alpine:v3.21thunderbird91.8.0-r0ALPINE-CVE-2022-24713
Alpine:v3.22thunderbird91.8.0-r0ALPINE-CVE-2022-24713
Alpine:v3.23thunderbird91.8.0-r0ALPINE-CVE-2022-24713
Debian:12firefox-esr91.8.0esr-1DEBIAN-CVE-2022-24713
Debian:13firefox-esr91.8.0esr-1DEBIAN-CVE-2022-24713
Debian:14firefox-esr91.8.0esr-1DEBIAN-CVE-2022-24713
Debian:12rust-regex1.5.5-1DEBIAN-CVE-2022-24713
Debian:13rust-regex1.5.5-1DEBIAN-CVE-2022-24713
Debian:14rust-regex1.5.5-1DEBIAN-CVE-2022-24713
Debian:12thunderbird1:91.8.0-1DEBIAN-CVE-2022-24713
Debian:13thunderbird1:91.8.0-1DEBIAN-CVE-2022-24713
Debian:14thunderbird1:91.8.0-1DEBIAN-CVE-2022-24713
Rocky Linux:8firefox0:91.8.0-1.el8_5RLSA-2022:1287
Rocky Linux:8thunderbird0:91.8.0-1.el8_5RLSA-2022:1301
Ubuntu:22.04:LTSfirefox1:1snap1-0ubuntu1UBUNTU-CVE-2022-24713
Ubuntu:22.04:LTSrust-regex1.5.4-1ubuntu0.1UBUNTU-CVE-2022-24713
Ubuntu:22.04:LTSrust-regex1.5.4-1ubuntu0.1USN-5610-1

Affected products (as reported)

VendorProductVersions
rust-lang regex < 1.5.5

Weakness: CWE-400 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References