marein/symfony-standard-headers-csrf-bundle
A Symfony bundle that adds CSRF protection using standard HTTP headers instead of form tokens. Ideal for APIs, SPAs, and stateless clients, it validates requests via headers like X-CSRF-Token and integrates cleanly with Symfony's security and event system.
^8.0. That removes a blocker from our PHP/Symfony upgrade track and lets platform modernization proceed without waiting on this dependency.Consider it when:
VerifyCsrfToken middleware and Sanctum already cover most first-party cases, and adopting a Symfony bundle means porting the concept rather than the code.composer.json before assuming compatibility; the release notes only document the upper bound being raised.Look elsewhere when:
For executives (one paragraph): This is a small open-source component that implements CSRF protection for APIs and single-page apps using standard request headers instead of session-bound form tokens. Adopting it is a low-cost, low-risk decision: it replaces custom security-adjacent code we would otherwise own and maintain, and it is removable in days if needed. The 1.0.4 release is a compatibility release — it adds PHP 8.4/8.5 to the test pipeline and allows Symfony 8 — which matters because it keeps this dependency from blocking our platform upgrade schedule. The main caveat is maintenance: it is a single-maintainer project, so we should pin versions and retain a fallback path. Recommendation: adopt for new stateless services, do not retrofit into flows where the framework's built-in CSRF already works.
For engineering (summary): 1.0.4 contains no functional, API, or behavioral changes — it is CI matrix expansion plus a widened Symfony constraint (^8.0). Integration cost is one bundle registration and configuration; there is no bespoke cryptography to review. Two action items before adoption: (1) confirm the actual Symfony/PHP constraint range in composer.json, since the notes only document the upper bound, and (2) confirm the exact header contract and token-format expectations from source and tests, since the package name implies a standard we should verify rather than assume. Given the single-maintainer profile, pin to an exact version, add it to our dependency-review watchlist, and keep the framework-native middleware documented as the rollback option. For Laravel-only services, treat this as a design reference rather than a dependency.
How can I help you explore Laravel packages today?