Skip to content

fix(webrtc): cap remote addresses per ufrag - #3500

Merged
MarcoPolo merged 1 commit into
masterfrom
webrtc-udpmux-cap-addrs-per-ufrag
May 11, 2026
Merged

MarcoPolo merged 1 commit into
masterfrom
webrtc-udpmux-cap-addrs-per-ufrag

Conversation

@lidel

@lidel lidel commented May 6, 2026 •

Copy link
Copy Markdown
Contributor

Why

Kubo's default Addresses.Swarm includes /ip4/0.0.0.0/udp/4001/webrtc-direct,
we should cap this to protect long running nodes.

IIUC this is high enough to never impact real STUN operations, but low enough to make certain fun activities unfeasible.

Why reject-new instead of FIFO or LRU

FIFO or LRU would let fresh STUN packets evict known-good addrMap entries. Reject-new keeps tracked addresses stable, no real peer should eat up more than 32.

ICE sessions advertise a small, bounded number of candidates per IP
family. Track at most 32 remote addresses per (ufrag, family) so the
udpmux bookkeeping stays predictable for long-lived listeners. Past
the cap, additional candidates still resolve to the existing muxed
connection but no longer extend addrMap or ufragAddrMap.
@lidel
lidel requested a review from MarcoPolo May 6, 2026 20:00
@lidel
lidel marked this pull request as ready for review May 6, 2026 20:25
@MarcoPolo
MarcoPolo merged commit 8f3cb82 into master May 11, 2026
11 checks passed
@lidel
lidel deleted the webrtc-udpmux-cap-addrs-per-ufrag branch May 15, 2026 11:53
@lidel lidel mentioned this pull request Jul 27, 2026
15 tasks
gammazero added a commit to ipni/go-libipni that referenced this pull request Jul 29, 2026
The update to `go-libp2p` 0.49.0 update contains security fixes and enhancements for DoS/hardening:
  - fix for CVE-2026-57497: GHSA-g35j-m5xg-vh3q
  - [3501](libp2p/go-libp2p#3501) bounds protocols accepted per peer in identify (a peer could plant 1800+ protocol entries in your peerstore via chunked identify)
  - [3486](libp2p/go-libp2p#3486) caps unconnected addrs per peer (stops DHT gossip flooding the peerstore with stale addrs; relevant to us)
  - [3500](libp2p/go-libp2p#3500) caps webrtc remote addrs per ufrag
  - [3487](libp2p/go-libp2p#3487) evicts stale certified addrs when a newer signed peer record drops them (an address a peer once advertised no longer lingers after removal)
gammazero added a commit to ipni/go-libipni that referenced this pull request Jul 30, 2026
The update to `go-libp2p` 0.49.0 update contains security fixes and enhancements for DoS/hardening:
  - fix for CVE-2026-57497: GHSA-g35j-m5xg-vh3q
  - [3501](libp2p/go-libp2p#3501) bounds protocols accepted per peer in identify (a peer could plant 1800+ protocol entries in your peerstore via chunked identify)
  - [3486](libp2p/go-libp2p#3486) caps unconnected addrs per peer (stops DHT gossip flooding the peerstore with stale addrs; relevant to us)
  - [3500](libp2p/go-libp2p#3500) caps webrtc remote addrs per ufrag
  - [3487](libp2p/go-libp2p#3487) evicts stale certified addrs when a newer signed peer record drops them (an address a peer once advertised no longer lingers after removal)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

⌂ 换网址