Skip to content

Migrate rmcp 0.8 → 2.1: fix MCP DNS rebinding (RUSTSEC-2026-0189)#29

Merged
heskew merged 1 commit into
mainfrom
rmcp-migration
Jul 4, 2026
Merged

Migrate rmcp 0.8 → 2.1: fix MCP DNS rebinding (RUSTSEC-2026-0189)#29
heskew merged 1 commit into
mainfrom
rmcp-migration

Conversation

@heskew

@heskew heskew commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Resolves the last cargo-audit finding, unblocking the weekly image publish.

What changed

  • rmcp 0.8.5 → 2.1.0 — the 0.8→2.x API delta for our usage was small: ContentContentBlock, and ServerInfo/Implementation are non-exhaustive now, so get_info() builds them via constructors.
  • DNS rebinding protection active: rmcp ≥1.4 validates the Host header against a loopback-only allowlist by default. That would break the documented LAN flow in docs/mcp.md (curl http://pi-hostname:3001/mcp), so this adds --mcp-allowed-hosts (comma-separated) to extend the allowlist, and updates the docs.
  • Protocol version now negotiates via rmcp's default (2025-06-18 observed) instead of pinned 2025-03-26.

Verification

  • cargo audit: clean (only informational warnings remain)
  • 801 tests pass, clippy clean, fmt clean
  • Live smoke test of the MCP endpoint:
    • initialize handshake on loopback → 200, correct serverInfo
    • Host: <allowed LAN host> with --mcp-allowed-hosts → 200
    • unlisted Host (rebinding vector) → 403

Closes #8. Closes #7 (with #9 already merged, the weekly build's security gates should now pass end to end).

🤖 Generated with Claude Code

…inding).

API migration for rmcp 2.x: Content → ContentBlock, non-exhaustive model
structs built via constructors instead of literals.

rmcp now validates the Host header against a loopback-only allowlist by
default — the actual DNS-rebinding defense. New --mcp-allowed-hosts flag
extends the allowlist for the documented LAN use case (docs/mcp.md updated).

Smoke-tested live: initialize handshake OK on loopback and on an allowed
LAN host; unlisted Host rejected with 403.

cargo audit is now clean, unblocking the weekly image publish.

Closes #8
Closes #7

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@heskew
heskew merged commit daee3d7 into main Jul 4, 2026
2 checks passed
@heskew
heskew deleted the rmcp-migration branch July 4, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant