GHSA-5HRJ-7FC3-CMX9
Vulnerability from github – Published: 2026-11-18 16:28 – Updated: 2026-11-18 16:28[!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
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
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 1.1.2"
},
"package": {
"ecosystem": "RubyGems",
"name": "mustache"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.1.3"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-130001"
],
"database_specific": {
"cwe_ids": [
"CWE-913"
],
"github_reviewed": true,
"github_reviewed_at": "2026-11-18T16:28:29Z",
"nvd_published_at": null,
"severity": "CRITICAL"
},
"details": "\u003e [!NOTE]\n\u003e The vulnerability was fully disclosed to the maintainer in private prior to security advisories were enabled for the project.\n\u003e 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\u003e [!IMPORTANT]\n\u003e Successful exploitation of this vulnerability does not depend on any configuration or objects passed to the template engine.\n\u003e 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 \u0027require \"mustache\"; puts Mustache.render(\"PAYLOAD GOES HERE\", key: \"value\")\u0027\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\u003e [!CAUTION]\n\u003e 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\u003e No network requirements are present for exploitation.\n\u003e Templating functionality is often provided on public websites.\n- Attack Complexity: Low\n\u003e Attacker can expect reliable and repeatable exploitation.\n\u003e There are no requirements beyond attacker\u0027s control.\n- Privileges Required: None\n\u003e Mustache is often used for untrusted user-supplied templates.\n\u003e Exploitation is often possible without authorization or by using self-registered accounts (without prior privileges).\n\u003e Mustache by itself does not provide access control functionality.\n- User Interaction: None\n\u003e Exploitation does not require any user interaction to achieve RCE.\n- Scope: Unchanged\n\u003e The code is executed with the same privileges as the web application, without changing the scope.\n- Confidentiality Impact: High\n\u003e Arbitrary code execution leads to the total loss of confidentiality.\n- Integrity Impact: High\n\u003e Arbitrary code execution leads to the total loss of integrity.\n- Availability Impact: High\n\u003e 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",
"id": "GHSA-5hrj-7fc3-cmx9",
"modified": "2026-11-18T16:28:29Z",
"published": "2026-11-18T16:28:29Z",
"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"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Mustache for Ruby: RCE using built-in method access"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.