GHSA-vp58-j275-797x: Better auth Better Auth Allows Bypassing The Vulnerability

HIGH
CVSS 7.1
CWE-601
Published
Advisory Summary

GHSA-vp58-j275-797x is a HIGH (CVSS 7.1) better auth allows bypassing the vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Better auth libraries in the npm ecosystem. The issue involves better auth allows bypassing the trustedorigins protection which leads to ato. Remediation is available by upgrading affected packages to version 1.1.21.

GHSA-vp58-j275-797x at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-vp58-j275-797x
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Better auth
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity High (I:H)
Availability None (A:N)

How to Fix GHSA-vp58-j275-797x

To remediate this vulnerability, upgrade all affected Better auth dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

better-auth fixed: 1.1.21
npm install better-auth@1.1.21
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls better-auth

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-vp58-j275-797x, inspect your project dependencies using npm:

npm ls better-auth

Analyze the terminal output to locate any version of Better auth in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.21), your application is affected.

Note: The npm ls better-auth command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In Better auth, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary A bypass was discovered in the trustedOrigins validation logic—affecting both absolute URL entries and wildcard domain patterns. This flaw allows an attacker to construct a malicious callbackURL that passes origin checks and triggers an open redirect. Because redirect endpoints include sensitive tokens (such as password-reset tokens), this vulnerability can enable one-click account takeover if a victim clicks a crafted link.

GHSA-vp58-j275-797x Affected Better auth Versions

1 component(s)
Fixed Versions:
1.1.21
Product / Package Ecosystem Affected Versions Fixed Version
better-auth
npm
< 1.1.21
1.1.21

References

Frequently Asked Questions

What is GHSA-vp58-j275-797x?
GHSA-vp58-j275-797x is a security vulnerability in Better auth involving Better Auth allows bypassing the trustedOrigins Protection which leads to ATO under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Better auth versions are affected?
Affected versions include releases prior to 1.1.21 across affected packages: better-auth.
What version fixes GHSA-vp58-j275-797x?
Upgrading to 1.1.21 (or the latest patched release for your respective branch) resolves the vulnerability.
Is better-auth affected?
Yes, better-auth is affected in releases prior to 1.1.21. Upgrade your dependency to 1.1.21 or later.
What is the CVSS score of GHSA-vp58-j275-797x?
GHSA-vp58-j275-797x has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:N.
What CWE is associated with GHSA-vp58-j275-797x?
GHSA-vp58-j275-797x is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check npm dependencies for GHSA-vp58-j275-797x?
Run the dependency tree command: 'npm ls better-auth'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vp58-j275-797x",
  "modified" : "2025-12-09T16:27:07Z",
  "published" : "2025-02-24T20:49:50Z",
  "aliases" : [ ],
  "summary" : "Better Auth allows bypassing the trustedOrigins Protection which leads to ATO",
  "details" : "### Summary\n\nA bypass was discovered in the trustedOrigins validation logic—affecting both absolute URL entries and wildcard domain patterns. This flaw allows an attacker to construct a malicious callbackURL that passes origin checks and triggers an open redirect.\n\nBecause redirect endpoints include sensitive tokens (such as password-reset tokens), this vulnerability can enable one-click account takeover if a victim clicks a crafted link.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "better-auth"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.1.21"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.1.20"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/better-auth/better-auth/security/advisories/GHSA-vp58-j275-797x"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/better-auth/better-auth/commit/b381cac7aafd6aa53ef78b6ab771ebfa24643c80"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/better-auth/better-auth"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/better-auth/better-auth/blob/ddebd0358d74376ea64541512d0167dd4377f182/packages/better-auth/src/api/middlewares/origin-check.ts#L53"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-02-24T20:49:50Z",
    "nvd_published_at" : null
  }
}