CVE-2026-129947

Contentlayer @contentlayer/core through 0.3.4 Code Injection via Generated _index.mjs

Published Nov 16, 2026 CVSS 4.0 · 8.6 High EPSS n/a KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

Contentlayer @contentlayer/core through version 0.3.4 contains a code injection flaw that can be triggered by embedding single quotes in the names of content files. The injection alters the generated import specifier in the makeDataExportFile() routine, allowing an attacker to inject arbitrary JavaScript that is executed when contentlayer dev or a Next.js dev server imports the resulting module.

Affected Systems

Vulnerable installations are those running contentlayerdev:@contentlayer/core versions up to and including 0.3.4. Any environment that imports the generated _index.mjs file – such as a local developer workstation, a developer server, or a build pipeline executing Next.js dev server code – is potentially impacted.

Risk and Exploitability

The CVSS score of 8.6 reflects a high severity due to the potential for arbitrary code execution. EPSS is not available, so the exact current exploitation probability is unknown, and the vulnerability is not listed in the CISA KEV catalog. Attackers can exploit the flaw by adding a maliciously named content file to the repository; the exploit succeeds only when the contentlayer dev or Next.js dev server loads the generated module, so risk to production systems is limited unless the same environment is used for builds or runtime. Nonetheless, a compromised developer or build environment could lead to severe compromise.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update contentlayer @contentlayer/core to version 0.3.5 or later, which removes the injection vector.
  • Rename or sanitize content file names to eliminate single quotes before they are processed by the framework.
  • Restrict or isolate the execution of contentlayer dev and Next.js dev server modules to trusted environments, ensuring that untrusted sources cannot trigger the import of maliciously crafted modules.

Generated by OpenCVE AI on November 16, 2026 at 16:23 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Description 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.
Title Contentlayer @contentlayer/core through 0.3.4 Code Injection via Generated _index.mjs
Weaknesses CWE-94
References
Metrics cvssV3_1

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

cvssV4_0

{'score': 8.6, 'vector': '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'}

Subscriptions

No data.

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Nov 16, 2026, 3:06 PM
Reserved
Nov 16, 2026, 2:43 PM
Status
Received
Published
Nov 16, 2026, 3:17 PM
Modified
Nov 16, 2026, 3:17 PM