NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
💎
💎 RubyGems
Not in CISA KEV
CRITICAL severity

CVE-2026-130001 — mustache

CRITICALFix: mustache/mustache@b015f86

CVE-2026-130001 is a critical-severity (CVSS 9.8) remote code execution vulnerability in mustache. A fix is available for mustache — see the affected versions and patch details below.

Mustache for Ruby: RCE using built-in method access

Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Nov 18, 2026 · OSV.dev, FIRST.org (EPSS)

Real-World Exposure

1 pkg affected
💎mustache

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects RubyGems packages — download data is not available via public APIs for these ecosystems.

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:

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

Footnotes

  1. https://portswigger.net/knowledgebase/papers/serversidetemplateinjection.pdf ↩

  2. https://hackerone.com/reports/423541 ↩

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
💎RubyGemsmustacheall versions1.1.3bundle update mustache --conservative

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for mustache, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update mustache to 1.1.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-130001 is resolved across your whole dependency graph.

  3. Workarounds

    Put an independent control in front of the weakness: restrict the affected endpoint or interface to trusted networks, require an additional authentication factor or proxy-level check, and invalidate existing sessions and credentials in case the flaw has already been used.

Frequently Asked Questions

> [!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
O3 Security · Impact-Aware SCA

Is CVE-2026-130001 in your dependencies?

Find it across RubyGems, including transitive dependencies.

CVE-2026-130001: mustache RCE — Fixed in 1.1.3