Commit 93fcc92
committed
feature #65390 [HttpFoundation] Expand PRIVATE_SUBNETS with five not-globally-reachable ranges (Synchro)
This PR was merged into the 8.2 branch.
Discussion
----------
[HttpFoundation] Expand PRIVATE_SUBNETS with five not-globally-reachable ranges
| Q | A
| ------------- | ---
| Branch? | 8.2
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Issues | -
| License | MIT
Split out of #65118, authored by `@Synchro`. That PR bundled this with a new `IpUtils::normalize()` method; this is the half we agreed on.
Adds five ranges that IANA marks as not globally reachable:
| range | |
| --- | --- |
| `192.0.0.0/24` | IETF Protocol Assignments (RFC 6890) |
| `192.88.99.0/24` | 6to4 Relay Anycast (RFC 7526, deprecated) |
| `224.0.0.0/4` | IPv4 multicast (RFC 5771) |
| `100::/64` | Discard prefix (RFC 6666) |
| `ff00::/8` | IPv6 multicast (RFC 4291) |
8.2 rather than a maintenance branch: none of these is an exploitable gap in `NoPrivateNetworkHttpClient`, since multicast and `100::/64` have no TCP semantics, `192.88.99.0/24` is a deprecated public relay and `192.0.0.0/24` needs ISP adjacency. Widening the constant also widens `trusted_proxies: private_ranges`, which is not a patch-branch change.
One deliberate trade: `192.0.0.9` and `192.0.0.10`, the PCP and TURN anycast addresses, are marked globally reachable by IANA, so the `/24` over-blocks them. The alternative is `192.0.0.0/29`, which covers the assignments that matter and leaves those two reachable. I went with the `/24` because it matches the registry entry, but it is worth a second opinion.
Not included from #65118: `IpUtils::normalize()`. `NoPrivateNetworkHttpClient` already resolves obfuscated literals through `gethostbynamel()`, the same resolver that dials, so a second parser in front of it would add a divergence rather than close a hole.
Commits
-------
84aa1cb [HttpFoundation] Expand PRIVATE_SUBNETS with five not-globally-reachable ranges3 files changed
+17Lines changed: 17 additions & 0 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- src/Symfony/Component/HttpFoundation
- Tests
Expand file treeCollapse file tree
Open diff view settings
Collapse file
src/Symfony/Component/HttpFoundation/CHANGELOG.md
Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/CHANGELOG.md+1Lines changed: 1 addition & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
4 | 4 | |
5 | 5 | |
6 | 6 | |
| 7 | + |
7 | 8 | |
8 | 9 | |
9 | 10 | |
|
Collapse file
src/Symfony/Component/HttpFoundation/IpUtils.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/IpUtils.php+5Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
22 | 22 | |
23 | 23 | |
24 | 24 | |
| 25 | + |
25 | 26 | |
26 | 27 | |
27 | 28 | |
28 | 29 | |
29 | 30 | |
| 31 | + |
30 | 32 | |
31 | 33 | |
32 | 34 | |
33 | 35 | |
| 36 | + |
34 | 37 | |
35 | 38 | |
36 | 39 | |
37 | 40 | |
38 | 41 | |
39 | 42 | |
| 43 | + |
40 | 44 | |
41 | 45 | |
42 | 46 | |
43 | 47 | |
44 | 48 | |
45 | 49 | |
| 50 | + |
46 | 51 | |
47 | 52 | |
48 | 53 | |
|
Collapse file
src/Symfony/Component/HttpFoundation/Tests/IpUtilsTest.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/IpUtilsTest.php+11Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
259 | 259 | |
260 | 260 | |
261 | 261 | |
| 262 | + |
| 263 | + |
| 264 | + |
| 265 | + |
| 266 | + |
| 267 | + |
| 268 | + |
| 269 | + |
| 270 | + |
| 271 | + |
262 | 272 | |
263 | 273 | |
| 274 | + |
264 | 275 | |
265 | 276 | |
266 | 277 | |
|
0 commit comments