GHSA-44jh-23m7-hpcf: Race Condition

Published Oct 27, 2026
·
Updated

Am I affected?

You are affected if you use @better-auth/drizzle-adapter from 1.6.17 through versions before 1.7.7 (including the 1.7.0 prereleases from beta.6 through rc.6) or @better-auth/kysely-adapter 1.6.17 through 1.6.31, and keep rate-limit records in a PostgreSQL database.

All of these must be true:

- Rate limiting is enabled. - Rate-limit records are stored in the database. - The database is PostgreSQL, used through one of the adapter versions above.

You are not affected if you store rate-limit records in memory (the default) or in secondary storage.

Summary

Database-backed rate limiting on PostgreSQL can let a burst of concurrent requests go over the configured maximum. When many requests arrive at the same time, several of them can pass the limit check together. This weakens the rate limit on password sign-in, two-factor verification, one-time codes, password resets, and other rate-limited endpoints.

Impact

An attacker who sends many requests at once can make more attempts than the application allows.

The issue does not bypass password or one-time-code validation. It does not directly compromise an account. The number of extra attempts is limited by the number of concurrent database connections, the number of application instances, and the rate-limit window.

Patches

@better-auth/kysely-adapter is fixed in 1.7.0. Upgrade to 1.7.0 or later.

The Drizzle fix is merged for the planned @better-auth/drizzle-adapter 1.7.7 release. That package is not available yet. Upgrade better-auth and the installed Drizzle adapter together when 1.7.7 is available. No database schema or public API migration is required.

Workarounds

- Store rate-limit records in secondary storage. - Use a custom rate-limit storage that checks and increments the counter in one atomic step. An atomic step cannot be interrupted by another request. - Enforce the intended limit at an upstream layer, such as a reverse proxy or gateway.

In-memory storage also avoids this issue. However, each application instance keeps its own counter, so it may not enforce one shared limit in multi-instance or serverless deployments.

Affected Software

3 affected componentsFixes available
npm/better-auth>=1.6.17<1.7.7
1.7.7
npm/@better-auth/kysely-adapter>=1.6.17<1.7.0
1.7.0
npm/@better-auth/drizzle-adapter>=1.6.17<1.7.7
1.7.7

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/better-auth to a version that resolves this vulnerability.

    Fixed in 1.7.7
  2. Upgrade

    Upgrade npm/@better-auth/kysely-adapter to a version that resolves this vulnerability.

    Fixed in 1.7.0
  3. Upgrade

    Upgrade npm/@better-auth/drizzle-adapter to a version that resolves this vulnerability.

    Fixed in 1.7.7
  4. Upgrade

    Upgrade better-auth with @better-auth/drizzle-adapter to a version that resolves this vulnerability.

    Fixed in 1.7.7
  5. Upgrade

    Upgrade @better-auth/kysely-adapter to a version that resolves this vulnerability.

    Fixed in 1.7.0
  6. Configuration

    Store rate-limit records in memory or secondary storage instead of PostgreSQL.

    Rate-limit storage rate-limit record storage = in-memory or secondary storage
  7. Configuration

    Use custom rate-limit storage that checks and increments the counter in one atomic step.

    Custom rate-limit storage counter update = atomic check-and-increment
  8. Compensating control

    Enforce the intended rate limit at an upstream layer such as a reverse proxy or gateway.

Event History

Oct 27, 2026
Advisory Published
via GitHub·03:32 PM
Data Sourced
via GitHub·03:32 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Is the default rate-limit storage configuration affected?

No. In-memory rate-limit storage, which is the default, is not affected. Secondary storage is also not affected.

2

What conditions must an attacker meet to exceed the configured limit?

The attacker must send many requests concurrently to a rate-limited endpoint. The issue only applies when rate limiting is enabled and its records are stored in PostgreSQL through the affected adapter versions.

3

Does exploiting this issue bypass authentication or directly compromise accounts?

No. It does not bypass password or one-time-code validation and does not directly compromise an account. It can allow extra attempts beyond the configured maximum, limited by the number of concurrent requests.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203