{"id":"CVE-2025-61928","published":"2025-10-09T21:24:37Z","modified":"2025-10-10T14:23:23Z","title":"Better Auth: Unauthenticated API key creation through api-key plugin","vendor":"better-auth","product":"better-auth","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.3,"severity":"CRITICAL","version":"4.0","vector":"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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00809,"percentile":0.53783,"provenance":"source"},"cwes":[{"id":"CWE-285","name":"Improper Authorization"},{"id":"CWE-306","name":"Missing Authentication for Critical Functionality"}],"references":[{"url":"https://github.com/better-auth/better-auth/security/advisories/GHSA-99h5-pjcv-gr6v","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/better-auth/better-auth/commit/556085067609c508f8c546ceef9003ee8c607d39","tags":["x_refsource_MISC"]}],"priority":{"score":17.3,"factors":[{"name":"EPSS percentile","points":10.76},{"name":"CVSS severity","points":6.51}]},"vendorSlug":"better-auth","affectedVersions":[{"vendor":"better-auth","product":"better-auth","versions":["< 1.3.26"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"total","timestamp":"2025-10-10T14:23:17.755463Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"better-auth","vulnerableRanges":["<1.3.26"],"patched":["1.3.26"],"from":["GHSA-99h5-pjcv-gr6v"],"provenance":"source"}],"summary":{"text":"The Better Auth library, specifically its api-key plugin, contains a flaw in the API key creation and update routes (the api/auth/api-key/create endpoint and its update counterpart) that fails to require authentication when a user id is supplied in the request body. An unauthenticated remote attacker who can reach the endpoint over the network, with no user interaction or prior credentials needed, can create or modify API keys for any user by supplying that user's id, then use those keys to act as the victim with the victim's privileges.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-21T05:39:15Z"},"euvd":{"id":"EUVD-2025-33660","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2024-56734","published":"2024-12-30","fixed":"1.1.6","kev":false},{"cve":"CVE-2025-27143","published":"2025-02-24","fixed":"1.1.20","kev":false},{"cve":"CVE-2025-53535","published":"2025-07-07","fixed":"1.2.10","kev":false,"link":{"from":"CVE-2025-53535","to":"CVE-2025-61928","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:better-auth","fromFixed":"1.2.10","toFixed":"1.3.26","daysApart":94}]}},{"cve":"CVE-2025-61928","published":"2025-10-09","fixed":"1.3.26","kev":false},{"cve":"CVE-2025-71401","published":"2026-08-02","fixed":"1.4.2","kev":false,"link":{"from":"CVE-2025-61928","to":"CVE-2025-71401","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:better-auth","fromFixed":"1.3.26","toFixed":"1.4.2","daysApart":297}]}},{"cve":"CVE-2026-45364","published":"2026-05-28","fixed":"1.5.0-beta.9","kev":false},{"cve":"CVE-2026-53517","published":"2026-07-15","fixed":"1.6.0","kev":false}],"package":"npm:better-auth"}}