Commit 2295b1c
committed
fix: block SSRF via IPv6 addresses embedding a non-global IPv4
load_web_page vets resolved addresses with `not address.is_global`, but
`is_global` on an IPv6 address does not reflect the embedded IPv4 target
for NAT64 (`64:ff9b::/96`) and IPv4-compatible (`::a.b.c.d`) addresses.
On a network with NAT64 (e.g. IPv6-only / DNS64 clusters), a URL like
`http://[64:ff9b::169.254.169.254]/` is treated as global and reaches the
internal 169.254.169.254 metadata endpoint. Extract the embedded IPv4 and
reject it when it is not globally routable.1 parent ab839d5 commit 2295b1c
1 file changed
Lines changed: 35 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
161 | 190 | | |
162 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
163 | 197 | | |
164 | 198 | | |
165 | 199 | | |
| |||
0 commit comments