# CVE-2022-28738: A double free was found in the Regexp compiler in Ruby 3.x before 3.0.4 and 3.1.x before 3.1.2.

- Severity: Critical 9.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 3.14%, higher than 88% of CVEs (2026-12-01)
- Published: 2022-05-09T00:00:00.000Z
- Modified: 2026-09-08T08:48:19.416Z
- Also known as: BIT-RUBY-2022-28738, BIT-RUBY-MIN-2022-28738
- Weaknesses: CWE-415
- Assigned by: mitre

## Description

A double free was found in the Regexp compiler in Ruby 3.x before 3.0.4 and 3.1.x before 3.1.2. If a victim attempts to create a Regexp from untrusted user input, an attacker may be able to write to unexpected memory locations.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- ruby-lang ruby: from 3.0.0 before 3.0.4; from 3.1.0 before 3.1.2
- ruby (Bitnami): from 3.0.0 before 3.0.4; from 3.1.0 before 3.1.2
- ruby-min (Bitnami): from 3.0.0 before 3.0.4; from 3.1.0 before 3.1.2

## Every score

- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 7.5 High `AV:N/AC:L/Au:N/C:P/I:P/A:P`
- Bitnami Vulnerability Database: rating Critical

## References

- <https://hackerone.com/reports/1220911> (advisory, permissions-required, third-party-advisory)
- <https://www.ruby-lang.org/en/news/2022/04/12/double-free-in-regexp-compilation-cve-2022-28738/> (advisory, vendor-advisory)
- <https://security-tracker.debian.org/tracker/CVE-2022-28738> (advisory, patch, third-party-advisory)
- <https://security.netapp.com/advisory/ntap-20220624-0002/> (advisory, third-party-advisory)
- <https://security.gentoo.org/glsa/202401-27> (vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-28738> (web)

## Sources

- CVE List: [CVE-2022-28738](https://www.cve.org/CVERecord?id=CVE-2022-28738), CVE Terms of Use, modified 2024-08-03
- NVD: [CVE-2022-28738](https://nvd.nist.gov/vuln/detail/CVE-2022-28738), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-RUBY-2022-28738](https://osv.dev/vulnerability/BIT-RUBY-2022-28738), Apache-2.0, modified 2026-09-08
- Bitnami Vulnerability Database: [BIT-RUBY-MIN-2022-28738](https://osv.dev/vulnerability/BIT-RUBY-MIN-2022-28738), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2022-28738 · Whole record: https://cve.day/CVE-2022-28738.json · Rebuilt by cve.day 2026-11-25T22:58:11.518Z
