Confirm a typed password without replaying it over JMAP
Creating an app password asks for the account password. A session holding a token has no password to compare with, so it sent the typed one to the mail server as HTTP Basic on the JMAP session. INBUXA's server now takes no password outside DAV (contract C-23), so that check would always fail. It now asks the server's sign-in endpoint, the one its own sign-in page posts to, as this client, to its registered redirect URI, with a PKCE challenge whose verifier is thrown away so the code can never be exchanged. "Two-factor code needed" counts as confirmed: the server says so only after the password matched, so accounts with two-factor sign-in now pass where the Basic check failed them. The mock answers /api/auth like the server and can refuse Basic on JMAP; the app-password test turns that on, and fails on the old check.
This commit is contained in:
1 parent
d73f5e8f9e
commit
1acf2f29e7
5 files changed
+86
-8
No files matched your search
@@ -198,6 +198,8 @@ test("a password change signs the session out, since the server revokes its toke
|
||||
|
||||
test("creating an app password checks the typed password with the server", async () => {
|
||||
await signIn();
|
||||
// As INBUXA's server does: no password over JMAP (contract C-23).
|
||||
oauthMock.refuseBasic(true);
|
||||
const wrong = await call("/api/account/app-passwords", { method: "POST", body: JSON.stringify({ description: "Phone", current: "nope" }) });
|
||||
assert.equal(wrong.status, 403);
|
||||
const right = await call("/api/account/app-passwords", { method: "POST", body: JSON.stringify({ description: "Phone", current: "demo-password" }) });
|
||||
|
||||
Reference in new issue
Block a user