Repository navigation
Conversation
Size Report
Startup median (7 runs, lower is better):
Affected plugins
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 2 new findings on a56ea57. The verdict and the full list are in the summary comment.
|
The proxy at a56ea57 does not yet hold its bounded, fail-closed rule: a peer can crash the host process or keep connection slots, and several limits can be passed. The six points below need fixes before merge. A peer failure can end the host process and every proxy connection, and refused peers can use up the listener's capacity for good (public-network-proxy.ts:70). Node removes its socket error and timeout handlers before it dispatches CONNECT or Upgrade. The proxy adds an error handler only after DNS and dial succeed, and adds none on a refused upgrade. Also, An ordinary HTTP response can be unlimited in size and time, so one connection can hold a slot forever (public-network-proxy.ts:230). The connect timer is cleared at TCP connect, and the other timers only measure idle time. Every forwarding path must have a finite byte budget and an elapsed deadline, and must destroy both sides when either one runs out. One client socket can start two forwarding operations (public-network-proxy.ts:73). The one-use marker is used only in the A closed client can leave its upstream dial running (public-network-proxy.ts:123). The close handler that destroys the upstream is added only after the dial resolves. The slot is freed, and Extra headers can hide forbidden fields from admission (public-network-proxy.ts:52). Malformed absolute-form targets can be forwarded (public-network-proxy.ts:257). The URL parser accepts excess slashes with an empty raw authority and erases empty userinfo, so a matching Host header lets such a target pass. The public-address policy still applies to the destination. The raw authority and delimiters must be checked before normalization, with the same strict authority parser for the target and the Host header. Not blocking: these can be taken or left: give CONNECT tunnels a lifetime limit through the same per-connection budget (tunnel limit); keep concurrent DNS lookups below the thread pool size or use a resolver with its own timeout (lookup); size the 8-connection limit from the browser caller, because Chromium can open up to 32 sockets per proxy and extra ones are destroyed (limit); use Should this proxy land together with its first caller, so that the owner of the browser launch sets the limits and the unused-export check sees a consumer? That would first need a decision at #5258 on whether primitives without a caller may land, or whether the stack folds #5268 and this PR into the phase that wires them. In that phase, would a The Repo Guards & Compatibility failure is likely related to this change. Its "Check for production-unused exports" step reports that Not verified here: the PR's test files were not run, the crash was not reproduced through Before merge, the six fixes above are needed, starting with the socket error and refusal handling, because it affects the whole host even without browser wiring. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
At 107e165, two points from the earlier review are fixed, but resolver work, pending dials, and handed-off sockets can still outlive their limits. public-network-proxy.ts:366: the deadline frees the pending-resolution slot while public-network-proxy.ts:133: closing the client frees its connection slot, but a pending upstream dial keeps running, and public-network-proxy.ts:83: Node removes its error and timeout listeners when it hands over a CONNECT or Upgrade socket, and the refusal path only calls The PR summary says the proxy fails closed, including on malformed framing and excess work. The code does not fully support that: unfinished lookups and pending dials are not capped, and the header and target checks listed below have gaps. Please make the code match the claim, or narrow the claim. Not blocking: these can be taken or left: strip For a follow-up issue, not for this PR:
These earlier threads no longer apply and can be resolved: this one, because single Repo Guards & Compatibility fails in the Fallow audit step: Not verified here: no tests were run locally, the 8/8 pass count was not observed, the crash and pipelining paths were not reproduced through Before merge, the resolver limit, pending dial, and socket handoff problems need fixes, and Repo Guards needs to pass. |
107e165 to
3c4b97b
Compare
ba8408e to
930953d
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 2 new findings on 930953d. The verdict and the full list are in the summary comment.
|
At 930953d, none of the three problems from the earlier review is fixed. A DNS lookup frees its slot at the deadline, but A CONNECT dial is not tied to the client or proxy lifetime. If the client closes during the dial, its per-proxy and process-wide connection slots are freed while A refused socket is only half-closed. Node removes its HTTP error and timeout handlers when it hands a socket to Repo Guards & Compatibility fails at this commit, likely because of this PR. The production-exports gate reports One lower-priority open thread still applies. These threads can be resolved: CONNECT ports, because the tunnel has byte and idle limits and a port allowlist is outside this bounded-budget requirement (a maintainer decision); keep-alive handling, because single Not verified here: no tests were run and the 8/8 pass count was not observed. The lookup buildup, the dial after close and the half-open or reset behavior were not reproduced through |
930953d to
b21da40
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
All reported issues were addressed across 47 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
At 302f1dd, the first-open cleanup issue from the earlier review is fixed, but remote web admission still needs production evidence before merge. The macOS and Linux confinement smoke constructs the provider in-process, opens example.com over HTTPS, and disposes a runtime slot. It does not establish that the production tenant route maintains the public-only invariant for the browser lifetime. Keep the existing remote-web refusal in effect until same-head production daemon runs on both platforms with the pinned browser correlate a controlled public IPv4 HTTP/80 redirect and destination with fixture receipts, and demonstrate authenticated proxy enforcement or host-enforced denial immediately after abrupt daemon exit and before recovery. The same-head Windows typed refusal is established. a second independent pass found that a bound confined provider admits a remote tenant web request on macOS and Linux while the production evidence required by #5306 remains outstanding. No bypass was observed in this review. Keep the PR in draft until both platforms supply the agreed production receipts with the pinned browser at this head; if the cleanup change must ship first, retain the existing remote-web refusal. The proof-cleanup timeout thread no longer applies: the close now retries on the same lease without another request. No lower-priority threads still apply. The latest GitHub check snapshot for 302f1dd reports 25 passed, with no pending or failed checks. The same-head smoke logs show five live cases with zero skips on each of macOS and Linux and one focused Windows refusal case with zero skips. Those provider runs did not exercise production tenant admission or abrupt daemon exit. No conflicts are known. First-open rollback ownership is supported by static production tracing, the daemon router test structure, and a mocked provider regression; the live smokes do not exercise autonomous retry after a failed first open. The focused 15-test result is author-reported, and historical checks in the PR body were not revalidated as current checks. CLI, Node, and MCP convergence is supported by source inspection. Not verified here: an independent live session through any surface. Before merge, keep remote web admission closed until the macOS and Linux production tenant-daemon receipts establish the redirect destination and post-exit enforcement described above. |
Chromium background tunnels can fill eight proxy sockets before a subsequent route proof or public navigation. Match the default browser pool and retain the shared connection budget and destination admission.
302f1dd to
3e807ac
Compare
This comment has been minimized.
This comment has been minimized.
|
At 3e807ac, the first-open cleanup is fixed, but remote web admission still opens before browser-lifetime confinement is established. The checks are green; the web lanes run local web and provider smokes or Windows refusal, not production tenant lifetime runs. No conflicts are known. The confinement smoke constructs a provider directly and observes a post-disposal probe while the test process stays alive. It does not establish confinement for the lifetime of a browser admitted by the production tenant daemon. Before merge, keep remote web admission closed until same-head production tenant-daemon runs on macOS and Linux with the pinned browser correlate a controlled public IPv4 HTTP/80 redirect and destination with fixture receipts, and demonstrate authenticated proxy enforcement or host-enforced denial immediately after abrupt daemon exit and before recovery. The admission guard accepts a public-network-only web request when the default provider is bound, but that flag does not prove lifetime enforcement. This enables managed remote tenant web before the required evidence exists. Retain the refusal for remote tenant web except close until the required production receipts establish confinement, and keep help and user docs aligned with that refusal. A second independent pass found that admission skips the previous refusal when provider construction sets the flag, while the smoke disposes an in-process runtime. Could the non-close refusal remain in place until the macOS and Linux production runs provide the redirect and destination receipts and establish enforcement immediately after abrupt daemon exit? No private-destination connection was observed in this review. The first-open cleanup is supported by production source tracing and a pre-fix comparison of mocked tests. Not verified here: an independent live session, failure reproduction, or local test was run. The earlier proof-cleanup fix remains at head. The previous Windows receipt applies to 302f1dd; no production lifetime receipt was supplied for 3e807ac. |
|
Addressed the admission finding from the review at 221b59c. Remote tenant web non-close operations unconditionally refuse; provider construction no longer supplies an admission capability. Help and user docs match. The modified router suite passes24tests, including existing-session read refusal and remote close retry. This does not claim production lifetime proof. The public redirect/destination and abrupt-daemon-exit receipts remain absent, so the PR stays draft and admission stays closed. |
This comment has been minimized.
This comment has been minimized.
|
The earlier findings from 3e807ac are fixed at 221b59c, but one new problem remains in the admission order. The delta changes what the typed refusal says for one route, and the new help and docs do not match the code. A remote tenant (proxy client or auth-hook tenant) can send snapshot, or any non-close command, for a session name that a local caller opened as a web session on the same daemon. admitDevice runs assertWebSessionConfinement first. The local session has no public-network marker and the request is remote, so it throws remote_web_session_confinement_mismatch before assertRemoteWebDeviceAdmitted at line 624 runs. On base 61f0e4d this route returned remote_web_public_network_unenforced, and commands.md said so explicitly. The delta now rewrites the help (cli-help.ts:694), commands.md:556 and remote-proxy.md:10 to say every remote tenant web command is disabled with remote_web_public_network_unenforced. The router tests at request-router-web-sessions.test.ts:290 and :341 assert the mismatch reason instead. The request is still refused, so this is not a confinement bypass. But an agent that follows the help and branches on remote_web_public_network_unenforced will read this refusal as a session-policy clash and may retry under another session name. The rule the code must satisfy is: while admission is closed, every remote non-close web admission refuses with remote_web_public_network_unenforced. The single admitDevice closure enumerates every bind path (request-runtime-binding.ts:136, :159, :169). The smallest fix is to call assertRemoteWebDeviceAdmitted before assertWebSessionConfinement at request-execution-scope.ts:619-624, then change the expectations at request-router-web-sessions.test.ts:314 and :396 to remote_web_public_network_unenforced. The mismatch check then still covers a local request on a confined session. Not blocking, and fine to take or leave: with admission closed for every remote non-close web request, no production caller can create a public-network session, so the proxy, address classification, confined launch and process-record fields run only in tests and the in-process smoke. Could the admission, docs and session-marker part land now, with the proxy and confined launch moving to the enablement PR that carries the receipts, or should this stay a draft until then? Required evidence is satisfied. CI is green: 28 checks with 0 not passing at 221b59c. Those checks cover the daemon admission, router tests, help and docs, but the web-confinement lanes run the local and in-process smokes and the Windows refusal, so they do not exercise remote tenant admission, which is closed at this head. No conflicts. Not verified here: tests or live runs, since this was a read-only review, and whether tenant isolation namespacing stops an auth-hook tenant from naming a local session. Before merge, the admission order and the two router expectations need to change as described above. |
Apex Sentinel · ✅ Approve · review of
|
| Where | Finding |
|---|---|
packages/daemon/src/sessions/session-lifecycle/internal/session-close.ts:457 |
🆕 session-close aborts release on close error, leaking proxy and device lease |
3 new findings away from what changed since 221b59c not shown. Comment @apex-sentinel-staging review for a full review.
Reviewed with this repository's own Sentinel configuration (7c6ef4a2ed46).
💬 Talking to Sentinel
In a finding's thread, reply with:
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 1c5e303. The verdict and the full list are in the summary comment.
- 🟡 Minor · session-close aborts release on close error, leaking proxy and device lease ·
packages/daemon/src/sessions/session-lifecycle/internal/session-close.ts:457
| platformResourceCleanup: params.platformResourceCleanup, | ||
| }); | ||
| let session = sessionStore.requireCurrent(ref); | ||
| if (session.webConfinement === 'public-network' && platformCloseError) { | ||
| throw platformCloseError; | ||
| } |
There was a problem hiding this comment.
🆕 🟡 Minor · session-close aborts release on close error, leaking proxy and device lease
A confined web session whose platform close fails (for example the backend answers confirmation_required) never reaches the release/retire step, so the session stays published and its device claim is never released. runCloseTeardownAndRelease rethrows at line 460, skipping the rest of the teardown. On permanent failure the session can only be freed by daemon restart.
Suggested change
Keep the confined session published when its platform close is unconfirmed, but still run the release path that frees the device claim and marks the session so a later close can retry; do not skip the rest of runCloseTeardownAndRelease with a bare throw.
Raised as major, posted as minor: no verification confirmed it.
Details
persona: javascript
Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.
Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.
|
The admission-order problem from the earlier review (#5272 (comment)) is fixed at 1c5e303, and this review found no new problems. CI shows 26 checks with none failing at this head, including the router tests for the reordered admission in the unit lanes. No conflicts. Not verified here: tests and live runs, since this was a read-only review, and the later refusals |
|
Closing. Remote web is not supported for now: #5348 refuses remote (public-network-only) requests that reach the managed web browser with REMOTE_WEB_PUBLIC_NETWORK_UNENFORCED. Remote web may be supported later; docs/experiments/remote-web-public-network-confinement.md (in #5348) describes the confinement that would have to replace that refusal. |
Summary
Stage managed-browser egress confinement for #5306. Remote tenant web admission is unconditionally refused except
close. Binding the managed provider does not grant admission.Confinement enablement and the legacy
fix/daybreak-daemon-boundariesbase are explicitly deferred. This PR remains draft; no fixture provisioning, positive proof run, rebase or successor integration is in the current scope.Before / after
openand reads refuse withremote_web_public_network_unenforced, including when the managed provider is configured.Validation
Head: 221b59c. The modified router file passes all 24 focused tests. Removed the provider-bound admission capability and callback plumbing. Replaced obsolete admitted-remote-open router scenarios with refusal coverage; provider-level rollback tests remain unchanged. Command and reason docs were regenerated. No broad local gates, builds or live browser runs.
Hosted status at handoff: 17 passed, 9 pending, none failed; no unresolved review threads. Pending checks are not a pass.
Before eventual confinement enablement, require same-head macOS and Linux production tenant-daemon receipts correlating controlled public IPv4 HTTP/80 redirect/destination receipts and enforcement immediately after abrupt daemon exit before recovery. The in-process provider smoke does not establish that contract. Deferral does not waive it.