[PR #975] [MERGED] fix(mcp): reject unknown MCP tool inputs #2546

Closed
opened 2026-10-17 21:07:25 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/975
Author: @morluto
Created: 10/7/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @morluto

Base: main ← Head: codex/audit-wave3-schema


📝 Commits (9)

  • 7fa16db fix(mcp): reject unknown official tool inputs
  • 6c9ddf2 Merge remote-tracking branch 'origin/main' into codex/audit-wave3-schema
  • 28bfa03 fix(mcp): reject unknown native tool inputs
  • a1257fa Merge remote-tracking branch 'origin/main' into codex/native-strict-inputs
  • 80ddd0e test(mcp): follow native contract module move
  • 3fd4eb7 fix(mcp): reject unknown remaining tool inputs
  • 8a66637 Merge remote-tracking branch 'origin/main' into codex/native-strict-inputs
  • 2d6de66 fix(mcp): satisfy strict unknown and browser input schemas
  • f155207 Merge remote-tracking branch 'origin/main' into codex/audit-wave3-schema

📊 Changes

18 files changed (+267 additions, -25 deletions)

View changed files

📝 src/application/investigation/EvidenceLedger.residualUnknown.test.ts (+0 -2)
📝 src/application/investigation/EvidenceLedger.test.ts (+0 -2)
📝 src/application/investigation/InvestigationRecords.test.ts (+10 -1)
📝 src/contracts/managed/managedToolContracts.ts (+1 -1)
📝 src/contracts/native/nativeToolContracts.ts (+3 -2)
📝 src/contracts/officialToolContracts.ts (+7 -5)
📝 src/contracts/sessionLifecycleInputs.ts (+2 -2)
📝 src/contracts/sessionStatusContract.ts (+1 -1)
📝 src/domain/browserObservation.ts (+1 -1)
📝 src/domain/callPathSchemas.ts (+1 -1)
📝 src/domain/changedBehavior.ts (+1 -1)
📝 src/domain/evidenceBundle.test.ts (+0 -2)
📝 src/domain/residualUnknown.ts (+3 -2)
📝 tests/boundary/browser/cdpBrowserProvider.discovery_authorization.test.ts (+5 -2)
📝 tests/boundary/mcp/managedMcp.test.ts (+31 -0)
➕ tests/boundary/mcp/nativeInputContracts.test.ts (+119 -0)
📝 tests/boundary/mcp/officialTools.test.ts (+48 -0)
📝 tests/boundary/mcp/toolSchemaValidity.test.ts (+34 -0)

📄 Description

What changes

MCP input objects silently accepted unknown top-level keys in several contract families; Zod stripped the keys, allowing a typo to turn into an omitted argument or a fallback to the previously selected managed target. The actual regression was inspect_managed_members receiving { pth: otherPath } after another managed artifact had been selected, then inspecting that selected artifact. The corrected boundary now rejects unknown root keys before dispatch while preserving intentional omitted-argument behavior and nested record fields.

This closes the 59 affected canonical contracts: 41 official, 7 native, 3 managed, 1 browser target discovery, 3 session lifecycle/status, and 4 investigation workflows. The generated MCP catalog was regenerated from the canonical contracts.

Validation

  • 11 focused test files, 49 tests passed across official/native/managed/browser/session/workflow boundaries and relevant domain schemas.
  • npm run build:cached, npm run check:fast, npm run format:check, and npm run docs:check passed.
  • Actual MCP SDK conversion audit covered all 133 contracts: Draft 2020-12 input/output schema validity passed; all catalog examples were accepted; no unexpected top-level key passed the paired Zod and advertised-schema checks. Nested record inputs remain supported.
  • No live Hopper, Ghidra, or IDA provider verification was performed.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/975 **Author:** [@morluto](https://github.com/morluto) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `codex/audit-wave3-schema` --- ### 📝 Commits (9) - [`7fa16db`](https://github.com/morluto/rea/commit/7fa16dba52d19329a0ee8c97e324561c157de2c9) fix(mcp): reject unknown official tool inputs - [`6c9ddf2`](https://github.com/morluto/rea/commit/6c9ddf2e733fa345815a3fab37963e6476c061ad) Merge remote-tracking branch 'origin/main' into codex/audit-wave3-schema - [`28bfa03`](https://github.com/morluto/rea/commit/28bfa030de11ae71cd44986562bfc5aa07d52cbd) fix(mcp): reject unknown native tool inputs - [`a1257fa`](https://github.com/morluto/rea/commit/a1257fa290d20f274d477e63afcd1c7821922163) Merge remote-tracking branch 'origin/main' into codex/native-strict-inputs - [`80ddd0e`](https://github.com/morluto/rea/commit/80ddd0ed9d2f6273c7c033b96473a5b147c1e2c6) test(mcp): follow native contract module move - [`3fd4eb7`](https://github.com/morluto/rea/commit/3fd4eb7442faa7fd6ef47fd8482a8e785d5808c9) fix(mcp): reject unknown remaining tool inputs - [`8a66637`](https://github.com/morluto/rea/commit/8a66637860f8a0250c8b142cac7b1d5b22a24cd3) Merge remote-tracking branch 'origin/main' into codex/native-strict-inputs - [`2d6de66`](https://github.com/morluto/rea/commit/2d6de6657720b17270725a3e807bc8c7cbcff29a) fix(mcp): satisfy strict unknown and browser input schemas - [`f155207`](https://github.com/morluto/rea/commit/f155207d971249a3e25314fac3e67fbea3936cd7) Merge remote-tracking branch 'origin/main' into codex/audit-wave3-schema ### 📊 Changes **18 files changed** (+267 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `src/application/investigation/EvidenceLedger.residualUnknown.test.ts` (+0 -2) 📝 `src/application/investigation/EvidenceLedger.test.ts` (+0 -2) 📝 `src/application/investigation/InvestigationRecords.test.ts` (+10 -1) 📝 `src/contracts/managed/managedToolContracts.ts` (+1 -1) 📝 `src/contracts/native/nativeToolContracts.ts` (+3 -2) 📝 `src/contracts/officialToolContracts.ts` (+7 -5) 📝 `src/contracts/sessionLifecycleInputs.ts` (+2 -2) 📝 `src/contracts/sessionStatusContract.ts` (+1 -1) 📝 `src/domain/browserObservation.ts` (+1 -1) 📝 `src/domain/callPathSchemas.ts` (+1 -1) 📝 `src/domain/changedBehavior.ts` (+1 -1) 📝 `src/domain/evidenceBundle.test.ts` (+0 -2) 📝 `src/domain/residualUnknown.ts` (+3 -2) 📝 `tests/boundary/browser/cdpBrowserProvider.discovery_authorization.test.ts` (+5 -2) 📝 `tests/boundary/mcp/managedMcp.test.ts` (+31 -0) ➕ `tests/boundary/mcp/nativeInputContracts.test.ts` (+119 -0) 📝 `tests/boundary/mcp/officialTools.test.ts` (+48 -0) 📝 `tests/boundary/mcp/toolSchemaValidity.test.ts` (+34 -0) </details> ### 📄 Description ## What changes MCP input objects silently accepted unknown top-level keys in several contract families; Zod stripped the keys, allowing a typo to turn into an omitted argument or a fallback to the previously selected managed target. The actual regression was `inspect_managed_members` receiving `{ pth: otherPath }` after another managed artifact had been selected, then inspecting that selected artifact. The corrected boundary now rejects unknown root keys before dispatch while preserving intentional omitted-argument behavior and nested record fields. This closes the 59 affected canonical contracts: 41 official, 7 native, 3 managed, 1 browser target discovery, 3 session lifecycle/status, and 4 investigation workflows. The generated MCP catalog was regenerated from the canonical contracts. ## Validation - 11 focused test files, 49 tests passed across official/native/managed/browser/session/workflow boundaries and relevant domain schemas. - `npm run build:cached`, `npm run check:fast`, `npm run format:check`, and `npm run docs:check` passed. - Actual MCP SDK conversion audit covered all 133 contracts: Draft 2020-12 input/output schema validity passed; all catalog examples were accepted; no unexpected top-level key passed the paired Zod and advertised-schema checks. Nested record inputs remain supported. - No live Hopper, Ghidra, or IDA provider verification was performed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:07:25 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2546
No description provided.