Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR adds fallback trust for unsigned WSL relays, rejects nested WindowsApps spoof paths, and displays relay-trust warnings in Connection settings. Example: An unsigned C:\Program Files\WSL\wslrelay.exe owns port 18789 and the managed distro confirms its gateway.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 5 items remain Keep open: this maintainer-authored PR addresses a documented compatibility failure, but the prior trust-gate defect remains and the warning can incorrectly report connection success. Priority: P1 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe connection layer combines Windows listener identity, executable trust, and managed-distro ownership to authorize credential handoffs; its snapshot also drives the Connection page. flowchart TD
A[Windows listener snapshot] --> B[Relay trust verifier]
C[Managed distro ownership] --> D[Endpoint provenance]
B --> D
D --> E[Connection manager]
E --> F[Credential bearing handshake]
E --> G[Connection warning banner]
Technical reviewBest possible solution: Keep the existing trust owners, reject writable or redirected paths before every fallback, and render state-accurate warnings with clear next steps. Do we have a high-confidence way to reproduce the issue? Source establishes that a null package result returns Warned before an Unprotected path inspection could run; positive distro ownership then permits strong-credential authorization, but no exploit or target code was executed during this review. Is this the best way to solve the issue? The existing verifier, provenance service, manager snapshot, and page projection are appropriate owners, but the fallback must preserve path protection independently of package lookup and the warning must distinguish preflight from connection success. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b917d7e197e5. Provenance checked
TestingProof path: shipped entry point. SecurityNeeds attention: Usable warning results can bypass filesystem protection at the strong-credential boundary. EvidenceSecurity concerns:
What I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 3, 2026, 1:13 PM ET / 18:13 UTC (Revision 2). |
Store WSL 2.6.3+ ships wslrelay.exe without embedded Authenticode signatures, so relay trust now accepts either a valid embedded Microsoft signature or MSIX package verification: canonical relay path, matching Get-AppxPackage family/publisher identity, and an admin-protected path ACL. A canonical relay that proves neither degrades to a warned result that still requires positive expected-distro systemd MainPID ownership; non-canonical and ACL-violating paths still fail closed. This unblocks setup pair-operator on machines where the unsigned Store relay was rejected and the whole pipeline rolled back.
…tory
The WSL relay package fallback accepted any wslrelay.exe whose immediate parent directory was named like the WSL package family, so a WSL-named folder nested inside another package's WindowsApps directory passed ownership checks. Validate the actual package root: only {WindowsApps}\{WSL package directory}\wslrelay.exe is treated as WSL-owned; deeper nesting is rejected with the existing not-owned-by-family message. Adds a regression theory covering the nested spoof with Protected and Unverifiable path evidence.
Adds a file header explaining the dual trust paths (embedded Microsoft Authenticode signature or the WSL MSIX package fallback for unsigned wslrelay.exe), the warning/rejection semantics, and an example of VerifyMicrosoftSignedFile with each AuthenticodeTrustResult outcome.
Carry the verifier reason as GatewayEndpointProvenance.RelayTrustWarning (replacing string matching), through EndpointCredentialAuthorization into GatewayConnectionSnapshot.ManagedRelayTrustWarning. The manager publishes it on connect/node-only connect, refreshes it on operator credential handoff, and clears it on disconnect. ConnectionPage renders a Warning InfoBar with localized copy plus the reason in all six locales.
8a409c3 to
66e0c47
Compare
Update: Connection page warning for unverified WSL relay trust (
|
A denied operator handoff moved the connection to Error but kept the banner claiming the distro confirmed the gateway. Also use full-width punctuation in the zh-cn/zh-tw warning copy.
Proof update (
|
| State | UI Automation reading |
|---|---|
| Connected | RelayTrustWarning present, IsOffscreen=False. Title "WSL relay could not be verified". Message "Windows could not fully verify the WSL relay (wslrelay.exe) that forwards this gateway connection. OpenClaw connected because the managed WSL distro confirmed it owns the gateway port. Reason: proof injection: no installed WSL package could corroborate the relay". Headline "Connected". |
| After toggling off | Element removed from the tree. Headline "Not connected". |
The window captures for both states will be attached in a follow-up comment.
Validation on 9521eec1
| Check | Result |
|---|---|
./build.ps1 |
all built |
| Shared | 4810 passed / 0 failed / 24 skipped |
| Tray | 4799 passed / 0 failed |
| Connection | 1716 passed / 3 failed (the same migration-script tests as before) / 1 skipped |
Still needs proof
windows-wsl-gateway-e2e: the genuine verifierWarnedpath on a real managed-WSL gateway. The fixture injection bypassesManagedLocalGatewayPortProvenanceService, which is covered by unit tests only.- Banner screenshot via the real data path: run on a host with a managed WSL gateway, with the injection placed in
InspectWslRelayBinary. - Screenshots: the two captures need to be attached to this PR.
|
I think I might have had an older version of wsl even, because now I don't see the same problem |
|
I collected the proof in four parts: unit tests that fail without the fix, an independent code review, the full build and test suites, and screenshots of the banner in the real app. The screenshots used a faked reason, because this machine can't produce the warning for real.
For each new behaviour I ran the test, then temporarily removed the line that implements it and ran the test again: ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────┬─────────────────────────┬────────────────┐ These tests use the real GatewayConnectionManager with a fake endpoint probe that returns whatever provenance result the test sets. A red run shows the test actually checks the behaviour rather than passing regardless. The relay-check tests
I sent a separate read-only reviewer agent the commit diff and a list of things to check: deadlocks, stale state, privacy, UI and translations, and test quality. It found a stale-banner bug (P2) and wrong Chinese punctuation (P3). I fixed both, added the denied-handoff test
On the final head 9521eec I ran ./build.ps1 and the Shared, Tray and Connection suites, reading the pass/fail counts from each run's output. On 66e0c47, before the review fixes, I also ran SetupEngine (all passed with OPENCLAW_REPO_ROOT set). The 3 Connection failures are
This machine has no managed WSL gateway, so the real "unverified relay" state can't happen here. So I:
What this does and doesn't prove
|
|
@shanselman, a finding from the validation host that's relevant to the proof gaps listed above. Validation host:
The host has an unsigned relay, and the current verifier trusts it outright.
I loaded the built
What this means for this PR:
|
Explained for toddlers.Why Short answerNo. Like you're 5Think of signatures as stickers that say "Microsoft made this, and nobody changed it."
So nothing cryptographically vouches for What was observed on the host
Why it's unsignedThe host can't tell us why Microsoft left it unsigned. This part is inference: every other executable in the same folder is signed, so it looks like There's also an oddity: the relay reports file version 2.6.3.0 while the installed product is 3.0.3.0. Either the relay binary wasn't rebuilt for 3.0.x, or its version stamp wasn't updated. I didn't confirm which. What the OpenClaw verifier actually checksThe verifier's "package-level" fallback is not a cryptographic check of the file. It is evidence that the relay sits where only a real WSL install could put it:
On the host all three pass, so the result is Trusted. The reasoning is: an attacker who could write to |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Hi @larroy! I'm a Copilot triage agent helping Scott, not Scott himself. Thanks again for reviewing and merging #1991 (refactor(connection): simplify WSL relay trust to install location plus in-distro ownership). Since that landed, a WSL relay outside the usual install folders is accepted with a log warning, and Is this PR still needed after #1991, or is it OK to close it? Totally your call, and no rush. We also have a small local draft of a Connection page warning banner. We're holding it for now, since the case is rare and #1991 already handles it without blocking. |
PR cleanup reviewReviewed head: Thanks for working through the unsigned WSL relay issue and documenting the tradeoffs. #1991 (refactor(connection): simplify WSL relay trust to install location plus in-distro ownership) now handles that compatibility case on main and removes the verifier this branch extends. I recommend closing this implementation rather than bringing the old verifier back. The Connection warning is still distinct work, not already shipped, and can be considered separately on current main if it is still useful. That follow-up should use state-accurate wording and prove the real managed-WSL path. This follows up on the existing November 8 closure question; no change has been made to your branch. Action in this cleanup pass: leaving this PR open. No branch changes or runtime-proof waiver. The findings above come from source, discussion and recorded-CI review; Windows validation was not rerun in this pass. |
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |



What Problem This Solves
Fixes three related problems with the managed-local WSL gateway trust check:
wslrelay.exe.wslrelay.exeplanted in a WSL-named folder nested inside another package'sWindowsAppsdirectory.User Impact
User impact:
WindowsAppsspoof can no longer be treated as the expected managed gateway or receive the shared gateway credential.Why This Change Was Made
Modern Store WSL ships
wslrelay.exewithout a per-file Authenticode signature. To handle that,WindowsAuthenticodeVerifiergained a package-level fallback (commit93a4d246, dual-reviewed). It grants trust when three conditions hold:Get-AppxPackageidentity exists.When that evidence is unavailable, the verifier returns a warning instead of failing, and the managed distro ownership probe must corroborate the gateway.
Nesting spoof (finding R1 of the advisory review). The original fallback checked only the relay's immediate parent directory name, so
WindowsApps\Other.App_...\MicrosoftCorporationII.WindowsSubsystemForLinux_9__8wekyb3d8bbwe\wslrelay.exepassed.IsWslPackageRootRelaynow accepts only{WindowsApps}\{WSL package directory}\wslrelay.exe: the WSL-named directory must be the package root, and the relay must sit directly in it. Review findings R2-R8 are intentionally not addressed here.Visible warning. The warned state was previously detected by searching
Detailfor a log phrase. The verifier reason now travels as a typed field:GatewayEndpointProvenance.RelayTrustWarning→EndpointCredentialAuthorization.RelayTrustWarning→GatewayConnectionSnapshot.ManagedRelayTrustWarning→ConnectionPagePlan.RelayTrustWarningDetail→ theRelayTrustWarningInfoBar.GatewayConnectionManagerowns the warning's lifecycle:The copy is localized in all six locales.
Evidence
VerifyMicrosoftSignedFile_WslNamedDirectoryNestedInsideAnotherWindowsAppsPackage_IsRejected, with Protected and Unverifiable path evidence. On the unfixed verifier both cases returnedIsTrusted=true; after the fix both are rejected.ManagedRelayTrustWarning_PublishesOnConnect_RefreshesOnHandoff_ClearsOnDisconnectruns for the device-token and shared-token credential paths. With the handoff observer removed, both cases time out.ManagedRelayTrustWarning_ClearsWhenLaterHandoffIsDeniedtimes out when the clear-on-denied-handoff line is removed.66e0c475found one P2: the banner went stale after a denied handoff. It also found one P3: ASCII punctuation in the zh-cn/zh-tw copy. Both are fixed in9521eec1.Change Type
Scope
winnodeRequired proof pools
windows-winui-interactive: the Warning InfoBar on Settings > Connection.windows-wsl-gateway-e2e: a real managed-WSL connection where the genuine verifier returnsWarned.Validation
On head
9521eec1(native ARM64 Windows 11,OPENCLAW_REPO_ROOTset):pwsh -NoProfile -File ./build.ps1: all projects built (Shared, Cli, WinNodeCli, SetupEngine, WinUI).dotnet test tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj: 4810 passed, 0 failed, 24 skipped.dotnet test tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj: 4799 passed, 0 failed. This includesLocalizationValidationTests: key parity,{0}placeholder parity, XAMLx:Uidresources, and all-or-none translation.dotnet test tests/OpenClaw.Connection.Tests/OpenClaw.Connection.Tests.csproj: 1716 passed, 3 failed, 1 skipped.StoreMigrationPackagePresenceTests.DeletedReceipt_WithoutStorePackage_ReportsNoMigrationand twoMigrationRecordTests.WindowsPowerShellChecker_UsesTheSameContractcases.--filter "FullyQualifiedName~ManagedRelayTrustWarning": 3 passed, 0 failed.dotnet test tests/OpenClaw.SetupEngine.Tests/OpenClaw.SetupEngine.Tests.csproj(on66e0c475): 2523 passed, 0 failed, 4 skipped.Real Behavior Proof
fix/wsl-relay-msix-trust, isolated fixture Gatewayscripts/run-gateway-fixture.ps1with a disposable profile.9521eec1plus a temporary, uncommitted injection. In the non-managed branch ofAuthorizeCredentialForEndpointAsync, the injection read the reason from an environment variable. It was reverted before commit; the committed diff contains no injection.5308ab1b.winnode --mcp-url <fixture> --command app.navigate --params '{"page":"connection"}'.RelayTrustWarningelement through UI Automation and captured the window.ConnectionToggleoff through UI Automation and captured again.RelayTrustWarningon screen with:WindowsAppsspoof paths are rejected with "not owned by the WSL package family".No. The two window captures (relay-warning-warned.png,relay-warning-disconnect.png) exist only locally and are not yet attached here.Warnedpath into the banner was not exercised, because this host has no managed WSL gateway. The fixture injection bypassesManagedLocalGatewayPortProvenanceService, which is covered by unit tests only.Security Impact
NoNoNoNoNoYes, explain the risk and mitigation: n/a.Compatibility and Migration
Yes. Genuine layouts are unchanged: the relay directly under the WSL package root,Program Files\WSL, andSystem32. New record and snapshot fields are optional and default to null.NoNoReview Conversations