Skip to content

fix: reject BPF qualifiers go-pcap ignores and tighten capture files - #5

Merged
ValgulNecron merged 1 commit into
mainfrom
fix/security-hardening-2026-11-24
Nov 24, 2026
Merged

ValgulNecron merged 1 commit into
mainfrom
fix/security-hardening-2026-11-24

Conversation

@ValgulNecron

Copy link
Copy Markdown
Contributor

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

Severity Finding Fix
Medium go-pcap compiles portrange to an unconditional keep, so tcp port 25565 or portrange 1-65535 passed validation and captured the whole pod network namespace (confirmed locally: both paths of the compiled program reach ret #262144). less/greater were silently compiled as a port test and ip broadcast as plain ip reject portrange, less, greater, broadcast, multicast; new canDrop reachability check refuses any program with no reachable drop
Low pcap files were created with os.Create (0644 under the default umask) and followed a planted symlink; the node worker runs as root O_NOFOLLOW, mode 0600 (the worker still widens to 0640 after finalizing)
Low legacy GET /captures/{id}/file skipped the identity check that delete and stop apply requests with identity headers go through the bound download check
Low start/stop decoded unbounded bodies MaxBytesReader 64 KiB

Follow-up for the Gameplane operator (not in this repo): the node-capture artifacts container could mount the captures volume read-only.

Checked and sound: no shell/exec of filters, capture ID regex and OpenRoot containment, mTLS with RequireAndVerifyClientCert, only cap_net_raw on the sidecar binary, duration/size limits, no outbound calls.

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


Generated by Claude Code

portrange compiled to an unconditional keep, so 'tcp port 1 or portrange 1-65535' captured the whole pod namespace; reject portrange, less, greater, broadcast and multicast and refuse any program with no reachable drop. Create pcap files 0600 with O_NOFOLLOW, apply the identity check to legacy downloads that send identity headers, and cap control request bodies at 64 KiB.

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: f321935c-df63-4cb6-96c6-464efa3490ec
  • 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 78a4f2e 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