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

State
Published
Severity
8.6 High
Published
Nov 16, 2026
Updated
Nov 18, 2026
Reserved
Nov 16, 2026

Read the record on cve.org

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.

ProductVersions
@contentlayer/core contentlayerdev0.3.4 and earlier Affected

Weaknesses

  • CWE-94 Improper Control of Generation of Code ('Code Injection')

References

Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.

© 2026 NVIDIA, the NVIDIA logo, and NVIDIA Inception are trademarks and/or registered trademarks of NVIDIA Corporation in the U.S. and other countries.