mirror of
https://github.com/Athou/commafeed.git
synced 2026-11-06 04:16:54 +00:00
block NAT64 local-use prefix in SSRF protection
This commit is contained in:
@@ -561,6 +561,17 @@ class HttpGetterTest {
|
||||
() -> getter.get("http://[64:ff9b::a00:1]")); // 10.0.0.1
|
||||
}
|
||||
|
||||
@Test
|
||||
void nat64LocalUse() {
|
||||
// 64:ff9b:1::/48 is reserved for local use (RFC 8215), the whole range is blocked
|
||||
Assertions.assertThrows(
|
||||
UnknownHostException.class,
|
||||
() -> getter.get("http://[64:ff9b:1::a9fe:a9fe]")); // 169.254.169.254
|
||||
Assertions.assertThrows(
|
||||
UnknownHostException.class,
|
||||
() -> getter.get("http://[64:ff9b:1:ffff::a00:1]")); // 10.0.0.1
|
||||
}
|
||||
|
||||
@Test
|
||||
void sixToFour() {
|
||||
// 2002::/16 embeds the IPv4 address in bits 16-47 (RFC 3056)
|
||||
|
||||
Reference in New Issue
Block a user