registry/internal/api/handlers/v0
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Radoslav Dimitrov f5f40bd980
fix(auth/http): extend SSRF blocklist to IPv6 6to4/NAT64/site-local prefixes (#1250)
The HTTP namespace-verification fetcher's `isBlockedIP` composed its
blocklist from Go stdlib's `Is*` helpers plus a manual CGNAT range. That
covers IPv4 cloud metadata, RFC1918, ULA, and link-local — but Go's
classification helpers don't recognise IPv6 prefix families that embed
or tunnel to arbitrary IPv4:

  - 2002::/16       RFC 3056 6to4 — bits 16-47 are an arbitrary IPv4
  - 64:ff9b::/96    RFC 6052 NAT64 well-known — low 32 bits are IPv4
  - 64:ff9b:1::/48  RFC 8215 NAT64 local-use — same IPv4-embedding shape
  - fec0::/10       RFC 3879 site-local (deprecated, still routed by
                    some stacks)

On hosts with 6to4 routing or a NAT64 next-hop (the default on
IPv6-only GKE node pools, AWS IPv6-only EC2, Azure IPv6 VMs with
NAT64, and many corporate DNS64/NAT64 networks), an attacker who
controls DNS for a publisher domain can cause the registry to dial
`169.254.169.254`, `10.0.0.0/8`, etc. via the IPv6 wrapper. Same
SSRF class as GHSA-56c3-vfp2-5qqj on n8n-mcp.

Define the four prefixes via a new `mustCIDR` helper (panic on
malformed CIDR at init so a typo can't fail-open silently) and iterate
them in `isBlockedIP` after the stdlib gates. Refactor the existing
CGNAT IIFE to use the same helper for consistency. IPv4-mapped IPv6
(::ffff:0:0/96) needs no special-casing: Go's `Is*` helpers honour the
`To4()` fast-path, so e.g. `::ffff:10.0.0.1` is already classified as
`IsPrivate`.

Adds 17 test cases to `TestIsBlockedIP` covering each new prefix
family, IPv4-mapped IPv6 sanity checks, and just-outside-the-range
positive controls (`2001::1`, `2003::1`, `64:ff9c::1`).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 09:41:23 -04:00
..
auth fix(auth/http): extend SSRF blocklist to IPv6 6to4/NAT64/site-local prefixes (#1250) 2026-05-04 09:41:23 -04:00
edit.go security: fix open redirect and add small hardening (#1227) 2026-04-29 19:14:00 -04:00
edit_test.go Publisher-managed "deleted" support (#893) 2026-02-27 09:00:07 -08:00
health.go Replace / with - for operation IDs (#660) 2025-10-14 15:26:43 +03:00
health_test.go Introduce v0.1 version of the API (#658) 2025-10-14 11:04:48 +03:00
ping.go Replace / with - for operation IDs (#660) 2025-10-14 15:26:43 +03:00
ping_test.go Introduce v0.1 version of the API (#658) 2025-10-14 11:04:48 +03:00
publish.go Added /validate endpoint and modified mcp-publish so that all validation happens there (#896) 2026-02-04 15:52:07 +02:00
publish_integration_test.go Make Repository field properly optional in server.json (#717) 2025-10-29 13:23:47 +00:00
publish_registry_validation_test.go Introduce v0.1 version of the API (#658) 2025-10-14 11:04:48 +03:00
publish_test.go Added /validate endpoint and modified mcp-publish so that all validation happens there (#896) 2026-02-04 15:52:07 +02:00
response.go auth: New auth flow (#273) 2025-08-15 13:03:35 +01:00
servers.go security: fix open redirect and add small hardening (#1227) 2026-04-29 19:14:00 -04:00
servers_test.go Publisher-managed "deleted" support (#893) 2026-02-27 09:00:07 -08:00
status.go security: fix open redirect and add small hardening (#1227) 2026-04-29 19:14:00 -04:00
status_test.go Publisher-managed "deleted" support (#893) 2026-02-27 09:00:07 -08:00
telemetry_test.go Make Repository field properly optional in server.json (#717) 2025-10-29 13:23:47 +00:00
ui.go Add simple web UI for browsing the registry (#757) 2025-11-10 12:37:36 +00:00
ui_index.html fix(ui): encode publisher-controlled URLs for href attribute context (#1248) 2026-05-04 09:25:41 -04:00
validate.go Added /validate endpoint and modified mcp-publish so that all validation happens there (#896) 2026-02-04 15:52:07 +02:00
validate_test.go Added /validate endpoint and modified mcp-publish so that all validation happens there (#896) 2026-02-04 15:52:07 +02:00
version.go Introduce a /version API (#667) 2025-10-15 17:24:46 +03:00
version_test.go Introduce a /version API (#667) 2025-10-15 17:24:46 +03:00