CVE-2026-130001mustache Improper Control of Dynamically-Managed Code Resources
NVD
Vulnerability Summary
> [!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
> 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
CVSS v3.1 Base Metrics — Score 9.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HAttack VectorNetwork
Attack ComplexityLow
Privileges RequiredNone
User InteractionNone
ScopeUnchanged
ConfidentialityHigh
IntegrityHigh
AvailabilityHigh
Affected & Patched Versions
- mustache <= 1.1.2
No patched version published yet
Until a fix ships, reduce exposure:
- Restrict access to the affected service or interface to trusted networks.
- Disable the affected feature if you do not need it.
- Watch the vendor advisory for a firmware or software update.
What to do
Plan remediation soon. No exploitation is confirmed yet, but the severity is critical.
- Check whether you run mustache and which version.
- No patched version is listed yet. Limit access to the affected service to trusted networks, and disable the feature if you can.
- Subscribe to the vendor advisory so you learn when a fix ships.
Timeline
- Nov 18, 2026Published
- Nov 18, 2026Record last modified
Score, severity and exploitation changes are tracked from the day Watchtower started logging them.
Get notified about new mustache CVEsYou are reading CVE-2026-130001. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alertsExternal References
- Vendor Advisoryhttps://github.com/mustache/mustache/security/advisories/GHSA-5hrj-7fc3-cmx9
- Patchhttps://github.com/mustache/mustache/commit/b015f866942a6eb45ce4d34009f2ba6ff16ce4c1
- Referencehttps://hackerone.com/reports/423541
- Referencehttps://portswigger.net/knowledgebase/papers/serversidetemplateinjection.pdf
- Referencehttps://github.com/advisories/GHSA-5hrj-7fc3-cmx9
Data last checked: Nov 24, 2026 20:01 UTC