Skip to content

fix: cap the Tailscale forwarding sessions one peer can hold - #5

Merged
ValgulNecron merged 1 commit into
mainfrom
fix/tunnel-per-peer-flow-limit
Nov 24, 2026
Merged

ValgulNecron merged 1 commit into
mainfrom
fix/tunnel-per-peer-flow-limit

Conversation

@ValgulNecron

Copy link
Copy Markdown
Contributor

Summary

Follow-up to the 2026-11-24 security review (#4). The Tailscale forwarder shares one budget of 128 sessions (TCP connections plus UDP sessions) across every tailnet peer, so a single peer could take all of them and lock everyone else out.

Severity Finding Fix
Low One tailnet source can exhaust the shared forwarding budget (denial of service for other peers) Each source IP may hold at most a quarter of the budget (at least 2; 32 of the default 128). Extra flows are rejected and counted like budget rejections.

Changes

  • tailscale_forward.go: per-peer accounting keyed by the peer's IP (acquirePeer / releasePeer), used by serveTCP and new UDP sessions. The existing acquire/release are unchanged.
  • tailscale_forward_test.go: two new tests (TestForwarderCapsFlowsPerPeer, TestPerPeerFlowLimitFloor). No existing test changed; a fresh reviewer given only the test diff judged it "only added".
  • specs.md: documents the per-peer cap.

After merge: tunnel pointer bump in Gameplane.


Generated by Claude Code

A single tailnet peer allowed by the ACL could open all 128 shared sessions and keep them alive with a byte every few minutes, locking every other player out. Each source address now holds at most a quarter of the budget (at least two) across all ports and protocols; refusals count as flow rejections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 79cdc080-57d0-42a3-bbc5-9beda499d224
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ValgulNecron ValgulNecron self-assigned this Nov 24, 2026
@ValgulNecron
ValgulNecron merged commit 5395b2d into main Nov 24, 2026
6 checks passed
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.

2 participants