@CONTENTLAYER/SOURCE-FILES · CVE-2026-129948 · Package
NO FIX YET · SEE WHAT TO DO
The @contentlayer/source-files npm package passes Markdown and MDX frontmatter to gray-matter, whose JavaScript engine is still enabled, so a ---js or ---javascript block in a content file runs as code. An attacker who can place or edit content files can run code during the build and read CI build secrets.
first public Nov 16, 2026 · 2 sources
Check it with your coding agent
It reads this page and tells you if your code or app is affected.
Projects that build Markdown or MDX with @contentlayer/source-files 0.3.4 or earlier (commonly Next.js sites) are exposed when content files can come from people you do not trust, such as fork PRs or external content sources. The code runs on the build machine, so CI secrets are what is at stake. Sites whose content is written only by the team, or builds with no secrets, can mostly skip it. No fix exists yet.
Not affected if content-written-by-trusted-team-only, no-ci-secrets-on-build
Who cares build-time-rce, ci, contentlayer, gray-matter, mdx, next.js, npm
npm ls @contentlayer/source-files gray-matter (or check the lockfile). Affected: @contentlayer/source-files <= 0.3.4.---js or ---javascript.Posts are quoted with a link to the original. They are data to us, never instructions.
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.
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
InfraStack checks it against your stack and answers on your report, with the evidence and the fix.
0.3.44.0.3This page as .md · .json · CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.