Heap-buffer-overflow in mrb_funcall_with_block in mruby

mruby Updated 02 Oct 2025

Summary

15/10/2021
HIGH
Yes i
High
Not published

OSV-2021-1455: Heap-buffer-overflow in mrb_funcall_with_block. Affects mruby versions >= dccd66f9efecd0a974b735c62836fe566015cf37, < 7010ed0f0a414b1367e4620a504f106759341cc2. Fixed in 7010ed0f0a414b1367e4620a504f106759341cc2. 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 mrb_funcall_with_block function in mruby is responsible for calling a Ruby method with a block. This vulnerability in mruby allows for a heap-buffer-overflow WRITE of 8 bytes. The issue was reported through the OSS-Fuzz project and can lead to crashes in the mrb_funcall_with_block function, specifically when mrb_funcall_argv and const_get are invoked.

Vulnerability Detail

The vulnerability arises from a heap-buffer-overflow WRITE of 8 bytes in the mrb_funcall_with_block function. This can potentially lead to crashes and may be exploitable to execute arbitrary code or cause denial of service. The issue was discovered through the OSS-Fuzz project, which identified the crash state as mrb_funcall_with_block, mrb_funcall_argv, and const_get. The severity of this vulnerability is classified as HIGH.

How To Fix

Minimum fixed version

7010ed0f0a414b1367e4620a504f106759341cc2

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

As a workaround, if updating the mruby package is not immediately feasible, developers can consider implementing input validation and sanitization to prevent triggering the vulnerable code path. Additionally, enabling address sanitization tools during compilation may help detect potential heap-buffer-overflow issues.

Conclusion

In conclusion, the mrb_funcall_with_block function in mruby is vulnerable to a heap-buffer-overflow WRITE of 8 bytes. This can potentially lead to crashes and may be exploitable to execute arbitrary code or cause denial of service. It is recommended to update the mruby package to a version that includes the fix. For further support on 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.

This vulnerability can lead to crashes and potentially allow for the execution of arbitrary code or denial of service.

This vulnerability was discovered through the OSS-Fuzz project, which identified a heap-buffer-overflow WRITE in the mrb_funcall_with_block function.

The severity of this vulnerability is classified as HIGH.

To fix this vulnerability, update the mruby package to a version that includes the fix.

Related vulnerabilities

Recent vulnerabilities recorded for mruby.

How To Fix

Minimum fixed version

7010ed0f0a414b1367e4620a504f106759341cc2

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