Skip to content

fix: harden audit relay against control-char injection and queued waits - #4

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 bridge (2026-11-24). Fixes, by severity:

Severity Finding Fix
Low buildSyslog only replaced CR/LF, so ESC, NUL, BEL and C1 bytes reached the collector (terminal-escape / log-viewer injection) every C0, DEL and C1 control character in MSG becomes a space
Low a request waiting for the syslog connection mutex never gave up, so a hung collector let waiting requests pile up one-slot gate taken before the mutex with select on ctx.Done()
Low subtle.ConstantTimeCompare on raw values leaks the token length compare SHA-256 digests

Not changed here (noted for the Gameplane chart review): with api.audit.webhook.authSecretRef unset the bridge accepts any POST; the chart's NetworkPolicy limits ingress to the API pod only when networkPolicies.enabled. Making the bridge fail closed would break current installs, so it belongs in a chart change.

Checked and sound: RFC 5424 header fields validated, octet-counting framing, 64 KiB body cap, server timeouts, TLS 1.2+ with verification, no secrets logged, distroless nonroot image.

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


Generated by Claude Code

Replace every C0, DEL and C1 control character in the MSG with a space (not just CR/LF), compare the Authorization header by SHA-256 digest so timing does not leak the token length, and let a request waiting for the syslog connection give up when its context ends.

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: 9ef75dda-dec2-4e40-ac71-18901610dffa
  • 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 db5fe97 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