Commit 7332b5b
committed
fix(net): Dns rejects the unspecified addresses (#2043, SR-AUD-304 wildcard half)
Dns::GetHostAddresses("0.0.0.0") returned the wildcard address.
This ticket was split out of #2039 precisely because it is the one half of the
finding that REMOVES A WORKING, MEANINGFUL RESULT, so it needed evidence rather
than judgement. The reference supplies it at three separate sites: Dns.cs:686-690
on the string path, and :46-50 / :158-162 on the IPAddress overloads, all
raising ArgumentException(SR.net_invalid_ip_addr) for IPAddress.Any or
IPAddress.IPv6Any.
.NET's message says why, and is transcribed rather than paraphrased: these are
unspecified addresses. They name every local interface to bind, and nothing at
all to connect -- so resolving one to itself hands a caller a target it cannot
use.
The rejection runs BEFORE the address-family check, matching the reference's own
ordering. GetHostAddresses("0.0.0.0", InterNetworkV6) is therefore an
ArgumentException, not a SocketException about the family, and a mutation that
moves the check after the family test is caught.
Only the two unspecified addresses moved. 127.0.0.1, ::1 and 8.8.8.8 still
resolve, and so does 0.0.0.1 -- the last of these asserting that the check is an
equality rather than a "starts with zero" test, which is the obvious way to get
this wrong.
+1 net test. Three mutations, all caught. Gate: 17,270 run, 0 failed, 38
executables -- green. Downstream, measured: zero Dns sites in either consumer.
SR-AUD-304 -> remediated, both halves. Record:
docs/Migration-DnsWildcardRejection.md.1 parent 5ea4e13 commit 7332b5b
6 files changed
Lines changed: 134 additions & 15 deletions
File tree
- audit
- docs
- modules/net
- src/System/Net
- tests/System/Net
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
192 | 219 | | |
193 | 220 | | |
194 | 221 | | |
| |||
224 | 251 | | |
225 | 252 | | |
226 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
227 | 257 | | |
228 | 258 | | |
229 | 259 | | |
| |||
Lines changed: 50 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
265 | 266 | | |
266 | 267 | | |
267 | 268 | | |
268 | | - | |
269 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
270 | 276 | | |
271 | 277 | | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
276 | 315 | | |
277 | | - | |
278 | | - | |
279 | | - | |
| 316 | + | |
| 317 | + | |
280 | 318 | | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
285 | 322 | | |
Binary file not shown.
0 commit comments