# GHSA-7hgr-xvrr-xpw3: nhost has Session Persistence After Password Change

- Severity: Low (CVSS:4.0, scored by GitHub) `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-05-08T17:39:48.000Z
- Modified: 2026-06-25T19:56:40.332Z
- Also known as: GO-2026-5222
- Weaknesses: CWE-613

## Description

## Description

When a user changes their password, either through the authenticated password change endpoint or a password reset ticket, the [`ChangePassword`](https://github.com/nhost/nhost/blob/main/services/auth/go/controller/workflows.go#L731-L759) workflow correctly hashes and persists the new password via [`UpdateUserChangePassword`](https://github.com/nhost/nhost/blob/main/services/auth/go/sql/query.sql#L314-L318). However, it does not revoke existing sessions. The `auth.refresh_tokens` and `auth.oauth2_refresh_tokens` tables are left untouched, meaning all previously issued refresh tokens remain valid and can continue generating new access tokens indefinitely.

This vulnerability affects all password change paths (handled in [`change_user_password.go`](https://github.com/nhost/nhost/blob/main/services/auth/go/controller/change_user_password.go)), since they share the same underlying workflow:

- Authenticated password change via the Nhost dashboard or client SDK
- Ticket-based password reset (magic links / recovery flows)
- OAuth2/OIDC sessions managed via `auth.oauth2_refresh_tokens`

## Attack Scenario

1. An attacker steals a victim's refresh token via XSS or a compromised device.
2. The victim changes their password, expecting it to terminate all active sessions.
3. The server updates `password_hash` but performs no session cleanup, the stolen token remains fully functional.

## Impact

The attacker retains persistent access even after the victim's password change. This is especially severe in credential theft scenarios, where the victim's only recovery action does nothing against an active session. Depending on configured TTL, the attacker's window could be days or weeks.

(As written by GitHub Advisory Database.)

## Affected

- github.com/nhost/nhost (Go): before 0.0.0-20260430132514-52c70664a7e9

## References

- <https://github.com/nhost/nhost/security/advisories/GHSA-7hgr-xvrr-xpw3> (advisory, web)
- <https://github.com/nhost/nhost/commit/52c70664a7e92031e592b873471939b10ca18079> (fix, web)
- <https://github.com/nhost/nhost> (package)

## Sources

- GitHub Advisory Database: [GHSA-7hgr-xvrr-xpw3](https://github.com/advisories/GHSA-7hgr-xvrr-xpw3), CC-BY-4.0, modified 2026-06-25
- Go Vulnerability Database: [GO-2026-5222](https://pkg.go.dev/vuln/GO-2026-5222), CC-BY-4.0, modified 2026-06-25

---

Page: https://cve.day/GHSA-7hgr-xvrr-xpw3 · Whole record: https://cve.day/GHSA-7hgr-xvrr-xpw3.json · Rebuilt by cve.day 2026-11-25T22:56:24.733Z
