CVE-2022-24713 Regular expression denial of service in Rust's regex crate
Attackers can cause denial of service by sending specially crafted regular expressions to services accepting untrusted regexes, bypassing built-in mitigations.
- 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-24713?
CVE-2022-24713 is a high-severity denial of service vulnerability in Debian Debian Linux, published on 8 Mar 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
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.
Which versions are affected by CVE-2022-24713?
3 open source packages ship an affected version, including regex. It affects 3 products.
| Package | Affected | Fixed in |
|---|---|---|
regex crates.io | All versions | 1.5.5 |
regex crates.io | All versions | 1.5.5 |
regex crates.io | From 0.0.0-0 | 1.5.5 |
Linux distribution packages (16)
bat openSUSE:Tumbleweed | All versions | 0.21.0-1.1 |
cargo-audit openSUSE:Tumbleweed | All versions | 0.16.0~git0.625c965-3.1 |
firecracker openSUSE:Tumbleweed | All versions | 1.0.0-2.1 |
git-delta openSUSE:Tumbleweed | All versions | 0.12.1-1.1 |
juliaup openSUSE:Tumbleweed | All versions | 1.5.37-2.1 |
macchina openSUSE:Tumbleweed | All versions | 6.0.6~git0.c21ce78-2.1 |
parsec openSUSE:Tumbleweed | All versions | 1.0.0~rc3-1.1 |
parsec-tool openSUSE:Tumbleweed | All versions | 0.5.2-1.1 |
pijul openSUSE:Tumbleweed | All versions | 1.0.0~beta.2-1.1 |
pleaser openSUSE:Tumbleweed | All versions | 0.5.1~git0.ce9627c-4.1 |
rage-encryption openSUSE:Tumbleweed | All versions | 0.7.1+0-2.1 |
rustup openSUSE:Tumbleweed | All versions | 1.24.3~0-3.1 |
sccache openSUSE:Tumbleweed | All versions | 0.2.15~git0.6b6d2f7-11.1 |
spotifyd openSUSE:Tumbleweed | All versions | 0.3.3-5.1 |
treefetch openSUSE:Tumbleweed | All versions | 2.0.0~git0.5b3eac1-2.1 |
tuigreet openSUSE:Tumbleweed | All versions | 0.7.1-4.1 |
Products include Debian Debian Linux, Fedoraproject Fedora, Rust-Lang Regex.
How do I fix CVE-2022-24713?
Upgrade regex to 1.5.5 or later.
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-24713 being exploited?
There is no known exploitation of CVE-2022-24713 in the wild and no public exploit code.
Public exploit code: 1 proofs of concept on GitHub.
Other vulnerabilities in Debian Debian Linux
Sources
Also known as AZL-40907, AZL-45021, AZL-61405, AZL-62435, CLEANSTART-2024-AG66831, DEBIAN-CVE-2022-24713 and 25 more.