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

Fortify Hardening For Laravel Laravel Package

pushery/fortify-hardening-for-laravel

Security hardening for Laravel Fortify. Adds stricter password rules, login throttling and rate limiting, safer session defaults, and optional two-factor enforcement, so your app's authentication is secure out of the box with minimal configuration and no loss of Fortify features.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Security & privacy hardening for authentication: The package still addresses the original PII leakage vector in Laravel Fortify’s login rate limiter—failed sign-in counts store the user’s email and IP address in plaintext within the cache store and any error tracker that records cache calls. Hashing those keys with the application key removes that exposure while preserving Fortify’s rate-limiting behavior (5 attempts per minute, same wait).
  • Account-enumeration defense as a first-class control: v0.3.0 broadens the package’s scope from cache hygiene into registration enumeration safety. The notification sent to the holder of a taken address now names the application, supports custom branding/greeting via a subclass, can omit password-reset language for passwordless apps, and ships in seven languages. Teams can treat “registration does not disclose whether an identity exists” as an explicit product requirement rather than an implicit hope.
  • Verifiable enumeration safety in CI: The fixed assertEnumerationSafe() helper now passes Livewire registration forms that answer known and unknown identities alike, and still fails when a field distinguishes them. This turns enumeration safety into an assertion you can run in the test suite instead of a manual review item—useful for a definition-of-done on auth flows.
  • Multi-tenant and white-label readiness: The new applicationName() hook (via fortify-hardening.registration.notification) lets a single installation serving multiple brands name the correct instance in the notice, and greeting() lets the host address the holder. This supports product decisions around shared infrastructure with per-tenant identity, and around making security emails feel native to the brand.
  • Compliance and data-minimization initiatives: Teams working toward GDPR, SOC 2, or internal privacy standards can point to this as a concrete control that reduces personal data in caching and observability layers, and now also as evidence of anti-enumeration handling on registration. Low effort, high signal for audits.
  • Build vs. buy: The functional delta per feature is narrow (hash limiter keys; customize a notification; assert response parity), but the subtlety lies in correct binding, response fingerprinting across Livewire’s randomized payloads, and translation coverage. In-house implementation is feasible but easy to get wrong—especially the Livewire fingerprinting, which is exactly the bug fixed here. This package offers a maintained, toggleable path. Evaluate against the cost of maintaining custom bindings and test helpers.
  • Feature and roadmap fit: If the roadmap includes “reduce PII in logs/caches,” “harden authentication infrastructure,” or “prevent account discovery,” this is a near-term candidate. It is still not a broader auth overhaul—no MFA, password policy, or session management—but its footprint now spans login rate limiting and registration enumeration.
  • Operational note for planning: Enabling the hashed-keys feature resets existing rate-limit counters at deploy time (because keys change). This is a minor, one-time effect—Fortify’s limits reapply immediately—but should be communicated to on-call or security teams if there’s an active brute-force window. The FORTIFY_HARDENING_HASHED_LOGIN_KEYS=false escape hatch allows quick rollback. Notification and assertion changes are non-breaking for existing adopters.

When to Consider This Package

  • Adopt when:
    • You use Laravel Fortify for authentication and rely on its built-in login rate limiter, its registration flow, or both.
    • Your cache store or error tracker may retain cache keys (e.g., Redis, Memcached, database cache, Sentry breadcrumbs for cache operations).
    • You have compliance, privacy, or security requirements that discourage plaintext email/IP retention in non-primary storage, or that require anti-enumeration behavior on registration.
    • You want enumeration safety covered by an automated assertion—particularly if your registration is a Livewire component, which the updated helper now handles.
    • You operate a multi-brand or multi-tenant installation and need security notices to name the correct application and greet the recipient.
    • You run a passwordless application and want the “taken address” notice to stop pointing at a password reset that does not exist.
    • You want a small, focused dependency rather than a broad security suite.
  • Look elsewhere or defer when:
    • You do not use Fortify, or you already use a custom rate limiter with hashed keys and your own enumeration tests.
    • You need broader authentication hardening (MFA, password policies, session management) beyond PII-in-cache and enumeration concerns.
    • Package maturity is a blocker: v0.3.0 is still early-stage, with limited real-world exposure. For high-assurance environments, evaluate the maintainer’s track record, test coverage, and release cadence before adopting.
    • You cannot tolerate a one-time reset of rate-limit counts on deploy (though this is typically acceptable and Fortify’s limits remain enforced).
    • Your error tracker or cache is already configured to exclude or redact cache keys—though defense-in-depth still argues for hashing at the source.
    • Your registration surface is heavily customized or non-Fortify; the notification and assertion features assume Fortify’s registration path.

How to Pitch It (Stakeholders)

  • Executives: This is a low-effort, targeted privacy and account-security control. It keeps customer email and IP addresses out of cache stores and error-tracking tools, and it now also helps ensure registration doesn’t reveal whether an account exists—an issue that enables credential-stuffing and phishing. It supports compliance narratives (GDPR, SOC 2) and brand consistency across multi-tenant installs. The package is small and toggleable; the main trade-off remains an early-stage dependency (now v0.3.0) and a one-time reset of rate-limit counters at deploy.
  • Engineering: Drop-in binding for Fortify’s LoginRateLimiter that hashes the email/IP pair with the application key before counting. No changes to Fortify’s limit (5/min) or wait behavior. Enabled by default; can be disabled via FORTIFY_HARDENING_HASHED_LOGIN_KEYS=false. Counts reset on deploy because keys change—acceptable for rate limiting, but worth noting in release notes. v0.3.0 adds configurable registration notice behavior (fortify-hardening.registration.notification, notice_mentions_password_reset), a :app translation placeholder, a subclass hook for applicationName()/greeting(), and a reworked assertEnumerationSafe() that normalizes Livewire component IDs, snapshots without checksums, and echoed identities before comparing—while still failing when a response genuinely distinguishes known from unknown identities. The package is small; review the source and tests, and consider pinning to a specific version until it reaches 1.0.
  • Security/Compliance: Directly addresses PII in cache and error-tracker payloads for failed login attempts, using Laravel’s application key so keys are not reversible without the app secret. It also provides a testable control against user enumeration on registration, including Livewire-based forms, and lets passwordless deployments avoid misleading reset instructions. This is defense-in-depth, not a replacement for broader auth monitoring. Recommend enabling by default, documenting the env toggle as an emergency rollback, and wiring assertEnumerationSafe() into the auth test suite.
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.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums