Skip to main content

gray-matter CVE-2026-78847

| EUVDEUVD-2026-84241 CRITICAL
Eval Injection (CWE-95)
2026-09-21 mitre GHSA-j9gx-vjm3-jpmm
9.8
CVSS 3.1 · Vendor: mitre
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit markdown with JS front-matter fence
  2. Delivery
    App parses via gray-matter
  3. Exploit
    JS engine calls eval() on payload
  4. Execution
    Arbitrary code executes in Node.js process
  5. Impact
    Full host/application compromise

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Eval input sanitization
MITRE ATT&CK

1 technique across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the application parses attacker-controlled input with gray-matter AND that the JavaScript/js engine is reachable - which it is by default, because gray-matter ships a js/javascript engine (lib/engines.js) using eval() and honors an inline language declaration in the front-matter fence (e.g. '---js' or '---javascript'). The concrete prerequisite is therefore: untrusted markdown/front-matter content flows into gray-matter's parse call. Limiting factors: the attacker must be able to supply the document content; applications that only parse trusted/first-party content, or that override the engines option to remove the JavaScript engine, are not exploitable. No authentication or user interaction is required by the library itself (per PR:N/UI:N), but the effective attack surface is gated by whether the host application exposes gray-matter parsing to untrusted input.

Impact

This is a genuine high-severity code-execution flaw whose real-world priority hinges entirely on integration context. The vendor CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N, C:H/I:H/A:H = 9.8) is defensible ONLY for applications that pass attacker-controlled documents to gray-matter, because the library's default engine set includes a JavaScript engine (lib/engines.js) that calls eval(), and gray-matter lets the document itself declare its front-matter language inline (e.g. a '---js'/'---javascript' fence). An attacker who controls the parsed content therefore needs no configuration change and no authentication, matching PR:N/UI:N. However, the signals conflict on urgency: EPSS is very low (0.17%, 7th percentile), there is no CISA KEV listing, and no formal POC=YES flag is present - so despite the 9.8 score this is NOT evidence of widespread active exploitation. Note the CWE-95 (eval injection) is well-documented in the referenced GitHub issues (#182, #131, #112) and a security blog, meaning the technique is public and trivially reproducible even if no packaged exploit is tracked. The dominant caveat: 'All versions' with no fix and a CPE of 'n/a:n/a' means affected-product metadata is effectively absent - the flaw is a long-standing by-design behavior of the library, so risk is a function of how each downstream app uses it rather than a discrete patchable version boundary. Bottom line: treat as high priority ONLY where untrusted markdown/front-matter is parsed; otherwise it is a latent high-CVSS issue with low observed exploitation.

Exploit ScenarioDerived

An application (e.g. a CMS, static-site builder, or markdown-processing API) uses gray-matter to parse user-submitted markdown. The attacker submits a document whose front-matter fence declares the JavaScript language (e.g. '---js') with a payload; gray-matter routes it to the eval()-based engine and runs the attacker's code in the Node.js process. The technique is publicly documented in the referenced GitHub issues and blog, but no packaged/weaponized exploit is tracked in the provided data.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
No patch listed yet 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Sep 22, 2026

Arbitrary code execution in the npm front-matter parser gray-matter is reachable through its built-in JavaScript engine, which evaluates front matter with eval() whenever the document declares a js/javascript language fence. Any application that passes attacker-influenced markdown or front-matter text into gray-matter's parse call can be induced to run attacker-supplied JavaScript in the Node.js process - the CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, 9.8) rates this as unauthenticated remote code execution, with the practical caveat from our assessment that the attack surface is gated by whether the host application exposes gray-matter parsing to untrusted content. Affected coverage is broad rather than version-specific: the reporter states all versions are impacted and verified 4.0.3, while there is no CISA KEV entry, no confirmed public exploit code, and a low EPSS of 0.17% (7th percentile) indicating limited observed exploitation pressure at time of analysis.

RemediationAI

No vendor-released patch identified at time of analysis: the available references are upstream GitHub issue threads (issues 182, 131 and 112) rather than a tagged release, GitHub PR or commit, and no fixed version number is published, so no upgrade target can be cited. The most effective compensating control is to never let untrusted documents reach the JavaScript engine: pass an explicit engines option to every gray-matter parse call (for example matter(input, { engines: { yaml: <yaml parser>, json: <json parser> } })) so the js/javascript and coffee engines are removed from the lookup table, accepting the trade-off that any legitimate document using a '---js' or '---javascript' fence will fail to parse or fall back to raw text. Where the full engine set must stay available, pre-validate and reject untrusted input whose opening front-matter fence carries a language declaration other than yaml or json - this requires careful, well-tested delimiter matching, and a missed or malformed case re-opens the eval() path. Applications that cannot avoid processing untrusted markdown should treat gray-matter as a code-execution sink: isolate parsing in a sandboxed worker or child process with a restricted filesystem, network and environment, which reduces post-exploitation reach but adds latency and operational complexity and is not a substitute for a real fix. Reducing the blast radius also means running the parsing service as a low-privilege account with no access to secrets, and monitoring the upstream issue threads at https://github.com/jonschlinkert/gray-matter/issues/182 and https://github.com/jonschlinkert/gray-matter/issues/131 plus the analysis at https://blog.checo.cc/en/posts/Security/1 for the eventual fixed release before upgrading.

Affected VersionsENISA

n/a n/a

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

gray-matter is a widely used Node.js library for extracting YAML, JSON or JavaScript front matter from markdown-style documents, and it ships a pluggable language-engine layer in lib/engines.js. The library selects an engine from a language token in the front-matter fence (for example '---js' or '---javascript') or from a caller-supplied language option; for the js/javascript engine, that engine implements parsing by calling JavaScript's eval() on the raw front-matter block. Because eval() receives the document's own content as source code, an attacker who controls the document content controls the executed program, which is the classic Eval Injection pattern classified as CWE-95 (Improper Neutralization of Directives in Dynamically Evaluated Code). The flaw is architectural rather than a memory-safety or parsing-boundary bug, so it is not version-pinned in the ordinary sense - the vulnerable engine exists across releases, matching the reporter's 'all versions' claim and the version 4.0.3 verification; the single CPE string supplied is a placeholder (cpe:2.3:a:n/a:n/a:*:*:*:*:*:*:*:*) and EUVD likewise records the affected version range as unresolved, so no machine-readable version boundary can be cross-referenced. Executed code inherits the full privileges of the Node.js process that invoked the parser, which is what drives the C:H/I:H/A:H impact rating.

Know when JavaScript gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (mitre) PRIMARY 9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 9.8 CRITICAL

Default js engine + inline language selection lets attacker-controlled content trigger eval() with no auth/interaction, yielding full RCE (C/I/A:H); AV:N assumes remotely supplied content.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
SUSE CRITICAL
Red Hat 9.8 HIGH

Primary rating from Vendor (mitre).

CVSS VectorVendor: mitre

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

3
CVSS changed
Sep 22, 2026 - 16:22 NVD
9.8 (CRITICAL)
CVE Published
Sep 21, 2026 - 00:00 cve.org
CRITICAL 9.8
CVE Published
Sep 21, 2026 - 00:00 cve.org
UNKNOWN (no severity yet)

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

A critical vulnerability in the widely used npm package gray-matter allows unauthenticated remote code execution in any Node.js service that parses markdown or front matter containing attacker-supplied content, meaning a single crafted document could let an outsider run arbitrary code inside our application servers. Because gray-matter is a common transitive dependency pulled in by documentation, static-site, CMS, and content-processing tooling, the affected footprint likely extends well beyond services where engineers believe they use it directly, and no vendor patch is currently available. Leadership should care because exploitation requires no credentials, yields full control of the host process and its data, and our only defense in the near term is disciplined containment rather than a fix.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: remove or block gray-matter parsing of untrusted content; strip or reject js/javascript language fences before parsing; substitute a non-eval front-matter parser; enforce strict input validation and allow-listing on ingested markdown; run Node.js processes with least privilege and restricted filesystem/network access; and add detection and logging for anomalous front-matter payloads.

Threat Intelligence Overview

EPSS Score
0.2%
Top 93% exploitable
Prevalence
High
gray-matter is a very widely used npm library and dependency of major JS site generators
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.2%
Patch available No
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Total

Priority Score

49
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +49
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

CVE-2026-102827 CRITICAL POC
9.8 Sep 29

Command injection in simple-git, the Node.js library for running git commands and published on npm, affects all releases

CVE-2026-77615 HIGH POC
8.7 Sep 17

Stored DOM-based cross-site scripting in Paella Player's closed-caption rendering path (paella-core before 2.12.11) allo

CVE-2026-92776 HIGH POC
8.6 Sep 16

Authorization bypass in Wiki.js through 2.5.314 allows an authenticated user who has been granted access to at least one

CVE-2026-102826 HIGH POC
8.1 Sep 29

Untrusted git configuration includes reachable through simple-git before 4.0.0 let an attacker execute arbitrary command

CVE-2026-85715 HIGH POC
7.5 Sep 17

Improper memory allocation control in ExifReader before 4.41.1 allows remote attackers to exhaust heap memory and termin

CVE-2026-102278 HIGH POC
7.5 Sep 28

Deeply nested brace patterns cause unbounded recursion in the npm brace-expansion library, exhausting the native stack a

CVE-2026-102276 HIGH POC
7.5 Sep 28

Stack exhaustion in the npm library brace-expansion (all versions prior to 1.1.19, 2.1.5, 3.0.7, and 5.0.10) lets a craf

CVE-2026-92775 HIGH POC
7.1 Sep 16

Server-side request forgery in Wiki.js through 2.5.314 lets an authenticated user who holds page-editing permissions for

CVE-2026-101910 MEDIUM POC
6.9 Sep 28

The JavaScript library ip-address (npm) fails to treat the NAT64 local-use prefix 64:ff9b:1::/48 as private, so applicat

CVE-2026-101914 MEDIUM POC
6.5 Sep 28

Authorization bypass in the @grpc/grpc-js-xds package (the xDS/RBAC extension for @grpc/grpc-js) lets a request for one

CVE-2026-101912 MEDIUM POC
6.3 Sep 28

Cross-family subnet comparisons in the ip-address npm library (all versions before 10.7.1) can cause isInSubnet and isHo

CVE-2026-101911 MEDIUM POC
6.3 Sep 28

Denial of service in the ip-address JavaScript/npm library (all versions prior to 10.7.1) lets remote attackers stall or

Vendor StatusVendor

SUSE

Severity: Critical
Product Status
SUSE Linux Enterprise High Performance Computing 12 Not-Affected
SUSE Linux Enterprise Micro 5.3 Affected
SUSE Linux Enterprise Micro 5.4 Affected
SUSE Linux Enterprise Micro 5.5 Affected
SUSE Linux Enterprise Module for Web and Scripting 15 SP7 Not-Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy