You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(plugin-auth): reject breached passwords via HIBP (ADR-0069 D1, P1) (#2361)
First slice of ADR-0069 (enterprise authentication hardening) and the
enforcement-wired pattern template the rest of the ADR copies. Adds a
`password_reject_breached` auth setting (default off) wired end-to-end to
better-auth's native `haveibeenpwned` plugin — a k-anonymity range check on
sign-up / change / reset; the plaintext password never leaves the process.
- spec: `passwordRejectBreached` flag on AuthPluginConfigSchema.
- service-settings: "Reject breached passwords" toggle in the auth manifest
password-policy group (global scope, manage_platform_settings).
- plugin-auth: bindAuthSettings maps the setting into plugin config;
buildPluginList gates + mounts haveIBeenPwned (env
OS_AUTH_PASSWORD_REJECT_BREACHED wins over config, mirroring twoFactor).
- cli: surface the knob in the serve boot config.
Default-off and additive (no upgrade behavior change). Per ADR-0049 the
toggle ships with its enforcement — no false surface; no new identity fields
(the [custom] D1 items land in follow-ups).
Verified: 102 plugin-auth + 128 service-settings unit tests green; spec /
service-settings / plugin-auth (incl. DTS) / cli build green; live dogfood —
with the toggle ON the HIBP plugin intercepts /sign-up/email (fail-closed when
the corpus is unreachable), with it OFF the same breached password is accepted.
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Auth: reject breached passwords via Have I Been Pwned (ADR-0069 D1, P1)
9
+
10
+
First slice of ADR-0069 (enterprise authentication hardening) and the enforcement-wired pattern template the rest of the ADR follows. Adds a `password_reject_breached` auth setting (default **off**) bound end-to-end to better-auth's native `haveibeenpwned` plugin — a k-anonymity range check on sign-up / change-password / reset-password (the plaintext password never leaves the process).
11
+
12
+
-**spec**: new `passwordRejectBreached` flag on `AuthPluginConfigSchema`.
13
+
-**service-settings**: new "Reject breached passwords" toggle in the `auth` manifest's password-policy group (`global` scope, `manage_platform_settings`).
14
+
-**plugin-auth**: `bindAuthSettings` maps the setting into the plugin config; `buildPluginList` gates and mounts the `haveIBeenPwned` plugin (env `OS_AUTH_PASSWORD_REJECT_BREACHED` wins over config, mirroring `OS_AUTH_TWO_FACTOR`).
15
+
-**cli**: surface the knob in the `serve` boot config alongside `twoFactor`.
16
+
17
+
Default-off and additive — no behavior change on upgrade. Per ADR-0049 the toggle ships with its enforcement (no false surface). No new identity fields (the `[custom]` D1 items — complexity / expiry / history — land in follow-up PRs).
0 commit comments