Miggo Logo

GHSA-vp58-j275-797x: Better Auth allows bypassing the trustedOrigins Protection which leads to ATO

N/A

CVSS Score

Basic Information

CVE ID
-
EPSS Score
-
Published
2/24/2025
Updated
3/3/2025
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
-
Package NameEcosystemVulnerable VersionsFirst Patched Version
better-authnpm<= 1.1.201.1.21

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from two key issues in URL validation: 1) Insufficient handling of absolute URLs with encoded backslashes (/%5C) that get normalized to external domains, and 2) Weak regex patterns for wildcard domains that allowed protocol injection. Both issues manifest in the validateURL functions within origin-check.ts, where the pre-patch code used naive string checks (!url.includes(':') && !url.includes('//')) rather than proper URL parsing and regex validation. The commit diff shows these checks were replaced with a strict regex pattern (/^/(?![\/%])[\w-./]*$/), confirming these functions as the vulnerable points.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Summ*ry * *yp*ss w*s *oun* *or **wil***r*** or ****solut* URLs** trust**Ori*ins *on*i*ur*tions *n* op*ns t** vi*tims w**sit* to * **Op*n R**ir**t** vuln*r**ility, w**r* it **n ** us** to st**l t** **r*s*t p*sswor* tok*n** o* * vi*tims ***ount *y

Reasoning

T** vuln*r**ility st*ms *rom two k*y issu*s in URL v*li**tion: *) Insu**i*i*nt **n*lin* o* **solut* URLs wit* *n*o*** ***ksl*s**s (/%**) t**t **t norm*liz** to *xt*rn*l *om*ins, *n* *) W**k r***x p*tt*rns *or wil***r* *om*ins t**t *llow** proto*ol in