Segv on unknown address in mrb_bint_to_s in mruby

mruby Updated 02 Oct 2025

Summary

20/07/2022
N/A
Yes i
Unrated
Not published

OSV-2022-600: Segv on unknown address in mrb_bint_to_s. Affects mruby versions >= 714e8a57af690805b3edcffdffc42729833bc50a, < cfea0c28a045790388aedf53f1c9a5c43a683dd2. Fixed in cfea0c28a045790388aedf53f1c9a5c43a683dd2. 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 Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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 arises in the mrb_bint_to_s function, which is responsible for converting a binary integer to a string representation. This vulnerability can lead to a segmentation fault (segv) when an unknown address is encountered during the conversion process.

Vulnerability Detail

The vulnerability occurs in the mrb_bint_to_s function of mruby. When converting a binary integer to a string, the function encounters an unknown address, resulting in a segmentation fault. This can potentially lead to a crash or denial of service if exploited. The issue was reported through OSS-Fuzz, and the crash state indicates that the crash occurs in mrb_integer_to_str and int_to_s functions.

How To Fix

Minimum fixed version

cfea0c28a045790388aedf53f1c9a5c43a683dd2

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, developers can avoid using the mrb_bint_to_s function or any code that relies on it until the package is updated with the fix. This can help mitigate the risk of encountering the segmentation fault. Here is an example of how to avoid using mrb_bint_to_s:

# Instead of using mrb_bint_to_s
# Use a custom implementation to convert binary integers to strings

def custom_bint_to_s(value)
  # Custom implementation logic here
end

Conclusion

In conclusion, the vulnerability in mruby's mrb_bint_to_s function can lead to a segmentation fault when encountering an unknown address during the conversion of a binary integer to a string. It is recommended to update the mruby package to a version that includes the fix or use the provided workaround until the fix is applied. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for mruby →

Share this vulnerability

FAQ

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 mruby is related to the mrb_bint_to_s function, which can lead to a segmentation fault when encountering an unknown address during the conversion of a binary integer to a string.

The potential consequences of this vulnerability include crashes or denial of service if the issue is exploited. It can impact applications that rely on mruby and use the mrb_bint_to_s function.

To fix this vulnerability, it is recommended to update the mruby package to a version that includes the fix. The fix can be found in commit cfea0c28a045790388aedf53f1c9a5c43a683dd2 on the official mruby GitHub repository.

Yes, developers can avoid using the mrb_bint_to_s function or any code that relies on it until the package is updated with the fix. This can help mitigate the risk of encountering the segmentation fault.

Related vulnerabilities

Recent vulnerabilities recorded for mruby.

How To Fix

Minimum fixed version

cfea0c28a045790388aedf53f1c9a5c43a683dd2

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