Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-36rg-gfq2-3h56

Опубликовано: 07 июл. 2025
Источник: github
Github: Прошло ревью
CVSS4: 2.1

Описание

Better Auth Open Redirect Vulnerability in originCheck Middleware Affects Multiple Routes

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

image
image 1

/verify-email

image
image

/delete-user/callback

image
image

/magic-link/verify

image
image

/oauth-proxy-callback

image
image

Impact

Untrusted open redirects in various routes.

Пакеты

Наименование

better-auth

npm
Затронутые версииВерсия исправления

<= 1.2.9

1.2.10

EPSS

Процентиль: 30%
0.00112
Низкий

2.1 Low

CVSS4

Дефекты

CWE-601

Связанные уязвимости

nvd
7 месяцев назад

Better Auth is an authentication and authorization library for TypeScript. 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. This vulnerability is fixed in 1.2.10.

EPSS

Процентиль: 30%
0.00112
Низкий

2.1 Low

CVSS4

Дефекты

CWE-601