next-mdx-remote Arbitrary Code Execution Vulnerability

Vulnerability

A vulnerability allowing arbitrary code execution has been identified in the next-mdx-remote library, specifically in versions 4.3.0 prior to 5.0.0. The issue arises in the serialize function used to compile MDX, where insufficient sanitization of MDX content allows untrusted user inputs with JavaScript expressions to be executed. This vulnerability is particularly concerning in React applications that render MDX content from untrusted sources on the server side.

Impact

Exploitation of this vulnerability could lead to remote code execution on the server where the affected application is running.

Remediation

Users of next-mdx-remote should upgrade to version 6.0.0, which addresses this vulnerability by disabling JavaScript expressions in MDX content by default. For deployments that require JavaScript expressions, the new 'blockDangerousJS' option can be used to mitigate the risk.

Added: Feb 12, 2026, 3:28 AM
Updated: Feb 12, 2026, 3:28 AM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
10.0
exploitability
6.2
remediation
0.0
relevance
2.7
threat
0.0
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.