Repository navigation
Replies: 2 comments
|
Corroborating this on desktop and iOS, and on a much broader trigger than an installed PWA: any cross-site top-level arrival, in an ordinary browser tab. Same mechanism you describe — Minimal repro, one browser, two navigations seconds apart, one variable changed, already-authenticated session in both:
So the everyday triggers are not exotic: tapping a link to dsh from a chat or mail client, and — for anyone running dsh behind an identity proxy — the redirect back from the login host after re-authenticating, which for us lands on this error on a fixed weekly cadence. Environment: dsh 0.1.5-rc.1, HTTPS via a reverse proxy on the same host, Chrome on desktop and Safari on iOS. No token, cookie value, or other credential was recorded for this report. Noting for others who arrive here: the workaround is a reload or a typed URL/bookmark, and an application-layer gateway in front does not help, because its own cookie is |
[Bug + Verified Fix] Android installed web app loses authentication on cold launch — confirmed on DSH 0.2.1-rc.5SummaryI'm reporting an independently reproduced authentication issue affecting DeepSeek Harness when installed as an Android web app. The regular browser can access the authenticated Web UI successfully, but launching the installed application from the Android home screen results in an authentication failure. I traced the problem to the browser-session cookie's hardcoded This confirms that the behaviour previously described in Discussion #5362 also affects the newer EnvironmentComponent | Configuration -- | -- DeepSeek Harness | @deepseek-ai/dsh@0.2.1-rc.5 Host OS | Arch Linux Android device | Google Pixel 10 Browser | Brave for Android Installation | Brave's installed web application Server | Local HTTP listener on port 3080 Remote access | HTTPS reverse proxy through private Tailscale networkSteps to reproduce
Actual result: The installed application fails authentication, even though the same base URL remains accessible in the normal Brave browser. Expected result: An already-authenticated installed application should reopen successfully without requiring another token exchange. Root causeThe browser-session authentication implementation in:
issues its signed authentication cookie with the hardcoded attribute:
An installed Android web application's initial navigation can be classified as cross-site, even when the destination is the same previously authenticated origin. Consequently, the browser may omit the Strict authentication cookie from the initial request. The server receives a request without its authentication cookie and returns HTTP 401. This creates an inconsistent experience:
The failure is caused by cookie transmission rules, not by invalid API credentials, expired authentication, or network connectivity. Confirmed workaroundI tested the following change in the installed runtime: Package: File: Original: After applying the change:
This establishes a direct correlation between the cookie's SameSite policy and the observed failure. The workaround does not remove authentication, modify the signing mechanism, or disable the existing Host/Origin checks. However, I recognize that changing the SameSite policy changes the browser's cookie-sending behaviour and should receive a security review before being adopted upstream. Proposed upstream solutionI recommend addressing Android installed-app startup within the browser authentication implementation. Preferred approach: preserve When a previously authenticated installed application initiates a cross-site top-level navigation without its Strict cookie, the server should provide a tightly scoped recovery navigation that allows the browser to submit the existing cookie on a subsequent same-origin request. The recovery mechanism must not grant access based solely on a bootstrap marker or request metadata. An alternative would be to expose a documented configuration option allowing an explicitly selected For example: This would provide compatibility for Android installed applications without silently changing authentication behaviour for existing deployments. Security requirementsAny accepted implementation should preserve:
A compatibility marker, if introduced, must never independently authorize privileged requests. Suggested regression tests
Related discussions
ContributionI have reproduced the issue on a current 0.2.x release and validated a minimal runtime workaround on a physical Android device. I'm interested in contributing a source-level fix with regression tests. Given that external pull requests are currently restricted, I'd be happy to publish the implementation on a fork for maintainer review or cherry-picking. The goal is to make DeepSeek Harness reliable as an installed Android web application without compromising its existing authentication guarantees. # [Bug + Verified Fix] Android installed web app loses authentication on cold launch — confirmed on DSH 0.2.1-rc.5SummaryI'm reporting an independently reproduced authentication issue affecting DeepSeek Harness when installed as an Android web app. The regular browser can access the authenticated Web UI successfully, but launching the installed application from the Android home screen results in an authentication failure. I traced the problem to the browser-session cookie's hardcoded This confirms that the behaviour previously described in [Discussion #5362](#5362) also affects the newer Environment
Steps to reproduce
Actual result: The installed application fails authentication, even though the same base URL remains accessible in the normal Brave browser. Expected result: An already-authenticated installed application should reopen successfully without requiring another token exchange. Root causeThe browser-session authentication implementation in:
issues its signed authentication cookie with the hardcoded attribute:
An installed Android web application's initial navigation can be classified as cross-site, even when the destination is the same previously authenticated origin. Consequently, the browser may omit the Strict authentication cookie from the initial request. The server receives a request without its authentication cookie and returns HTTP 401. This creates an inconsistent experience:
The failure is caused by cookie transmission rules, not by invalid API credentials, expired authentication, or network connectivity. Confirmed workaroundI tested the following change in the installed runtime: Package: File: Original: - SameSite=Strict
+ SameSite=LaxAfter applying the change:
This establishes a direct correlation between the cookie's SameSite policy and the observed failure. The workaround does not remove authentication, modify the signing mechanism, or disable the existing Host/Origin checks. However, I recognize that changing the SameSite policy changes the browser's cookie-sending behaviour and should receive a security review before being adopted upstream. Proposed upstream solutionI recommend addressing Android installed-app startup within the browser authentication implementation. Preferred approach: preserve When a previously authenticated installed application initiates a cross-site top-level navigation without its Strict cookie, the server should provide a tightly scoped recovery navigation that allows the browser to submit the existing cookie on a subsequent same-origin request. The recovery mechanism must not grant access based solely on a bootstrap marker or request metadata. An alternative would be to expose a documented configuration option allowing an explicitly selected For example: cookieSameSite: strict # strict | laxThis would provide compatibility for Android installed applications without silently changing authentication behaviour for existing deployments. Security requirementsAny accepted implementation should preserve:
A compatibility marker, if introduced, must never independently authorize privileged requests. Suggested regression tests
Related discussions
ContributionI have reproduced the issue on a current 0.2.x release and validated a minimal runtime workaround on a physical Android device. I'm interested in contributing a source-level fix with regression tests. Given that external pull requests are currently restricted, I'd be happy to publish the implementation on a fork for maintainer review or cherry-picking. The goal is to make DeepSeek Harness reliable as an installed Android web application without compromising its existing authentication guarantees. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
On Android, an installed Chrome WebAPK for
dsh webcan fail on a cold top-level launch with:The same DSH origin remains authenticated and functional in the ordinary Chrome tab. The installed app's initial root request is a cross-site top-level navigation, so Chrome withholds DSH's
SameSite=Strictbrowser-session cookie on that request.This report is not asking to remove browser authentication, accept a non-authentication cookie as authentication, or change the signed authentication cookie to
SameSite=None.Version and environment
dsh-v0.1.2-alpha.20a53fb55bea101816fa226bb964ae2bed71c343bpackages/client/connection/src/browser-auth.tshttp://127.0.0.1:<port>)No launch token, cookie value, credential, session content, workspace data, or other sensitive value was recorded for this report.
User-facing reproduction
dsh webon a loopback port.For controlled validation, I also navigated the standalone WebAPK to the one-time launch URL using local test tooling, without logging or persisting the token. This confirmed that the app could hold a valid signed authentication cookie. After force-stopping and cold-launching the WebAPK, the first root navigation still reproduced the failure before the compatibility patch described below.
The installed app cannot normally edit its fixed launch URL to add a fresh process token. Retaining a launch token in the installed URL would also violate the intended token-to-cookie exchange model.
Sanitized Fetch Metadata evidence
The failing cold launch has this request shape:
This is a top-level document navigation, not a cross-site API call or iframe request. Once navigation is established on the DSH origin, a subsequent same-origin navigation can carry the existing Strict authentication cookie normally.
Expected behavior
A previously authorized installed WebAPK should be able to resume the same authenticated loopback session after a cold launch while preserving the current security properties:
HttpOnly, andSameSite=Strict;Actual behavior
The first WebAPK request is classified as cross-site. Chrome therefore does not send the Strict authentication cookie,
authorizeIndex()sees an unauthenticated root request, and DSH returns its normal 401 text response. The installed app cannot reach a same-origin navigation from which Chrome would send the existing Strict cookie.Relation to #5063
This is related to #5063, but it is a different browser topology.
#5063 concerns a UI that remains inside a cross-site iframe/WebView, where HTTP and WebSocket traffic continues to be third-party. This report concerns only an Android-installed WebAPK's initial top-level cold launch. After one constrained same-origin navigation, the official Strict cookie works normally for the page, API, and WebSocket.
A one-hop top-level bootstrap can therefore address this case without defining or weakening a persistent cross-site embedding contract.
Reference implementation
I have a source-level alpha.2 reference patch available for review. It uses the following fail-closed mechanism:
Keep the existing signed authentication cookie unchanged as
HttpOnly; SameSite=Strict.On a successful token exchange, also set an authority-derived, fixed-value,
HttpOnly; SameSite=Laxlaunch marker.Never accept that marker in
isAuthenticated()or as authentication for index, API, RPC, or WebSocket routes.Only when all of the following are true:
GET /;Sec-Fetch-Site: cross-site;Sec-Fetch-Mode: navigate;Sec-Fetch-Dest: document;return a no-store 401 HTML bootstrap containing only a CSP-hash-authorized
location.replace('/').The replacement performs a same-origin navigation, allowing the existing Strict authentication cookie to be sent.
Every other unauthenticated request retains the current plain 401 behavior.
The bootstrap also sends
frame-ancestors 'none',default-src 'none',base-uri 'none',form-action 'none',Referrer-Policy: no-referrer, andX-Content-Type-Options: nosniff.The Lax marker is deliberately not an authentication credential. Even if supplied alone, privileged requests continue to receive 401. Its only effect is selecting one static root self-navigation. The marker name includes the normalized authority, although cookies themselves are not port-scoped; maintainers may prefer a signed or shorter-lived marker even with its non-authentication role.
Validation performed
The reference patch includes tests for:
isAuthenticated()returning false;HEADrequests retaining the plain 401 response;Set-Cookiehandling in connection, gateway, and stream fixtures.On a real Android installed WebAPK, the patched build passed two consecutive force-stop/cold-launch cycles with a clean URL and no authentication error; the ordinary Chrome DSH tab remained healthy.
Known gaps
Sec-Fetch-Mode, missing or wrongSec-Fetch-Dest, and a marker minted for a different hostname or port.Would the maintainers consider this narrowly scoped top-level launch bootstrap, or prefer another mechanism that preserves the Strict authentication cookie while supporting installed Android WebAPKs?
All reactions