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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:8 | firefox | 91.8.0-1.el8_5.alma | ALSA-2022:1287 |
| AlmaLinux:8 | thunderbird | 91.8.0-1.el8_5.alma | ALSA-2022:1301 |
| AlmaLinux:8 | thunderbird | 91.8.0-1.el8_5.alma.plus | ALSA-2022:1301 |
| Alpine:v3.20 | bat | 0.21.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.21 | bat | 0.21.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.22 | bat | 0.21.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.23 | bat | 0.21.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.24 | bat | 0.21.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.20 | delta | 0.13.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.21 | delta | 0.13.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.22 | delta | 0.13.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.23 | delta | 0.13.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.24 | delta | 0.13.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.20 | firefox | 99.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.21 | firefox | 99.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.22 | firefox | 99.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.23 | firefox | 99.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.20 | firefox-esr | 91.8.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.21 | firefox-esr | 91.8.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.22 | firefox-esr | 91.8.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.23 | firefox-esr | 91.8.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.21 | librewolf | 99.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.22 | librewolf | 99.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.23 | librewolf | 99.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.24 | librewolf | 99.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.20 | swayr | 0.16.1-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.21 | swayr | 0.16.1-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.22 | swayr | 0.16.1-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.23 | swayr | 0.16.1-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.24 | swayr | 0.16.1-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.20 | thunderbird | 91.8.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.21 | thunderbird | 91.8.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.22 | thunderbird | 91.8.0-r0 | ALPINE-CVE-2022-24713 |
| Alpine:v3.23 | thunderbird | 91.8.0-r0 | ALPINE-CVE-2022-24713 |
| Debian:12 | firefox-esr | 91.8.0esr-1 | DEBIAN-CVE-2022-24713 |
| Debian:13 | firefox-esr | 91.8.0esr-1 | DEBIAN-CVE-2022-24713 |
| Debian:14 | firefox-esr | 91.8.0esr-1 | DEBIAN-CVE-2022-24713 |
| Debian:12 | rust-regex | 1.5.5-1 | DEBIAN-CVE-2022-24713 |
| Debian:13 | rust-regex | 1.5.5-1 | DEBIAN-CVE-2022-24713 |
| Debian:14 | rust-regex | 1.5.5-1 | DEBIAN-CVE-2022-24713 |
| Debian:12 | thunderbird | 1:91.8.0-1 | DEBIAN-CVE-2022-24713 |
| Debian:13 | thunderbird | 1:91.8.0-1 | DEBIAN-CVE-2022-24713 |
| Debian:14 | thunderbird | 1:91.8.0-1 | DEBIAN-CVE-2022-24713 |
| Rocky Linux:8 | firefox | 0:91.8.0-1.el8_5 | RLSA-2022:1287 |
| Rocky Linux:8 | thunderbird | 0:91.8.0-1.el8_5 | RLSA-2022:1301 |
| Ubuntu:22.04:LTS | firefox | 1:1snap1-0ubuntu1 | UBUNTU-CVE-2022-24713 |
| Ubuntu:22.04:LTS | rust-regex | 1.5.4-1ubuntu0.1 | UBUNTU-CVE-2022-24713 |
| Ubuntu:22.04:LTS | rust-regex | 1.5.4-1ubuntu0.1 | USN-5610-1 |
Affected products (as reported)
Weakness: CWE-400 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
References
- https://github.com/rust-lang/regex/security/advisories/GHSA-m5pq-gvj9-9vr8 x_refsource_CONFIRM
- https://github.com/rust-lang/regex/commit/ae70b41d4f46641dbc45c7a4f87954aea356283e x_refsource_MISC
- https://groups.google.com/g/rustlang-security-announcements/c/NcNNL1Jq7Yw x_refsource_MISC
- FEDORA-2022-ceb3e03c5e vendor-advisory, x_refsource_FEDORA
- FEDORA-2022-8436ac4c39 vendor-advisory, x_refsource_FEDORA
- FEDORA-2022-d20d44ba98 vendor-advisory, x_refsource_FEDORA
- [debian-lts-announce] 20220407 [SECURITY] [DLA 2971-1] firefox-esr security update mailing-list, x_refsource_MLIST
- DSA-5113 vendor-advisory, x_refsource_DEBIAN
- [debian-lts-announce] 20220411 [SECURITY] [DLA 2978-1] thunderbird security update mailing-list, x_refsource_MLIST
- DSA-5118 vendor-advisory, x_refsource_DEBIAN
- GLSA-202208-08 vendor-advisory, x_refsource_GENTOO
- GLSA-202208-14 vendor-advisory, x_refsource_GENTOO