Summary
Changing a user's password does not revoke existing sessions. An attacker who has compromised a session token retains full access even after the legitimate user changes their password, defeating the standard incident response action of credential rotation.
Details
The password change handler (apps/dokploy/server/api/routers/user.ts:201-250) updates the account.password field but does not call any session revocation API. Sessions have a 3-day lifetime (auth.ts:354) with updateAge: 60*60*24, meaning an attacker's compromised session can persist for up to 3 days after the password is changed.
Better-auth provides auth.api.revokeSessions({ userId }) for exactly this purpose, but it is not called during the password change flow.
Note: member removal and role downgrade were tested and both correctly terminate sessions immediately. Only the password change path is affected.
PoC
Prerequisites: A Dokploy instance with a test user account.
Step 1 — Establish a session:
Log in as a test user and note the session token from the better-auth.session_token cookie.
Step 2 — Change the password:
Change the user's password through the UI or API.
Step 3 — Use the pre-change session token:
GET /api/trpc/user.all HTTP/1.1
Host: <target>
Cookie: better-auth.session_token=<PRE_PASSWORD_CHANGE_TOKEN>
The request succeeds. The old session remains valid despite the password change.
Impact
The standard incident response procedure of changing a compromised password does not lock out an attacker who holds an active session. The attacker retains full access at the compromised user's privilege level for up to 3 days after the password is rotated. This is particularly dangerous when combined with other findings that enable session compromise.
Summary
Changing a user's password does not revoke existing sessions. An attacker who has compromised a session token retains full access even after the legitimate user changes their password, defeating the standard incident response action of credential rotation.
Details
The password change handler (
apps/dokploy/server/api/routers/user.ts:201-250) updates theaccount.passwordfield but does not call any session revocation API. Sessions have a 3-day lifetime (auth.ts:354) withupdateAge: 60*60*24, meaning an attacker's compromised session can persist for up to 3 days after the password is changed.Better-auth provides
auth.api.revokeSessions({ userId })for exactly this purpose, but it is not called during the password change flow.Note: member removal and role downgrade were tested and both correctly terminate sessions immediately. Only the password change path is affected.
PoC
Prerequisites: A Dokploy instance with a test user account.
Step 1 — Establish a session:
Log in as a test user and note the session token from the
better-auth.session_tokencookie.Step 2 — Change the password:
Change the user's password through the UI or API.
Step 3 — Use the pre-change session token:
The request succeeds. The old session remains valid despite the password change.
Impact
The standard incident response procedure of changing a compromised password does not lock out an attacker who holds an active session. The attacker retains full access at the compromised user's privilege level for up to 3 days after the password is rotated. This is particularly dangerous when combined with other findings that enable session compromise.