korotovsky/csrf-validator-bundle
A Symfony bundle for CSRF protection that generates and validates anti-CSRF tokens for forms and state-changing requests, helping guard against cross-site request forgery with straightforward, framework-native configuration.
Architecture fit — category mismatch, not a Laravel package. korotovsky/csrf-validator-bundle is a Symfony bundle: DI extension, event subscriber on kernel.request, and Doctrine-style annotations on controller actions. There is no service provider, no facade, no extra.laravel block, and zero Laravel auto-discovery support. Installing it into a Laravel application yields an inert dependency plus a potential boot-time failure if the bundle is registered on a Symfony kernel that doesn't exist. The request was framed as a Laravel/PHP package; the honest technical read is that this is a Symfony artifact that happens to be written in PHP.
Problem fit — the capability is already native. Laravel ships VerifyCsrfToken middleware (global by default), the @csrf Blade directive, csrf_token()/csrf_field() helpers, X-XSRF-TOKEN handling for Axios, per-route exclusion via $except, and Sanctum's stateful SPA cookie flow. The package's differentiator — declarative per-action token validation via annotation — is a weaker version of what the framework does by default. Even in its native Symfony ecosystem, the annotation mechanism is legacy: Doctrine annotations were removed from Symfony core in favor of PHP 8 attributes (#[IsCsrfTokenValid]), so adoption creates migration debt on day one.
Technical risk — high, and concentrated on a security primitive. 0 stars, 0 dependents, single maintainer, no observable release cadence, no published security policy, no downstream base to surface regressions. For CSRF specifically, failure is silent: a validator that fails open on misconfiguration is indistinguishable from no protection until it is exploited. Replacing a framework-native, security-team-reviewed control with an unvetted third-party bundle is a net increase in risk, not a mitigation.
Key questions before any further spend:
composer.json constraints: PHP and Symfony versions, and does it require doctrine/annotations (removed from Symfony core in 7.0)?hash_equals)? Is the token per-session, per-form, or one-time? Is there rotation?Stack fit — effectively zero for a Laravel estate. There is no adapter, no middleware bridge, and no container integration. Porting would require re-implementing all three moving parts — the annotation/attribute reader, the request listener, and the token manager — behind a Laravel middleware or a FormRequest rule. At that point you have written a new package and inherited the maintenance burden while gaining nothing over VerifyCsrfToken.
Migration path — there isn't a meaningful one. The rational sequence is to close the request: document the native equivalent (VerifyCsrfToken + $except + @csrf) and, if a genuine gap exists (e.g., stateless CSRF on a token-auth API), route it to the platform team for a double-submit-cookie or SameSite design rather than a third-party dependency.
Compatibility — unverified and likely narrow. A bundle of this vintage typically pins Symfony 4/5-era constraints and depends on the Doctrine annotation reader. It is not PSR-15 middleware, so it does not drop into a generic PHP pipeline either. Version drift against current PHP 8.2+/Symfony 7 is a probable blocker independent of the Laravel mismatch.
Sequencing, if leadership insists on a spike:
composer.json and the listener. If it fails open or requires Doctrine annotations, stop — that is a sufficient "no."VerifyCsrfToken on identical routes; require security sign-off on the fail-closed test before any cutover.Realistically, steps 2–4 should not be funded. The 0 score, 0 dependents, and opportunity score of ~22 are consistent with the technical read: low strategic value, high integration cost.
Maintenance. This becomes an internal fork on day one. No release cadence, no dependents to catch breakage, no upstream patch stream. For a security control, "we patch it ourselves, eventually" is a commitment most teams cannot honor, and the cost lands quietly on whoever owns the application.
Support. No meaningful documentation, no community, no issue-tracker signal. Onboarding material must be written from scratch, and there is no external authority to escalate to mid-incident. Compare the native middleware: framework docs, CVE handling, and a very large installed base.
Scaling. Annotation metadata is cached after first parse, so steady-state CPU cost is acceptable. The real constraint is token storage: session-bound tokens break horizontal scaling for stateless APIs unless sessions are externalized (Redis/DB), and they complicate multi-tab, long-lived-form, and mobile-client flows. Stateless CSRF (double-submit cookie, SameSite) is where the industry has moved; this package predates that.
Failure modes, ranked by severity.
Ramp-up. Code volume is small, but assessing it correctly requires Symfony DI, event-subscriber, and annotation-reader fluency that a Laravel-only team does not have. The true ramp-up cost is not learning the package — it is building the security-review capability to trust it, which is precisely the cost avoided by using the framework-native control.
Bottom line. Recommend reject / no adoption. The package targets the wrong framework, solves a problem Laravel already solves natively, and wraps a security primitive in a 0-star, single-maintainer, annotation-based artifact whose dominant failure mode is silent. The TPM action is to close the request with a one-page note pointing to VerifyCsrfToken and $except, and to route any genuine stateless-API CSRF gap to the platform team rather than to a third-party dependency.
How can I help you explore Laravel packages today?