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(remote-access): deny disabled host mismatches

cyh1c6cf95ac09d
diff --git a/tests/test_ui_remote_access_auth.py b/tests/test_ui_remote_access_auth.py
index 119d690e8..7cf5af8a9 100644
--- a/tests/test_ui_remote_access_auth.py
+++ b/tests/test_ui_remote_access_auth.py
@@ -194,6 +194,23 @@ def test_remote_host_fails_closed_when_disabled_but_hostname_still_matches(monke
assert response.get_json()["error"] == "remote_access_disabled"
+def test_unmatched_non_local_host_fails_closed_when_remote_access_disabled(monkeypatch, tmp_path):
+ monkeypatch.setenv("VIBE_REMOTE_HOME", str(tmp_path))
+ config = _save_config(tmp_path)
+ config.remote_access.vibe_cloud.enabled = False
+ config.save()
+
+ response = app.test_client().get(
+ "/dashboard",
+ base_url="https://old-alex.avibe.bot",
+ environ_base=_remote_peer(),
+ follow_redirects=False,
+ )
+
+ assert response.status_code == 503
+ assert response.get_json()["error"] == "remote_access_host_mismatch"
+
+
def test_remote_host_fails_closed_when_public_url_is_invalid(monkeypatch, tmp_path):
monkeypatch.setenv("VIBE_REMOTE_HOME", str(tmp_path))
config = _save_config(tmp_path)
diff --git a/vibe/ui_server.py b/vibe/ui_server.py
index b2e13d0d7..d7fd592dd 100644
--- a/vibe/ui_server.py
+++ b/vibe/ui_server.py
@@ -369,7 +369,7 @@ def enforce_remote_access_cookie():
return jsonify({"ok": False, "error": "remote_access_public_url_invalid"}), 503
remote_request = _is_remote_access_request(config)
if not remote_request:
- if config.remote_access.vibe_cloud.enabled and not local_request:
+ if not local_request:
return jsonify({"ok": False, "error": "remote_access_host_mismatch"}), 503
return None
if _remote_auth_exempt_path():