CVE-2026-129948: Contentlayer @contentlayer/source-files through 0.3.4 Code Injection via JavaScript Frontmatter

Published Nov 16, 2026
·
Updated

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.

Affected Software

1 affected component
npm/@contentlayer/source-files<=0.3.4

Event History

Nov 16, 2026
CVE Published
via MITRE·03:06 PM
Data Sourced
via MITRE·03:06 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who is realistically exposed to this issue?

Projects using npm/@contentlayer/source-files through 0.3.4 are exposed when an attacker can control Markdown or MDX content files processed by Contentlayer. The code executes during the build, so CI environments are particularly sensitive because build secrets may be exposed.

2

What must an attacker do to trigger code execution?

The attacker needs the ability to introduce or modify a content file that Contentlayer parses. They can place a ---js or ---javascript frontmatter delimiter at the beginning of a Markdown or MDX file, causing JavaScript to run through gray-matter's enabled JavaScript engine in parseMarkdown().

3

When does the malicious code run?

The supplied data indicates that execution occurs during the Contentlayer build process. This means review and protection of content-file changes is important for build pipelines that process untrusted or contributor-controlled content.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203