Description
RubyGems fails to re-validate path containment after filesystem symlink resolution during gem extraction. When a pre-existing symlink inside the destination directory points outside the extraction root, extracted files that appear to be written under the destination directory can instead be written outside of it, breaking the extraction safety boundary. The fix resolves the real path of the parent directory before writing and raises Gem::Package::PathError if it escapes the destination directory.
Published: 2026-08-29
Score: 6.9 Medium
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

During gem extraction, RubyGems does not re‑validate that the resolved path of a symlink stays within the destination directory. An attacker can construct a gem containing a symlink that points outside the extraction root, causing files extracted through that symlink to be written to an arbitrary location on the filesystem. This enables overwriting critical files, potentially leading to privilege escalation or denial of service. The flaw lies in CWE‑59, a path traversal weakness.

Affected Systems

Systems running RubyGems before version 4.0.13 are affected, including all deployments that rely on the ruby:rubygems package. The vulnerability applies regardless of the operating system, as it is triggered during the extraction process of any gem installed to a writable location.

Risk and Exploitability

The flaw is rated a CVSS score of 6.9, indicating a medium severity risk. No EPSS score is available, so the current exploitation probability is unknown, but the vulnerability is not listed in CISA’s KEV catalog, suggesting no widespread active exploitation at the time of analysis. The attack requires the ability to install a crafted gem, which can be done remotely if a public gem source is exploitable or locally if an attacker has file‑system write access to the gem installation directory. The path traversal allows arbitrary file creation, so the impact can be extensive if executed with elevated privileges.

Generated by OpenCVE AI on August 29, 2026 at 15:21 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Update RubyGems to version 4.0.13 or later to include the path resolution safeguard
  • Install gems as a non‑privileged user and restrict write permissions on the gem installation directory
  • Verify gem authenticity by using signed packages and comparing checksums before installation

Generated by OpenCVE AI on August 29, 2026 at 15:21 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Sat, 29 Aug 2026 14:00:00 +0000

Type Values Removed Values Added
Description RubyGems fails to re-validate path containment after filesystem symlink resolution during gem extraction. When a pre-existing symlink inside the destination directory points outside the extraction root, extracted files that appear to be written under the destination directory can instead be written outside of it, breaking the extraction safety boundary. The fix resolves the real path of the parent directory before writing and raises Gem::Package::PathError if it escapes the destination directory.
Title RubyGems before 4.0.13 Path Traversal via Symlink Resolution
First Time appeared Rubygems
Rubygems rubygems
Weaknesses CWE-59
CPEs cpe:2.3:a:rubygems:rubygems:*:*:*:*:*:*:*:*
Vendors & Products Rubygems
Rubygems rubygems
References
Metrics cvssV3_1

{'score': 7.1, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H'}

cvssV4_0

{'score': 6.9, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N'}


Subscriptions

Rubygems Rubygems
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-29T13:47:56.760Z

Reserved: 2026-08-29T13:22:59.614Z

Link: CVE-2026-82455

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-29T14:16:38.623

Modified: 2026-08-29T14:16:38.623

Link: CVE-2026-82455

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-29T15:30:05Z

Weaknesses
  • CWE-59

    Improper Link Resolution Before File Access ('Link Following')