Commit 84cc15a
committed
fix(proxy): unwrap SIIT IPv4-translated IPv6 addresses in SSRF guard
A code-review pass surfaced a residual smuggling vector in the same
fixed-offset embedded-IPv4 class the guard already covers: the deprecated
SIIT IPv4-translated form ::ffff:0:0/96 (RFC 2765). Its 0xffff marker sits
in bytes [8:10] (not [10:12] like the IPv4-mapped form), so net.IP.To4
does not surface it and embeddedIPv4 did not unwrap it — leaving e.g.
::ffff:0:7f00:1 (127.0.0.1) and ::ffff:0:a9fe:a9fe (169.254.169.254)
reachable past isBlockedIP.
Extend embeddedIPv4 to unwrap the trailing 32 bits of ::ffff:0:0/96 and
apply the IPv4 blocklist, consistent with the existing NAT64 well-known
prefix, ISATAP, and IPv4-compatible handling. Add coverage to
Test_Security_IsBlockedIP for private/metadata (blocked) and public
(allowed) translated literals.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KBSS2Bm2KRAZmL2A5XfDhu1 parent 0435012 commit 84cc15a
2 files changed
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
682 | 682 | | |
683 | 683 | | |
684 | 684 | | |
| 685 | + | |
| 686 | + | |
685 | 687 | | |
686 | 688 | | |
687 | 689 | | |
688 | 690 | | |
689 | 691 | | |
690 | | - | |
691 | | - | |
| 692 | + | |
| 693 | + | |
692 | 694 | | |
693 | 695 | | |
694 | 696 | | |
| |||
706 | 708 | | |
707 | 709 | | |
708 | 710 | | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
709 | 720 | | |
710 | 721 | | |
711 | 722 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| |||
0 commit comments