Adom Bridge
Public Made by Adomby adom
Adom Bridge unleashes your AI onto your full PC: full power, full safety. The AI breaks out of the container it runs in and onto your real machine, managing and running your entire laptop as you: launch apps, move files, drive any window, control KiCad, Fusion 360 or your real signed-in browser. Works with any AI, cloud or local (Claude Desktop, Claude Code, Codex), no Hydrogen required. Bridge and its bridges are an operating system for AI, with managed Node and Python runtimes, and a human-onl
Web-control handshake unusable cross-origin: CORS preflight omits X-Adom-WebControl-Secret
Summary
The web-control handshake is unusable from a real (cross-origin) web page, because ab's CORS preflight for POST /command does not allow the X-Adom-WebControl-Secret header. When "Require wiki handshake" is enabled, every web command is blocked by the browser before it ever reaches ab's consent gate.
Root cause
When requireHandshake is on, a web page must send X-Adom-WebControl-Secret on POST /command. A custom request header makes the POST a non-simple CORS request, so the browser first sends an OPTIONS preflight and requires the server to echo that header in Access-Control-Allow-Headers.
web_gate's OPTIONS handler in src-tauri/src/direct_api.rs sets:
h.insert(
HeaderName::from_static("access-control-allow-headers"),
"content-type".parse().unwrap(),
);
It lists only content-type, not x-adom-webcontrol-secret. So the preflight fails and the browser never sends the actual command.
Reproduction (live, ab v2.0.59, real Chrome)
From a public https page (kcknox-...adom.cloud) reaching loopback, fetching http://127.0.0.1:24680/command:
- With
Content-Type: application/jsononly:HTTP 200(runs). - Same POST plus
X-Adom-WebControl-Secret: <secret>:TypeError: Failed to fetch(preflight blocked).
Driven via the puppeteer bridge against the git-wiki Quick Actions demo; the two calls differ only by the presence of the secret header.
Impact
The handshake is self-defeating for exactly the case it exists for (wiki.adom.inc, or any first-party wiki surface, reaching the user's loopback ab). With requireHandshake OFF the loop works (no header is sent); turn it ON to actually require the secret and every cross-origin web command is blocked by the browser before the consent prompt. This blocks the wiki-side Quick Actions handshake integration end to end.
Note: the read paths (/health, /status) and a header-less POST /command are unaffected, since their preflights only need content-type. So the bug only surfaces once a page presents the secret.
Suggested fix
Add the handshake header to the preflight allow-list in web_gate:
"access-control-allow-headers",
"content-type, x-adom-webcontrol-secret",
Browsers send the requested header lowercased in Access-Control-Request-Headers, so the lowercase spelling is what matters. A small follow-up worth considering: reflect back whatever the request's Access-Control-Request-Headers asked for (still gated to the loopback host + web paths), so a future client header does not hit the same wall.
Environment
- Adom Bridge v2.0.59 (6e078da), HOST, Direct API :24680, signed in.
- Verified in real Chrome on the same machine; source confirmed in the 2.0.59 tree.