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
CVE-2022-28738 is a critical-severity flaw (CVSS 9.8) affecting ruby. Below: why it ranks where it does, which versions are affected, what to do, and the exact commands.
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.
Why this priority
- Critical severity
- Remotely exploitable, no login, no user action
A fixed release or distro patch exists.
Risk facts
| CVSS score | 9.8 (Critical) |
| Attack vector | Network (remote) |
| Attack complexity | Low |
| Privileges needed | None |
| User interaction | None |
| EPSS exploit chance | 3.1% (top 12%) |
| CISA exploited list | No |
| Weakness | CWE-415 |
| Published | 2022-05-09 |
| Last modified | 2026-06-17 |
Last updated 2026-06-17 · Sources: CVE Program, NVD, CISA KEV, EPSS and vendor advisories · How we score
Am I affected?
Timeline
- Published CVE record published
- Updated Record last modified
Advisories and coverage
Official advisories
- Ruby News: Regexp compilation fixes related to GitLab's CVE-2026-89078, CVE-2026-93577, CVE-2026-97229 and CVE-2026-110264 2026-10-23
Scores and fixes here are computed automatically from those and other public sources. Confirm with the vendor advisory before changing production systems.
Quick answers
How do I fix CVE-2022-28738?
ruby: upgrade to 3.0.4, 3.1.2. Exact commands for each OS are on this page.
Is CVE-2022-28738 being exploited?
CVE-2022-28738 is not on the CISA Known Exploited Vulnerabilities list at the time of the last update. Check again, as this can change.
What does CVE-2022-28738 affect?
CVE-2022-28738 affects ruby. Severity is critical (CVSS 9.8). 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.
How urgent is CVE-2022-28738?
Priority 61/100. Critical severity; Remotely exploitable, no login, no user action
Software pages
Related CVEs
- CVE-2026-46727 HIGH 8.1 UPGRADE An issue was discovered in Ruby 4 before 4.0.5
- CVE-2023-28756 MEDIUM 5.3 UPGRADE DOWNGRADE A ReDoS issue was discovered in the Time component through 0.2.1 in Ruby through 3.2.1
- CVE-2022-28739 HIGH 7.5 UPGRADE MITIGATE There is a buffer over-read in Ruby before 2.6.10, 2.7.x before 2.7.6, 3.x before 3.0.4, and 3.1.x before 3.1.
- CVE-2021-41819 HIGH 7.5 DOWNGRADE UPGRADE CGI::Cookie.parse in Ruby through 2.6.8 mishandles security prefixes in cookie names
- CVE-2021-41817 HIGH 7.5 UPGRADE UPGRADE Date.parse in the date gem through 3.2.0 for Ruby allows ReDoS (regular expression Denial of Service) via a lo