Repository navigation
Commit 272daca
fix(buzz-auth): complete SSRF policy, cancellation-safe permit, and invariant tests
Network policy (buzz-core):
- Rename is_private_ip → is_not_global_unicast; is_private_ip alias preserved for
unowned callers. Registry source: IANA IPv4/IPv6 Special-Purpose Address Space
(registries last updated 2025-10-09, retrieved 2026-08-31; URLs in source doc
comment).
- Implement the IANA deny/exception table: outer predicate denies ranges whose
registry entry is non-global or blank; explicit globally-reachable exceptions
carved out inside otherwise-denied envelopes. IPv4 embedded in IPv4-mapped,
IPv4-compatible, NAT64 well-known (64:ff9b::/96), and SIIT IPv4-translated space
is evaluated recursively against the IPv4 table — registry global=True on the
IPv6 wrapper does not bypass the embedded-address check.
- IPv4: add 192.0.0.0/24 IETF Protocol Assignments (global=False) with globally-
reachable exceptions 192.0.0.9 (PCP anycast, RFC 7723) and 192.0.0.10 (TURN
anycast, RFC 8155); add 192.88.99.0/24 deprecated 6to4 relay anycast (global=None
— conservative posture: block).
- IPv6: replace individual Teredo/benchmarking/ORCHID checks with the 2001::/23
IETF Protocol Assignments envelope (global=False). Globally-reachable exceptions
inside the /23 are allowed: 2001:1::1/2/3 (PCP/TURN/DNS-SD anycast), 2001:3::/32
(AMT), 2001:4:112::/48 (AS112-v6), 2001:20::/28 (ORCHIDv2, global=True),
2001:30::/28 (DETs, global=True). Add 100:0:0:1::/64 dummy prefix (RFC 9780),
3fff::/20 documentation (RFC 9637), 5f00::/16 SRv6 SIDs (RFC 9252).
2001:db8::/32 (outside 2001::/23) remains a separate check.
- Consumer audit: buzz-workflow (CallWebhook) and desktop link_preview use the
is_private_ip alias; the stricter predicate closes all new ranges for both callers.
Cancellation-safe refresh permit (buzz-auth):
- Per-issuer OwnedMutexGuard spans the complete fetch and state commit; cancelled
callers release the permit on drop — no manual flag to poison.
- ScriptedFetcher replaces BlockingFetcher + SequencedFetcher: a VecDeque of
FetchStep{entered, release} makes call order self-documenting without comments.
- concurrent_refresh_coalesces_without_second_fetch: entered barrier proves permit
ownership before the second call; assert call_count == 1.
- aborted_first_caller_releases_permit_for_next_caller: pending_step returns the
release sender, which is held until after abort — task is genuinely blocked (not
resolved via error path) when cancelled. assert call_count == 2.
Central invariant regressions (buzz-auth):
- expired_snapshot_never_served_after_hard_deadline: hard-deadline expiry closes
both the async and synchronous snapshot paths.
- two_issuer_keys_and_generations_are_isolated: advancing A's document advances
A's generation only; B's key binding and generation are unchanged.
Architecture docs (ARCHITECTURE.md):
- Update is_private_ip function-table entry to is_not_global_unicast with compat alias.
- Rewrite SSRF Protection section: deny/exception-table framing, embedded-IPv4
recursive evaluation, all three audited callers.
Co-authored-by: Will Pfleger <[email protected]>
Signed-off-by: Will Pfleger <[email protected]>1 parent 8194e62 commit 272daca
4 files changed
Lines changed: 724 additions & 287 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
364 | | - | |
| 364 | + | |
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
| |||
746 | 746 | | |
747 | 747 | | |
748 | 748 | | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
| 749 | + | |
753 | 750 | | |
754 | | - | |
| 751 | + | |
| 752 | + | |
755 | 753 | | |
756 | 754 | | |
757 | 755 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
151 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
152 | 154 | | |
153 | 155 | | |
154 | 156 | | |
155 | 157 | | |
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
159 | | - | |
| 161 | + | |
160 | 162 | | |
161 | 163 | | |
162 | 164 | | |
| |||
230 | 232 | | |
231 | 233 | | |
232 | 234 | | |
233 | | - | |
| 235 | + | |
234 | 236 | | |
235 | 237 | | |
236 | 238 | | |
| |||
464 | 466 | | |
465 | 467 | | |
466 | 468 | | |
467 | | - | |
468 | | - | |
469 | | - | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
470 | 474 | | |
471 | 475 | | |
472 | 476 | | |
| |||
493 | 497 | | |
494 | 498 | | |
495 | 499 | | |
496 | | - | |
497 | | - | |
498 | | - | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
499 | 507 | | |
500 | | - | |
501 | 508 | | |
502 | 509 | | |
503 | 510 | | |
504 | 511 | | |
505 | 512 | | |
506 | 513 | | |
507 | 514 | | |
| 515 | + | |
508 | 516 | | |
509 | 517 | | |
510 | 518 | | |
511 | | - | |
512 | 519 | | |
513 | 520 | | |
514 | 521 | | |
515 | 522 | | |
| 523 | + | |
| 524 | + | |
516 | 525 | | |
517 | 526 | | |
518 | 527 | | |
| |||
521 | 530 | | |
522 | 531 | | |
523 | 532 | | |
| 533 | + | |
524 | 534 | | |
525 | 535 | | |
526 | 536 | | |
| |||
0 commit comments