Skip to content

fix(macos): reject insecure non-loopback ws remote gateway urls#21971

Merged
mbelinky merged 1 commit intomainfrom
fix/macos-remoteconfig-ws-loopback
Feb 20, 2026
Merged

fix(macos): reject insecure non-loopback ws remote gateway urls#21971
mbelinky merged 1 commit intomainfrom
fix/macos-remoteconfig-ws-loopback

Conversation

@mbelinky
Copy link
Contributor

@mbelinky mbelinky commented Feb 20, 2026

Summary\n- reject insecure non-loopback ws:// URLs in GatewayRemoteConfig normalization\n- use strict loopback parsing to avoid prefix bypasses\n- add/adjust GatewayEndpointStore tests for allowed loopback and rejected non-loopback/prefix-bypass hosts\n\n## Why\nThis lands the macOS remote-config hardening intent from #21268 as a separate focused change.

Greptile Summary

Adds security hardening to reject insecure ws:// URLs for non-loopback gateway connections on macOS. The implementation uses robust IP address parsing via the Network framework to prevent both direct non-loopback connections and prefix-bypass attacks (e.g., ws://127.attacker.example). The loopback detection correctly handles localhost, IPv4 127.x.x.x addresses, IPv6 ::1, and IPv4-mapped IPv6 addresses.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk - it's a focused security hardening change with appropriate test coverage
  • The implementation correctly addresses the security concern by using proper IP address parsing instead of string matching, includes comprehensive loopback detection for IPv4 and IPv6, and has test coverage for the new security constraints including edge cases
  • No files require special attention

Last reviewed commit: 93df6ad

@openclaw-barnacle openclaw-barnacle bot added app: macos App: macos size: S maintainer Maintainer-authored PR labels Feb 20, 2026
@mbelinky mbelinky force-pushed the fix/macos-remoteconfig-ws-loopback branch from 93df6ad to 0c33523 Compare February 20, 2026 16:18
@openclaw-barnacle openclaw-barnacle bot added the docs Improvements or additions to documentation label Feb 20, 2026
@bmendonca3
Copy link

This matches the macOS hardening intent from #21268, and the strict loopback parsing approach should prevent a lot of subtle edge cases. If there’s any room for it later, it might be worth centralizing the loopback-check helper across the Swift surfaces to reduce drift

@mbelinky mbelinky force-pushed the fix/macos-remoteconfig-ws-loopback branch from 0c33523 to 9e8cdbf Compare February 20, 2026 16:33
@mbelinky mbelinky merged commit 774d73b into main Feb 20, 2026
8 checks passed
@mbelinky mbelinky deleted the fix/macos-remoteconfig-ws-loopback branch February 20, 2026 16:34
@mbelinky
Copy link
Contributor Author

Merged via squash.

Thanks @mbelinky!

@openclaw-barnacle openclaw-barnacle bot removed the docs Improvements or additions to documentation label Feb 20, 2026
rodrigogs pushed a commit to rodrigogs/openclaw that referenced this pull request Feb 20, 2026
…claw#21971)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 9e8cdbf
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
Hansen1018 added a commit to Hansen1018/openclaw that referenced this pull request Feb 21, 2026
…claw#21971)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 9e8cdbf
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
vincentkoc pushed a commit that referenced this pull request Feb 21, 2026
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 9e8cdbf
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
dgarson pushed a commit to dgarson/clawdbot that referenced this pull request Feb 21, 2026
…claw#21971)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 9e8cdbf
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
mmyyfirstb pushed a commit to mmyyfirstb/openclaw that referenced this pull request Feb 21, 2026
…claw#21971)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 9e8cdbf
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
obviyus pushed a commit to guirguispierre/openclaw that referenced this pull request Feb 22, 2026
…claw#21971)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 9e8cdbf
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
mreedr pushed a commit to mreedr/openclaw-custom that referenced this pull request Feb 24, 2026
…claw#21971)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 9e8cdbf
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 1, 2026
…claw#21971)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 9e8cdbf
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky

(cherry picked from commit 774d73b)

# Conflicts:
#	apps/macos/Tests/OpenClawIPCTests/GatewayEndpointStoreTests.swift
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 3, 2026
…claw#21971)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 9e8cdbf
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky

(cherry picked from commit 774d73b)

# Conflicts:
#	apps/macos/Tests/MoltbotIPCTests/GatewayEndpointStoreTests.swift
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…claw#21971)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 9e8cdbf
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants