نسخههای متأثر
npmbetter-auth
- نسخههای متأثر
- <= 1.2.9
- نسخهٔ اصلاحشده
- 1.2.10
بهرهبرداری
شرح آسیبپذیری
Summary
An open redirect has been found in the originCheck middleware function, which affects the following routes: /verify-email, /reset-password/:token, /delete-user/callback, /magic-link/verify, /oauth-proxy-callback.
Details
In the matchesPattern function, url.startsWith( can be deceived with a url that starts with one of the trustedOrigins.
const matchesPattern = (url: string, pattern: string): boolean => {
if (url.startsWith("/")) {
return false;
}
if (pattern.includes("*")) {
return wildcardMatch(pattern)(getHost(url));
}
return url.startsWith(pattern);
};
Open Redirect PoCs
export const auth = betterAuth({
baseURL: 'http://localhost:3000',
trustedOrigins: [
"http://trusted.com"
],
emailAndPassword: {
...
},
})
/reset-password/:token
/verify-email
/delete-user/callback
/magic-link/verify
/oauth-proxy-callback
Impact
Untrusted open redirects in various routes.
پیوندها
- https://github.com/advisories/GHSA-36rg-gfq2-3h56
- https://github.com/better-auth/better-auth
- https://github.com/better-auth/better-auth/commit/9801d1be53d9da04686b94c6286c53ec97496740
- https://github.com/better-auth/better-auth/security/advisories/GHSA-36rg-gfq2-3h56
- https://nvd.nist.gov/vuln/detail/CVE-2025-53535
گزارشدهندگان
- mwlik
- imenyoo2

