Critical Format String Vulnerability in Ruby Package

ruby Updated 02 Oct 2025

Summary

15/09/2017
N/A
Yes i
Critical
9.1

ALPINE-CVE-2017-0898: Ruby before 2.4.2, 2.3.5, and 2.2.8 is vulnerable to a malicious format string which contains a precious specifier (*) with a huge minus value. Affects ruby versions < 2.4.2-r0. Fixed in 2.4.2-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 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, open-source programming language with a focus on simplicity and productivity. It is widely used for web development, particularly in conjunction with the Ruby on Rails framework. The Ruby package in Alpine Linux is essential for running Ruby applications. However, certain versions of Ruby are vulnerable to a format string attack, which can lead to severe security issues.

Vulnerability Detail

The vulnerability identified as CVE-2017-0898 affects Ruby versions prior to 2.4.2, 2.3.5, and 2.2.8. It arises from a malicious format string that includes a precious specifier (*) with a significant negative value. This can result in a buffer overrun, leading to heap memory corruption or potential information disclosure from the heap. The CVSS score for this vulnerability is 9.1, indicating a critical level of risk.

How To Fix

Minimum fixed version

2.4.2-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 an immediate update is not feasible, consider restricting access to the affected Ruby applications or implementing strict input validation to mitigate the risk of exploitation.

Conclusion

The CVE-2017-0898 vulnerability poses a significant risk to Ruby applications running on Alpine Linux. It is crucial to update to the patched versions to mitigate potential security threats. Users should also consider using tools like Vulert to monitor for vulnerabilities in their software.

See every vulnerability recorded for ruby →

Share this vulnerability

FAQ

CVE-2017-0898 is a critical vulnerability in Ruby that allows for a format string attack, potentially leading to memory corruption or information disclosure.

Ruby versions prior to 2.4.2, 2.3.5, and 2.2.8 are affected by this vulnerability.

You can use the Vulert platform to check if your application is affected by this vulnerability by analyzing your manifest file without requiring any installation.

If an immediate update is not possible, consider implementing strict input validation and restricting access to the affected applications as a temporary measure.

The CVSS score for CVE-2017-0898 is 9.1, indicating a critical level of risk associated with this vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for ruby.

How To Fix

Minimum fixed version

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