{"id":10636,"date":"2026-02-13T10:03:57","date_gmt":"2026-02-13T10:03:57","guid":{"rendered":"https:\/\/serisec.com\/index.php\/2026\/02\/13\/critical-vulnerability-in-next-mdx-remote-allows-arbitrary-code-execution-in-react-server-side-rendering\/"},"modified":"2026-02-13T10:03:57","modified_gmt":"2026-02-13T10:03:57","slug":"critical-vulnerability-in-next-mdx-remote-allows-arbitrary-code-execution-in-react-server-side-rendering","status":"publish","type":"post","link":"https:\/\/serisec.com\/index.php\/2026\/02\/13\/critical-vulnerability-in-next-mdx-remote-allows-arbitrary-code-execution-in-react-server-side-rendering\/","title":{"rendered":"Critical Vulnerability in Next-Mdx-Remote Allows Arbitrary Code Execution in React Server-Side Rendering"},"content":{"rendered":"<p>    Critical Vulnerability in Next-Mdx-Remote Allows Arbitrary Code Execution in React Server-Side Rendering<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n    <!-- no image --><br \/>\n \t<BR><br \/>\n<BR><\/BR><\/p>\n<div>\n<p>Security advisory HCSEC-2026-01 revealed a critical vulnerability in the next-mdx-remote library that allows attackers to execute arbitrary code on servers rendering untrusted MDX content.<\/p>\n<p>Tracked as CVE-2026-0969, the issue affects versions 4.3.0 through 5.0.0 and is fixed in 6.0.0. Next-mdx-remote is a popular open-source TypeScript library for <a href=\"https:\/\/cybersecuritynews.com\/next-js-cache-poisoning-vulnerability\/\" target=\"_blank\" rel=\"noreferrer noopener\">Next.js based React apps<\/a>.<\/p>\n<p>It lets developers pull MDX (Markdown with JSX) <a href=\"https:\/\/cybersecuritynews.com\/claude-ai-indirect-prompt-attack\/\" target=\"_blank\" rel=\"noreferrer noopener\">from databases, APIs, or user input<\/a> and render it dynamically on the server or client.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-how-the-attack-works\"><strong>How the Attack Works<\/strong><\/h2>\n<p>MDX mixes Markdown\u2019s simplicity with React components, making it great for blogs, docs, and user-generated content.<\/p>\n<p>The problem lies in the library\u2019s\u00a0serialize\u00a0and\u00a0compileMDX\u00a0functions. These lacked proper sanitization for <a href=\"https:\/\/cybersecuritynews.com\/new-magecart-attack-with-malicious-javascript\/\" target=\"_blank\" rel=\"noreferrer noopener\">JavaScript expressions<\/a> in untrusted MDX.<\/p>\n<figure class=\"wp-block-table is-style-stripes\">\n<table class=\"has-fixed-layout\">\n<thead>\n<tr>\n<th class=\"has-text-align-left\" data-align=\"left\">Aspect<\/th>\n<th class=\"has-text-align-left\" data-align=\"left\">Information<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"has-text-align-left\" data-align=\"left\"><strong>CVE ID<\/strong><\/td>\n<td class=\"has-text-align-left\" data-align=\"left\"><strong>CVE-2026-0969<\/strong><\/td>\n<\/tr>\n<tr>\n<td class=\"has-text-align-left\" data-align=\"left\"><strong>Affected<\/strong><\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">next-mdx-remote 4.3.0 to 5.0.0<\/td>\n<\/tr>\n<tr>\n<td class=\"has-text-align-left\" data-align=\"left\"><strong>CVSS Score<\/strong><\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">Critical (estimated 9.8\/10)<\/td>\n<\/tr>\n<tr>\n<td class=\"has-text-align-left\" data-align=\"left\"><strong>Impact<\/strong><\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">RCE on SSR with untrusted MDX<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>Attackers could sneak in malicious code such as\u00a0eval(),\u00a0Function(), or\u00a0require() hidden in curly braces\u00a0{}. When the server processes this during <a href=\"https:\/\/cybersecuritynews.com\/angular-ssr-vulnerability\/\" target=\"_blank\" rel=\"noreferrer noopener\">server-side rendering<\/a> (SSR), it executes the code with full server privileges.<\/p>\n<p>This leads to <a href=\"https:\/\/cybersecuritynews.com\/1-click-clawdbot-vulnerability-enable-malicious-remote-code-execution-attacks\/\">remote code execution (RCE)<\/a>, potentially letting hackers steal data, install malware, or take over the server.<\/p>\n<p>For example, an attacker submits MDX like:\u00a0{require(\u2018child_process\u2019).execSync(\u2018rm -rf \/\u2019)}. If JavaScript expressions are enabled (the default), the server runs them blindly.<\/p>\n<p><a href=\"https:\/\/discuss.hashicorp.com\/t\/hcsec-2026-01-arbitrary-code-execution-in-react-server-side-rendering-of-untrusted-mdx-content\/77155\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Version 6.0.0 brings breaking changes<\/a>: JavaScript expressions are now blocked by default (blockJS: true).<\/p>\n<p>When enabled (blockJS: false), a new\u00a0blockDangerousJS: true\u00a0option (default on) filters risky globals like\u00a0process,\u00a0eval, and\u00a0require.<\/p>\n<p>Upgrade to next-mdx-remote 6.0.0 immediately if you <a href=\"https:\/\/cybersecuritynews.com\/wormgpt-database-leak\/\" target=\"_blank\" rel=\"noreferrer noopener\">handle untrusted MDX on servers<\/a>. Audit code for\u00a0compileMDX\u00a0or\u00a0serialize\u00a0calls.<\/p>\n<p>Never render user-supplied MDX without sanitization. Use libraries like remark-rehype for extra safety. Test in staging to catch breaks from the defaults.<\/p>\n<p class=\"has-text-align-center has-background\" style=\"background:linear-gradient(180deg,rgb(238,238,238) 94%,rgb(169,184,195) 100%)\"><strong>Follow us on <a href=\"https:\/\/news.google.com\/publications\/CAAqMggKIixDQklTR3dnTWFoY0tGV041WW1WeWMyVmpkWEpwZEhsdVpYZHpMbU52YlNnQVAB?hl=en-IN&amp;gl=IN&amp;ceid=IN:en\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Google News<\/a>, <a href=\"https:\/\/www.linkedin.com\/company\/cybersecurity-news\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">LinkedIn<\/a>, and <a href=\"https:\/\/x.com\/cyber_press_org\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">X<\/a> for daily cybersecurity updates. <a href=\"https:\/\/cybersecuritynews.com\/contact-us\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Contact us<\/a> to feature your stories.<\/strong><\/p>\n<p>The post <a href=\"https:\/\/cybersecuritynews.com\/vulnerability-in-next-mdx-remote\/\">Critical Vulnerability in Next-Mdx-Remote Allows Arbitrary Code Execution in React Server-Side Rendering<\/a> appeared first on <a href=\"https:\/\/cybersecuritynews.com\/\">Cyber Security News<\/a>.<\/p>\n<\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><br \/>\n    Abinaya<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/cybersecuritynews.com\/vulnerability-in-next-mdx-remote\/\">Go to cyber-security-news<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Critical Vulnerability in Next-Mdx-Remote Allows Arbitrary Code Execution in React Server-Side Rendering Security advisory HCSEC-2026-01 revealed a critical vulnerability in the next-mdx-remote library that allows attackers to execute arbitrary code on servers rendering untrusted MDX content. Tracked as CVE-2026-0969, the issue affects versions 4.3.0 through 5.0.0 and is fixed in 6.0.0. Next-mdx-remote is a popular [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129,63,648],"tags":[130],"class_list":["post-10636","post","type-post","status-publish","format-standard","hentry","category-cyber-security","category-cyber-security-news","category-vulnerability-news","tag-cyber-security-news"],"_links":{"self":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/10636"}],"collection":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/comments?post=10636"}],"version-history":[{"count":0,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/10636\/revisions"}],"wp:attachment":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/media?parent=10636"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/categories?post=10636"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/tags?post=10636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}