modelcontextprotocol / modelcontextprotocol/php-sdk

[Schema] SEP-2106: Harden SchemaValidator against external $ref SSRF and composition DoS

オープン
#358 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

2026-07-28 enhancement improves spec compliance Schema
主要言語
PHP
スター
1.6k
フォーク
173
平均マージ
2日 49分
マージ済み PR(30日)
23

説明

Implements the security hardening portion of SEP-2106 for the MCP Spec 2026-07-28 release.

Tracked by umbrella #337.

Spec rationale

Once $ref and rich composition land in inputSchema/outputSchema, naive validators are exposed to: SSRF via external $ref URIs, and DoS via pathological compositions / deep nesting / large subschema counts.

PHP SDK changes

  • SchemaValidator MUST NOT auto-dereference external $ref URIs (block any non-same-document reference by default).
  • Bound: schema depth, subschema count, validation time.
  • Configurable limits with sensible defaults (mirror existing session-store DoS limit ergonomics).
  • Add regression tests with adversarial schemas.

Related

  • Umbrella #337
  • Vocabulary sub-issue (introduces $ref support that this hardens)

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

SchemaValidator から開始し、意図されたリミットの使いやすさとデフォルト値を把握するために、既存の session-store の DoS リミット設定を調査します。現在の $ref 処理を確認し、その後、外部参照、深いネスト、大量のサブスキーマ数、検証時間に対する敵対的な回帰テストカバレッジを追加します。同じドキュメントを参照しない外部参照がデフォルトでブロックされ、リミットを設定可能になれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
php
領域
backend-api-design, security
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。