Repository navigation
Commit 1134d60
fix(core): classify NAT64 addresses by the longest matching prefix
embedded_ipv4 returned the first registered prefix that contained the
address. With a configured 2001:db8::/32 and a later-discovered
2001:db8:8c52:7003::/96, 2001:db8:8c52:7003::7f00:1 was read through the
/32 as 140.82.112.3 and passed the SSRF checks, while the /96 route
translates it to 127.0.0.1.
Pick the longest matching prefix, the well-known prefix included, the
same way the route that carries the packet does. The tests register the
broad prefix first and check loopback, metadata and private destinations
under the nested one. They use RFC 9637 documentation space because the
registry is process-wide and a 2001:db8::/32 would change how other
tests classify their 2001:db8 addresses.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Joffref <[email protected]>1 parent f7f1f99 commit 1134d60
2 files changed
Lines changed: 53 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
859 | 859 | | |
860 | 860 | | |
861 | 861 | | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
862 | 885 | | |
863 | 886 | | |
864 | 887 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
163 | 168 | | |
164 | 169 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
| 170 | + | |
169 | 171 | | |
170 | | - | |
171 | | - | |
172 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
173 | 178 | | |
174 | 179 | | |
175 | 180 | | |
| |||
262 | 267 | | |
263 | 268 | | |
264 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
265 | 288 | | |
0 commit comments