Regular expression denial of service in Rust's regex crate
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Partial Red Hat: 10 fixed, 1 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-400.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| rust-lang | regex | before 1.5.5 | 1.5.5 | Patch available | CNA |
| — | regex (crates.io) | before 1.5.5 | 1.5.5 | Patch available | GHSA-m5pq-gvj9-9vr8 |
- regex Vendorrust-lang Affected before 1.5.5 Fixed in 1.5.5 Patch available CNA
- regex (crates.io) Vendor— Affected before 1.5.5 Fixed in 1.5.5 Patch available GHSA-m5pq-gvj9-9vr8
CPE configurations NVD · 7
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:rust-lang:regex:*:*:*:*:*:rust:*:* | before 1.5.5 | Vulnerable | rust-lang |
| cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* | 34 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* | 35 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:* | 36 | Vulnerable | Fedoraproject |
| cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* | 9.0 | Vulnerable | Debian |
| cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* | 10.0 | Vulnerable | Debian |
| cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* | 11.0 | Vulnerable | Debian |
- cpe:2.3:a:rust-lang:regex:*:*:*:*:*:rust:*:* Versions before 1.5.5 Vulnerable ·rust-lang
- cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* Versions 34 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* Versions 35 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:* Versions 36 Vulnerable ·Fedoraproject
- cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* Versions 9.0 Vulnerable ·Debian
- cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* Versions 10.0 Vulnerable ·Debian
- cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* Versions 11.0 Vulnerable ·Debian
Remediation
- Fix · CNA regex (rust-lang) Fixed in 1.5.5
- Fix · GHSA-m5pq-gvj9-9vr8 regex (crates.io) Fixed in 1.5.5 Advisory →
Red Hat 10 advisories
- RHSA-2022:1326 Released 2022-04-12 · Red Hat rating Importantthunderbird security update
- Red Hat Enterprise Linux AppStream EUS (v. 8.2) thunderbird-91.8.0-1.el8_2
- RHSA-2022:1302 Released 2022-04-11 · Red Hat rating Importantthunderbird security update
- Red Hat Enterprise Linux Client (v. 7) thunderbird-91.8.0-1.el7_9
- Red Hat Enterprise Linux Server Optional (v. 7) thunderbird-91.8.0-1.el7_9
- Red Hat Enterprise Linux Workstation (v. 7) thunderbird-91.8.0-1.el7_9
- RHSA-2022:1305 Released 2022-04-11 · Red Hat rating Importantthunderbird security update
- Red Hat Enterprise Linux AppStream EUS (v.8.4) thunderbird-91.8.0-1.el8_4
Show 7 more Red Hat advisories
- RHSA-2022:1301 Released 2022-04-11 · Red Hat rating Importantthunderbird security update
- Red Hat Enterprise Linux AppStream (v. 8) thunderbird-91.8.0-1.el8_5
- RHSA-2022:1303 Released 2022-04-11 · Red Hat rating Importantthunderbird security update
- Red Hat Enterprise Linux AppStream E4S (v. 8.1) thunderbird-91.8.0-1.el8_1
- RHSA-2022:1284 Released 2022-04-08 · Red Hat rating Importantfirefox security update
- Red Hat Enterprise Linux Client (v. 7) firefox-91.8.0-1.el7_9
- Red Hat Enterprise Linux Client Optional (v. 7) firefox-91.8.0-1.el7_9
- Red Hat Enterprise Linux Server (v. 7) firefox-91.8.0-1.el7_9
- Red Hat Enterprise Linux Server Optional (v. 7) firefox-91.8.0-1.el7_9
- Red Hat Enterprise Linux Workstation (v. 7) firefox-91.8.0-1.el7_9
- Red Hat Enterprise Linux Workstation Optional (v. 7) firefox-91.8.0-1.el7_9
- RHSA-2022:1285 Released 2022-04-08 · Red Hat rating Importantfirefox security update
- Red Hat Enterprise Linux AppStream EUS (v.8.4) firefox-91.8.0-1.el8_4
- RHSA-2022:1287 Released 2022-04-08 · Red Hat rating Importantfirefox security update
- Red Hat Enterprise Linux AppStream (v. 8) firefox-91.8.0-1.el8_5
- RHSA-2022:1286 Released 2022-04-08 · Red Hat rating Importantfirefox security update
- Red Hat Enterprise Linux AppStream EUS (v. 8.2) firefox-91.8.0-1.el8_2
- RHSA-2022:1283 Released 2022-04-08 · Red Hat rating Importantfirefox security update
- Red Hat Enterprise Linux AppStream E4S (v. 8.1) firefox-91.8.0-1.el8_1
Vendor assessments
Red Hat
Red Hat rating: Low. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Enterprise Linux 6 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux AppStream (v. 8) | Fixed | RHSA-2022:1287, RHSA-2022:1301 |
| Red Hat Enterprise Linux AppStream E4S (v. 8.1) | Fixed | RHSA-2022:1283, RHSA-2022:1303 |
| Red Hat Enterprise Linux AppStream EUS (v. 8.2) | Fixed | RHSA-2022:1286, RHSA-2022:1326 |
| Red Hat Enterprise Linux AppStream EUS (v.8.4) | Fixed | RHSA-2022:1285, RHSA-2022:1305 |
| Red Hat Enterprise Linux Client (v. 7) | Fixed | RHSA-2022:1284, RHSA-2022:1302 |
| Red Hat Enterprise Linux Client Optional (v. 7) | Fixed | RHSA-2022:1284 |
| Red Hat Enterprise Linux Server (v. 7) | Fixed | RHSA-2022:1284 |
| Red Hat Enterprise Linux Server Optional (v. 7) | Fixed | RHSA-2022:1284, RHSA-2022:1302 |
| Red Hat Enterprise Linux Workstation (v. 7) | Fixed | RHSA-2022:1284, RHSA-2022:1302 |
| Red Hat Enterprise Linux Workstation Optional (v. 7) | Fixed | RHSA-2022:1284 |
Not affected: 1 product
- Red Hat Enterprise Linux 9
Timeline
- 2026-10-02 Threatist record created from CVE-2022-24713
- 2026-10-03 Alias added: GHSA-m5pq-gvj9-9vr8
References
Advisory 12
- https://github.com/rust-lang/regex/security/advisories/GHSA-m5pq-gvj9-9vr8
- https://groups.google.com/g/rustlang-security-announcements/c/NcNNL1Jq7Yw
- FEDORA-2022-ceb3e03c5e
- FEDORA-2022-8436ac4c39
- FEDORA-2022-d20d44ba98
- [debian-lts-announce] 20220407 [SECURITY] [DLA 2971-1] firefox-esr security update
- DSA-5113
- [debian-lts-announce] 20220411 [SECURITY] [DLA 2978-1] thunderbird security update
- DSA-5118
- GLSA-202208-08
- GLSA-202208-14
- https://nvd.nist.gov/vuln/detail/CVE-2022-24713
Other 5
- https://github.com/rust-lang/regex
- https://lists.fedoraproject.org/archives/list/[email protected]/message/JANLZ3JXWJR7FSHE57K66UIZUIJZI67T
- https://lists.fedoraproject.org/archives/list/[email protected]/message/O3YB7CURSG64CIPCDPNMGPE4UU24AB6H
- https://lists.fedoraproject.org/archives/list/[email protected]/message/PDOWTHNVGBOP2HN27PUFIGRYNSNDTYRJ
- https://rustsec.org/advisories/RUSTSEC-2022-0013.html
Sources
- CVE-2022-24713 · CVE Program
- CVE-2022-24713 · NVD
- FIRST EPSS
- GHSA-m5pq-gvj9-9vr8 · GitHub Advisory Database · CC BY 4.0
- CVE-2022-24713 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences