Migrate rmcp 0.8 → 2.1: fix MCP DNS rebinding (RUSTSEC-2026-0189)#29
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves the last cargo-audit finding, unblocking the weekly image publish.
What changed
Content→ContentBlock, andServerInfo/Implementationare non-exhaustive now, soget_info()builds them via constructors.Hostheader 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.Verification
cargo audit: clean (only informational warnings remain)Host: <allowed LAN host>with--mcp-allowed-hosts→ 200Host(rebinding vector) → 403Closes #8. Closes #7 (with #9 already merged, the weekly build's security gates should now pass end to end).
🤖 Generated with Claude Code