CVE-2022-24713
Regular expression denial of service in Rust's regex crate
Reported by github_m · Published March 8, 2022
regex is fixed in 1.5.5 (crates.io)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| regex | crates.io | 1.5.5 |
| swayr | Alpine | 0.16.1-r0 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| rust-lang | regex | < 1.5.5 |
| crates.io | regex | 0 |
| alpine | swayr | 0 |
| arch | thunderbird | 91.7.0-1 |
| rust-lang | regex | 0 |
| amazon:2023 | amazon-efs-utils | 0 |
| amazon:2 | amazon-efs-utils | 0 |
| alpine | bat | 0, 0 |
| alpine | firefox-esr | 0 |
| alpine | firefox | 0 |
| alpine | thunderbird | 0 |
| amazon:2 | thunderbird | 0 |
| alpine | delta | 0 |
| arch | firefox | 0 |
| alpine | librewolf | 0 |
Timeline
- Mar 8, 2022 CVE Published
- Mar 9, 2022 EPSS Score (30 in total, the first dated here)
- Mar 22, 2022 PoC Published
- Mar 17, 2026 Security Advisory (24 in total, the first dated here)
- Jul 2, 2026 Coalition ESS Score
- Oct 31, 2026 Distribution Patch (16 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2022-24713
vulnetix vdb fixes CVE-2022-24713
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2022-24713/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- x_refsource_CONFIRM
- x_refsource_MISC
- x_refsource_MISC
- FEDORA-2022-ceb3e03c5e vendor-advisoryx_refsource_FEDORA
- FEDORA-2022-8436ac4c39 vendor-advisoryx_refsource_FEDORA
- FEDORA-2022-d20d44ba98 vendor-advisoryx_refsource_FEDORA
- [debian-lts-announce] 20220407 [SECURITY] [DLA 2971-1] firefox-esr security update mailing-listx_refsource_MLIST
- DSA-5113 vendor-advisoryx_refsource_DEBIAN
- [debian-lts-announce] 20220411 [SECURITY] [DLA 2978-1] thunderbird security update mailing-listx_refsource_MLIST
- DSA-5118 vendor-advisoryx_refsource_DEBIAN
- GLSA-202208-08 vendor-advisoryx_refsource_GENTOO
- GLSA-202208-14 vendor-advisoryx_refsource_GENTOO
- https://nvd.nist.gov/vuln/detail/CVE-2022-24713 advisory
- https://github.com/advisories/GHSA-m5pq-gvj9-9vr8 advisory
- https://github.com/rust-lang/regex url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JANLZ3JXWJR7FSHE57K66UIZUIJZI67T url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/O3YB7CURSG64CIPCDPNMGPE4UU24AB6H url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PDOWTHNVGBOP2HN27PUFIGRYNSNDTYRJ url
- https://rustsec.org/advisories/RUSTSEC-2022-0013.html url