Repository navigation
fix(mcp)!: require absolute local paths for pcap capture and debugger sessions - #11508
Conversation
… sessions The MCP server's working directory is not the caller's, so sibling local file contracts refuse a relative path. inspect_pcap_capture (path), start_rizin_debug_session (path, inferior_tty) and start_gdb_session (inferior_tty) admitted one and resolved it against the server's directory. They now use absoluteLocalPathStringSchema. The inspect-pcap-capture CLI command declares path as a caller path, so a relative CLI argument is still resolved against the caller's working directory before the contract sees it. debug-with-rizin and debug-with-gdb call their managers directly and are unchanged. BREAKING CHANGE: MCP calls to inspect_pcap_capture, start_rizin_debug_session and start_gdb_session with a relative path or inferior_tty are refused with invalid_request. Pass absolute paths. Fixes #11079
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
[Medium impact] The reviewed changes appear safe to merge and already match a landed commit in the available main-branch history. SummaryRequires absolute local paths for the four selected MCP fields while keeping relative paths available through the CLI.
Reviews (7) · Last reviewed commit: "test(pcap): expect the absolute-path for..." · Reviewed by Greptile |
…lute requirement The CLI resolves a relative capture path, so its help keeps the caller-path description instead of inheriting the contract's absolute wording.
|
@greptileai review — ae00cff updates the pcap service test to expect the absolute-path format issue beside the empty-path bound (the gate's only failure). |
Summary
Fixes #11079.
inspect_pcap_capture(path),start_rizin_debug_session(path,inferior_tty) andstart_gdb_session(inferior_tty) now refuse a relative path over MCP, like the sibling local-file contracts. The CLI keeps accepting relative paths.Problem and expected behavior
These contracts used
localPathStringSchema, which admits a relative path. The MCP server's working directory is not the caller's, so a relative path resolved against the wrong directory, while sibling tools (inspect_packet_capture,extract_firmware, ...) refuse it withinvalid_request.Change and scope
absoluteLocalPathStringSchema(the advertised pattern already exists in the catalog;verify:advertised-schemaspasses).inspect-pcap-capturedeclarespathas a CLI caller path with a CLI-only description (no "absolute" wording), so the CLI resolves a relative argument against its own working directory before the contract sees it and records the caller's spelling. The hand-writtencallerInputsoverride it replaces is removed.debug-with-rizinanddebug-with-gdbcall their managers directly, which already resolve and record launch provenance, so CLI behavior is unchanged.start_gdb_session.inferior_ttyhas the same meaning as Rizin'sinferior_ttyand is included. The Frida scriptpathhas the same problem but also needs a Frida CLI change, andprogrammay name a path on a remote device; tracked in Frida script file contracts admit relative paths over MCP #11506.inspect_plist.pathselects a member inside an open session and stays relative.Scope decision: not applicable, contract alignment within existing boundaries; breaking for MCP callers that relied on relative paths.
Contract and boundary impact
src/domain/pcap/pcapAnalysis.ts,src/contracts/rizinDebugToolContracts.ts,src/contracts/gdbToolContracts.ts(MCP admission);src/cli/pcapCommands.ts(CLI caller-path resolution).Evidence and regression coverage
tests/acceptance/tools/localToolContracts.test.tsrefuses a relative path for each changed field through the real advertised MCP contract (and keeps the existingextract_firmwarecase);tests/boundary/cli/pcapCli.test.tsadds a relativeinspect-pcap-captureargument that reaches tool configuration. MCP tests that passed relative fixture paths now pass absolute ones; the Rizin provenance test uses/tmp/./relative/../rizin-fixture.binso resolution still changes the spelling.main, the four new MCP cases fail (relative paths admitted); without the CLI caller-path declaration, the CLI pcap cases fail.Validation performed
npm run test:focused -- tests/acceptance/tools/localToolContracts.test.ts: 11 passed; with the source change reverted, 4 failed.npm run test:focused -- tests/boundary/cli/pcapCli.test.ts: 4 passed; withoutcallerPaths, 2 failed.npm run test:focused -- tests/boundary/cli/cliContractCommandParity.test.ts tests/boundary/cli/pcapCli.test.ts: 1045 passed; without the CLI help override forpath, the parity test fails 1 case.npm run test:focused --8 MCP files (debugger host availability, Rizin cancellation/output/pending/stopped, GDB cancellation, pcap MCP, analysis view): 95 passed.npm run verify:advertised-schemas: passed.Compatibility, safety, and release
inspect_pcap_capture {"path":"capture.pcap"}orstart_gdb_session {"inferior_tty":"pts/7"}was admitted and resolved against the server's working directory; it is now refused withinvalid_requestnaming the field. Pass an absolute path. Keeping the old behavior would keep resolving against a directory the caller does not control.Author readiness
Human owner:
Before merge
type(scope): outcome.