Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAdd content file with single-quote name
-
DeliveryName breaks out of import specifier in makeDataExportFile()
-
ExploitGenerated index.mjs contains injected JavaScript
-
ExecutionDeveloper runs contentlayer dev / Next.js dev server imports module
-
ImpactArbitrary code executes on developer or build host
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Two concrete prerequisites must both hold. First, the attacker must be able to create or control the NAME of a content file in the project's content source - e.g., via an accepted pull request, a user-content submission pipeline, or write access to the content directory - placing a filename containing a single quote that breaks out of the import specifier in makeDataExportFile(). Second, a victim must build the project: specifically, someone must run |
| Impact | The input CVSS 4.0 score of 8.6 (High) reflects full compromise of the vulnerable system (VC:H/VI:H/VA:H) via a network vector with low complexity, but the real-world risk is strongly conditioned by two metrics the raw number obscures: PR:L (the attacker must be able to introduce or name a content file) and UI:P (a developer or build process must run |
| Exploit ScenarioDerived | An attacker who can contribute content to a project - for example by opening a pull request or submitting user content - adds a content file whose name contains a single quote crafted to break out of the import specifier generated by makeDataExportFile(). When a developer or CI runs |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 16, 2026
Code injection in @contentlayer/core through 0.3.4 lets an attacker who can control the name of a content file embed a single quote that breaks out of the import specifier built by makeDataExportFile(), so injected JavaScript runs when contentlayer dev or a Next.js dev server imports the generated index.mjs. Two prerequisites must both hold: the attacker must be able to create or name a content file in the project's content source (via an accepted pull request, a user-content submission pipeline, or write access to the content directory), and a victim must then build, i.e. run contentlayer dev or start a Next.js dev server that imports the generated module (the UI:P requirement). Exploitation is confined to the development/build toolchain rather than the deployed production site's runtime, and no public exploit code is identified at time of analysis (the referenced GitHub issue is a bug report, not verified working exploit code); the CVSS 4.0 score of 8.6 reflects full compromise of the vulnerable system, but PR:L and UI:P substantially condition real-world exposure.
RemediationAI
No vendor-released fixed version is identified in the available data for @contentlayer/core through 0.3.4, so until an upstream patched release is available the primary mitigation is to prevent attacker-controlled filenames from reaching the code generator: reject or sanitize content file names containing single quotes (and other characters unsafe in import specifiers) in any submission or PR review pipeline, and restrict write access to the content directory to trusted contributors. Because the injection fires when the generated index.mjs is imported, avoid running contentlayer dev or a Next.js dev server against content branches or submissions that have not been reviewed; the trade-off is reduced developer convenience for untrusted-content workflows. Track https://github.com/contentlayerdev/contentlayer/issues/688 and https://www.vulncheck.com/advisories/contentlayer-contentlayer-core-through-0.3.4-code-injection-via-generated-index-mjs for a patched release and upgrade immediately when one is published; pinning content dependencies to reviewed sources limits exposure in the interim.
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 for JavaScript/TypeScript projects (commonly paired with Next.js) that transforms Markdown/MDX content files into typed JSON data plus generated modules. The flaw is CWE-94 (improper control of generation of code), specifically an injection into generated source: makeDataExportFile() in packages/@contentlayer/core/src/generation/generate-dotpkg.ts (lines 377-379 and 511 in the v0.3.4 source referenced by NVD) constructs import specifiers from content file names without escaping single quotes. A filename containing a quote terminates the string literal in the generated index.mjs, so attacker-supplied text becomes executable module-level JavaScript. Because the injected code is part of the generated package that contentlayer dev and the Next.js dev server load, execution occurs in the developer/build environment and toolchain rather than in the deployed production runtime. The assessed vector is CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H: network reachable, low complexity, but requiring the attacker to be able to introduce or name a content file and a victim to perform the build action.
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:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Attacker needs the ability to add/name a content file (PR:L) and a developer must run the build to import the module (UI:R); injected JS yields full code execution on the host (C/I/A:H), scope unchanged.
Primary rating from Vendor (vulncheck).
CVSS VectorVendor: vulncheck
DescriptionCVE.org
Contentlayer @contentlayer/core through 0.3.4 contains a code injection vulnerability that allows attackers to inject JavaScript by embedding single quotes in content file names. Attackers can add a content file whose name breaks out of the import specifier in makeDataExportFile(), executing injected code when contentlayer dev or a Next.js dev server imports the generated module.
Executive ViewAI
CVE-2026-129947 is a high-severity code injection vulnerability in @contentlayer/core, a development dependency used to generate content imports for Next.js sites. If an attacker can influence the name of a content file, they can execute arbitrary JavaScript on a developer's machine when the dev server runs. This puts development environments and CI/CD pipelines at risk, potentially leading to source code theft or supply chain compromise, but does not directly affect production website visitors.
No vendor-released patch identified at time of analysis. Interim mitigations: restrict write access to content directories, validate and sanitize content file names (reject single quotes and special characters), enforce pull request reviews for content changes, run development servers in isolated environments with least privilege, and consider replacing @contentlayer/core with a maintained alternative.
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.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
EUVD-2026-126424
GHSA-gxcv-hr94-jjmj
NVD
CVE.org
EPSS
Exploit-DB