Skip to content

Conversation

@pcarleton
Copy link
Member

Summary

Backport of the ReDoS fix from #1363 to the v1.x branch.

Changes

The exploded array handling regex patterns in UriTemplate were vulnerable to ReDoS (Regular Expression Denial of Service) attacks. Changed [^/]+ to [^/,]+ in the character class to prevent catastrophic backtracking when matching malicious input.

Security Impact

  • CVE: CVE-2026-0621
  • Severity: Moderate
  • Attack Vector: A malicious URI with repeated commas could cause exponential backtracking

Changes Made

  • Fixed regex pattern on line 228 (empty operator, exploded)
  • Fixed regex pattern on line 238 (path operator, exploded)
  • Added ReDoS regression tests

Testing

All existing tests pass, plus two new security regression tests that verify the fix prevents the ReDoS vulnerability.

Version

Bumped to v1.25.2 for patch release.

Fixes #965

The exploded array handling regex patterns were vulnerable to ReDoS attacks.
Changed [^/]+ to [^/,]+ in the character class to prevent catastrophic backtracking.

CVE-2026-0621
Fixes #965
@pcarleton pcarleton requested a review from a team as a code owner January 7, 2026 12:14
@changeset-bot
Copy link

changeset-bot bot commented Jan 7, 2026

⚠️ No Changeset found

Latest commit: 390df91

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 7, 2026

Open in StackBlitz

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/sdk@1365

commit: 390df91

@pcarleton
Copy link
Member Author

hmm changesets don't exist on the v1.x branch, we should probably fix that notification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants