CVE-2026-130001: Mustache for Ruby Remote Code Execution Vulnerability

CRITICAL
Advisory Identifier: GHSA-5hrj-7fc3-cmx9
CVSS 9.8
CWE-913
Published
Advisory Summary

CVE-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.

CVE-2026-130001 at a Glance

CVE Identifier CVE-2026-130001
GHSA Identifier GHSA-5hrj-7fc3-cmx9
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-913: Improper Control of Dynamically-Managed Code Resources
Affected Product Mustache for Ruby
Package Ecosystem RubyGems
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (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.

mustache fixed: 1.1.3
Upgrade mustache to 1.1.3
Verify Direct and Transitive Dependencies

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

> [!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

CVE-2026-130001 Affected Mustache for Ruby Versions

1 component(s)
Fixed Versions:
1.1.3
Product / Package Ecosystem Affected Versions Fixed Version
mustache
RubyGems
< 1.1.3
1.1.3

References

Frequently Asked Questions

What is CVE-2026-130001?
CVE-2026-130001 is a security vulnerability in Mustache for Ruby involving RCE using built-in method access under CWE-913: Improper Control of Dynamically-Managed Code Resources.
Which Mustache for Ruby versions are affected?
Affected versions include releases prior to 1.1.3 across affected packages: mustache.
What version fixes CVE-2026-130001?
Upgrading to 1.1.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mustache affected?
Yes, mustache is affected in releases prior to 1.1.3. Upgrade your dependency to 1.1.3 or later.
What is the CVSS score of CVE-2026-130001?
CVE-2026-130001 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-130001?
CVE-2026-130001 is classified under CWE-913: Improper Control of Dynamically-Managed Code Resources (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.).
How can I check RubyGems dependencies for CVE-2026-130001?
Run the dependency tree command: 'inspect dependencies for mustache'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}