[PR #9102] fix(utils): add input validation for validatePassword #25336

Open
opened 2026-04-15 22:50:36 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/9102
Author: @MuzzaiyyanHussain
Created: 4/10/2026
Status: 🔄 Open

Base: mainHead: fix/val-password-input


📝 Commits (2)

  • 6358ed2 fix(utils): add input validation for validatePassword
  • 1667fb7 fix(utils): add input validation for validatePassword

📊 Changes

1 file changed (+7 additions, -1 deletions)

View changed files

📝 packages/better-auth/src/utils/password.ts (+7 -1)

📄 Description

Summary

Adds input validation to prevent empty or invalid password values from being processed.

Changes

  • Added guard clause for missing passwords
  • Trimmed password input before verification

Result

Prevents unnecessary processing and improves safety of password validation

This is a non-breaking change.


Summary by cubic

Add input validation to validatePassword to return false when the password is missing or whitespace-only. Trim the input before verification to prevent unnecessary account lookups and hash checks.

Written for commit 1667fb74a4. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/9102 **Author:** [@MuzzaiyyanHussain](https://github.com/MuzzaiyyanHussain) **Created:** 4/10/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/val-password-input` --- ### 📝 Commits (2) - [`6358ed2`](https://github.com/better-auth/better-auth/commit/6358ed2b7e471dde8d51dc5ab69d27386c090ee9) fix(utils): add input validation for validatePassword - [`1667fb7`](https://github.com/better-auth/better-auth/commit/1667fb74a4c477005c93bcf9dabec84c4529bdab) fix(utils): add input validation for validatePassword ### 📊 Changes **1 file changed** (+7 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/utils/password.ts` (+7 -1) </details> ### 📄 Description ## Summary Adds input validation to prevent empty or invalid password values from being processed. ## Changes - Added guard clause for missing passwords - Trimmed password input before verification ## Result Prevents unnecessary processing and improves safety of password validation This is a non-breaking change. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Add input validation to validatePassword to return false when the password is missing or whitespace-only. Trim the input before verification to prevent unnecessary account lookups and hash checks. <sup>Written for commit 1667fb74a4c477005c93bcf9dabec84c4529bdab. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 22:50:36 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#25336