Vulnerabilities in pkg:gem/mustache
PACKAGECVE-2026-130001 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-913: Improper Control of Dynamically-Managed Code Resources) affecting Mustache for Ruby libraries in the RubyGems ecosystem. The issue involves rce using built-in method access. Remediation is available by upgrading affected packages to version 1.1.3.
pkg:gem/mustache
Vulnerability advisories affecting package pkg:gem/mustache. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-5hrj-7fc3-cmx9 | CVE-2026-130001 | CRITICAL | Mustache for Ruby: RCE using built-in method access |
CVE-2026-130001 at a Glance
Security Impact
CVSS: 9.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2026-130001
To remediate this vulnerability, upgrade all affected Mustache for Ruby dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade mustache to 1.1.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for mustache
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-130001, inspect your project dependencies for Mustache for Ruby:
inspect dependencies for mustache
Analyze the terminal output to locate any version of Mustache for Ruby in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.3), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-913: Improper Control of Dynamically-Managed Code Resources, where the product does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements. In Mustache for Ruby, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-130001 Affected Mustache for Ruby Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
mustache
|
RubyGems |
< 1.1.3
|
1.1.3
|
References
Frequently Asked Questions
What is CVE-2026-130001?
Which Mustache for Ruby versions are affected?
What version fixes CVE-2026-130001?
Is mustache affected?
What is the CVSS score of CVE-2026-130001?
What CWE is associated with CVE-2026-130001?
How can I check RubyGems dependencies for CVE-2026-130001?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5hrj-7fc3-cmx9",
"modified" : "2026-11-18T16:28:29Z",
"published" : "2026-11-18T16:28:29Z",
"aliases" : [ "CVE-2026-130001" ],
"summary" : "Mustache for Ruby: RCE using built-in method access",
"details" : "> [!NOTE]\n> The vulnerability was fully disclosed to the maintainer in private prior to security advisories were enabled for the project.\n> 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.\n\n## Summary\nMustache 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.\n\n## Details\nMustache is often suggested as a safe simple template language to avoid SSTI vulnerabilities.[^1] [^2]\n\nMustache 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.\n\n> [!IMPORTANT]\n> Successful exploitation of this vulnerability does not depend on any configuration or objects passed to the template engine.\n> An attacker controlling the template string can achieve arbitrary code execution without any additional requirements.\n\nAdditional methods provided by the application or installed gems can further expand the attack surface but exploitation was proven without them.\n\n## PoC\nAll discovered payloads were tested using `ruby -e` shell commands with `mustache` as the only explicitly required gem:\n\n```bash\nruby -e 'require \"mustache\"; puts Mustache.render(\"PAYLOAD GOES HERE\", key: \"value\")'\n```\n\nFor initial information release, only the descriptions of the most important discovered payloads would be provided:\n- Universal RCE for a major Ruby version\n- File upload to RCE (3 different payloads)\n- Infinite memory consumption DoS\n- Infinite sleep DoS\n\nUniversal 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.\n\n> [!CAUTION]\n> Exploitation is not limited to the discovered Exploits/PoCs and real-life web applications are likely to expose even more dangerous functionality.\n\n## Impact\nAn attacker with the ability to modify the template string can execute arbitrary code in the context of the Ruby application.\n\n## Rationale for CVSS assessment:\n\n- Attack Vector: Network\n> No network requirements are present for exploitation.\n> Templating functionality is often provided on public websites.\n- Attack Complexity: Low\n> Attacker can expect reliable and repeatable exploitation.\n> There are no requirements beyond attacker's control.\n- Privileges Required: None\n> Mustache is often used for untrusted user-supplied templates.\n> Exploitation is often possible without authorization or by using self-registered accounts (without prior privileges).\n> Mustache by itself does not provide access control functionality.\n- User Interaction: None\n> Exploitation does not require any user interaction to achieve RCE.\n- Scope: Unchanged\n> The code is executed with the same privileges as the web application, without changing the scope.\n- Confidentiality Impact: High\n> Arbitrary code execution leads to the total loss of confidentiality.\n- Integrity Impact: High\n> Arbitrary code execution leads to the total loss of integrity.\n- Availability Impact: High\n> Arbitrary code execution can be used to achieve the total loss of availability.\n\n## Resources\n[^1]: https://portswigger.net/knowledgebase/papers/serversidetemplateinjection.pdf\n[^2]: https://hackerone.com/reports/423541",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "mustache"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.1.3"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.1.2"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/mustache/mustache/security/advisories/GHSA-5hrj-7fc3-cmx9"
}, {
"type" : "WEB",
"url" : "https://github.com/mustache/mustache/commit/b015f866942a6eb45ce4d34009f2ba6ff16ce4c1"
}, {
"type" : "WEB",
"url" : "https://hackerone.com/reports/423541"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mustache/mustache"
}, {
"type" : "WEB",
"url" : "https://portswigger.net/knowledgebase/papers/serversidetemplateinjection.pdf"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-913" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-11-18T16:28:29Z",
"nvd_published_at" : null
}
}