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.
Python agentagent-osaiai-agentsai-partnerchatopsclaudeclaude-codecodexdevtoolsdiscord-botlark-botllmlocal-firstlong-term-memoryopencodeslack-botvibe-codingvibeywechat
fix(ui_server): exclude container wildcard lan interfaces
cyh58e048a26863
diff --git a/tests/test_ui_remote_access_auth.py b/tests/test_ui_remote_access_auth.pyindex 333c44395..4623daf49 100644--- a/tests/test_ui_remote_access_auth.py+++ b/tests/test_ui_remote_access_auth.py@@ -1168,6 +1168,7 @@ def test_setup_host_mismatched_host_header_is_not_local(monkeypatch, tmp_path):def test_setup_host_wildcard_allows_actual_lan_interface_host(monkeypatch, tmp_path):monkeypatch.setenv("VIBE_REMOTE_HOME", str(tmp_path))+ monkeypatch.setattr(ui_server, "_is_containerized_runtime", lambda: False)_save_config_with_setup_host(tmp_path, "0.0.0.0")_mock_interface(monkeypatch, "192.168.2.3", 24)@@ -1180,6 +1181,38 @@ def test_setup_host_wildcard_allows_actual_lan_interface_host(monkeypatch, tmp_passert response.status_code == 200+def test_setup_host_wildcard_allows_bare_metal_eth_lan_interface(monkeypatch, tmp_path):+ monkeypatch.setenv("VIBE_REMOTE_HOME", str(tmp_path))+ monkeypatch.setattr(ui_server, "_is_containerized_runtime", lambda: False)+ _save_config_with_setup_host(tmp_path, "0.0.0.0")+ _mock_interface(monkeypatch, "192.168.2.3", 24, name="eth0")++ response = app.test_client().get(+ "/health",+ base_url="http://192.168.2.3:5123",+ environ_base={"REMOTE_ADDR": "192.168.2.5"},+ )++ assert response.status_code == 200+++def test_setup_host_wildcard_does_not_trust_container_eth_interface(monkeypatch, tmp_path):+ monkeypatch.setenv("VIBE_REMOTE_HOME", str(tmp_path))+ monkeypatch.setattr(ui_server, "_is_containerized_runtime", lambda: True)+ _save_config_with_setup_host(tmp_path, "0.0.0.0")+ _mock_interface(monkeypatch, "192.168.2.3", 24, name="eth0")++ response = app.test_client().get(+ "/dashboard",+ base_url="http://192.168.2.3:5123",+ environ_base={"REMOTE_ADDR": "192.168.2.5"},+ follow_redirects=False,+ )++ assert response.status_code == 503+ assert response.get_json()["error"] == "remote_access_host_mismatch"++def test_setup_host_wildcard_does_not_trust_unconfigured_lan_host(monkeypatch, tmp_path):monkeypatch.setenv("VIBE_REMOTE_HOME", str(tmp_path))_save_config_with_setup_host(tmp_path, "0.0.0.0")@@ -1398,6 +1431,7 @@ def test_setup_host_wildcard_does_not_trust_unconfigured_tailscale_host(monkeypadef test_setup_host_ipv6_wildcard_allows_actual_private_interface_host(monkeypatch, tmp_path):monkeypatch.setenv("VIBE_REMOTE_HOME", str(tmp_path))+ monkeypatch.setattr(ui_server, "_is_containerized_runtime", lambda: False)_save_config_with_setup_host(tmp_path, "::")_mock_interface(monkeypatch, "fd00::5", 64)diff --git a/vibe/ui_server.py b/vibe/ui_server.pyindex a6d90e0c6..c3d181ab2 100644--- a/vibe/ui_server.py+++ b/vibe/ui_server.py@@ -301,6 +301,7 @@ _TAILSCALE_IP_CACHE_TTL_SECONDS = 30.0_TAILSCALE_IP_CACHE: tuple[float, frozenset[ipaddress._BaseAddress]] | None = None_TAILSCALE_PEER_CACHE_TTL_SECONDS = 30.0_TAILSCALE_PEER_CACHE: dict[ipaddress._BaseAddress, tuple[float, bool]] = {}+_CONTAINER_CGROUP_MARKERS = ("docker", "kubepods", "containerd", "libpod", "podman")def _is_private_address(address: ipaddress._BaseAddress) -> bool:@@ -309,6 +310,19 @@ def _is_private_address(address: ipaddress._BaseAddress) -> bool:return isinstance(address, ipaddress.IPv4Address) and address in _SHARED_ADDRESS_SPACE+def _is_containerized_runtime() -> bool:+ if Path("/.dockerenv").exists() or Path("/run/.containerenv").exists():+ return True+ for cgroup_path in (Path("/proc/self/cgroup"), Path("/proc/1/cgroup")):+ try:+ cgroup = cgroup_path.read_text(encoding="utf-8", errors="ignore").lower()+ except OSError:+ continue+ if any(marker in cgroup for marker in _CONTAINER_CGROUP_MARKERS):+ return True+ return False++def _is_private_peer() -> bool:address = _request_peer_address()return address is not None and _is_private_address(address)@@ -649,6 +663,8 @@ def _allows_wildcard_setup_host_trust(interface_name: str, address: ipaddress._Bif normalized_name.startswith(_TAILSCALE_UTUN_INTERFACE_PREFIXES):return address in _tailscale_local_addresses()return False+ if _is_containerized_runtime():+ return Falsereturn normalized_name.startswith(_WILDCARD_TRUST_LAN_INTERFACE_PREFIXES)