CVE-2026-0621: MCP TypeScript SDK UriTemplate Exploded Array Pattern ReDoS
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.
Affected Versions
All versions of @modelcontextprotocol/sdk prior to the patched release.
Patches
v1.25.2 contains b392f02ffcf37c088dbd114fedf25026ec3913d3 the fix modifies the regex pattern to prevent backtracking.
Workarounds
- Avoid using exploded patterns ({/id}, {?tags}) in resource templates - Implement request timeouts and rate limiting - Validate URIs before processing to reject suspicious patterns
Other sources
Anthropic's MCP TypeScript SDK versions up to and including 1.25.1 contain a regular expression denial of service (ReDoS) vulnerability in the UriTemplate class when processing RFC 6570 exploded array patterns. The dynamically generated regular expression used during URI matching contains nested quantifiers that can trigger catastrophic backtracking on specially crafted inputs, resulting in excessive CPU consumption. An attacker can exploit this by supplying a malicious URI that causes the Node.js process to become unresponsive, leading to a denial of service.
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/@modelcontextprotocol/sdkto a version that resolves this vulnerability.Fixed in 1.25.2 - Upgrade
Upgrade
@modelcontextprotocol/sdkto a version that resolves this vulnerability.Fixed in 1.25.2Patch b392f02ffcf37c088dbd114fedf25026ec3913d3 - Configuration
Update MCP resource templates to avoid exploded array patterns in URI templates (e.g., do not use "{/id*}" or "{?tags*}"), since these cause UriTemplate to generate regexes with nested quantifiers that are vulnerable to ReDoS.
MCP resource templates (UriTemplate) Resource template exploded array patterns (RFC 6570) = avoid patterns like "{/id*}" and "{?tags*}" - Compensating control
Implement request timeouts and rate limiting, and validate URIs before processing to reject suspicious patterns.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-0621?
CVE-2026-0621 is considered a moderate severity vulnerability due to its potential for denial of service attacks.
How do I fix CVE-2026-0621?
To fix CVE-2026-0621, update the Anthropic MCP TypeScript SDK to version 1.25.2 or later.
What is the nature of the vulnerability in CVE-2026-0621?
CVE-2026-0621 is a regular expression denial of service (ReDoS) vulnerability that affects URI matching in the UriTemplate class.
What versions are affected by CVE-2026-0621?
CVE-2026-0621 affects all versions of the Anthropic MCP TypeScript SDK up to and including 1.25.1.
Can CVE-2026-0621 be exploited by an unprivileged user?
Yes, CVE-2026-0621 can be exploited by an unprivileged user, potentially leading to denial of service.