Skip to content

redteam: Phase 4 part 2 — the stream/gRPC suite - #336

Merged
randomizedcoder merged 5 commits into
mainfrom
redteam/phase4-part2
Nov 25, 2026
Merged

randomizedcoder merged 5 commits into
mainfrom
redteam/phase4-part2

Conversation

@randomizedcoder

Copy link
Copy Markdown
Owner

Phase 4 part 2 — the stream/gRPC suite

Rows rt-4-3, rt-4-4, rt-11-3, rt-2-9 (the rt-2-2 Phase-4 deferral). All four green solo; the full-matrix regression runs alongside this PR (redteam-matrix, 30 scenarios).

Verdicts

row verdict headline
rt-4-3 BLOCKED (11/11) read-cred oversize → PermissionDenied at the method ACL (never reaches the 4 MB cap); admin-cred oversize → ResourceExhausted; 10×20 reading storm → linear 299 goroutines, 1.1 M records, no leak
rt-11-3 CONFIRMED (11/11) the strongest RT-11 crossover: one never-reading authenticated stream → catcher 1993 → 0 lines/6 s (flatRecordServiceSend's blocking per-client Send on the decode hot path, no Send timeout); API stays 200; recovery ≤ 6 s; no leak
rt-4-4 BLOCKED (11/11) RSS slope −17 KiB/s under 4 paced readers (the OOM axis holds); the backpressure finding — catcher 1494 → 0 lines/6 s with exactly 32 records in 240 s (the paced wedge, same root cause as rt-11-3)
rt-2-9 CONFIRMED (7/7) stream-expiry carry-over: 2158/2200 records flowed ~50 s past the skew-0 window (authz once at stream open); file-don't-fix

The pinned product finding (S2)

flatRecordServiceSend (pkg/xtcp/grpc_flatRecordService.go:231) runs per record on the decode hot path (deserialize.go:274) and does a blocking per-client stream.Send under a per-stream mutex. A read credential with one never-reading (or slow-reading) FlatRecords stream backpressures the entire decode fleet — envelopes never complete and the destination goes dark while the API stays 200. Fix direction: a Send timeout or a decoupled fan-out (buffered per-stream channel, drop-on-full).

Harness

  • grpcstorm — new static tool (storm / oversize / rate-0 wedge / paced-reader / HMAC shapes) in the attacker tools tar, with in-package tests
  • XTCP2_PPROF deploy axis — a loopback, token-gated serves=debug listener on 9090 for goroutine-count asserts (observability axis, not a surface change)
  • vm_push hardening — a failed push left a mode-0444 .incoming that blocked its own retry (found via the disk-full recovery); removed first now
  • rt-2-2's Phase-4 deferral landed as row rt-2-9 (a second rt-2-2-* file would collide with scenarioId)

The stream/grRPC suite (docs/redteam-plan.md rows rt-4-3, rt-4-4,
rt-11-3, rt-2-9 — the rt-2-2 Phase-4 deferral), all four green solo:

- rt-4-3 BLOCKED (11/11): read-cred oversized PollFlatRecords answered
  PermissionDenied at the method ACL (before the 4 MB cap is even
  reachable); admin-cred oversized answered ResourceExhausted; a
  10x20 reading storm cost a linear 299 goroutines, 1.1 M records, no
  leak (71->299->71).
- rt-11-3 CONFIRMED (11/11): the strongest RT-11 crossover — ONE
  never-reading authenticated FlatRecords stream took the catcher
  1993 -> 0 lines/6s (flatRecordServiceSend's blocking per-client Send
  runs per record on the decode hot path; no Send timeout exists);
  the API stayed 200 (the tier-2 split), recovery <=6s, no leak.
  Product finding pinned: decouple the fan-out (S2).
- rt-4-4 BLOCKED (11/11): RSS slope -17 KiB/s under 4 paced readers
  (the OOM axis holds) and the backpressure finding — the catcher
  collapsed 1494 -> 0 lines/6s with EXACTLY 32 records in 240 s (the
  paced wedge; same root cause as rt-11-3). RT_SOAK=1h env-gates the
  plan's 1 h soak.
- rt-2-9 CONFIRMED (7/7): stream-expiry carry-over — 2158/2200
  records flowed ~50 s past the skew-0 window (the interceptor
  authorizes once at stream open); file-don't-fix, ops note recorded
  (key rotation does not break held-open streams).

Harness: new static tool grpcstorm (storm/oversize/wedge/paced/HMAC
shapes) in the attacker tools tar; new XTCP2_PPROF deploy axis (a
loopback, token-gated debug listener on 9090 for goroutine-count
asserts); vm_push now removes a stale .incoming left by a failed push
(the disk-full recovery found one mode-0444 that blocked the retry).
The findings backlog rows now carry their issue numbers: the
flatRecordServiceSend fan-out decoupling (#337 — rt-11-3/rt-4-4), the
dead skew default (#338 — rt-2-2), tcpDest reconnect (#339 — the
harness finding, rt-4-7/rt-11-5 next), SetEnvelopeFlush upper bound
(#340 — rt-3-4), the rt-7-2 bootstrap-integrity + gauge findings
(#341), the telemetry amplifier (#342 — rt-4-1), and the rt-2-3 CLI
typo residual (#343).
…boundary

The matrix run (20261125T195100) failed rt-2-2's in-minute replay: the
mint landed at :44 (inside the old 05..45 guard), the apt-get + 8s
tcpdump window pushed the replay to :11 of the NEXT minute — correctly
401 under skew 0, so the assert raced the boundary, not the product.

Fix: land the mint in seconds 05..18 (the mint -> scrape -> tcpdump ->
replay sequence needs ~35s of runway inside the mint's minute) and
retry the mint+capture once if a slow provision still crosses. The
out-minute 401 behavior itself is unchanged (that is the defense, and
assert 7 pins it).

Re-verified solo 10/10 (mint :05, scrape :15, replay :27 — all
in-minute); the other 29 matrix rows passed unchanged.
@randomizedcoder
randomizedcoder deleted the redteam/phase4-part2 branch November 25, 2026 22:05
@randomizedcoder
randomizedcoder restored the redteam/phase4-part2 branch November 25, 2026 22:06
@randomizedcoder
randomizedcoder merged commit 1935fd8 into main Nov 25, 2026
1 check passed
@randomizedcoder
randomizedcoder deleted the redteam/phase4-part2 branch November 25, 2026 22:17
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.

1 participant