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: 9.8 Critical
EPSS: < 1% Very Low
KEV: No
Impact: Arbitrary code execution via eval() in front matter parsing
Action: Immediate Patch
AI Analysis

Impact

The vulnerability originates in the gray‑matter library, where the JavaScript engine in lib/engines.js calls eval() on front matter marked with the language js or javascript. An attacker can embed arbitrary JavaScript code into the front matter block, and when the file is parsed that code is executed with the same privileges as the application. This flaw permits full compromise of confidentiality, integrity and availability by allowing arbitrary code execution.

Affected Systems

The gray‑matter npm package, maintained by Jonas Schlinkert, is widely used in static site generators and markdown processors. All released versions of the package, including 4.0.3, are affected. Any system that imports or processes content with gray‑matter without prior validation is at risk.

Risk and Exploitability

The CVSS score of 9.8 marks this vulnerability as critical. The EPSS score of <1% indicates a low but non‑zero probability of exploitation. The vulnerability does not require authentication; the attacker can simply provide a crafted file. It is inferred that uploading or ingesting a file containing malicious front matter would trigger the flaw. The vulnerability is not listed in the CISA KEV catalog.

Generated by OpenCVE AI on September 22, 2026 at 20:26 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade gray‑matter to the latest version that removes the vulnerable eval() call.
  • If upgrading is not immediately feasible, configure the application to reject or ignore front matter blocks whose language is js or javascript, or replace the parser with a safer alternative.
  • Sanitize or validate all input content before it reaches gray‑matter, ensuring only trusted data is processed.

Generated by OpenCVE AI on September 22, 2026 at 20:26 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 23 Sep 2026 15:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Tue, 22 Sep 2026 20:45:00 +0000

Type Values Removed Values Added
Title Arbitrary code execution via eval() in front matter parsing

Tue, 22 Sep 2026 19:45:00 +0000

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

Tue, 22 Sep 2026 16:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-95
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}


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-22T15:12:53.387Z

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

Link: CVE-2026-78847

cve-icon Vulnrichment

Updated: 2026-09-22T15:09:43.862Z

cve-icon NVD

Status : Deferred

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

Modified: 2026-09-22T20:00:03.713

Link: CVE-2026-78847

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-09-22T20:30:08Z

Weaknesses
  • CWE-95

    Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')