Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(ui_server): reject generic utun wildcard trust

cyh73bca7338ca6
diff --git a/tests/test_ui_remote_access_auth.py b/tests/test_ui_remote_access_auth.py
index 1009aa777..9b9b4d459 100644
--- a/tests/test_ui_remote_access_auth.py
+++ b/tests/test_ui_remote_access_auth.py
@@ -1359,6 +1359,38 @@ def test_setup_host_ipv6_wildcard_does_not_trust_bridge_in_tailscale_ula_range(m
assert response.get_json()["error"] == "remote_access_host_mismatch"
+def test_setup_host_wildcard_does_not_trust_generic_utun_tunnel(monkeypatch, tmp_path):
+ monkeypatch.setenv("VIBE_REMOTE_HOME", str(tmp_path))
+ _save_config_with_setup_host(tmp_path, "0.0.0.0")
+ _mock_interface(monkeypatch, "100.97.103.112", 32, name="utun4")
+
+ response = app.test_client().get(
+ "/dashboard",
+ base_url="http://100.97.103.112:5123",
+ environ_base={"REMOTE_ADDR": "100.97.103.5"},
+ follow_redirects=False,
+ )
+
+ assert response.status_code == 503
+ assert response.get_json()["error"] == "remote_access_host_mismatch"
+
+
+def test_setup_host_ipv6_wildcard_does_not_trust_generic_utun_tunnel(monkeypatch, tmp_path):
+ monkeypatch.setenv("VIBE_REMOTE_HOME", str(tmp_path))
+ _save_config_with_setup_host(tmp_path, "::")
+ _mock_interface(monkeypatch, "fd7a:115c:a1e0::5", 128, name="utun4")
+
+ response = app.test_client().get(
+ "/dashboard",
+ base_url="http://[fd7a:115c:a1e0::5]:5123",
+ environ_base={"REMOTE_ADDR": "fd7a:115c:a1e0::20"},
+ follow_redirects=False,
+ )
+
+ assert response.status_code == 503
+ assert response.get_json()["error"] == "remote_access_host_mismatch"
+
+
def test_setup_host_with_cloudflare_metadata_is_not_local(monkeypatch, tmp_path):
monkeypatch.setenv("VIBE_REMOTE_HOME", str(tmp_path))
_save_config_with_setup_host(tmp_path, "192.168.2.3")
diff --git a/vibe/ui_server.py b/vibe/ui_server.py
index 0652394a8..bc717d78a 100644
--- a/vibe/ui_server.py
+++ b/vibe/ui_server.py
@@ -292,7 +292,6 @@ _WILDCARD_TRUST_LAN_INTERFACE_PREFIXES = (
)
_WILDCARD_TRUST_OVERLAY_INTERFACE_PREFIXES = (
"tailscale",
- "utun",
)