Skip to content

fix(webui): allow WebUI access via IPv6 addresses - #1908

Open
VedantMadane wants to merge 1 commit into
bitaxeorg:masterfrom
VedantMadane:fix/issue-1841-webui-ipv6
Open

fix(webui): allow WebUI access via IPv6 addresses#1908
VedantMadane wants to merge 1 commit into
bitaxeorg:masterfrom
VedantMadane:fix/issue-1841-webui-ipv6

Conversation

@VedantMadane

Copy link
Copy Markdown

Summary

Fixes WebUI access when browsing the miner over IPv6 (http://[device-ipv6]/). The HTTP server accepted the TCP connection and served static assets, but API/WebSocket handlers rejected requests because is_network_allowed() only understood IPv4-mapped peers and IPv4 Origin hosts.

Changes

Firmware (http_server.c)

  • Parse bracketed IPv6 literals in the Origin header (previously split on the first : as a port)
  • Classify IPv6 peers as LAN when ULA / link-local / loopback / IPv4-mapped private
  • Allow Origin that matches this device's configured IPv4 or IPv6 (including GUA from SLAAC shown in System menu) so home dual-stack CGNAT+IPv6 access works
  • Keep existing hostname / .local allow paths

AxeOS swarm UI

  • Bracket IPv6 hosts when building http:// URLs so client requests remain valid under IPv6

Notes

  • Related: open PR Restrict API access to LAN peers and origins #1847 hardens LAN origin classification more broadly; this PR is scoped to making IPv6 WebUI access work (including device GUA Origin) and UI URL construction.
  • No hardware test on this machine (no Bitaxe). Logic review + build CI expected.

Test plan

  • Browse http://[device-ipv6]/ — dashboard loads and /api/system/info returns 200
  • WebSocket live data connects over IPv6
  • IPv4 WebUI still works unchanged
  • Origin from non-LAN host still denied

Fixes #1841

is_network_allowed only understood IPv4-mapped peers and IPv4 Origin
hosts, so browsing http://[device-ipv6] loaded static assets but API
calls were rejected. Parse bracketed IPv6 Origin hosts, classify
ULA/link-local/loopback peers, and allow Origin that matches the
device's own IPv4/IPv6 (including GUA from SLAAC).

Also bracket IPv6 literals in AxeOS swarm HTTP URLs so client-side
requests remain valid when the UI is opened over IPv6.

Fixes bitaxeorg#1841

Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.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.

[Bug] Fix access to WebUI via IPv6

1 participant