Heap-use-after-free vulnerability in mruby

mruby Updated 02 Oct 2025

Summary

28/02/2023
HIGH
Yes i
High
Not published

OSV-2023-118: Heap-use-after-free in mrb_gc_mark. Affects mruby versions >= 0a1fd07910f534f0585fa74f9abde261ca6786eb, < 321cfe97605de8f050ac9be597069e370d5d9da3. Fixed in 321cfe97605de8f050ac9be597069e370d5d9da3. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

mruby is an open-source lightweight implementation of the Ruby programming language. It is designed to be embedded in other applications and provides a minimalistic and efficient runtime environment. The vulnerability in question is a heap-use-after-free issue that has been identified in the mruby codebase.

Vulnerability Detail

The vulnerability arises due to a heap-use-after-free condition in the mrb_gc_mark function. This can lead to a crash when attempting to read from freed memory. The issue has been reported through OSS-Fuzz, and the crash state indicates that the problem occurs during garbage collection marking. The severity of this vulnerability is classified as HIGH.

How To Fix

Minimum fixed version

321cfe97605de8f050ac9be597069e370d5d9da3

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

At present, there is no known workaround for this vulnerability. It is essential to update to a fixed version of the mruby package to mitigate the risk.

Conclusion

In conclusion, the mruby package is affected by a heap-use-after-free vulnerability in the mrb_gc_mark function. This vulnerability can lead to crashes and potentially allow for arbitrary code execution. It is crucial to update to a fixed version of the mruby package to mitigate the risk. For further assistance with vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for mruby →

Share this vulnerability

FAQ

mruby is a lightweight implementation of the Ruby programming language that is designed to be embedded in other applications.

A heap-use-after-free vulnerability occurs when a program attempts to access memory that has already been freed. This can lead to crashes or potentially allow an attacker to execute arbitrary code.

This vulnerability was discovered through the OSS-Fuzz project, which performs continuous fuzz testing on open-source software.

The severity of this vulnerability is classified as HIGH.

No, there is currently no known workaround for this vulnerability. It is recommended to update to a fixed version of the mruby package.

Related vulnerabilities

Recent vulnerabilities recorded for mruby.

How To Fix

Minimum fixed version

321cfe97605de8f050ac9be597069e370d5d9da3

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback