CVE-2026-129947: Contentlayer @contentlayer/core through 0.3.4 Code Injection via Generated _index.mjs
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.
Affected Software
Event History
Frequently Asked Questions
Who can exploit this issue?
An attacker needs the ability to add or cause the addition of a content file with a crafted filename containing single quotes. The vulnerable generated module is then imported by contentlayer dev or a Next.js development server.
Is user interaction required for exploitation?
Yes. The supplied severity vector indicates user interaction is required. The available description identifies the triggering action as importing the generated module through contentlayer dev or a Next.js dev server.
Which environments are specifically identified as affected?
The described execution path occurs when contentlayer dev or a Next.js development server imports the generated _index.mjs module. The provided data does not establish impact for production server workflows.
How can I determine whether my project is exposed?
Check whether it uses @contentlayer/core through version 0.3.4 and whether untrusted parties can introduce content files or influence their filenames. Filesystem content names containing single quotes are the relevant injection condition.