/

CVE-2025-71400

Severity:

HIGH RISK

(7.1)

IDOR (CWE-639) in better-auth Passkey Deletion API

CVE-2025-71400

Deferred

Vulnerability type

Category:

Insecure Direct Object Reference

CWE:

CWE-639

Impact:

Unauthorized Passkey Deletion and Account Disruption

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

better-auth passkey versions before 1.4.0 contain an insecure direct object reference in the passkey deletion endpoint, allowing authenticated users to delete passkeys by ID.

When an attacker with a valid session can submit crafted requests with arbitrary passkey identifiers, they may remove other users' passkeys and disrupt account authentication.

Affected context

This vulnerability appears in applications that integrate better-auth passkey functionality and expose a delete-passkey endpoint relying on client-supplied identifiers.

It tends to occur when:

  • Passkeys are referenced directly by an ID parameter in API calls
  • Authorization checks only verify that the caller is authenticated, not that they own the targeted passkey
  • Passkey IDs are predictable or enumerable in the data store

In such environments, any authenticated user could potentially target passkeys belonging to other accounts.

Exploit preconditions

  • Attack surface: HTTP API endpoint for deleting passkeys (e.g., /delete-passkey).
  • Required access: An authenticated session in the application; no special privileges beyond standard user access.
  • Trigger point: Submission of a deletion request containing the ID of a passkey owned by another user.
  • Why exploitation is possible: The endpoint trusts the caller-supplied passkey ID and does not enforce ownership or object-level authorization, enabling users to operate on resources they do not control.

Why this happens

The underlying bug class is an insecure direct object reference (IDOR), mapped to CWE-639.

The application exposes internal resource identifiers (passkey IDs) and uses them directly to perform sensitive operations without verifying that the requesting user is authorized to act on that specific resource.

By coupling access control solely to authentication status and not to resource ownership, the system permits horizontal privilege abuse where one user can manipulate another user's passkeys.

Potential impact

  • Attackers may delete other users' registered passkeys.
  • Users can experience unexpected login failures or lockouts due to missing passkeys.
  • Accounts may be forced to fall back to weaker or less secure authentication methods.
  • Helpdesk and support workloads can increase due to account recovery and re-enrollment requests.
  • In some workflows, attackers can disrupt multi-factor authentication setups or security policies that rely on passkeys.

General mitigation guidance

Effective mitigation focuses on enforcing object-level authorization and tightening how resource identifiers are used.

Common defensive patterns include:

  • Validating that the authenticated user owns the passkey referenced by the incoming ID before performing any deletion.
  • Implementing centralized access control checks for all operations on user-bound credentials rather than relying on endpoint-specific logic.
  • Avoiding direct reliance on predictable or sequential identifiers; use opaque, hard-to-guess IDs that are bound to a user context.
  • Designing APIs so that clients operate on "current user's resources" without supplying cross-tenant IDs wherever possible.
  • Applying least privilege to credential-management operations and logging all changes to authentication factors for auditing.

How teams detect issues like this

Detection typically involves combining code-level analysis with runtime observation:

  • Static analysis or manual code review to identify endpoints that accept resource IDs and perform sensitive actions without explicit ownership checks.
  • Pattern-based review for calls that look up passkeys or similar credentials using user-supplied IDs without joining on the authenticated user's identity.
  • Security test cases and automated integration tests that attempt operations on resources belonging to different users to verify enforcement of horizontal authorization.
  • Application logging and anomaly detection that flag unusual patterns of passkey deletions spanning many different accounts from a single user session.
  • Optional use of automated security review tools or API gateways enforcing policy rules around credential management endpoints.

Sources

SourceLink
github.comgithub.com/better-auth/better-auth/security/advisories/GHSA-4vcf-q4xf-f48m
vulncheck.comvulncheck.com/advisories/better-auth-passkey-before-idor-via-delete-passkey

Frequently asked

questions

No. Exploitation requires a valid authenticated session. However, any user who can log in, including compromised or low-privilege accounts, may attempt to delete other users' passkeys.

It does not. Standard user-level access is sufficient if the application does not enforce ownership checks on the passkey deletion endpoint.

Implement strict object-level authorization: ensure that passkeys are always resolved in the context of the authenticated user, and verify ownership before allowing deletion or modification. Centralizing these checks in the credential-management layer helps prevent similar bugs.

Adopt a consistent access control model that binds resource operations to user identity, avoid exposing or trusting raw internal IDs from clients, enforce authorization at every layer handling resource access, and include horizontal access control tests in your CI and security review processes.

Find out what's already
exploitable in your codebase.