Skip to main content

@contentlayer/source-files CVE-2026-129948

| EUVDEUVD-2026-126423 HIGH
Eval Injection (CWE-95)
2026-11-16 disclosure@vulncheck.com GHSA-qp9j-64hv-w35c
8.7
CVSS 4.0 · Vendor: vulncheck
View

Attack ChainAIDerived

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

  1. Access
    Obtain content-file write/contribution access
  2. Delivery
    Add ---js frontmatter JavaScript payload
  3. Exploit
    Build pipeline runs on the content
  4. Execution
    gray-matter engine evaluates the JavaScript
  5. Impact
    Exfiltrate 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.

Monitor Track and reassess. Why: Vendor states no customer action required.
No patch listed yet 0.3% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – 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

@contentlayer/source-files 0 ≤0.3.4

Affected Packages

euvd contentlayer_source_files no fix

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

Vendor (vulncheck) PRIMARY 8.7 HIGH
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
vuln.today AI 8.8 HIGH

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.

3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (vulncheck).

CVSS VectorVendor: vulncheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.3%
Top 72% exploitable
Prevalence
Low
niche Next.js build-time content SDK, now effectively unmaintained
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High

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 HIGH
CISA KEV No
Public POC No
EPSS 0.3%
Patch available No
Active threat No
Deciding rule
Vendor states no customer action required
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
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
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.

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