Skip to content

fix: validate frp ports and recreate tunnel secrets with O_EXCL - #4

Merged
ValgulNecron merged 2 commits into
mainfrom
fix/security-hardening-2026-11-24
Nov 24, 2026
Merged

ValgulNecron merged 2 commits into
mainfrom
fix/security-hardening-2026-11-24

Conversation

@ValgulNecron

Copy link
Copy Markdown
Contributor

Security review of the tunnel supervisor (2026-11-24). Fixes, by severity:

Severity Finding Fix
Low localPort/remotePort from BACKING_SERVICE_PORT were written raw into the frpc TOML and localIP was unescaped, so a value with a newline could add a [[proxies]] table (not reachable today: the operator passes integers) ports parsed as integers 1–65535 and written with %d; localIP escaped
Low escapeTomlString left other control bytes raw they become \uXXXX
Low the frpc config and playit secret live at fixed /tmp paths and os.WriteFile follows symlinks and keeps an existing file's mode remove, then create with O_EXCL at 0600

Not changed: a tailnet peer allowed by the ACL can hold all 128 forwarding slots (Medium availability, needs a per-source cap design); health/metrics on :8091 are unauthenticated by spec and expose only closed-set states.

Checked and sound: forward targets fixed to the backing Service, no subnet routes, secrets never logged or on argv, credential path containment, TLS on the status PATCH, bounded UDP sessions, distroless nonroot images, playit download pinned by SHA-256.

New tests only (4); no existing test changed (checked by a separate test-diff review). specs.md updated.


Generated by Claude Code

frp localPort/remotePort must be integers in 1-65535 before they reach the TOML, localIP is escaped, other control bytes are \uXXXX-escaped, and the fixed /tmp config and playit secret files are removed and recreated with O_EXCL at 0600 so a planted file or symlink cannot redirect or widen them.

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: 2b4be5d4-2968-40e0-8073-0ded5373a4ea
  • 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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>
@ValgulNecron
ValgulNecron merged commit 61263f5 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