Description
An issue in gray-matter All versions (verified on 4.0.3) allows the JavaScript engine in lib/engines.js using eval() to parse front matter when language is js/javascript.This allows arbitrary code execution.
Published: 2026-09-21
Score: n/a
EPSS: n/a
KEV: No
Impact: Arbitrary code execution via eval() in front matter parsing
Action: Immediate Patch
AI Analysis

Impact

An issue in gray-matter causes the JavaScript engine in lib/engines.js to invoke eval() on front matter when the declared language is js or javascript. This flaw allows an attacker to embed malicious code into front matter that will be executed in the context of the JavaScript engine, leading to arbitrary code execution. The vulnerability can compromise confidentiality, integrity, and availability of any system that processes user-supplied gray-matter files.

Affected Systems

The npm package gray-matter (v4.0.3 and earlier) is affected. All versions verified to be vulnerable until a remediation is applied. The package is maintained by Jonas Schlinkert and is widely used in static site generators, markdown processors, and other JavaScript environments.

Risk and Exploitability

The exploit requires the attacker to supply a file or content that includes front matter marked with language js/javascript. Once parsed, the eval() call will execute the malicious code. This is a high-severity flaw because it achieves arbitrary code execution without further authentication. Although EPSS data is unavailable, the CVE is not listed in CISA KEV, but the severity of the impact suggests a high likelihood of exploitation in exposed environments. The likely attack vector is injection of malicious front matter via uploaded files or crafted content in a web application that consumes gray-matter.

Generated by OpenCVE AI on September 21, 2026 at 22:29 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Update gray-matter to a version where eval() is removed or guarded against; the latest release after 4.0.3 removes the vulnerable engine usage.
  • If an immediate update is not possible, reconfigure the application to disallow the js/javascript language for front matter, or replace the gray-matter engine with a safer parser that does not evaluate code.
  • Limit the source of front matter to trusted, internal content by sanitizing or validating input before it reaches gray-matter, and audit any use of the library to ensure it only processes trusted data.

Generated by OpenCVE AI on September 21, 2026 at 22:29 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 21 Sep 2026 22:45:00 +0000

Type Values Removed Values Added
Title gray-matter JavaScript Front Matter Evaluates User Input, Enabling Arbitrary Code Execution
Weaknesses CWE-94

Mon, 21 Sep 2026 21:45:00 +0000

Type Values Removed Values Added
Description An issue in gray-matter All versions (verified on 4.0.3) allows the JavaScript engine in lib/engines.js using eval() to parse front matter when language is js/javascript.This allows arbitrary code execution.
References

Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: mitre

Published:

Updated: 2026-09-21T21:31:50.449Z

Reserved: 2026-08-25T00:00:00.000Z

Link: CVE-2026-78847

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-09-21T22:16:58.863

Modified: 2026-09-21T22:16:58.863

Link: CVE-2026-78847

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-09-21T22:30:12Z

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')