CVE-2022-28738
Ruby vulnerability analysis and mitigation

Overview

A double-free vulnerability (CVE-2022-28738) was discovered in the Regexp compiler in Ruby 3.x before 3.0.4 and 3.1.x before 3.1.2. The vulnerability was disclosed on April 12, 2022, affecting Ruby's regular expression compilation process. When attempting to create a Regexp object from untrusted user input, this vulnerability could potentially allow attackers to manipulate memory locations unexpectedly (Ruby Lang, Ubuntu Security).

Technical details

The vulnerability stems from a bug in the Regexp compilation process where creating a Regexp object with a crafted source string could cause the same memory to be freed twice, leading to a double-free condition. The vulnerability has received a CVSS score of 9.8 (CRITICAL) with a vector of CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, indicating its severe nature. Notably, Ruby versions 2.6 and 2.7 series were not affected by this vulnerability (NetApp Security, Ruby Lang).

Impact

The successful exploitation of this vulnerability could lead to arbitrary code execution, allowing attackers to write to unexpected memory locations. Additionally, it could result in the disclosure of sensitive information, modification of data, or cause a Denial of Service (DoS) condition (NetApp Security).

Mitigation and workarounds

The primary mitigation is to upgrade Ruby to version 3.0.4 or 3.1.2 or later versions. For systems running Ruby 2.6 or 2.7 series, no action is required as these versions are not affected by the vulnerability (Ruby Lang).

Additional resources


SourceThis report was generated using AI

Related Ruby vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-4249-gjr8-jpq3HIGH8.7
  • RubyRuby
  • prosemirror_to_html
NoYesNov 13, 2025
CVE-2025-64501HIGH7.6
  • RubyRuby
  • prosemirror_to_html
NoYesNov 10, 2025
GHSA-vfpf-xmwh-8m65HIGH7.6
  • RubyRuby
  • prosemirror_to_html
NoYesNov 07, 2025
GHSA-52c5-vh7f-26fxHIGH7.6
  • RubyRuby
  • prosemirror_to_html
NoYesNov 06, 2025
CVE-2025-12790HIGH7.4
  • RubyRuby
  • mqtt
NoYesNov 06, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management