Security: reject insecure non-loopback gateway deep links#21268
Closed
bmendonca3 wants to merge 2 commits intoopenclaw:mainfrom
Closed
Security: reject insecure non-loopback gateway deep links#21268bmendonca3 wants to merge 2 commits intoopenclaw:mainfrom
bmendonca3 wants to merge 2 commits intoopenclaw:mainfrom
Conversation
This was referenced Feb 20, 2026
Contributor
|
Closing as superseded by focused split PRs:\n- #21970 shared deep-link ws loopback hardening\n- #21971 macOS remote-config ws loopback hardening\n- #21972 browser upload symlink-escape hardening\n\nReason:\n- each security fix is now isolated and reviewable on its own\n- strict loopback matching is applied to avoid prefix-bypass hosts\n- removes unrelated scope mixing from the original combined PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
openclaw://gatewaydeep links that request insecurews://transport for non-loopback hostsws://URLsws://flows working for local development and same-host agent setupsSecurity impact
This closes a configuration/deep-link vector where users could be tricked into pairing over cleartext WebSocket to a non-loopback host, exposing gateway tokens in transit.
Validation
swift test --package-path apps/shared/OpenClawKit --filter DeepLinksSecurityTests(fails in this environment due upstream macro plugin resolution in dependency checkout:SwiftUIMacrosnot found; unrelated to this change)swiftc apps/shared/OpenClawKit/Sources/OpenClawKit/DeepLinks.swift /tmp/deeplink_security_repro.swift -o /tmp/deeplink_security_repro && /tmp/deeplink_security_reproswiftc apps/macos/Sources/OpenClaw/GatewayRemoteConfig.swift /tmp/gateway_remote_config_repro.swift -o /tmp/gateway_remote_config_repro && /tmp/gateway_remote_config_reproNotes
Greptile Summary
Adds security guardrails to prevent cleartext WebSocket (
ws://) connections to non-loopback hosts in gateway deep links and setup codes, mitigating a social engineering vector where users could be tricked into pairing over insecure connections.Key changes:
isLoopbackHost()helper inDeepLinks.swiftandGatewayRemoteConfig.swiftthat checks forlocalhost,127.0.0.1,::1, and127.*prefixesDeepLinkParser.parse()to rejectopenclaw://gatewaydeep links withtls=0for non-loopback hostsGatewayConnectDeepLink.fromSetupCode()to reject setup code payloads with insecure non-loopbackws://URLsGatewayRemoteConfig.normalizeGatewayUrl()to reject non-loopbackws://URLs in macOS remote configSecurity impact:
This prevents users from being socially engineered into establishing cleartext WebSocket connections that would expose gateway authentication tokens to network eavesdropping. The change preserves local development workflows (
ws://127.0.0.1) while blocking the attack vector (ws://attacker.example).Confidence Score: 5/5
Last reviewed commit: 290f1c9