Skip to content
DayZeroHub
Critical CVSS 9.8GHSA-5hrj-7fc3-cmx9CVE-2026-130001

Mustache for Ruby: remote code execution via built-in method access

mustache

Summary

Versions 1.1.2 and earlier of the mustache Ruby gem allow a remote attacker who controls the template being rendered to execute arbitrary code. The CVSS 3.1 score given is 9.8 (critical).

What happened

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 through an attacker-supplied template. According to the source, exploitation does not depend on any configuration or objects passed to the template engine; controlling the template string is enough. The source adds that methods provided by the application or installed gems can expand the attack surface, and that denial-of-service impacts (memory consumption and indefinite sleep) are also described besides code execution. The original advisory states that it is published with limited information to give a time window for installing updates. It is associated with CWE-913 and the identifiers CVE-2026-130001 and GHSA-5hrj-7fc3-cmx9.

Why it matters

An attacker able to modify the template can execute arbitrary code with the privileges of the Ruby application. The source notes that Mustache is often used with untrusted, user-supplied templates. The CVSS 3.1 score is 9.8, with vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, and severity is critical. The source does not indicate known active exploitation; it is not listed in CISA's KEV catalog.

Affected products and versions

mustache gem (rubygems ecosystem), versions <= 1.1.2. The fixed version indicated is 1.1.3.

ProductVersionsFixed in
mustache<= 1.1.21.1.3

Action recommended by the source

The vendor indicates that the fixed version is 1.1.3, so it recommends updating to that version or later. The source does not mention other mitigations.

Fixed in: 1.1.3

Information taken from the source or the vendor. Verify it at the original link before acting.

Sources and references

Weaknesses (CWE): CWE-913

Relevant change history

  1. Published

    Advisory published.

Summary written with AI assistance from the source data. See the sources and references for complete information. View sources