Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Nist Password Rules Laravel Package

langleyfoxall/laravel-nist-password-rules

Laravel validation rules implementing NIST SP 800-63B password guidance: enforce minimum length, reject breached and common dictionary passwords, block context-specific words, and avoid outdated composition rules. Easy to add to form requests and validators.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

langleyfoxall/laravel-nist-password-rules is a Laravel validation-rule package that enforces NIST SP 800-63B password guidance: minimum length (8) and maximum length (64), rejection of common/breached passwords (via the HaveIBeenPwned Pwned Passwords range API using k-anonymity), and rejection of context-specific strings (name, email, username), repeated characters, and keyboard/alphabetic sequences.

Architecture fit. It is a pure validation layer — no migrations, no persistence, no service provider side effects beyond config and translation loading. It plugs into Laravel's Validator through a facade of rule sets (NISTPasswordRules::register(), ::changePassword($username, $email), etc.) and therefore composes with FormRequests, Password::defaults(), Fortify, Breeze, and Jetstream password flows. That means near-zero architectural coupling and no schema or data-model impact. The one non-trivial architectural property is that validation performs a synchronous outbound HTTPS call to api.pwnedpasswords.com on the request path for registration and password-reset submissions.

Integration feasibility. Low. composer require langleyfoxall/laravel-nist-password-rules, optional vendor:publish for the config and lang files, then swap existing min:8|confirmed|regex:... chains for a single rule set in the two or three controllers that touch credentials. Realistic effort for a mid-level Laravel developer is well under a day, including message copy and translations. No infrastructure change is required unless we choose to self-host the breach corpus.

Technical risk.

  • External dependency on the request path. HIBP latency (typically 100–400 ms) and availability (HTTP 429 under load, occasional 5xx) directly affect sign-up and reset conversion. The behavioural choice between fail-open (accept password if the API is unreachable) and fail-closed (block the flow) is a policy decision, not a library default, and must be made explicitly and monitored.
  • Policy conflict. The package deliberately omits composition rules (no "must contain a symbol"), does not enforce periodic rotation, and caps length at 64. This aligns with NIST SP 800-63B and with PCI DSS 4.0's move away from composition/rotation, but will conflict with older internal audit checklists and any inherited ISO 27001 control wording. Expect a compliance conversation, not a technical one.
  • Privacy/egress review. Only the first five characters of the SHA-1 hash are transmitted, which is the standard k-anonymity design and is defensible, but it is still an outbound call from an authentication path and should be documented in the DPIA/third-party register.
  • Vendor concentration. Single-maintainer package from a UK agency; bus factor is the primary long-term risk, mitigated by its small surface area and permissive licence.
  • Release risk for v8.2.0 specifically. The release is a maintenance-only dependency bump ("Bumping versions", PR #68) — no API changes, no new rules, no deprecations. From a TPM standpoint its only significance is evidence that the dependency constraints are being kept current with the Laravel/PHP support matrix, which slightly reduces the "abandoned package" risk.

Key questions for the maintainer/engineering spike.

  1. What is the supported Laravel and PHP range at v8.2.0, and does it cover our current and next-upgrade framework versions?
  2. What is the library's behaviour and timeout configuration when HIBP is unreachable or rate-limits — does it throw, fail validation, or pass?
  3. Are breach-check results cached, and can we substitute our own breach-checker (self-hosted Pwned Passwords or an internal service) behind the rule?
  4. Does the config allow tuning minimum/maximum length and disabling individual checks (e.g. context words) to match our policy?
  5. Are validation messages translatable, and is any password material written to logs by default?
  6. What does the test suite cover, and does it mock the HTTP client (Http::fake) so our CI does not depend on a live third-party API?

Integration Approach

Stack fit. Native Laravel — the package targets the framework's Validator contract and ships a facade, config, and lang files. It is framework-idiomatic rather than a bolt-on, so it fits wherever we already use FormRequests or Password::defaults(). It is not appropriate for non-Laravel PHP services in our estate; those would need a direct HIBP range-check client instead.

Migration path. Treat this as a policy migration, not a code migration:

  1. Pin ^8.2 in composer.json and publish config/lang files so defaults are reviewable in-repo.
  2. Introduce the rules in shadow mode on one low-risk application: compute the rule outcome alongside existing validation, accept the request either way, and log only the rejection reason (never the credential). This quantifies how many current users would be blocked by length/common-password checks before we harden.
  3. Flip registration and password-reset to enforcing; leave login untouched.
  4. Retire bespoke regex/complexity rules and rotation-expiry logic in the same change window, otherwise users receive contradictory instructions.
  5. Update reset/registration UI copy, help-centre articles, and the support script.

Compatibility. Requires a Laravel version within the package's constraint and a PHP version matching its floor; verify against our oldest maintained application before adopting broadly. Password hashing (bcrypt/argon) is unaffected — the 64-character cap is a validation policy, not a storage limit, but confirm no legacy path truncates at 60/72 bytes. Unicode passwords need the app's connection charset to be utf8mb4; where it is not, enforce the cap conservatively to avoid silent truncation.

Sequencing. Pilot (1 app, shadow) → enforce on new-credentials flows (registration, reset, change) → policy and documentation update → second wave of applications → evaluate self-hosted Pwned Passwords if call volume or egress policy demands it. Do not couple this to a framework major-version upgrade; land it as an isolated change so failures are attributable.

Operational Impact

Maintenance. Small, slow-moving codebase with a single primary maintainer; the v8.2.0 dependency bump is typical of its cadence — infrequent but alive. Ongoing work is limited to tracking Laravel major releases and refreshing the pinned constraint. Recommended mitigation: fork-and-pin discipline (internal mirror or composer.lock pinning) so an upstream abandonment does not block a framework upgrade, plus a calendar reminder each Laravel release cycle to check compatibility.

Support. The user-visible change is large even though the code change is small: support staff will field "why was my password rejected?" and "why can't I use my usual symbol-heavy password?" Volume should be low but sentiment can be poor if copy is unclear. Rejection messages must be specific ("this password has appeared in a known data breach", "this password is too long") and localised. Publish an internal FAQ before rollout; the dominant ticket driver is confusion over removed complexity requirements, not defects.

Scaling. Validation is synchronous and adds one outbound HTTP round-trip per credential submission — negligible against overall authentication volume for typical apps, but it does put a third party on the critical path of a conversion-sensitive flow. Two levers: cache HIBP range responses (the range → suffix list is stable and cacheable for hours/days) to cut call volume substantially, and configure short timeouts with explicit fail-open/fail-closed behaviour. At high volume or under strict egress controls, self-hosting the Pwned Passwords dataset removes the dependency at the cost of a sizeable on-disk corpus and a periodic refresh job.

Failure modes.

  • HIBP returns 429/5xx or times out → registration or reset unavailable, or (fail-open) weaker enforcement silently. Needs alerting on the failure branch and a documented decision, reviewed quarterly.
  • Egress/DNS/proxy change blocks api.pwnedpasswords.com → deterministic validation failures that look like product bugs; add the host to the outbound allowlist and to the dependency register.
  • Policy drift between the package defaults and our published password policy → inconsistent enforcement across applications; keep config in version control and review per release.
  • Locale/encoding edge cases → legitimate users with non-Latin passwords rejected; covered by shadow-mode data and a pre-production test matrix.
  • Upstream abandonment → a Laravel upgrade blocks. The rule set is ~a few hundred lines and could be vendored in-house if necessary; note this as an exit option, not a plan.

Ramp-up. Roughly half a day for a Laravel developer familiar with validation to integrate and test, plus one to two days of TPM/compliance time for the policy rewrite and stakeholder sign-off — which is the larger and more schedule-sensitive component. Security, legal/privacy (egress and data-protection review), and support enablement each need a light-touch review; none should gate the technical work, but all should complete before enforcement goes live.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings