Repository navigation
Web UI: remember passwordless logins and drop a stale autofilled password - #118638
Conversation
…word The page offers the login to the browser's password manager after each Run, but the Credential Management API cannot express an empty password (`PasswordCredential` rejects it with a `TypeError`) and there is no API to delete a saved login. So after a server/user was saved with a password and later authenticates with an empty one, the browser keeps the stale entry and autofills it on every visit, and the page sends the stale secret with every request. Remember in `localStorage` which server/user logins last succeeded with an empty password (recorded from the credential probe and from a successful query run, forgotten again when a non-empty password succeeds), and drop a browser-autofilled password (`:autofill`) for such a login when it shows up: on the `input` event autofill raises, and at the points that read the field to build a request. A typed password is always kept. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
Workflow [PR], commit [200935e] Summary: ✅
AI ReviewSummaryThis PR teaches PR Metadata
Findings
Final Verdict
LLVM Coverage ReportMeasured on commit 200935e.
Changed lines: Uncovered code analysis did not run: No coverable C/C++ source files changed (contrib/ is excluded from coverage). Newly covered: +173 lines in 53 files (-170 lines lost coverage) · Details |
…ke the passwordless-login bookkeeping best-effort `dropAutofilledStalePassword` now also runs before `loadDatabases` (opening the databases panel), before the download rerun, before `storeCredentials` and in `sendCredentialsToTerminal`, so a stale autofilled password for a login remembered as passwordless is dropped on every path that sends or stores it, not only on credential checks, query submission and completions. `rememberLoginPassword` and `loadPasswordlessLogins` swallow `localStorage` failures (`QuotaExceededError`, storage policy exceptions), so a successful authentication check or query is never turned into a client-side error by the bookkeeping. Co-Authored-By: Claude Fable 5.1 <[email protected]>
The `:autofill` selector detection called `CSS.supports` while the page script was being evaluated. The headless harnesses of `test_play_image_preview` and `test_play_reconcile_startup` run the extracted script in a Node `vm` context without a `CSS` global, so the whole script failed with `ReferenceError: CSS is not defined`. The detection now yields no selector where `CSS.supports` is unavailable, which leaves the stale-password handling inert there, as it already is in a browser supporting neither form. CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118638&sha=5e5b5018080d4bf074737d61603ce90eaa0df59c&name_0=PR&name_1=Integration%20tests%20%28amd_asan_ubsan%2C%20db%20disk%2C%20old%20analyzer%2C%201%2F6%29 PR: #118638 Co-Authored-By: Claude Fable 5.1 <[email protected]>
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline. |
…d request `rememberLoginPassword` was only called from `checkCredentials` and from a 2xx response in `postImpl`. On deployments where `checkURL` never reaches `checkCredentials` (the ping probes the origin, not the configured path), the database panel, `auxiliaryQuery` or the completions can be the first request to authenticate with a newly typed password, and a query that fails after authenticating (a syntax error, an unknown table) also proves the credentials. The new `rememberAuthenticationOutcome` is called from `auxiliaryQuery`, `loadCompletions` and `postImpl` (on the response the framing retries settled on). `401`/`403` never update the entry; another error updates it when the server itself produced it (`X-ClickHouse-Exception-Code`); without that proof a non-empty password still forgets the entry, but an empty one is not remembered. Adds the `test_play_passwordless_logins` harness test. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…s proof of authentication The `Format` button sent `password_elem.value` without `dropAutofilledStalePassword`, so a stale autofilled password could still be sent by it. It now goes through the guard like the other requests built from the live connection fields. `rememberAuthenticationOutcome` ignored every `403`, but `ACCESS_DENIED` (a missing privilege) is also answered with `403` and is thrown only after a successful authentication. The `X-ClickHouse-Exception-Code` header tells it apart, so a `403` with `ACCESS_DENIED` now updates the passwordless entry like any other error of the query. The harness pins both cases. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118638&sha=fd719b912618&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29 ( |
|
The fix is #122132, merged 2026-09-28. Reads of The failed run tested |
|
🕵 Merged master to pick up #123738, which fixes the None of the other failures on
@groeneai, please investigate this failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118638&sha=3e608fb18fa21cca1be96ccb82b9c2f54b308ffc&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20s3%20storage%2C%20DBReplicated%2C%20parallel%2C%201%2F2%29 (the |
|
The fix is in progress: #123790 (it includes the change from my #123774, closed in its favor). In its own run on The diff on |
The Web UI (
play.html) offers the login to the browser's password manager after each Run (navigator.credentials.store). The Credential Management API cannot express an empty password:PasswordCredentialrejects it withTypeError: 'password' must not be empty., and there is no API to delete a saved login. So once a password was saved for a server/user and that user later authenticates with an empty password (the account was switched tono_password, or its password was removed), the browser keeps the stale entry and autofills it on every visit, and the page sends the stale secret with every request. From the user's point of view the page "still remembers the previous password".The page cannot fix the browser's store, but it can remember on its own which logins are passwordless:
checkCredentials, or a query run with a 2xx response) records the[server, user]login inlocalStorage; a successful authentication with a non-empty password forgets it again. The server identity and effective user are normalized the same way assameServerAddressandeffectiveConnectionUser.:autofillpseudo-class), it is dropped before it is shown as checked or sent: on theinputevent autofill raises, and at the points that read the field to build a request (the credential probe,postOne/postAll, the completion query), since autofill does not always raiseinput.Verified in headless Chromium against a local server with a passwordless
defaultuser: the probe and a query run with an empty password record the login, a rejected password changes nothing, and a simulated autofilled password is dropped via theinputpath, the probe, and the completion URL, while a typed one is kept.Related: #118637
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Web UI: when a login last succeeded with an empty password, a stale password autofilled by the browser's password manager for that server and user is no longer used.
Workflow [PR]
Sync PR [sync-upstream/pr/118638]
Version info
26.10.1.1612-master(included in26.10and later)