Intel

AIKIDO-2026-288031

rubygems-update is vulnerable to Path Traversal

Path Traversal Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published 3 days ago

53

Medium Risk

This Affects:

RUBYrubygems-update
2.0.0 - 4.0.16
Fixed in 4.0.17
Are you affected? Scan for Free

TL;DR

Gem::Source#fetch_spec builds the on-disk spec cache path directly from the spec name in a name tuple returned by a remote gem index, without validating that name as a path component. A crafted spec name containing path separators or .. causes the downloaded gemspec bytes to be written outside Gem.spec_cache_dir, before the Marshal payload is ever loaded. A malicious or compromised gem source can therefore trigger an arbitrary file write on the client with an attacker-controlled path and content. The fix rejects any spec name whose File.basename differs from the full value before the cache path is constructed.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and fetch specs from an untrusted or compromised gem source.

Background info

rubygems-update is vulnerable to Path Traversal in versions 2.0.0 - 4.0.16.

How to fix this

Upgrade the rubygems-update library to the patch version.