Buffer Under-read Vulnerability in Ruby Package: CVE-2018-8778

ruby Updated 02 Oct 2025

Summary

03/04/2018
N/A
Yes i
High
7.5

ALPINE-CVE-2018-8778: In Ruby before 2.2.10, 2.3.x before 2.3.7, 2.4.x before 2.4.4, 2.5.x before 2.5.1, and 2.6.0-preview1, an attacker controlling the unpacking format (similar to format string vulnerabilities) can trigger a buffer under-re... Affects ruby versions < 2.5.1-r0. Fixed in 2.5.1-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 is widely used for web development, particularly with the Ruby on Rails framework. The language is known for its elegant syntax and powerful features, but like any software, it is susceptible to vulnerabilities. CVE-2018-8778 is a significant security issue affecting multiple versions of Ruby, which can lead to information disclosure through improper handling of unpacking formats.

Vulnerability Detail

CVE-2018-8778 is a buffer under-read vulnerability found in Ruby versions prior to 2.2.10, 2.3.x before 2.3.7, 2.4.x before 2.4.4, 2.5.x before 2.5.1, and 2.6.0-preview1. This vulnerability arises when an attacker controls the unpacking format, similar to format string vulnerabilities, allowing them to trigger a buffer under-read in the String#unpack method. The consequences include potential information disclosure, where sensitive data could be exposed to unauthorized users, leading to severe security breaches.

How To Fix

Minimum fixed version

2.5.1-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

If immediate upgrading is not possible, consider restricting access to the application or disabling features that utilize the String#unpack method until the update can be applied. This can help mitigate the risk of exploitation.

Conclusion

CVE-2018-8778 represents a serious security vulnerability in Ruby that can lead to significant information disclosure. It is essential for users to update their Ruby installations to the patched versions to mitigate risks. Utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.

See every vulnerability recorded for ruby →

Share this vulnerability

FAQ

CVE-2018-8778 is a buffer under-read vulnerability in Ruby that can lead to information disclosure.

Affected versions include Ruby before 2.2.10, 2.3.x before 2.3.7, 2.4.x before 2.4.4, and 2.5.x before 2.5.1.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The CVSS score for CVE-2018-8778 is 7.5, indicating a high severity level.

If immediate upgrading is not feasible, consider restricting access to the application or disabling features that utilize the vulnerable method until an update can be applied.

Related vulnerabilities

Recent vulnerabilities recorded for ruby.

How To Fix

Minimum fixed version

2.5.1-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