Mustache for Ruby CVE-2026-130001
CRITICALAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit attacker-controlled Mustache template
-
ExploitChain built-in Ruby methods to escape sandbox
-
ExecutionExecute arbitrary code as the application
-
ImpactFull compromise of app context
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V15 - Secure Coding and Architecture Dynamic code resource control
|
| Exploitation Conditions | The specific, mandatory prerequisite is that the attacker must be able to control (supply or modify) the Mustache template string that the application renders; the advisory states exploitation does NOT depend on any configuration or objects passed to the engine once the template is attacker-controlled. The vulnerable mechanism is unrestricted access to built-in methods, which can be chained to achieve arbitrary code execution. The key LIMITING factor is template reachability: applications that render only static, developer-authored templates do not expose this to remote attackers, so real risk is concentrated in deployments that treat Mustache as a safe sandbox for untrusted/user-supplied templates. Affects Mustache for Ruby <= 1.1.2 on any Ruby version (a universal RCE payload for at least one major Ruby version is confirmed). The only complete fix per the vendor is updating to 1.1.3. |
| Impact | The signals are mostly aligned toward high urgency but with one important real-world caveat. The provided CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H = 9.8 Critical) describes reliable, repeatable, unauthenticated, no-interaction remote code execution, and the vuln.today Decision label is 'act_now', so this should be treated as a patch-now item. However, the CVSS 'worst case' assumes the attacker controls the Mustache template string itself - the advisory confirms exploitation requires template control and is otherwise independent of any configuration or objects passed in. Applications that only render developer-authored/static templates are not remotely reachable by an outside attacker, so true exposure depends on whether the deployment accepts user-supplied or otherwise attacker-influenced templates. No EPSS score is provided in the input, so exploitation-probability modeling is unavailable and cannot be compared. The CVE is NOT listed in CISA KEV and there is no confirmation of active exploitation. The GitHub advisory describes several working payload categories (universal RCE, file-upload-to-RCE, DoS) but explicitly withholds the actual PoCs to provide an update window, so no verified public working exploit code was identified at analysis time. Net: a genuinely critical, high-priority flaw for any Ruby app that renders untrusted Mustache templates, but the headline 9.8 overstates risk for the common case of trusted/static templates. |
| Exploit ScenarioDerived | A Ruby web application lets users supply or customize Mustache templates (for example email/report templates, themeable pages, or a low-code feature) under the assumption that Mustache is a safe sandbox. An attacker submits a crafted template that chains built-in Ruby methods to break out and execute arbitrary code in the application's context. The advisory describes working payloads (including universal RCE and file-upload-to-RCE) but withholds them during the patch window, so no verified public working exploit code is available yet. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 18, 2026
Arbitrary code execution in Mustache for Ruby 1.1.2 and earlier allows unauthenticated remote attackers to run code in the host Ruby application whenever they can supply or modify the template string being rendered, because the engine fails to restrict chaining of built-in methods and thus does not provide the safe sandbox many teams assume. The vendor scores it CVSS 9.8 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H), vuln.today priority is act_now, and a vendor-released patch exists in version 1.1.3; the practical limiting factor is template reachability, since applications that only render static, developer-authored templates do not expose this to remote users. The advisory states that working payloads were validated during research (universal RCE on at least one major Ruby version, three file-upload-to-RCE payloads, and memory-exhaustion and infinite-sleep denial-of-service variants) but withholds the actual PoC code at initial release; no confirmed active exploitation (CISA KEV) or published working exploit code was identified at time of analysis.
RemediationAI
Vendor-released patch: upgrade the mustache gem to version 1.1.3 or later, which the advisory and the HISTORY entry (2026-08-20) identify as the release addressing this RCE, and the vendor states that updating is the only complete fix. Pin the corrected version in the Gemfile/Gemfile.lock and redeploy every service that resolves the gem transitively, then confirm the loaded version at runtime with Mustache::VERSION since bundled dependencies can silently retain 1.1.2. Details and the fixing commit are at https://github.com/mustache/mustache/security/advisories/GHSA-5hrj-7fc3-cmx9 and https://github.com/mustache/mustache/commit/b015f866942a6eb45ce4d34009f2ba6ff16ce4c1. Where upgrading cannot be completed immediately, the effective compensating control is to stop passing attacker-influenced strings as templates: render only static, developer-authored templates and move all user input into context values, since the vulnerability requires attacker control of the template itself; the trade-off is loss of any feature that intentionally lets users author templates, and this is a containment measure rather than a complete fix because the underlying method-access restriction remains absent in 1.1.2 and earlier.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in rubygems
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The affected component is the mustache gem for Ruby (CPE pkg:rubygems/mustache), a logic-less template engine commonly recommended as a safer alternative to full-featured templating systems that are prone to server-side template injection. The root cause falls under CWE-913, Improper Control of Dynamically-Managed Code Resources: Mustache resolves template names against the rendering context and invokes corresponding methods without adequately restricting which built-in Ruby methods may be reached, so an attacker-controlled template can chain multiple built-in methods and escape the intended data-only rendering model. Per the advisory, successful exploitation does not depend on any configuration or on objects passed to the engine - an attacker who controls the template string alone can achieve arbitrary code execution in the Ruby process, and methods supplied by the host application or other installed gems only widen that surface (the vendor proved exploitation without them). The mechanism is confirmed to yield universal RCE on at least one major Ruby version, three file-upload-to-RCE chains, and denial-of-service paths; the exact payload syntax and the underlying method chains are withheld from the initial advisory and are not described in the available sources, so the specific trigger sequences are not detailed here.
Know when Ruby gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
When templates are attacker-controlled (Mustache's advertised untrusted-template use case) exploitation is remote, reliable, and needs no auth or interaction, yielding full C/I/A loss via RCE.
Primary rating from GitHub Advisory.
CVSS VectorGitHub Advisory
DescriptionGitHub Advisory
> [!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
[^1]: https://portswigger.net/knowledgebase/papers/serversidetemplateinjection.pdf [^2]: https://hackerone.com/reports/423541
Technical POC Analysis
Bug class: CWE-913 in the prompt metadata, while the GHSA Weaknesses field says CWE-470 (Use of Externally-Controlled Input to Select Classes or Code).
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
CVE-2026-130001 is a critical remote code execution vulnerability in the Mustache templating engine for Ruby (versions 1.1.2 and earlier) that allows unauthenticated attackers to execute arbitrary code on the host application if they can influence the template content. This affects any Ruby application that renders user-modifiable templates, potentially leading to full system compromise, data breaches, and service disruption. Leadership should prioritize remediation because the vulnerability is trivially exploitable (CVSS 9.8) and a patch is already available.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Malicious file upload attacks exploit insufficient validation when web applications accept user-provided files.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Affected Products (CPE)GitHub Advisory
Ruby before 2.4.3 allows Net::FTP command injection. Rated high severity (CVSS 8.8), this vulnerability is remotely expl
The lazy_initialize function in lib/resolv.rb in Ruby through 2.4.3 uses Kernel#open, which might allow Command Injectio
Ruby through 2.2.7, 2.3.x through 2.3.4, and 2.4.x through 2.4.1 can expose arbitrary memory during a JSON.generate call
Type confusion exists in two methods of Ruby's WIN32OLE class, ole_invoke and ole_query_interface. Rated critical severi
Authenticated remote code execution in OpenC3 COSMOS (Ruby gem 'openc3' versions 5.1.0 through 7.2.1) lets any logged-in
Ruby code execution in Elo (npm @enspirit/elo) through 1.0.0 lets an attacker who controls Elo source gain arbitrary Rub
Type confusion exists in _cancel_eval Ruby's TclTkIp class method. Rated critical severity (CVSS 9.8), this vulnerabilit
An exploitable heap overflow vulnerability exists in the Fiddle::Function.new "initialize" function functionality of Rub
An issue was discovered in Oniguruma 6.2.0, as used in Oniguruma-mod in Ruby through 2.4.1 and mbstring in PHP through 7
Stored XSS in Bugsink error tracking tool before 2.0.13 allows unauthenticated attackers to inject persistent scripts th
Ruby before 2.4.2, 2.3.5, and 2.2.8 is vulnerable to a malicious format string which contains a precious specifier (*) w
Heap-based buffer overflow in Ruby 1.8, 1.9 before 1.9.3-p484, 2.0 before 2.0.0-p353, 2.1 before 2.1.0 preview2, and tru
GHSA-5hrj-7fc3-cmx9
NVD
CVE.org
Exploit-DB