Repository navigation
Commit 6a924dd
authored
Cache DNS guard resolutions and harden the outbound URL guard (#1524)
* Cache DNS guard resolutions and harden the outbound URL guard
* Add changeset for the DNS guard fix
* Pin the redirect mode and the remaining guard arms in tests
* Stream request bodies through redirects instead of buffering them
Refuse a 307/308 that would replay a one-shot body rather than buffering
every upload up front. Also strip all trailing dots when canonicalizing a
hostname, so appending one does not skip the name blocklist.
* Set duplex for streamed bodies and scrub credential init fields on cross-origin hops
Every Request input normalizes to a ReadableStream body, which undici
rejects unless the init sets duplex. Rebuild the cross-origin init from an
explicit field list so referrer and credentials cannot ride past the header
safelist.
* Reject address forms the platform resolver reads differently
A dotted quad is legal only at the end of a whole address, and octets are
decimal-only: both forms otherwise decode to a public-looking leading word
while the resolver dials loopback. Also fail an empty resolver answer so the
zero failure TTL drops it instead of blackholing the hostname.
* Keep integrity across redirects, drop failed DNS entries, honor undefined init members
* Pin range boundaries in outbound guard address tests
* Honor caller redirect mode and share one DNS cache across hosted adapters
* Note redirect mode and shared cache in changeset
* Block the metadata endpoint by address, not hostname string
* Note metadata address blocking in the changeset
* Check resolved addresses in permissive mode and match fetch redirect semantics1 parent 59a6640 commit 6a924dd
5 files changed
Lines changed: 2176 additions & 173 deletions
File tree
- .changeset
- packages/core
- api/src/server
- sdk/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 46 | + | |
51 | 47 | | |
52 | 48 | | |
53 | 49 | | |
| |||
269 | 265 | | |
270 | 266 | | |
271 | 267 | | |
272 | | - | |
273 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
274 | 272 | | |
275 | 273 | | |
276 | 274 | | |
| |||
363 | 361 | | |
364 | 362 | | |
365 | 363 | | |
| 364 | + | |
366 | 365 | | |
367 | 366 | | |
368 | 367 | | |
369 | 368 | | |
370 | 369 | | |
371 | 370 | | |
372 | | - | |
373 | | - | |
| 371 | + | |
| 372 | + | |
374 | 373 | | |
375 | 374 | | |
376 | 375 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
0 commit comments