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): reject userinfo in public urls

cyhfd872192d157
diff --git a/tests/test_ui_remote_access_auth.py b/tests/test_ui_remote_access_auth.py
index 27983bceb..6e719d5bc 100644
--- a/tests/test_ui_remote_access_auth.py
+++ b/tests/test_ui_remote_access_auth.py
@@ -130,6 +130,18 @@ def test_remote_host_fails_closed_when_public_url_is_invalid(monkeypatch, tmp_pa
assert response.get_json()["error"] == "remote_access_public_url_invalid"
+def test_remote_host_fails_closed_when_public_url_contains_userinfo(monkeypatch, tmp_path):
+ monkeypatch.setenv("VIBE_REMOTE_HOME", str(tmp_path))
+ config = _save_config(tmp_path)
+ config.remote_access.vibe_cloud.public_url = "https://user:[email protected]"
+ config.save()
+
+ response = app.test_client().get("/dashboard", base_url="https://alex.avibe.bot", follow_redirects=False)
+
+ assert response.status_code == 503
+ assert response.get_json()["error"] == "remote_access_public_url_invalid"
+
+
def test_remote_host_fails_closed_when_public_url_is_empty(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 62beeb79c..1532e5051 100644
--- a/vibe/ui_server.py
+++ b/vibe/ui_server.py
@@ -225,9 +225,9 @@ def _remote_access_public_host(config: V2Config) -> str | None:
if not public_url:
return ""
parsed = urlparse(public_url)
- if parsed.scheme not in {"http", "https"} or not parsed.netloc:
+ if parsed.scheme not in {"http", "https"} or not parsed.netloc or parsed.username or parsed.password:
return None
- return _normalized_host(parsed.netloc)
+ return _normalized_host(parsed.hostname)
def _remote_access_public_url_invalid(config: V2Config) -> bool: