Skip to content

A2App passthrough and WebSocket paths - #454

Merged
korivi-CraftOS merged 2 commits into
ahmad/a2app-auth-bypassfrom
ahmad/a2app-passthrough
Sep 23, 2026
Merged

korivi-CraftOS merged 2 commits into
ahmad/a2app-auth-bypassfrom
ahmad/a2app-passthrough

Conversation

@ahmad-ajmal

Copy link
Copy Markdown
Collaborator

No description provided.

@ahmad-ajmal
ahmad-ajmal added this pull request to stack #455 September 22, 2026 06:08
@ahmad-ajmal
ahmad-ajmal marked this pull request as ready for review September 22, 2026 06:08
@ahmad-ajmal ahmad-ajmal self-assigned this Sep 22, 2026
@ahmad-ajmal
ahmad-ajmal force-pushed the ahmad/a2app-passthrough branch from d710e42 to 48450e1 Compare September 22, 2026 09:50
guard_request returned None for OPTIONS before any credential check, even
when the request arrived through the tunnel or the LAN relay. _handle then
forwarded it upstream with its body and returned the app's response, so an
uncredentialed visitor holding only the bare share origin could drive and
read any native route of an adopted app with OPTIONS while every other
method was correctly refused. Every framework that answers OPTIONS with a
real handler is affected -- aiohttp add_route("*"), Express app.all,
FastAPI methods=["*"], Flask methods=['OPTIONS'], most Go muxes.

Locally OPTIONS still passes: a browser strips credentials from a preflight
by spec, so demanding one there would break every cross-origin call the
app's own UI makes. Through a share channel the app's UI is same-origin
with the app and never preflights, so nothing legitimate is lost.

Verified end to end against the real proxy with a stub upstream: remote
OPTIONS went from 200 (response delivered from the app) to 401, while a
local preflight and a local cookie-authenticated write are untouched.

The new test lives under tests/ because pytest.ini sets testpaths = tests,
so the suites in app/agent_app/test_*.py are not collected by a plain
pytest run -- the assertions guarding this surface have to sit where they
will actually execute.
@korivi-CraftOS
korivi-CraftOS merged commit 6a46f13 into V1.4.3 Sep 23, 2026
@zfoong
zfoong deleted the ahmad/a2app-passthrough branch September 29, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants