# CVE-2026-67333: better-auth before 1.6.13 Stored XSS via javascript redirect_uri

> Stored XSS in better-auth allows attackers to execute JavaScript via malicious OAuth redirect URIs, leading to session theft and account takeover.

- **Severity:** Medium 5.1 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N`)
- **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:** No
- **Published:** 1 Aug 2026
- **Updated:** 3 Aug 2026
- **Also known as:** GHSA-86j7-9j95-vpqj, GHSA-w277-2xmj-j2rc

## What is CVE-2026-67333?

CVE-2026-67333 is a medium-severity cross-site scripting vulnerability in better-auth, published on 1 Aug 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

better-auth before 1.6.13 (and pre-release builds 1.7.0-beta.0 through 1.7.0-beta.3) fail to validate the scheme of redirect_uris registered via the deprecated oidc-provider plugin and the mcp plugin (which wraps the same provider). An attacker can register an OAuth client with a javascript: redirect_uri, which the authorization server later returns unchanged in the consent response. If the deployment's consent page navigates the browser to the returned redirectURI (e.g. assigning it to window.location.href), the attacker's JavaScript executes in the authorization-server origin, exposing the victim's session and enabling account takeover.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation)

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

4 open source packages ship an affected version, including better-auth.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `better-auth` | npm | All versions | 1.6.13 |
| `better-auth` | npm | All versions | 1.6.13 |
| `better-auth` | npm | From 1.7.0-beta.0 | 1.7.0-beta.4 |
| `better-auth` | npm | From 1.7.0-beta.0 | 1.7.0-beta.4 |

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

Upgrade better-auth to a fixed version for your release line: 1.6.13 or 1.7.0-beta.4.

## Is CVE-2026-67333 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2026-67333 is a medium-severity cross-site scripting vulnerability in better-auth, published on 1 Aug 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 CVE-2026-67333 in the wild and no public exploit code.

Affected packages and fixed versions:
- better-auth (npm): affected all versions; fixed in 1.6.13
- better-auth (npm): affected all versions; fixed in 1.6.13
- better-auth (npm): affected from 1.7.0-beta.0; fixed in 1.7.0-beta.4
- better-auth (npm): affected from 1.7.0-beta.0; fixed in 1.7.0-beta.4

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

## Sources

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

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