Skip to content

test(browser-egress): verify redirect hops require authorization - #163

Merged
senamakel merged 9 commits into
epic/7328-security-busfrom
epic-7328-tc111-redirect-hop
Oct 23, 2026
Merged

senamakel merged 9 commits into
epic/7328-security-busfrom
epic-7328-tc111-redirect-hop

Conversation

@senamakel

Copy link
Copy Markdown
Member

Adds a live loaded-module browser test that redirects Chromium from an allowed fixture host to a private fixture host. It verifies the redirect destination receives its own host authorization request and that Chromium never opens the denied destination socket.

This is behavior-evidence coverage only: the existing proxy already authorizes each hop. It does not complete TinyComputer #111.

Validation:

  • TINYCOMPUTER_LIVE_BROWSER_EGRESS_TESTS=1 RUST_TEST_THREADS=1 scripts/ci-cancel-aware.sh cargo test --locked -p tinycomputer --features static-link --lib live_chromium_module_authorizes_redirect_hops_before_dialing -- --nocapture (1 passed)
  • Same env with filter live_chromium_ (5 passed)
  • cargo check --locked -p tinycomputer --features static-link
  • cargo clippy --locked -p tinycomputer --all-targets --features static-link -- -D warnings
  • cargo fmt --all -- --check, git diff --check, and cargo metadata --locked --format-version 1

Remaining #111 acceptance gaps include proving resolved-address pinning on the actual socket across redirects, subresources, workers, and WebSockets; broader controlled public/private/DNS-rebinding and subresource/worker/WebSocket fixtures; fail-closed behavior for stale or missing authority in all relevant paths; and supported Linux/macOS/Windows backend evidence. Windows CPU semantics remain deferred/Unsupported.

Refs #111
Part of tinyhumansai/openhuman#7328

senamakel and others added 5 commits October 23, 2026 05:11
…erence

Update the pinned submodule commits for the four vendored dependencies to
their latest revisions.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a live Chromium test that serves a 302 pointing at a denied host and
asserts the redirect hop is authorized through the host before any socket
is dialed, so a denied destination never reaches grant consumption or
receives a connection.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reverts the tinytools git dependency to revision bd60b9b and drops the
icu_casemap, rawzip, and unicode-normalization crates that the newer
versions pulled in. The lockfile also picks up the corresponding
transitive dependency changes.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
This reverts commit 93de7cb.

Co-authored-by: Medulla <medulla@tinyhumans.ai>
…erence

Update the pinned submodule commits for the four vendored dependencies to
their latest revisions.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@tinysweeper

tinysweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Reviewed head: c08b699b6b8953acbcc38a538808a42f8518e229

Verdict: Ready for maintainer review · Priority: none
Coverage: Reviewed 1 of 1 files.
Pull request purpose (title): test(browser-egress)…

Diagnostics and supporting details

Full summary

Pull request purpose (title): test(browser-egress): verify redirect hops require authorization. Tiny Sweeper completed its review; deterministic results follow.

Review snapshot

Change surface Files Review signal Count
Production 0 Active findings 0
Tests 1 Noted findings 0
Documentation 0 Resolved findings 0
Configuration 0 Pending checks/questions 0

Completeness: Complete
Test assessment: No supported feature-to-test mapping was available; this does not mean tests are absent or passed.

What changed

One file changed, adding 141 lines with no deletions. The redirect fixture helper now reads the request in chunks until the header terminator or EOF under a 10-second deadline, asserts the path is `/redirect`, repoints the host's resolved address to the denied one, and replies with a 302 to the raw denied loopback address. The new opt-in live test binds allowed and denied loopback listeners, wires the fixture EgressHost to the shared resolved address, attaches the linked module with a redirect egress policy, opens a browser session, navigates to the allowed `fixture.test` URL, and asserts the redirect hop reached host authorization for the denied port, that the resolver mapped the denied IP to its listener, that the denied address never reached grant consumption, and that the denied listener received no connection within a short timeout. It panics with navigation and egress observations if the fixture server never receives the initial navigation.

Features

  • Added — Redirect fixture helper: Provides the server side of the redirect scenario: waits for the authorized Chromium socket before a deadline, reads the request until the header terminator under a bounded timeout, verifies the path is `/redirect`, repoints the host's resolved address to the denied listener, and returns a 302 to the supplied destination so the test exercises Chromium's redirect handling against the host's authorization and resolution. (crates/tinycomputer/src/tinybus_module/browser_egress_live_tests.rs async fn serve_fixture(, crates/tinycomputer/src/tinybus_module/browser_egress_live_tests.rs)

Tests

No supported feature-to-test mapping was produced. Test execution is not inferred.

Findings

No active actionable findings.

Before merge

None.

Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The new live test wires a redirect fixture to the existing EgressHost and checks that Chromium's redirect hop is authorized before dialing. The assertions and the fixture look consistent with the host's contract; I found no defect that would make the test misbehave for a reachable input. _The code index is behind this pull request (indexed at `174f08ddacad`), so retrieved context may be out of date._

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The security lane found the change is test-only code using loopback listeners bound to port 0, introducing no new untrusted input path, subprocess or network calls beyond the existing live-test harness.
  • Lane summary: Adds an opt-in live-Chromium test asserting redirect hops go through host authorization before dialing, plus a local fixture server. It is test-only code, uses loopback listeners bound to port 0, and introduces no new untrusted input path, subprocess or network calls beyond the existing live-test harness; the change looks sound. _The code index is behind this pull request (indexed at `174f08ddacad`), so retrieved context may be out of date._

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The tests lane found the new assertions anchored to host-observed authorization for the redirect hop, rejection of grant consumption for the denied address, and the denied listener never accepting a connection.
  • Lane summary: The diff adds a test (and its fixture) to the live-Chromium egress suite; the "behavioural" file is itself a test module, so the test absence concern is answered by the diff itself. The new test asserts on host-observed authorization for the redirect hop, rejects grant consumption for the denied address, and confirms the denied listener never accepts a connection, so it would fail if redirect hops stopped going through authorization. No reportable defect found. _The code index is behind this pull request (indexed at `174f08ddacad`), so retrieved context may be out of date._

commits

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The commits lane reported no sensitive content in committed files.
  • Lane summary: No sensitive content in committed files. _The code index is behind this pull request (indexed at `174f08ddacad`), so retrieved context may be out of date._

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The description lane found the PR adds one live Chromium test with a redirect fixture that flips the host's resolved address after the first hop, that the description matches what the diff does, and that it is test-only, says so, and lists the remaining gaps.
  • Lane summary: The pull request adds one live Chromium test with a redirect fixture that flips the host's resolved address after the first hop and asserts the second hop goes through host authorization and never reaches the denied socket. The description matches what the diff does: it is test-only, it says so, and it lists the remaining gaps. No reportable defect found. _The code index is behind this pull request (indexed at `174f08ddacad`), so retrieved context may be out of date._
Evidence and run details
  • Models: ladder/vectors-oai3, deepseek-v4.1-flash
  • Spend: $0.000521
  • Tokens: 192045 input · 3590 output · 39424 cached · 294 embedding
  • Updated: 2026-10-23T05:56:16Z
Head State Pass summary
a649491dfbec ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-10-23T05:20:19Z)
418e3b2380f6 ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-10-23T05:37:29Z)
d691bdb3f0a5 ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-10-23T05:54:12Z)
c08b699b6b89 ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-10-23T05:56:16Z)

tinysweeper 0.1.2

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d0c1ffa9-8a61-4782-a48a-90eec4c3a6b7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T05:57:44.797065Z c08b699 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tinysweeper found nothing blocking. Approving.

Diagnostics

Total spend: $0.0006

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a649491dfb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

senamakel and others added 4 commits October 23, 2026 05:34
…failure

The live redirect test now keeps the navigation response and, when the
allowed server fails to complete, panics with the navigation result and
the recorded egress observations instead of a bare expect message. This
makes failures easier to diagnose without changing what the test asserts.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The redirect fixture listener now waits up to 30 seconds for the authorized
Chromium socket instead of 10, since the browser can take longer to connect
under load and the shorter deadline caused flaky failures.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The redirect fixture now rewrites the shared resolved address to the denied
listener once the redirect request arrives, and the redirect location uses that
literal address instead of a hostname. This makes the test assert that the
redirect hop is authorized against the actual denied IP and that the fixture
resolved it to the listener it serves.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The redirect fixture previously read the Chromium request in a single
chunk, which could truncate the request line and make the assertion
flaky. It now loops until the header terminator arrives, with a timeout
so a stalled client fails the test instead of hanging.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel merged commit 0be3ab3 into epic/7328-security-bus Oct 23, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant