Summary
Affected Versions
All versions of @modelcontextprotocol/sdk prior to the patched release.
Workarounds
- Avoid using exploded patterns (
{/id*},{?tags*}) in resource templates - Implement request timeouts and rate limiting
- Validate URIs before processing to reject suspicious patterns
Impact
A ReDoS vulnerability in the UriTemplate class allows attackers to cause denial of service. The partToRegExp() function generates a regex pattern with nested quantifiers (([^/]+(?:,[^/]+)*)) for exploded template variables (e.g., {/id*}, {?tags*}), causing catastrophic backtracking on malicious input.
Who is affected: MCP servers that register resource templates with exploded array patterns and accept requests from untrusted clients.
Attack result: An attacker sends a crafted URI via resources/read request, causing 100% CPU utilization, server hang/crash, and denial of service for all clients.
A regular expression with worst-case exponential or polynomial matching time is applied to untrusted input, causing excessive CPU use. Typical impact: denial of service when input is crafted to trigger backtracking.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
v1.25.2 contains b392f02ffcf37c088dbd114fedf25026ec3913d3 the fix modifies the regex pattern to prevent backtracking.
Frequently Asked Questions
- What is CVE-2026-0621? CVE-2026-0621 is a high-severity inefficient regular expression (ReDoS) vulnerability in @modelcontextprotocol/sdk (npm), affecting versions < 1.25.2. It is fixed in 1.25.2. A regular expression with worst-case exponential or polynomial matching time is applied to untrusted input, causing excessive CPU use.
- Which versions of @modelcontextprotocol/sdk are affected by CVE-2026-0621? @modelcontextprotocol/sdk (npm) versions < 1.25.2 is affected.
- Is there a fix for CVE-2026-0621? Yes. CVE-2026-0621 is fixed in 1.25.2. Upgrade to this version or later.
- Is CVE-2026-0621 exploitable, and should I be worried? Whether CVE-2026-0621 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-0621 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-0621? Upgrade
@modelcontextprotocol/sdkto 1.25.2 or later.