Code injection in Contentlayer core via crafted content file names
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- Passive
- Attack complexity
- Low
- Attack requirements
- None
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- No fix listed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA. Impact type from CWE-94.
Summary
Contentlayer @contentlayer/core through 0.3.4 contains a code injection flaw (CWE-94) that lets attackers inject JavaScript by embedding single quotes in content file names. A file whose name breaks out of the import specifier in makeDataExportFile() runs the injected code when contentlayer dev or a Next.js dev server imports the generated module. The CVSS 4.0 base score is 8.6 (HIGH).
Written with Claude Haiku 5.5 from the sources below · 2026-11-16
Description from the CNA
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| contentlayerdev | @contentlayer/core | up to 0.3.4 | — | No fix listed | CNA |
- @contentlayer/core Vendorcontentlayerdev Affected up to 0.3.4 Fixed in — No fix listed CNA
Remediation
No fixed version is listed for @contentlayer/core, and all versions through 0.3.4 are affected.
Written with Claude Haiku 5.5 from the sources below · 2026-11-16
Timeline
- 2026-11-16 Threatist record created from CVE-2026-129947
- 2026-11-16 Alias added: GHSA-gxcv-hr94-jjmj
References
Other 3
- https://github.com/contentlayerdev/contentlayer/issues/688
- https://github.com/contentlayerdev/contentlayer/blob/v0.3.4/packages/@contentlayer/core/src/generation/generate-dotpkg.ts#L377-L379
- https://github.com/contentlayerdev/contentlayer/blob/v0.3.4/packages/@contentlayer/core/src/generation/generate-dotpkg.ts#L511
More contentlayerdev vulnerabilities
- TI-2026-92182 Code injection in Contentlayer source-files via JavaScript frontmatter CVSS 4.0HIGH 8.7
Sources
- CVE-2026-129947 · CVE Program
- CVE-2026-129947 · NVD
- GHSA-gxcv-hr94-jjmj · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences