CVE-2025-53535
BaseFortify
Publication date: 2025-07-07
Last updated on: 2025-07-08
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-601 | The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
CVE-2025-53535 is an open redirect vulnerability in the originCheck middleware of the Better Auth library for TypeScript. The issue arises because the function that validates URLs uses a simple 'startsWith' check to verify if a URL matches a trusted origin. This check can be bypassed by crafting malicious URLs that appear to start with a trusted origin but actually redirect users to untrusted, potentially harmful sites. This affects several routes like /verify-email and /reset-password/:token, allowing attackers to redirect users to malicious websites. [1]
How can this vulnerability impact me? :
This vulnerability can lead to users being redirected to malicious websites without their knowledge when interacting with affected routes in the Better Auth library. Such open redirects can be exploited for phishing attacks, stealing user credentials, or delivering malware, thereby compromising user security and trust. [1]
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by testing the affected routes (/verify-email, /reset-password/:token, /delete-user/callback, /magic-link/verify, /oauth-proxy-callback) for open redirect behavior. You can attempt to access these endpoints with URLs crafted to bypass the originCheck middleware, such as URLs that start with a trusted origin string but redirect to an untrusted site. For example, using curl commands to test redirection responses: curl -v 'https://yourdomain.com/verify-email?redirect=https://trusted.com.evil.com' and observe if the redirect occurs to an untrusted domain. Automated scanning tools or custom scripts can be used to detect open redirects by sending payloads that exploit the insufficient url.startsWith(pattern) check. [1]
What immediate steps should I take to mitigate this vulnerability?
The immediate mitigation step is to upgrade the better-auth package to version 1.2.10 or later, where the vulnerability is fixed. Until the upgrade can be applied, consider implementing additional validation on redirect URLs to ensure they exactly match trusted origins rather than using startsWith checks, or temporarily disable the affected routes if possible to prevent exploitation. [1]