Vulnerability in RubyGems Allows File Overwrite (CVE-2017-0901)

ruby Updated 02 Oct 2025

Summary

31/08/2017
N/A
Yes i
High
7.5

CVE-2017-0901: RubyGems version 2.6.12 and earlier fails to validate specification names, allowing a maliciously crafted gem to potentially overwrite any file on the filesystem. Affects ruby across 2 version ranges.

< 2.4.2-r0 < ad5c0a53a86ca5b218c7976765c0365b91d22cb2

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

RubyGems is a package manager for the Ruby programming language. It allows users to easily install, manage, and update Ruby libraries and dependencies. However, versions 2.6.12 and earlier of RubyGems fail to validate specification names, which can be exploited by a maliciously crafted gem to potentially overwrite any file on the filesystem.

Vulnerability Detail

The vulnerability (CVE-2017-0901) in RubyGems arises from the lack of validation of specification names. This allows an attacker to create a gem with a specially crafted name that can overwrite any file on the system. By exploiting this vulnerability, an attacker can gain unauthorized access to sensitive files, modify critical system configurations, or disrupt the normal functioning of the affected system. The CVSS score for this vulnerability is 7.5, indicating a high severity.

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

There is no known workaround for this vulnerability. It is essential to apply the recommended fix by updating RubyGems to the latest version.

Conclusion

The vulnerability in RubyGems (CVE-2017-0901) allows a maliciously crafted gem to overwrite any file on the filesystem. To mitigate this risk, it is crucial to update RubyGems to version 2.4.2-r0 or later. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for ruby →

Share this vulnerability

FAQ

RubyGems is a package manager for the Ruby programming language, allowing easy installation and management of Ruby libraries and dependencies.

This vulnerability allows an attacker to overwrite any file on the system, potentially leading to unauthorized access, data loss, or system disruption.

To fix this vulnerability, update RubyGems to version 2.4.2-r0 or later.

No, there is no known workaround. It is crucial to update RubyGems to the latest version.

The CVSS score for this vulnerability is 7.5, indicating a high severity.

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