Skip to content
FlawDB
Sign in

CVE-2026-130001

CRITICAL 9.8

Mustache for Ruby: RCE using built-in method access

Also known as GHSA-5hrj-7fc3-cmx9

Mitigation

  • Upgrade mustache to 1.1.3 or later.

Who should check

  • Projects that depend on RubyGems package mustache (<= 1.1.2)

Vulnerability facts

Affected
mustache <= 1.1.2
Fixed in
1.1.3
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Remote, no login needed
CVSS
9.8 (v3.1, GitHub)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Network
  • Attack complexity: Low
  • Privileges required: None
  • User interaction: None
  • Scope: Unchanged
  • Confidentiality impact: High
  • Integrity impact: High
  • Availability impact: High
CWE
CWE-913
Published
Modified

Description

> [!NOTE] > The vulnerability was fully disclosed to the maintainer in private prior to security advisories were enabled for the project. > This advisory presents a limited information for initial release to provide a time window for installing updates. Full information with PoCs would be added later. ## Summary Mustache template engine for Ruby in versions 1.1.2 and earlier allows remote attackers to achieve arbitrary code execution through accessing specific built-in methods in an attacker-supplied template. ## Details Mustache is often suggested as a safe simple template language to avoid SSTI vulnerabilities.[^1] [^2] Mustache for Ruby up to version 1.1.2 did not properly restrict method access which allowed chaining multiple built-in methods to achieve arbitrary code execution. > [!IMPORTANT] > Successful exploitation of this vulnerability does not depend on any configuration or objects passed to the template engine. > An attacker controlling the template string can achieve arbitrary code execution without any additional requirements. Additional methods provided by the application or installed gems can further expand the attack surface but exploitation was proven without them. ## PoC All discovered payloads were tested using `ruby -e` shell commands with `mustache` as the only explicitly required gem: ```bash ruby -e 'require "mustache"; puts Mustache.render("PAYLOAD GOES HERE", key: "value")' ``` For initial information release, only the descriptions of the most important discovered payloads would be provided: - Universal RCE for a major Ruby version - File upload to RCE (3 different payloads) - Infinite memory consumption DoS - Infinite sleep DoS Universal RCE payloads for other major Ruby versions and other payloads could exist, as the attack surface is very large. The presented list only contains payloads discovered using a fairly primitive approach. > [!CAUTION] > Exploitation is not limited to the discovered Exploits/PoCs and real-life web applications are likely to expose even more dangerous functionality. ## Impact An attacker with the ability to modify the template string can execute arbitrary code in the context of the Ruby application. ## Rationale for CVSS assessment: - Attack Vector: Network > No network requirements are present for exploitation. > Templating functionality is often provided on public websites. - Attack Complexity: Low > Attacker can expect reliable and repeatable exploitation. > There are no requirements beyond attacker's control. - Privileges Required: None > Mustache is often used for untrusted user-supplied templates. > Exploitation is often possible without authorization or by using self-registered accounts (without prior privileges). > Mustache by itself does not provide access control functionality. - User Interaction: None > Exploitation does not require any user interaction to achieve RCE. - Scope: Unchanged > The code is executed with the same privileges as the web application, without changing the scope. - Confidentiality Impact: High > Arbitrary code execution leads to the total loss of confidentiality. - Integrity Impact: High > Arbitrary code execution leads to the total loss of integrity. - Availability Impact: High > Arbitrary code execution can be used to achieve the total loss of availability. ## Resources [^1]: https://portswigger.net/knowledgebase/papers/serversidetemplateinjection.pdf [^2]: https://hackerone.com/reports/423541

Affected and fixed versions

Package / productAffectedFixedSource
RubyGems mustache<= 1.1.21.1.3ghsa

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2026-130001. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-130001.md
Affected: mustache <= 1.1.2
Fixed in: 1.1.3

Steps:
1. Search this machine and project for mustache (RubyGems): dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

Technologies

References

FAQ

Is CVE-2026-130001 being exploited?

There is no confirmed exploitation: CVE-2026-130001 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

How serious is CVE-2026-130001?

Critical: CVSS 9.8 (v3.1, scored by GitHub). Remote, no login needed.

Which versions are affected by CVE-2026-130001?

mustache <= 1.1.2.

Is there a fix for CVE-2026-130001?

Yes. Fixed in 1.1.3. Upgrade mustache to 1.1.3 or later.

How do I check if I'm affected by CVE-2026-130001?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors