Ruby Vulnerability: Heap Data Exposure in BasicSocket#read_nonblock

ruby Updated 02 Oct 2025

Summary

04/05/2020
N/A
Yes i
Medium
5.3

ALPINE-CVE-2020-10933: An issue was discovered in Ruby 2.5.x through 2.5.7, 2.6.x through 2.6.5, and 2.7.0. Affects ruby versions < 2.5.8-r0. Fixed in 2.5.8-r0. 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

Ruby is a dynamic, open-source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write. The Ruby package in Alpine Linux provides the Ruby interpreter and standard libraries. This vulnerability affects Ruby versions 2.5.x through 2.5.7, 2.6.x through 2.6.5, and 2.7.0, allowing potential exposure of sensitive data from the heap memory.

Vulnerability Detail

An issue was discovered in Ruby versions 2.5.x through 2.5.7, 2.6.x through 2.6.5, and 2.7.0. When a user calls the BasicSocket#read_nonblock method with parameters that include a buffer and exception set to false, the method resizes the buffer to accommodate the requested size without copying any data. As a result, the buffer retains the previous value from the heap, which may inadvertently expose sensitive information from the Ruby interpreter's memory.

How To Fix

Minimum fixed version

2.5.8-r0

This is the first release that contains the fix.

sudo apk add --upgrade ruby

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid using the BasicSocket#read_nonblock method with the exception parameter set to false until the package is updated to a secure version.

Conclusion

The Ruby vulnerability identified as CVE-2020-10933 poses a risk of exposing sensitive heap data through the BasicSocket#read_nonblock method. It is crucial to update to the patched versions of Ruby to mitigate this risk and ensure the security of applications using this interpreter.

See every vulnerability recorded for ruby →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 5.3, indicating a medium severity level.

Ruby versions 2.5.x through 2.5.7, 2.6.x through 2.6.5, and 2.7.0 are affected.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check if your application is affected without needing to sign up.

If an immediate update is not possible, refrain from using the BasicSocket#read_nonblock method with the exception parameter set to false as a temporary measure.

More details can be found in the CVE-2020-10933 documentation and the Alpine Linux vulnerability database.

Related vulnerabilities

Recent vulnerabilities recorded for ruby.

How To Fix

Minimum fixed version

2.5.8-r0

This is the first release that contains the fix.

sudo apk add --upgrade ruby

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