Critical Vulnerability in Ruby Package: UNIXSocket Null Character Handling

ruby Updated 02 Oct 2025

Summary

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

ALPINE-CVE-2018-8779: 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, the UNIXServer.open and UNIXSocket.open methods are not checked for null characters. 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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

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 Ruby package provides essential libraries and tools for developers to build applications. However, certain versions of Ruby are vulnerable to a security flaw that allows for unintended socket connections due to improper handling of null characters in UNIXServer and UNIXSocket methods.

Vulnerability Detail

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, the methods UNIXServer.open and UNIXSocket.open do not validate input for null characters. This oversight can lead to the establishment of unintended socket connections, potentially exposing applications to unauthorized access and data breaches. The vulnerability is classified under CVE-2018-8779 and has a CVSS score of 7.5, indicating a high severity level.

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

As a temporary measure, avoid using the UNIXServer.open and UNIXSocket.open methods with untrusted input. Implement input validation to sanitize any user-provided data before processing it through these methods.

Conclusion

The vulnerability CVE-2018-8779 poses a significant risk to applications using affected versions of Ruby. By updating to the patched version and implementing input validation, developers can mitigate the risks associated with this flaw. Utilizing tools like Vulert can further enhance security by providing real-time alerts for open-source vulnerabilities.

See every vulnerability recorded for ruby →

Share this vulnerability

FAQ

CVE-2018-8779 is a security vulnerability in Ruby that allows for unintended socket connections due to improper handling of null characters in specific methods.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

Affected versions include 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.

Update your Ruby package to version 2.5.1-r0 or later to patch the vulnerability. Additionally, validate inputs to prevent untrusted data from being processed.

Vulert is a tool that monitors and alerts for open-source vulnerabilities in software using just a manifest file like package-lock.json. It helps developers stay informed about vulnerabilities in their applications.

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