Repository navigation
fix(client): refuse insecure credential transport - #5299
Conversation
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 16 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.
114df0f to
7214c93
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on a93da8c. The verdict and the full list are in the summary comment.
278fdec to
65f4412
Compare
36119a3 to
2c6e9f7
Compare
This comment has been minimized.
This comment has been minimized.
be122c3 to
ac0eadf
Compare
This comment has been minimized.
This comment has been minimized.
ac0eadf to
b6e9bb3
Compare
51c56f0 to
3ca55c8
Compare
This comment has been minimized.
This comment has been minimized.
b6e9bb3 to
ee8075e
Compare
3ca55c8 to
1dfc70a
Compare
|
At 1dfc70a, this change would make the next 0.21.x release refuse requests that 0.21.x should only warn about. Two credential paths also need fixes. credential-admission.ts:11 changes the admission result from a warning to a throw on a stack based on A second independent pass found a likely gap in the Metro companion. A second independent pass found that the proxy can likely skip the masked refusal. With the default transport, a non-loopback Would it be simpler to keep Not blocking: these can be taken or left: These earlier threads are addressed at this head and can be resolved: the The cancelled Body rules check only reads the PR body and was superseded by a body edit, so it looks unrelated to the code. One other check is still queued. An earlier failure in Not verified here: no tests were run, and the expectation that the new admission and proxy tests fail on the base comes from reading the code. Not verified here: whether a CLI client behind an Before merge, the release line needs a decision: keep the refusal off |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
At 525847e, the companion entry check, proxy admission ordering and origin masking address parts of the earlier review, but the release-line refusal remains unresolved. The static review found no conflicts. The shared admission boundary now refuses configured off-loopback HTTP destinations without the override, so existing 0.21.x deployments can fail before the announced 0.22 cutoff; the embedded default proxy also stops forwarding its daemon token. Please preserve the warning on 0.21.x and port the companion check, proxy ordering and origin masking to 0.22, which already carries #5191. Preserve the existing 0.22 health refusal wire contract when porting the mask. Admission boundary A second independent pass found that the earlier refusal finding still applies: the unchanged 0.21.x base now returns INVALID_ARGS for CLI, SDK, Metro and proxy callers that previously sent credentials with a warning. Could the release target be resolved before merge, either by keeping the warning on 0.21.x and porting the remaining changes to 0.22, or by moving the stack to 0.22 and aligning the package versions, ADR status, contract comment and docs? Release guidance Body rules was cancelled without a failure excerpt; the check grades PR metadata and its cancellation cause is not established, so it appears unrelated to the source change. Not verified here: tests or live sessions; the focused run was reported by the author without a captured receipt. The changed routes are host-side proxy forwarding and Metro registration admission before device dispatch, so this delta does not require live device evidence. Resolve the release target and obtain a passing Body rules check on the resulting head before merge. |
525847e to
5a70105
Compare
|
Following up on the release-line review. This PR now targets The prepared port passed all 16 focused proxy and companion tests. The published diff matches that port, and GitHub reports it mergeable. Body rules and hosted review are pending on the new head. |
This comment has been minimized.
This comment has been minimized.
Apex Sentinel · ✅ Approve · review of
|
| Where | Finding |
|---|---|
packages/react-native/src/companion/client-companion-tunnel-worker.test.ts:675 |
🆕 Companion admission test stubs the insecure-transport override to "1" |
Reviewed with this repository's own Sentinel configuration (86188448f4b0).
💬 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 1fc6689. The verdict and the full list are in the summary comment.
- 🟡 Minor · Companion admission test stubs the insecure-transport override to "1" ·
packages/react-native/src/companion/client-companion-tunnel-worker.test.ts:675
|
At 1fc6689, the earlier review findings on credential transport are addressed, and no new code issues were found. The ambient override thread does not apply: the override intentionally checks that the injected environment controls admission. Body rules was cancelled; the check grades the PR title and body, which this patch does not change, so the cancellation appears unrelated. No conflicts are known. Obtain a passing Body rules check at 1fc6689 before merge; the release-line issue is resolved. Not verified here: tests and devices were not run during this static review. Not verified here: the author-reported local runs and the suspected historical cause of the Coverage failure were not supported by captured receipts. |
* fix(security): complete credential admission on 0.22 * fix(proxy): keep upstream fetch within the file line limit * test(daemon-client): keep the unreachable fixture port bound
Summary
Complete ADR 0041 credential admission on
0.22(#5182), which already includes refusal through #5191. This four-file port checks the Metro companion's environment before registration, awaits default proxy admission before preparing upstream credentials, and masks the configured origin in public errors. The 0.21.x warning remains on its release line.Before / after
/healthretains HTTP 400,INVALID_ARGS, the nesteddetails.reason, and the hint. The public message masks the configured origin./rpcapplies the same masking within its existing JSON-RPC envelope.Validation
At
dddd87b9c34714daaa0d1ae000704abbe070144a, all 16 focused tests passed indaemon-proxy-credential-transport.test.tsandclient-companion-tunnel-worker.test.ts. Focused oxlint and oxfmt passed fordaemon-proxy.ts. The earlier CI job rejected the proxy file at 1,001 lines. The follow-up simplifies the default fetch declaration to meet the 1,000-line limit while preserving behavior. Hosted lint passed at that head.Coverage failed in an inherited daemon-client test. A local probe confirmed that the fixture's released port could be rebound. CI did not establish port reuse. A separate test commit keeps the port bound and closes HTTP requests before responding.
At
1fc668992eb59e0ed611e093f20c78b2d83aecc4, all 13 tests indaemon-client-ensuring.test.tspassed locally with loopback required. Hosted CI and review are pending.