CVE-2025-61928
Better Auth: Unauthenticated API key creation through api-key plugin
Check your servers for CVE-2025-61928
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2025-61928 affects better-auth, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
Better Auth is an authentication and authorization library for TypeScript. In versions prior to 1.3.26, unauthenticated attackers can create or modify API keys for any user by passing that user's id in the request body to the `api/auth/api-key/create` route. `session?.user ?? (authRequired ? null : { id: ctx.body.userId })`. When no session exists but `userId` is present in the request body, `authRequired` becomes false and the user object is set to the attacker-controlled ID. Server-only field validation only executes when `authRequired` is true (lines 280-295), allowing attackers to set privileged fields. No additional authentication occurs before the database operation, so the malicious payload is accepted. The same pattern exists in the update endpoint. This is a critical authentication bypass enabling full an unauthenticated attacker can generate an API key for any user and immediately gain complete authenticated access. This allows the attacker to perform any action as the victim user using the api key, potentially compromise the user data and the application depending on the victim's privileges. Version 1.3.26 contains a patch for the issue.
Severity (CVSS)
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
- Attack vector
- network: an attacker can reach the vulnerable part over the network, often from the internet
- Attack complexity
- low: an attack works without special conditions
- Attack requirements
- none: an attack works without special conditions on the target
- Privileges required
- none: the attacker does not need an account
- User interaction
- none: nobody has to click or open anything
- Impact on the vulnerable system
- confidentiality high, integrity high, availability high: what an attacker can read, change or stop in the vulnerable component
- Impact on other systems
- confidentiality none, integrity none, availability none: what an attacker can read, change or stop beyond it
Exploitation
EPSS 17.7%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 97.2% of all scored CVEs. Scores of 2 Dec 2026.
The assessment of CISA (SSVC, 10 Oct 2025):
- Exploitation
- poc: a proof of concept is public
- Automatable
- yes: an attacker can automate the attack across many targets
- Technical impact
- total: full control of the component or of its data
Weakness
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| better-auth |
affected < 1.3.26
|
Is my server affected?
Find the installed version of better-auth and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i better-auth
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2025-61928 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2025-61928RHEL, Rocky, Alma, Fedora
rpm -q better-auth
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2025-61928Alpine
apk list --installed | grep -i better-authWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2025-61928
trivy image --scanners vuln IMAGE | grep CVE-2025-61928
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Exploits and proof of concept
- https://github.com/better-auth/better-auth/security/advisories/GHSA-99h5-pjcv-gr6v github.com · exploit
Other references
- https://github.com/better-auth/better-auth/commit/556085067609c508f8c546ceef9003ee8c607d39 github.com
Source: the record CVE-2025-61928 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse