CVE-2026-118389 in RubyGemsinfo

Summary

by MITRE • 11/15/2026

The RubyGems package registry accepted gems whose platform, dependency names or dependency version requirements contain newline characters. Because the compact index served to clients is line-based, a user who can publish a gem to an owner's registry could forge index entries, such as packages that do not exist or additional versions of an existing gem with dependencies of their choice. Clients that resolve gems from that registry could then be led to install attacker-chosen dependencies. Gems with such metadata are now rejected.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 11/15/2026

The vulnerability identified in RubyGems involves a critical input validation failure within the package registry's handling of gem metadata, specifically concerning platform identifiers, dependency names, and version requirements. The core technical flaw stems from the acceptance of newline characters embedded within these fields during the gem publishing process. This oversight is particularly dangerous because the compact index format used by RubyGems clients to resolve dependencies relies on a strict line-based structure where each entry corresponds to a specific package or version. By injecting newline characters into metadata, an attacker can effectively break this structural assumption, allowing them to manipulate how the registry data is parsed and interpreted by downstream consumers.

From an operational perspective, this flaw enables index forgery attacks that compromise the integrity of the dependency resolution process. An authenticated user with publishing rights on a specific gem's owner account could craft malicious metadata containing newline characters. When such a gem is published, it alters the layout of the compact index file served to clients. This manipulation allows the attacker to forge entries for packages that do not actually exist or to introduce additional versions of existing gems with arbitrary dependencies. Consequently, when developers or automated build systems resolve and install these gems, they may inadvertently pull in malicious code disguised as legitimate dependencies, leading to potential supply chain compromises.

This vulnerability aligns closely with CWE-74 Improper Neutralization of Special Elements used in an Output Document Called a Process, specifically regarding the injection of special elements that alter document structure. In terms of offensive security frameworks, it maps to MITRE ATT&CK technique T1195 Supply Chain Compromise, where attackers exploit trusted software distribution channels to inject malicious components. The attack vector leverages the trust relationship between developers and package registries, exploiting the automated nature of dependency resolution tools that assume metadata integrity without sufficient validation against structural anomalies like control characters.

To mitigate this risk, RubyGems has implemented stricter input sanitization rules that reject gems containing newline characters in platform strings, dependency names, or version requirements. This fix ensures that the compact index remains structurally sound and resistant to manipulation via embedded control characters. Organizations relying on RubyGems should ensure their gem clients are updated to versions that enforce these validation checks. Additionally, developers should adopt defense-in-depth strategies by verifying the integrity of installed dependencies through checksums or digital signatures where possible, reducing reliance solely on registry metadata for security assurance.

Responsible

Gitea

Reservation

11/15/2026

Disclosure

11/15/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!