Heap-use-after-free vulnerability in mruby
Summary
OSV-2023-176: Heap-use-after-free in mrb_gc_mark. Affects mruby versions >= 0e51da81bb7981a5005ca22c95384056bcb87671, < 8d1192f8a28034b1931a41e8c55cd86715101d0c. Fixed in 8d1192f8a28034b1931a41e8c55cd86715101d0c. How to fix ↓
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.
No signup required · Results in about 60 seconds
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 affects the garbage collector (GC) functionality of mruby.
Vulnerability Detail
The vulnerability arises due to a heap-use-after-free condition in the mrb_gc_mark function of mruby. This can lead to a crash when attempting to read from a freed memory location. The issue was discovered and reported by OSS-Fuzz, and more details can be found in their bug report (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=56991). The severity of this vulnerability is considered high.
How To Fix
Minimum fixed version
8d1192f8a28034b1931a41e8c55cd86715101d0c
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 mentioned for this vulnerability.
Conclusion
In conclusion, the mruby package is affected by a heap-use-after-free vulnerability in the mrb_gc_mark function. It is recommended to update to a version of mruby that includes the fix for this vulnerability. For further support and assistance with vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for mruby →
FAQ
mruby is a lightweight implementation of the Ruby programming language 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, leading to potential crashes or other unexpected behavior.
This vulnerability was discovered and reported by OSS-Fuzz, a continuous fuzzing service for open-source software.
The severity of this vulnerability is considered high.
More information about this vulnerability can be found in the OSS-Fuzz bug report: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=56991
References
Related vulnerabilities
Recent vulnerabilities recorded for mruby.