UNKNOWN READ vulnerability in mruby

mruby Updated 02 Oct 2025

Summary

10/11/2022
MEDIUM
Yes i
Medium
Not published

OSV-2022-1161: UNKNOWN READ in pack_unpack. Affects mruby versions >= 4e9773ae3db701ff284171f916d3cd144d6fcae4, < 9fcfd01f205fdd092be0932ac0b7a6a4eb29d2b3. Fixed in 9fcfd01f205fdd092be0932ac0b7a6a4eb29d2b3. 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 Penetration testing for web, API and mobile 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 runtime environment. The vulnerability in question affects the pack_unpack function in mruby, which is responsible for packing and unpacking data. This vulnerability allows for an unknown read operation, which can lead to unexpected behavior or crashes in the application.

Vulnerability Detail

The UNKNOWN READ vulnerability in pack_unpack function of mruby allows an attacker to read uninitialized or invalid memory, potentially leading to information disclosure or denial of service. The vulnerability originates from a flaw in the implementation of the function, which fails to properly handle certain input data. This can be exploited by an attacker to read sensitive information from memory or cause the application to crash.

How To Fix

Minimum fixed version

9fcfd01f205fdd092be0932ac0b7a6a4eb29d2b3

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 modify the pack_unpack function in their local codebase to add proper input validation and handling. Here is an example of a possible workaround:

# Add input validation to pack_unpack function

def pack_unpack(data)
  if data.nil?
    raise ArgumentError, 'Invalid input: data cannot be nil'
  end

  # Rest of the function implementation
end

Implementing this workaround will help mitigate the vulnerability by ensuring that the pack_unpack function only operates on valid input data.

Conclusion

The UNKNOWN READ vulnerability in mruby's pack_unpack function can have serious consequences, including information disclosure and denial of service. It is crucial to update the mruby package to a fixed version or implement the provided workaround to mitigate the vulnerability. For further assistance and support 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 to be embedded in other applications.

The pack_unpack function in mruby is responsible for packing and unpacking data.

The UNKNOWN READ vulnerability can lead to information disclosure or denial of service.

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

Yes, developers can implement input validation in the pack_unpack function as a temporary workaround.

Related vulnerabilities

Recent vulnerabilities recorded for mruby.

How To Fix

Minimum fixed version

9fcfd01f205fdd092be0932ac0b7a6a4eb29d2b3

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