mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-08-10 17:46:15 +00:00
The net.IP predicates every SSRF guard is built from read only the literal address bytes, so an IPv6 transition address smuggles an internal IPv4 destination past all of them. 64:ff9b::a9fe:a9fe reaches 169.254.169.254 while IsLoopback, IsPrivate, IsLinkLocalUnicast and To4 all report an ordinary public address, defeating both the webhook URL validator and the restricted outbound transport with the same input. Add securityutil.EmbeddedIPv4Candidates, which unwraps NAT64 (RFC 6052 well-known and RFC 8215 local-use prefixes), 6to4, Teredo, ISATAP, IPv4-compatible and IPv4-translated encodings, and run every candidate through the caller's own policy in both layers. The embedded destination inherits the outer policy rather than a stricter one, so a NAT64 address wrapping a permitted public target stays permitted and AllowPrivateIPs / AllowLoopback relax the embedded check the same way they relax the outer. Reported by tonghuaroot. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| embedded_ipv4.go | ||
| embedded_ipv4_test.go | ||
| httpurl.go | ||
| httpurl_branchcov0724pm_test.go | ||
| httpurl_test.go | ||
| outbound_branchcov0724pm_test.go | ||
| outbound_http.go | ||
| outbound_http_branchcov0718_test.go | ||
| outbound_http_test.go | ||
| pkg_securityutil_httpurl_branchcov0716_test.go | ||
| securityutil_websocket_origin_branchcov0716_test.go | ||
| websocket_origin.go | ||