# CVE-2026-53518: Better Auth OAuth Provider: Race Condition in Authorization Code Exchange Enables Multi-Use Code Redemption

> Concurrent requests can redeem a single-use OAuth authorization code multiple times, allowing attackers to mint duplicate tokens and potentially take over accounts.

- **Severity:** High 7.6 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 15 Jul 2026
- **Updated:** 15 Jul 2026
- **Also known as:** GHSA-7w99-5wm4-3g79

## What is CVE-2026-53518?

CVE-2026-53518 is a high-severity vulnerability in better-auth, published on 15 Jul 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

Better Auth is an authentication and authorization library for TypeScript. From 1.6.0 until 1.6.11, the @better-auth/oauth-provider POST /oauth2/token endpoint for the authorization_code grant redeems a single-use authorization code through a non-atomic find-then-delete sequence, allowing two concurrent requests to pass the read step and mint independent access tokens, refresh tokens, and ID tokens; legacy /oauth2/token and /mcp/token paths in oidc-provider and mcp plugins share the same primitive. This issue is fixed in version 1.6.11.

Weakness: CWE-367 (Time-of-check Time-of-use (TOCTOU) Race Condition), CWE-362 (Concurrent Execution using Shared Resource with Improper Synchronization)

## Which versions are affected by CVE-2026-53518?

4 open source packages ship an affected version, including @better-auth/oauth-provider and better-auth. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@better-auth/oauth-provider` | npm | From 1.6.0 | 1.6.11 |
| `@better-auth/oauth-provider` | npm | From 1.6.0 | 1.6.11 |
| `better-auth` | npm | All versions | 1.6.11 |
| `better-auth` | npm | All versions | 1.6.11 |

Products: Better-Auth Better-Auth\/Oauth-Provider, Better-Auth Better Auth.

## How do I fix CVE-2026-53518?

Upgrade @better-auth/oauth-provider to 1.6.11 or later.

## Is CVE-2026-53518 being exploited?

There is no known exploitation of CVE-2026-53518 in the wild and no public exploit code.

## Other vulnerabilities in better-auth

- [CVE-2026-53517](https://insights.sbomify.com/CVE-2026-53517/): Better Auth OAuth Provider: Refresh Token Rotation Race Condition Allows Concurrent Replay and Token Family Forking (high 8.1)
- [CVE-2026-41427](https://insights.sbomify.com/CVE-2026-41427/): Better Auth OAuth 2.1 Provider: Unprivileged users can register OAuth clients (high 7.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-53518 and fix it if it is affected.

What it is: CVE-2026-53518 is a high-severity vulnerability in better-auth, published on 15 Jul 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-53518 in the wild and no public exploit code.

Affected packages and fixed versions:
- @better-auth/oauth-provider (npm): affected from 1.6.0; fixed in 1.6.11
- @better-auth/oauth-provider (npm): affected from 1.6.0; fixed in 1.6.11
- better-auth (npm): affected all versions; fixed in 1.6.11
- better-auth (npm): affected all versions; fixed in 1.6.11

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/CVE-2026-53518/ (Markdown: https://insights.sbomify.com/CVE-2026-53518/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-53518
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-53518
- OSV: https://osv.dev/vulnerability/CVE-2026-53518

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-53518/
Summaries are generated and may contain mistakes; the official description above is the record.
