Skip to content

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

Description

@chr-hertel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    2026-07-28All issues and PRs related to the spec release 2026-07-28P0Broken core functionality, security issues, critical missing featureSchemaIssues & PRs related to the Schema componentenhancementRequest for a new feature that's not currently supportedimproves spec complianceImproves consistency with other SDKs such as TyepScript

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions