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

> Attackers retain access via stolen refresh tokens after victims change passwords because existing sessions are not revoked.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 8 May 2026
- **Also known as:** GO-2026-5222

## What is GHSA-7hgr-xvrr-xpw3?

GHSA-7hgr-xvrr-xpw3 is a vulnerability in github.com/nhost/nhost, published on 8 May 2026. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official 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.

## Which versions are affected by GHSA-7hgr-xvrr-xpw3?

3 open source packages ship an affected version, including github.com/nhost/nhost.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/nhost/nhost` | Go | All versions | 0.0.0-20260430132514-52c70664a7e9 |
| `github.com/nhost/nhost` | Go | All versions | 0.0.0-20260430132514-52c70664a7e9 |
| `github.com/nhost/nhost` | Go | All versions | 0.0.0-20260430132514-52c70664a7e9 |

## How do I fix GHSA-7hgr-xvrr-xpw3?

Upgrade github.com/nhost/nhost to 0.0.0-20260430132514-52c70664a7e9 or later.

## Is GHSA-7hgr-xvrr-xpw3 being exploited?

There is no known exploitation of GHSA-7hgr-xvrr-xpw3 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-7hgr-xvrr-xpw3 and fix it if it is affected.

What it is: GHSA-7hgr-xvrr-xpw3 is a vulnerability in github.com/nhost/nhost, published on 8 May 2026. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of GHSA-7hgr-xvrr-xpw3 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/nhost/nhost (Go): affected all versions; fixed in 0.0.0-20260430132514-52c70664a7e9
- github.com/nhost/nhost (Go): affected all versions; fixed in 0.0.0-20260430132514-52c70664a7e9
- github.com/nhost/nhost (Go): affected all versions; fixed in 0.0.0-20260430132514-52c70664a7e9

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-7hgr-xvrr-xpw3/ (Markdown: https://insights.sbomify.com/GHSA-7hgr-xvrr-xpw3/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-7hgr-xvrr-xpw3

---
From sbomify Insights: https://insights.sbomify.com/GHSA-7hgr-xvrr-xpw3/
Summaries are generated and may contain mistakes; the official description above is the record.
