You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MCP schema validator's additionalProperties check misses the omitted-key and empty-object equivalents of unbounded #2553
PR #2551's `validate_tool_schema`/`check_schema_depth` (`packages/cli/src/commands/mcp.rs`) enforces ADR-038's "no unbounded `additionalProperties`" requirement, but only rejects the explicit `additionalProperties: true` case.
Per the JSON Schema spec, an omitted `additionalProperties` key defaults to `true` (unbounded), and `additionalProperties: {}` (an unconstrained schema) is equally unbounded — neither is currently caught.
The schema currently validated is hardcoded (the single passthrough tool's own fixed schema), not externally supplied, so this gap isn't exploitable today. Flagged during adversarial review as worth closing before this validator is ever pointed at a genuinely external/registry-generated schema.
Acceptance criteria
`check_schema_depth` (or wherever the `additionalProperties` check lives) treats an omitted `additionalProperties` key and `additionalProperties: {}` as unbounded, same as `additionalProperties: true`
Tests covering both the omitted-key and empty-object cases (currently only `additionalProperties: true` is tested)
Tests pass (`bun run test:all`), code passes `bun run quality:fix`
check_schema_depth now treats an omitted additionalProperties key and additionalProperties: {} as unbounded, same as the explicit true case, on any schema fragment that describes a JSON object ("type": "object" or a properties map).
The real passthrough tool schema now carries an explicit additionalProperties: false (it previously relied on the omitted-key loophole this closes). Added 4 new tests covering the omitted-key and empty-object cases at both the top level and nested inside properties; all mutation-tested individually. Full bun run test:all is green.
Activity
mstomar125 commentedon Sep 10, 2026
Fixed in PR #2557.
check_schema_depthnow treats an omittedadditionalPropertieskey andadditionalProperties: {}as unbounded, same as the explicittruecase, on any schema fragment that describes a JSON object ("type": "object"or apropertiesmap).The real passthrough tool schema now carries an explicit
additionalProperties: false(it previously relied on the omitted-key loophole this closes). Added 4 new tests covering the omitted-key and empty-object cases at both the top level and nested insideproperties; all mutation-tested individually. Fullbun run test:allis green.