CVE-2022-28738 Use after free in n/a
A double free in the Ruby Regexp compiler allows attackers to write to unexpected memory locations, potentially leading to code execution.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-28738?
CVE-2022-28738 is a critical use after free vulnerability in Ruby-Lang Ruby, published on 9 May 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official 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.
Weakness: CWE-415
Which versions are affected by CVE-2022-28738?
2 open source packages ship an affected version, including ruby and ruby-min. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
ruby Bitnami | From 3.0.0 | 3.0.4, 3.1.2 |
ruby-min Bitnami | From 3.0.0 | 3.0.4, 3.1.2 |
Products include Ruby-Lang Ruby.
How do I fix CVE-2022-28738?
Upgrade ruby to a fixed version for your release line: 3.0.4 or 3.1.2.
Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.
Is CVE-2022-28738 being exploited?
There is no known exploitation of CVE-2022-28738 in the wild and no public exploit code.
Other vulnerabilities in Ruby-Lang Ruby
Sources
Also known as ALPINE-CVE-2022-28738, BIT-ruby-2022-28738, BIT-ruby-min-2022-28738, CLEANSTART-2026-WY79580, GHSA-8pqg-8p79-j5j8, UBUNTU-CVE-2022-28738.