fix(http): validate incoming Host/Origin and outbound fetch targets - #30
fix(http): validate incoming Host/Origin and outbound fetch targets#30reneaaron wants to merge 1 commit into
Conversation
HTTP mode exposed /mcp and /sse with no Host/Origin validation, and fetch_l402 fetched any caller-supplied URL. Combined, a malicious web page could DNS-rebind to a victim's local MCP listener and read private HTTP resources via fetch_l402 (SSRF). - Add hostOriginGuard middleware validating Host/Origin on all HTTP endpoints (loopback-only by default; ALLOWED_HOSTS/ALLOWED_ORIGINS to extend). - Add assertPublicUrl SSRF guard to fetch_l402 that blocks loopback, link-local (incl. cloud metadata), RFC1918 and IPv6 local ranges; ALLOWED_FETCH_HOSTS opt-in for local development. - Set ALLOWED_HOSTS on the Fly deployment so mcp.getalby.com keeps working. Reported by Avishai Gonen (Pluto Security).
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
How is this exploitable in practice? the normal flow is that your agent can access a few alby MCP tools to communicate with your wallet. |
Superseded by #33, which contains the same change on a branch off current
master.