Skip to content

test(browser): prove exact-socket egress pinning in Chromium - #158

Merged
senamakel merged 2 commits into
mainfrom
tinycomputer-111-transport-pinning
Oct 23, 2026
Merged

senamakel merged 2 commits into
mainfrom
tinycomputer-111-transport-pinning

Conversation

@senamakel

@senamakel senamakel commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Adds a real Chromium integration test for the browser transport's exact-socket grant behavior. The test grants one resolved socket, navigates to a different host on the same port, and proves the authorized listener receives the request while the denied listener receives no connection.

This is supplementary transport evidence for tinyhumansai/tinycomputer#111; it does not complete that issue. Controlled DNS rebinding, TinySecurity-backed authority coverage, worker/direct-socket confinement, and cross-platform acceptance remain outstanding.

Part of tinyhumansai/openhuman#7328
Refs #111

Validation:

  • TINYCOMPUTER_LIVE_BROWSER_TESTS=1 cargo test -p tinycomputer-browser --features agent-browser live_chromium_dials_only_the_exact_host_authorized_socket -- --nocapture
  • cargo fmt --check
  • cargo clippy -p tinycomputer-browser --features agent-browser --all-targets -- -D warnings
  • git diff --check

Summary by CodeRabbit

  • Tests
    • Added browser coverage confirming that socket access is limited to the specifically authorized address, even when another listener shares the same port. The test also verifies that navigating to a denied host does not connect to its listener.
    • No user-facing behavior changes are included in this update.

senamakel and others added 2 commits October 23, 2026 00:14
Add a live test that grants a single authorized socket and asserts Chromium
dials only that exact address, with a listener on the same port at a
different host left untouched. A small authorizer fixture supplies the
pinned grant so the check exercises the real dial path.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The fixture response declared a Content-Length of 26 while the body is 30 bytes, so the test server advertised a shorter body than it sent. The header now matches the actual body length.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@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-23T00:23:54.170772Z 6b0a3c8 PR opened
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ 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: af11eed6-ebe5-409a-a15f-b49273f870f4
📥 Commits

Reviewing files that changed from the base of the PR and between 8313543 and 6b0a3c8.

📒 Files selected for processing: 1
  • crates/tinycomputer-browser/src/linked/linked_tests/live_tests.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

Adds a live Chromium test for socket pinning. The test uses an authorization helper that grants only its configured socket address and checks that a listener on a different address receives no connection.

Changes: Socket pinning test

Layer / File(s) Summary
Exact-address authorization and live test
crates/tinycomputer-browser/src/linked/linked_tests/live_tests.rs
AuthorizeExactSocket grants and consumes only its configured address. The live Chromium test checks that navigation succeeds through the granted socket and that the denied listener receives no connection.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 6b0a3

The live test checks that navigation succeeds through the authorized socket and that the denied listener receives no connection. No actionable merge-blocking issue is established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: a Chromium browser test for exact-socket egress pinning.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 Clippy (1.99.0)

Clippy execution failed

A rabbit checks the socket grant,
One address lets the browser pass.
The other listener waits in vain,
No visitor arrives there on the wire.
The rabbit hops; the test is green!

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

@tinysweeper

tinysweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Reviewed head: 6b0a3c8536cc41ef117bbcadb8deed75cc28965a

Findings

No active actionable findings.

Unverified notes — repository context was unavailable; these are not actionable findings

Unverified note — critique

  • medium: Navigate to the allowed 127.0.0.2 socket, not 127.0.0.1 (crates/tinycomputer-browser/src/linked/linked_tests/live_tests.rs:97)
    Problem: The test's stated intent is that Chromium must reach only the exact socket the host granted, and `AuthorizeExactSocket(allowed_address)` grants `127.0.0.2:<port>`. But the navigati
    Suggested fix:
                "url":format!("http://{}/", allowed_address)
    

Verdict: Ready for maintainer review · Priority: none
Coverage: Reviewed 1 of 1 files.

Diagnostics and supporting details

Full summary

Pull request purpose (title): test(browser): prove exact-socket egress pinning in Chromium. 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 1
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.

Features

  • Added — Exact-socket egress pinning live test: This is supplementary evidence for the referenced egress issue, not completion of it. (crates/tinycomputer-browser/src/linked/linked_tests/live_tests.rs async fn live_chromium_loopback_navigation_uses_the_authenticated_session_proxy()
  • Added — AuthorizeExactSocket test authorizer: Provides a test-only EgressAuthorizer that issues a fixed lease covering exactly one socket address, permits consumption only of addresses within that grant, and approves validation unconditionally, allowing the pinning test to isolate grant enforcement from authority lookup. (crates/tinycomputer-browser/src/linked/linked_tests/live_tests.rs struct RejectAllButFixture {)

Tests

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

Before merge

None.

Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Critique findings were capped at Likely confidence because retrieval was degraded: Navigate to the allowed 127.0.0.2 socket, not 127.0.0.1; Close the browser before asserting launch success. (2 model findings retained at no more than Likely confidence because retrieval was degraded) _The code index is behind this pull request (indexed at `37cc9f4fbda5`), so retrieved context may be out of date._

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Security lane reported no findings: the change adds only live-gated fixtures and a test authorizer, binds only to local loopback listeners, introduces no untrusted-input path, and makes no production change in the file.
  • Lane summary: This adds a live-browser fixture test and an `AuthorizeExactSocket` test authorizer; it is gated behind `live_browser_tests`, exercises only local loopback listeners, and introduces no untrusted-input path or production change inside this file. I checked the changed calls against `EnforcedAgentBrowser`, `DialGrant`, and `EgressProxy` and found nothing reportable. _The code index is behind this pull request (indexed at `37cc9f4fbda5`), so retrieved context may be out of date._

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Tests lane reported no reportable defect, noting the fixture authorizer's consume and validate only need to answer affirmatively for the exercised path and that the test asserts denial concretely.
  • Lane summary: A new live-browser test and its fixture authorizer were added; the test asserts concretely that navigation succeeds while the same-port socket on a different loopback address never receives a connection, and the fixture's `consume`/`validate` only need to answer in the affirmative for that path. I found no reportable defect. _The code index is behind this pull request (indexed at `37cc9f4fbda5`), so retrieved context may be out of date._

commits

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: 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 `37cc9f4fbda5`), so retrieved context may be out of date._

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Description lane found the PR description accurate and honestly scoped as supplementary evidence, with the noted caveat that the exact-socket assertion derives from proxy dialing behavior rather than the requested hostname — an evidence-strength note, not a defect.
  • Lane summary: The PR adds a live Chromium integration test that grants one resolved socket (127.0.0.2:port), navigates to a different host on the same port (127.0.0.1), and asserts the granted listener is hit while the denied listener never accepts a connection, plus a small test-only authorizer stub. The description accurately covers this and honestly scopes it as supplementary evidence for the issue. One caveat: the browser is steered by navigating to the denied host, so the "exact socket" assertion rests on the proxy dialing the allow-listed address rather than the requested hostname; that is a strength-of-evidence question about a new test rather than a defect in the change, and nothing in the diff is wrong. _The code index is behind this pull request (indexed at `37cc9f4fbda5`), so retrieved context may be out of date._
Evidence and run details
  • Models: ladder/vectors-oai3, deepseek-v4.1-flash
  • Spend: $0.000696
  • Tokens: 231210 input · 5713 output · 26624 cached · 183 embedding
  • Updated: 2026-10-23T00:34:12Z
Head State Pass summary
6b0a3c8536cc ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-10-23T00:34:12Z)

tinysweeper 0.1.2

@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.0007

@senamakel
senamakel merged commit 02f9aac into main 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