Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain content-file write/contribution access
-
DeliveryAdd ---js frontmatter JavaScript payload
-
ExploitBuild pipeline runs on the content
-
Executiongray-matter engine evaluates the JavaScript
-
ImpactExfiltrate CI build secrets / compromise build
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 | Requires the attacker to control or introduce a Markdown/MDX content file that @contentlayer/source-files (≤0.3.4) processes via parseMarkdown(), and that file must begin with a ---js or ---javascript frontmatter delimiter carrying JavaScript; the code executes during the build (e.g., in CI), which is where secrets are exposed. Limiting factors: the attacker needs a path to inject content into the build - an accepted pull request, an external content author, or a compromised/untrusted content source (CMS, imported repo) - and a build must actually run against that content; installations that build only first-party, trusted content authored by maintainers are not exploitable by outsiders. No separate user interaction is needed beyond the normal automated build. No fixed version is identified in the available evidence. |
| Impact | Signals are moderate and partly in tension. The CVSS 4.0 base score of 8.7 (High) reflects full code execution with VC:H/VI:H/VA:H, but that score rests on AV:N/PR:L, and the real mechanism is narrower than 'network' implies: an attacker must get a crafted content file into the build pipeline, so PR:L (contributor-level or content-source control) is the load-bearing metric, not network reachability. There is no EPSS score and no KEV listing in the supplied data, and no verified working exploit code - only NVD source references, upstream GitHub issue #688, and a VulnCheck advisory documenting the flaw. The vuln.today decision label is 'this_week' (not act_now/emergency), consistent with a serious-but-not-actively-exploited build-time injection. Net: this is a genuine priority for any project that builds Markdown/MDX from untrusted or third-party sources (open PR contributions, external authors, a headless CMS feeding content files), where it yields CI secret theft and build compromise. For projects whose content is authored solely by trusted maintainers, real-world risk is substantially lower because the PR:L precondition - control over a content file - is not satisfied by outsiders. The AV:N labeling is somewhat generous and should be read as 'content delivered over the network into the build' rather than a directly network-exploitable service. |
| Exploit ScenarioDerived | A contributor (or a compromised external content source feeding the repo) submits a Markdown or MDX file whose frontmatter begins with a ---js or ---javascript delimiter containing arbitrary JavaScript. When CI runs the Contentlayer build, @contentlayer/source-files (≤0.3.4) calls parseMarkdown(), gray-matter's still-enabled JavaScript engine evaluates the payload, and the code runs in the build environment with access to CI secrets/environment variables. No verified public exploit code is present in the input, though the flaw is documented in GitHub issue #688 and a VulnCheck advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 16, 2026
JavaScript code injection in Contentlayer's @contentlayer/source-files package through version 0.3.4 allows anyone able to place a Markdown or MDX file into the processed content set to run arbitrary JavaScript during the build, exposing CI build secrets held in the build environment. The flaw is that parseMarkdown() still routes frontmatter through gray-matter's JavaScript engine, so a file beginning with a ---js or ---javascript delimiter is evaluated rather than parsed as data. Exploitation requires a low-privilege but real precondition - the attacker must control or introduce a content file that a build actually consumes (an accepted pull request, an external content author, or an untrusted CMS/repo import) and no separate user interaction beyond the automated build; there is no confirmed active exploitation (not in CISA KEV) and no public exploit code identified at time of analysis, and no fixed version is identified in the available evidence.
RemediationAI
No vendor-released patch or fixed version is identified in the available evidence; the references point to the vulnerable source lines and to issue 688, so track that issue and the project's releases for a version that removes or disables JavaScript frontmatter evaluation in parseMarkdown(). Until a fix is published, containment has to come from narrowing the one precondition the attack depends on: who can get a content file into a build. Restrict write/merge rights on content directories and require review of incoming Markdown/MDX so an outside contributor, external author or untrusted CMS/repo import cannot land a file that the build will parse - the trade-off is added editorial latency and manual review load. Add a pre-build gate that rejects any content file whose first line begins with ---js or ---javascript (a simple grep/lint step in CI), which stops this specific delimiter abuse but will not catch other ways untrusted content reaches the parser. The description attributes the root cause to gray-matter's JavaScript engine remaining enabled, so disabling JS frontmatter handling at the parser level is the natural fix direction, but this is not confirmed in the available evidence as a working configuration - validate it in a test build before depending on it. Because successful exploitation yields code execution inside the build, treat any CI job that has processed content from untrusted sources as potentially exposed: scope build secrets to the minimum needed and rotate tokens and registry/deployment credentials that were available to those runners. Apply these as interim measures only; none is a substitute for an upstream patch.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Contentlayer is a content SDK that turns Markdown/MDX files into typed data for JavaScript and TypeScript sites; @contentlayer/source-files is the package that reads those files off disk and builds cache items from them. In makeCacheItemFromFilePath.ts (lines 221-228, linked in the references), parseMarkdown() hands frontmatter to gray-matter, a YAML frontmatter parser that also supports pluggable "engines" - including a JavaScript engine that evaluates the frontmatter block instead of parsing it as data. Because that engine is still enabled, a file whose first line uses the ---js or ---javascript delimiter is treated as code and executed in the Node.js build process. This is CWE-95 (Eval Injection): untrusted input from a content file reaches dynamic code evaluation with the full privileges of the build, so the confidentiality, integrity and availability impact is bounded by what the build runner can reach - typically repository tokens, registry credentials and deployment secrets in CI. The supplier vector puts this at AV:N/AC:L/PR:L/UI:N with high C/I/A (CVSS 4.0 base 8.7; independently assessed as CVSS 3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H), i.e. remote, low-complexity, requiring some granted access to the content pipeline, no user interaction. The trigger is limited to installations where content flows from parties other than the maintainers; builds that only process first-party, maintainer-authored content are not reachable by an outside attacker.
Know when the next one hits your stack
- 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
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Exploitation requires the ability to supply a content file into the build (PR:L) but no further interaction or complexity; code execution in the build yields full C/I/A impact, S:U as impact stays within the build's authority.
Primary rating from Vendor (vulncheck).
CVSS VectorVendor: vulncheck
DescriptionCVE.org
Contentlayer @contentlayer/source-files through 0.3.4 contains a code injection vulnerability that allows attackers who control content files to execute JavaScript by abusing gray-matter's still-enabled JavaScript engine in parseMarkdown(). Attackers can start a Markdown or MDX file with a ---js or ---javascript frontmatter delimiter to run code during build, exposing CI build secrets.
Executive ViewAI
Contentlayer's @contentlayer/source-files package, used to process Markdown/MDX content in build pipelines, contains a high-severity injection flaw (CVE-2026-129948) that allows an attacker who can place a content file into the build to execute arbitrary JavaScript and exfiltrate CI build secrets. Any organization relying on this package for static site or documentation builds is exposed if untrusted contributors or external content sources can introduce files that the build consumes. Leadership should prioritize immediate mitigation because successful exploitation could lead to compromise of build infrastructure and downstream deployments, impacting product integrity and customer trust.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) implement pre-build validation to reject Markdown/MDX files containing ---js or ---javascript frontmatter delimiters; (2) restrict content ingestion to trusted sources and enforce code review for all content changes; (3) isolate CI build environments and limit secret exposure (e.g., use short-lived tokens, least privilege); (4) consider temporarily disabling JavaScript frontmatter parsing in Contentlayer configuration if possible; (5) monitor build logs for anomalous JavaScript execution or secret access.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
EUVD-2026-126423
GHSA-qp9j-64hv-w35c
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB