You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(pnpr): block link-local redirects and trailing-dot metadata hosts
Addresses the review on this PR:
- The request-boundary check only validated the original registry URL, but
the metadata-fetch client follows redirects: a registry on an allowed
host could 302-redirect a server-side fetch to a link-local /
instance-metadata host and still reach IMDS. Add a reqwest redirect
policy that denies redirects whose target host is blocked (legitimate
redirects to other hosts still follow, up to the default depth).
- Move the blocked-host predicate into pacquet-network as
`is_blocked_request_host`, the single source shared by the redirect
policy and pnpr's `reject_blocked_registries` boundary check, so the two
can't drift.
- Normalize a trailing dot on a domain host so the root-zone FQDN form
`metadata.google.internal.` can't bypass the metadata-host match.
Tests cover the link-local IPv4/IPv6, IPv4-mapped, metadata-hostname, and
trailing-dot cases, plus the allowed public/private/loopback hosts.
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments