Heap-use-after-free vulnerability in mruby

mruby Updated 02 Oct 2025

Summary

04/05/2023
HIGH
Yes i
High
Not published

OSV-2023-366: Heap-use-after-free in gc_mark_children. Affects mruby versions >= 672495555bb741aefbde2f31a523f7ed8666d2c6, < b47c8b738ae3e400ec02269fae9857222218e9d5. Fixed in b47c8b738ae3e400ec02269fae9857222218e9d5. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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 interpreter. The vulnerability in question is a heap-use-after-free issue that has been identified in the gc_mark_children function of mruby. This function is responsible for marking objects during garbage collection. The vulnerability can potentially lead to a crash due to a read of 4 bytes from a freed heap memory region.

Vulnerability Detail

The heap-use-after-free vulnerability in gc_mark_children can be triggered during incremental garbage collection or a full garbage collection process. An attacker could potentially exploit this vulnerability to execute arbitrary code or cause a denial-of-service condition. The vulnerability was reported through the OSS-Fuzz project, and the affected versions of mruby can be found in the provided OSS-Fuzz report link.

How To Fix

Minimum fixed version

b47c8b738ae3e400ec02269fae9857222218e9d5

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

There is no specific workaround available for this vulnerability. It is recommended to follow the steps mentioned in the 'how_to_fix' section to update the mruby package to a fixed version.

Conclusion

The heap-use-after-free vulnerability in mruby's gc_mark_children function can have serious security implications. It is crucial to update the mruby package to a version that includes the fix or apply the necessary patches to mitigate the risk. For further support and assistance in 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 designed for embedding 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.

An attacker could exploit this vulnerability by crafting a malicious input that triggers the heap-use-after-free condition, potentially leading to arbitrary code execution or denial-of-service.

Yes, a fix for this vulnerability is available in commit b47c8b738ae3e400ec02269fae9857222218e9d5 or later. Users should update their mruby installation to a version that includes this fix.

More information about this vulnerability can be found in the provided OSS-Fuzz report: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58577

Related vulnerabilities

Recent vulnerabilities recorded for mruby.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

b47c8b738ae3e400ec02269fae9857222218e9d5

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