Use-after-poison vulnerability in rb_gc_writebarrier in Ruby

ruby Updated 02 Oct 2025

Summary

09/04/2023
HIGH
No i
High
Not published

OSV-2023-292: Use-after-poison in rb_gc_writebarrier. Affected versions are not published. No fix is published. 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

Ruby is a dynamic, object-oriented programming language known for its simplicity and productivity. It is widely used for web development, scripting, and system administration tasks. The rb_gc_writebarrier function in Ruby is responsible for garbage collection and memory management. However, a use-after-poison vulnerability has been discovered in this function, which can lead to a crash or potential code execution.

Vulnerability Detail

The use-after-poison vulnerability in rb_gc_writebarrier allows an attacker to read uninitialized or freed memory, potentially leading to information disclosure or arbitrary code execution. This vulnerability can be triggered by calling certain functions, such as rb_set_class_path_string and rb_define_class_id_under, which interact with the rb_gc_writebarrier function. Exploiting this vulnerability can result in a denial of service or the execution of malicious code.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, users can avoid calling the vulnerable functions rb_set_class_path_string and rb_define_class_id_under until the Ruby package is updated. By avoiding these functions, the use-after-poison vulnerability can be mitigated.

Conclusion

The use-after-poison vulnerability in rb_gc_writebarrier in Ruby can have serious consequences, including crashes and potential code execution. It is crucial to update your Ruby installation to the latest patched version to mitigate the risk. If you have any further questions or need assistance with vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for ruby →

Share this vulnerability

FAQ

This vulnerability can potentially lead to a crash or code execution, allowing an attacker to compromise the affected system.

You can use the Vulert Playground at Vulert Scanner to check if your Ruby application is affected by this vulnerability. Simply upload your package-lock.json file to the playground and it will provide real-time alerts for open-source vulnerabilities.

Yes, the Ruby development team has released a fix for this vulnerability in the latest versions. It is recommended to update your Ruby installation to the latest patched version.

Yes, as a temporary workaround, you can avoid calling the vulnerable functions rb_set_class_path_string and rb_define_class_id_under until the Ruby package is updated.

You can find more information about this vulnerability in the OSS-Fuzz report at https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=57782

Related vulnerabilities

Recent vulnerabilities recorded for ruby.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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