CVE-2026-129948
8.8HighPublished 16 Nov 2026 · NVD status: Received · AI triage by gemini-3.1-flash-lite
High
0CVSS v3.110
- Attack vector
- Network
- Complexity
- Low
- Privileges
- Low
- User action
- None
- Impact
- Full C/I/A compromise
- Weakness
- CWE-95
What an attacker gets
Attackers who can commit or modify content files can execute arbitrary JavaScript during your build process. This allows them to steal CI build secrets and compromise your deployment pipeline.
Root cause
The library uses gray-matter with its JavaScript engine enabled, which interprets ---js or ---javascript frontmatter as executable code.
Affected versions
@contentlayer/source-files through 0.3.4
CVSS v3.1 · CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Fix & remediation
Upgrade to a version beyond 0.3.4 if available or audit all content files for malicious frontmatter. If no patch exists, disable JS frontmatter support in your gray-matter configuration or restrict file access to trusted contributors only.
$ npm list @contentlayer/source-filesAI-suggested. Run it in staging first and check it against the vendor advisory. Why?
NVD 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.
References
- https://github.com/contentlayerdev/contentlayer/blob/v0.3.4/packages/@contentlayer/source-files/src/fetchData/makeCacheItemFromFilePath.ts#L221-L228
- https://github.com/contentlayerdev/contentlayer/issues/688
- https://www.vulncheck.com/advisories/contentlayer-contentlayer-source-files-through-0.3.4-code-injection-via-javascript-frontmatter