Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8276536

Browse files
[HttpClient] Block IPv6 transition forms in NoPrivateNetworkHttpClient
Extends PRIVATE_SUBNETS with IPv4-compatible (::/96), 6to4 (2002::/16), Teredo (2001::/32) and NAT64 (64:ff9b::/96, 64:ff9b:1::/48) prefixes, so that requests to e.g. http://[2002:7f00:1::]/ are blocked when they embed a private IPv4 address.
1 parent 77a770d commit 8276536

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/Symfony/Component/HttpClient/NoPrivateNetworkHttpClient.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ final class NoPrivateNetworkHttpClient implements HttpClientInterface, LoggerAwa
4646
'fe80::/10',
4747
'::ffff:0:0/96',
4848
'::/128',
49+
'::/96',
50+
'2002::/16',
51+
'2001::/32',
52+
'64:ff9b::/96',
53+
'64:ff9b:1::/48',
4954
];
5055

5156
private $defaultOptions = self::OPTIONS_DEFAULTS;

src/Symfony/Component/HttpClient/Tests/NoPrivateNetworkHttpClientTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ public static function getExcludeIpData(): array
3737
['fe80::1', null, true],
3838
['fc00::1', null, true],
3939
['fd00::1', null, true],
40+
['::7f00:1', null, true],
41+
['2002:7f00:1::', null, true],
42+
['2001::1', null, true],
43+
['64:ff9b::7f00:1', null, true],
44+
['64:ff9b:1::7f00:1', null, true],
4045
['10.0.0.1', '10.0.0.0/24', true],
4146
['10.0.0.1', '10.0.0.1', true],
4247
['fc00::1', 'fc00::1/120', true],

0 commit comments

Comments
 (0)