Migrated from nfvelten/arbitus#124
Summary
JSON Schema allows $ref to reference other schema definitions. If an upstream MCP server returns a schema with a circular $ref (A → B → A), the schema validation middleware could loop infinitely while resolving the reference chain.
Location
src/middleware/schema_validation.rs
Fix
Track visited $ref paths during schema resolution. Return an error (and block the request) if a cycle is detected.
References
Migrated from nfvelten/arbitus#124
Summary
JSON Schema allows
$refto reference other schema definitions. If an upstream MCP server returns a schema with a circular$ref(A → B → A), the schema validation middleware could loop infinitely while resolving the reference chain.Location
src/middleware/schema_validation.rsFix
Track visited
$refpaths during schema resolution. Return an error (and block the request) if a cycle is detected.References