Skip to content

fix(mcp)!: require absolute local paths for pcap capture and debugger sessions - #11508

Merged
morluto merged 6 commits into
mainfrom
fix/mcp-absolute-pcap-rizin-paths
Nov 16, 2026
Merged

morluto merged 6 commits into
mainfrom
fix/mcp-absolute-pcap-rizin-paths

Conversation

@morluto

@morluto morluto commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes #11079. inspect_pcap_capture (path), start_rizin_debug_session (path, inferior_tty) and start_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 with invalid_request.

Change and scope

  • The four fields use absoluteLocalPathStringSchema (the advertised pattern already exists in the catalog; verify:advertised-schemas passes).
  • inspect-pcap-capture declares path as 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-written callerInputs override it replaces is removed.
  • debug-with-rizin and debug-with-gdb call their managers directly, which already resolve and record launch provenance, so CLI behavior is unchanged.
  • Sibling sweep: start_gdb_session.inferior_tty has the same meaning as Rizin's inferior_tty and is included. The Frida script path has the same problem but also needs a Frida CLI change, and program may name a path on a remote device; tracked in Frida script file contracts admit relative paths over MCP #11506. inspect_plist.path selects 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

  • Semantic owner and earliest changed stage: src/domain/pcap/pcapAnalysis.ts, src/contracts/rizinDebugToolContracts.ts, src/contracts/gdbToolContracts.ts (MCP admission); src/cli/pcapCommands.ts (CLI caller-path resolution).
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: the advertised input schemas gain the absolute-path pattern for these fields. CLI unchanged for callers.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: Rizin launch provenance still records the caller's spelling and the resolved path.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): a relative MCP path is refused before any process starts.
  • Generated metadata, package, or installation impact: the generated product catalog picks up the pattern.

Evidence and regression coverage

  • Tests added or updated: tests/acceptance/tools/localToolContracts.test.ts refuses a relative path for each changed field through the real advertised MCP contract (and keeps the existing extract_firmware case); tests/boundary/cli/pcapCli.test.ts adds a relative inspect-pcap-capture argument that reaches tool configuration. MCP tests that passed relative fixture paths now pass absolute ones; the Rizin provenance test uses /tmp/./relative/../rizin-fixture.bin so resolution still changes the spelling.
  • Base reproduction or other evidence: on main, the four new MCP cases fail (relative paths admitted); without the CLI caller-path declaration, the CLI pcap cases fail.
  • Remaining proof gaps: Rizin/GDB start paths only run on Linux; locally (macOS) the Linux-only cases were skipped.

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; without callerPaths, 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 for path, 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.
  • Pre-push hook (typecheck, lint, architecture guards): passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: an MCP call such as inspect_pcap_capture {"path":"capture.pcap"} or start_gdb_session {"inferior_tty":"pts/7"} was admitted and resolved against the server's working directory; it is now refused with invalid_request naming the field. Pass an absolute path. Keeping the old behavior would keep resolving against a directory the caller does not control.
  • Real Hopper/Ghidra, browser, or OS coverage: macOS only locally.
  • Package or release metadata impact: release note added to the draft.
  • Security, privacy, process, or containment review: removes an implicit dependency on the server's working directory.

Author readiness

Human owner:

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

… 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
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-15T21:12:35.212742Z
We couldn’t complete this review. Comment @codex review to try again.
208df27 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The reviewed changes appear safe to merge and already match a landed commit in the available main-branch history.

Summary

Requires absolute local paths for the four selected MCP fields while keeping relative paths available through the CLI.

  • MCP capture and debugger tools require absolute local paths.

Reviews (7) · Last reviewed commit: "test(pcap): expect the absolute-path for..." · Reviewed by Greptile

Comment thread src/cli/pcapCommands.ts Resolved
…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.
@morluto
morluto merged commit 2234a7d into main Nov 16, 2026
7 checks passed
@morluto

morluto commented Nov 16, 2026

Copy link
Copy Markdown
Owner Author

@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).

@morluto
morluto deleted the fix/mcp-absolute-pcap-rizin-paths branch November 16, 2026 01:48
@morluto morluto added area: mcp MCP server, transport, and tool registration bug Something isn't working provider: pcap Analysis provider / engine: pcap labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: mcp MCP server, transport, and tool registration bug Something isn't working provider: pcap Analysis provider / engine: pcap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] inspect_pcap_capture and start_rizin_debug_session MCP contracts admit relative paths unlike sibling file tools

1 participant