Markdown Madness: Turning Blog Posts into Shells with CVE-2026-0969
Vulnerability ID: CVE-2026-0969
CVSS Score: 8.8
Published: 2026-02-12
A critical Remote Code Execution (RCE) vulnerability in next-mdx-remote allows attackers to execute arbitrary commands on the server by injecting malicious JavaScript expressions into MDX content. This flaw exploits the library's default behavior of evaluating code within Markdown during the serialization process, effectively turning a harmless blog post into a weaponized payload.
TL;DR
If you use next-mdx-remote versions 4.3.0 through 5.0.0 to render user-provided content, your server is wide open. The library fails to sanitize JavaScript expressions inside MDX files. An attacker can submit a post containing {process.exit()} or worse, and your server will execute it during rendering. Upgrade to v6.0.0 immediately to disable inline JS execution.
⚠️ Exploit Status: POC
Technical Details
- CWE ID: CWE-94
- CVSS Score: 8.8 (High)
- Attack Vector: Network
- Exploit Maturity: Proof of Concept (High Probability)
- Privileges Required: Low (User Input)
- Confidentiality Impact: High
- Integrity Impact: High
- Availability Impact: High
Affected Systems
- Next.js applications using next-mdx-remote < 6.0.0
- Node.js SSR environments rendering untrusted MDX
-
next-mdx-remote: >= 4.3.0 < 6.0.0 (Fixed in:
6.0.0)
Exploit Details
- Internal Research: Exploitation involves passing {process.mainModule.require('child_process')} into the MDX source during serialization.
Mitigation Strategies
- Upgrade to version 6.0.0 which disables JavaScript execution by default.
- Enable 'blockDangerousJS' if strictly necessary to allow some JS.
- Run Next.js rendering services with least-privilege users.
- Sanitize upstream content (CMS/Database) before it reaches the rendering layer.
Remediation Steps:
- Run
npm install next-mdx-remote@latestoryarn add next-mdx-remote@latest. - Audit codebases for usage of
serialize()orcompileMDX(). - Verify that
mdxOptionsdoes not explicitly setblockJS: false. - Rebuild and redeploy the application to clear any cached build artifacts.
References
Read the full report for CVE-2026-0969 on our website for more details including interactive diagrams and full exploit analysis.
Top comments (0)