CVE-2022-24713
Regular expression denial of service in Rust's regex crate
Check your servers for CVE-2022-24713
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2022-24713 affects regex, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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.
Severity (CVSS)
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Attack vector
- network: an attacker can reach the vulnerable part over the network, often from the internet
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- none: the attacker does not need an account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality none, integrity none, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 14.4%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 96.7% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 23 Apr 2025):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- yes: an attacker can automate the attack across many targets
- Technical impact
- partial: limited control or limited data
Weakness
- CWE-400 Uncontrolled Resource Consumption
Affected products
As the CNA lists them.
Is my server affected?
Find the installed version of regex and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i regex
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2022-24713 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2022-24713RHEL, Rocky, Alma, Fedora
rpm -q regex
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2022-24713Alpine
apk list --installed | grep -i regexWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2022-24713
trivy image --scanners vuln IMAGE | grep CVE-2022-24713
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
- https://github.com/rust-lang/regex/security/advisories/GHSA-m5pq-gvj9-9vr8 github.com
- FEDORA-2022-ceb3e03c5e lists.fedoraproject.org · vendor advisory
- FEDORA-2022-8436ac4c39 lists.fedoraproject.org · vendor advisory
- FEDORA-2022-d20d44ba98 lists.fedoraproject.org · vendor advisory
- DSA-5113 debian.org · vendor advisory
- DSA-5118 debian.org · vendor advisory
- GLSA-202208-08 security.gentoo.org · vendor advisory
- GLSA-202208-14 security.gentoo.org · vendor advisory
Other references
- https://github.com/rust-lang/regex/commit/ae70b41d4f46641dbc45c7a4f87954aea356283e github.com
- https://groups.google.com/g/rustlang-security-announcements/c/NcNNL1Jq7Yw groups.google.com
- [debian-lts-announce] 20220407 [SECURITY] [DLA 2971-1] firefox-esr security update lists.debian.org · mailing list
- [debian-lts-announce] 20220411 [SECURITY] [DLA 2978-1] thunderbird security update lists.debian.org · mailing list
Source: the record CVE-2022-24713 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse