Contentlayer @contentlayer/source-files through 0.3.4 Code Injection via JavaScript Frontmatter
- State
- Published
- Severity
- 8.7 High
- Published
- Nov 16, 2026
- Updated
- Nov 17, 2026
- Reserved
- Nov 16, 2026
Description
Contentlayer @contentlayer/source-files through 0.3.4 contains a code injection vulnerability that allows attackers who control content files to execute JavaScript by abusing gray-matter's still-enabled JavaScript engine in parseMarkdown(). Attackers can start a Markdown or MDX file with a ---js or ---javascript frontmatter delimiter to run code during build, exposing CI build secrets.
| Product | Versions |
|---|---|
| @contentlayer/source-files contentlayerdev | 0.3.4 and earlier Affected |
| CVSS | Score | How It's Reached | Source |
|---|---|---|---|
| 4.0 | 8.7 High | VulnCheck | |
| 3.1 | 8.8 High | VulnCheck |
Weaknesses
- CWE-95 Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')
References
- https://github.com/contentlayerdev/contentlayer/issues/688Issue Tracker
- https://github.com/contentlayerdev/contentlayer/blob/v0.3.4/packages/@contentlayer/source-files/src/fetchData/makeCacheItemFromFilePath.ts#L221-L228Technical Details
- VulnCheck Advisory: Contentlayer @contentlayer/source-files through 0.3.4 Code Injection via JavaScript FrontmatterThird-Party Advisory
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.