# 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.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 8 Mar 2022
- **Updated:** 23 Apr 2025
- **Also known as:** AZL-40907, AZL-45021, AZL-61405, AZL-62435, CLEANSTART-2024-AG66831, DEBIAN-CVE-2022-24713, GHSA-m5pq-gvj9-9vr8, RUSTSEC-2022-0013, SUSE-SU-2025:3911-1, UBUNTU-CVE-2022-24713, USN-5610-1, openSUSE-SU-2024:11913-1, openSUSE-SU-2024:11914-1, openSUSE-SU-2024:11917-1, openSUSE-SU-2024:11918-1, openSUSE-SU-2024:11920-1, openSUSE-SU-2024:11921-1, openSUSE-SU-2024:11922-1, openSUSE-SU-2024:11923-1, openSUSE-SU-2024:11925-1, openSUSE-SU-2024:11928-1, openSUSE-SU-2024:11931-1, openSUSE-SU-2024:11937-1, openSUSE-SU-2024:11941-1, openSUSE-SU-2024:11945-1, openSUSE-SU-2024:11946-1, openSUSE-SU-2024:11948-1, openSUSE-SU-2024:11962-1, openSUSE-SU-2024:12055-1, openSUSE-SU-2024:12114-1, openSUSE-SU-2024:12131-1

## 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.

Weakness: CWE-1333 (Inefficient Regular Expression Complexity), CWE-400 (Uncontrolled Resource Consumption)

## Which versions are affected by CVE-2022-24713?

3 open source packages ship an affected version, including regex. It affects 3 products.


| Package | Ecosystem | 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 |
| `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: Debian Debian Linux, Fedoraproject Fedora, Rust-Lang Regex.

## How do I fix CVE-2022-24713?

Upgrade regex to 1.5.5 or later.

## 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:

- Proof of Concept/Test for CVE-2022-24713 on Ubuntu (github_poc): https://github.com/jpeisach/CVE-2022-24713-POC

## Other vulnerabilities in Debian Debian Linux

- [CVE-2015-3306](https://insights.sbomify.com/CVE-2015-3306/): ProFTPD Improper Access Control (critical 10.0, exploited in the wild)
- [CVE-2025-49113](https://insights.sbomify.com/CVE-2025-49113/): RoundCube Webmail Deserialization of Untrusted Data (critical 9.9, exploited in the wild)
- [CVE-2026-24061](https://insights.sbomify.com/CVE-2026-24061/): GNU InetUtils Argument Injection (critical 9.8, exploited in the wild)
- [CVE-2025-39682](https://insights.sbomify.com/CVE-2025-39682/): Linux Kernel Improper Check for Unusual or Exceptional Conditions (critical 9.8, exploited in the wild)
- [CVE-2024-9680](https://insights.sbomify.com/CVE-2024-9680/): Mozilla Firefox Use-After-Free (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-24713 and fix it if it is affected.

What it is: 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.
Exploitation: There is no known exploitation of CVE-2022-24713 in the wild and no public exploit code.

Affected packages and fixed versions:
- regex (crates.io): affected all versions; fixed in 1.5.5
- regex (crates.io): affected all versions; fixed in 1.5.5
- regex (crates.io): affected from 0.0.0-0; fixed in 1.5.5

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-24713/ (Markdown: https://insights.sbomify.com/CVE-2022-24713/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-24713
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-24713
- OSV: https://osv.dev/vulnerability/CVE-2022-24713

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-24713/
Summaries are generated and may contain mistakes; the official description above is the record.
