Skip to content

fix: allow WSL2 172.x subnet in CORS origin whitelist - #998

Open
web3dev1337 wants to merge 4 commits into
mainfrom
fix/cors-wsl2-origin
Open

fix: allow WSL2 172.x subnet in CORS origin whitelist#998
web3dev1337 wants to merge 4 commits into
mainfrom
fix/cors-wsl2-origin

Conversation

@web3dev1337

Copy link
Copy Markdown
Owner

Summary

  • Adds http://172. to the Socket.IO CORS origin whitelist
  • WSL2 uses a 172.x.x.x virtual network — browsers connecting via the WSL IP were rejected by the CORS policy added during public-release security hardening

Test plan

  • Access orchestrator from Windows browser via WSL2 IP (e.g. http://172.30.127.227:2080)
  • Verify Socket.IO connects without 400 errors

🤖 Generated with Claude Code

web3dev1337 and others added 2 commits April 7, 2026 15:56
WSL2 uses a 172.x.x.x virtual network — browsers connecting via
the WSL IP were rejected by the CORS policy added in the
public-release security hardening.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Review feedback: a bare "http://172." prefix whitelists all of 172.0.0.0/8,
which includes active public internet space (Cloudflare 172.64/13, Google
172.217/16). WSL2 vEthernet addresses only come from the RFC1918
172.16-172.31 range, so match exactly that.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@web3dev1337

Copy link
Copy Markdown
Owner Author

Reviewed in the open-PR sweep: right idea, but bare http://172. matched all of 172.0.0.0/8 — including public ranges like Cloudflare's 172.64/13 and Google's 172.217/16 — not just WSL2's private 172.16.0.0/12. Tightened to /^http:\/\/172\.(1[6-9]|2\d|3[01])\./. Note the pre-existing 100. prefix has the same imprecision (all of 100/8 vs CGNAT 100.64/10) — left for a follow-up since it's on main already. Good to merge after this.

Devices on the home LAN reach the orchestrator through the Windows
portproxy with origins like http://192.168.0.53:2080, which the whitelist
rejected — Socket.IO connections from a phone or second PC failed even
though the private 172.16/12 (WSL) and CGNAT 100/8 (Tailscale) ranges were
already allowed. Adds 192.168/16 and 10/8; all public space stays blocked.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@web3dev1337

Copy link
Copy Markdown
Owner Author

Extended for remote access: the whitelist now also accepts the remaining RFC1918 private ranges (192.168/16, 10/8) — LAN devices reaching the orchestrator through the Windows portproxy present origins like http://192.168.0.53:2080, which were being rejected so Socket.IO never connected from a phone or second PC. Public address space remains blocked.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant