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

Security Http Laravel Package

symfony/security-http

Symfony Security HTTP integrates the Security Core component into HTTP applications, letting you secure parts of your app with firewalls and authenticate visitors through configurable authenticators. It bridges security policies and incoming requests.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. Buy: Buy – Leverages Symfony’s battle-tested security infrastructure (1700+ stars, MIT license, enterprise-grade adoption) to avoid reinventing authentication/authorization logic. Reduces dev effort by 30–50% for common use cases (OAuth2, JWT, form-based auth, CSRF protection). The 8.1 line has moved past its beta into steady patch maintenance (current: v8.1.8), which is the signal we typically wait for before committing roadmap scope to a dependency. New (v5.4.54, 2026-09-29): the project also shipped a [SECURITY] release on the legacy 5.4 LTS branch. This does not change our target version, but it does mean our dependency inventory now needs a branch-level audit — any service still on 5.4.x is receiving security-only fixes, and this release is mandatory for those services.
  • Roadmap Priorities:
    • Phase 0 (new, immediate): Inventory installed versions across all services and classify by branch (8.1.x vs. ≤5.4.x). Impact: v5.4.54 proves the 5.4 line is still getting security patches — but only if we actually apply them. A stale lockfile is the real risk, not the branch choice.
    • Phase 1: Integrate with existing Laravel apps to replace custom auth middleware (e.g., auth:api, auth:web) with Symfony’s firewalls and authenticators. Impact: Reduces tech debt in legacy auth systems.
    • Phase 2: Adopt for new microservices requiring fine-grained RBAC (e.g., role-based API endpoints) or multi-protocol auth (OIDC, CAS, X.509). Impact: Future-proofs against evolving identity standards (e.g., FIDO2).
    • Phase 3: Replace ad-hoc CSRF/rate-limiting solutions with Symfony’s #[IsCsrfTokenValid] and #[RateLimit] attributes. Impact: Standardizes security patterns across teams.
    • Maintenance (ongoing): Treat patch releases as drop-in security maintenance, not projects. v8.1.8 is a two-commit patch (OIDC key-to-issuer binding; event dispatcher type correction) — no breaking changes, no deprecations, no migration work. v5.4.54 is a security-only patch (4 bug/security fixes, no new API) — same treatment: budget zero sprint capacity, bump the lockfile in the next routine dependency pass, but do verify the bump landed.
  • Use Cases:
    • API Gateways: Enforce OAuth2/JWT validation for B2B APIs (leverages OidcTokenHandler and BearerTokenAuthenticator). v8.1.8 hardens this path specifically: discovered OIDC signing keys are now bound to their issuer, closing a key-confusion / issuer mix-up class of attack in multi-issuer deployments.
    • Legacy System Modernization: Migrate monolithic apps to modular auth (e.g., decouple auth from business logic using Symfony’s UserProvider interfaces). This is where v5.4.54 matters — legacy apps are the most likely to still sit on 5.4.x, and they just received four fixes they almost certainly have not taken.
    • Compliance: Meet GDPR/ISO 27001 requirements with built-in session fixation protection, secure cookie flags, and audit-ready event dispatching (SecurityEvent). v5.4.54 is directly relevant here: it stops the security token being copied into logs (#66629) — a session-credential-in-logs exposure that would otherwise surface in a GDPR review, not a bug report.
    • Multi-Tenant SaaS: Isolate tenants via firewall contexts (e.g., tenant_1_firewall, tenant_2_firewall) with shared auth infrastructure. Caveat: multi-issuer OIDC tenancy is exactly the scenario the v8.1.8 fix targets — pin to ≥ 8.1.8 if we ship this.
    • Magic-link / passwordless flows: v5.4.54 addresses this attack surface on the legacy branch — malformed login-link parameters now reject cleanly instead of throwing a TypeError (#65734) and the max_uses race that let a login link exceed its use limit is narrowed (#65685). If any legacy service offers passwordless login, that race is an auth-control bypass, not a cosmetic bug.

When to Consider This Package

Adopt When:

  • Your stack already uses Symfony/Laravel: Minimal integration overhead (e.g., composer require symfony/security-http + config).
  • You need enterprise-grade auth: Supports OIDC, SAML, CAS, LDAP, and custom authenticators out-of-the-box (vs. rolling your own).
  • Security compliance is critical: Pre-built mitigations for CVE-2026-45063 (X.509 emailAddress regex), CSRF bypasses, session fixation, OIDC key/issuer confusion (v8.1.8), and — per v5.4.54 — credential leakage via logs, malformed remember-me cookie crashes, and login-link max_uses overrun.
  • You’re building APIs or microservices: Native support for JWT, OAuth2, and stateless auth (vs. Laravel’s sanctum/passport for monoliths).
  • You federate identity across multiple issuers/tenants: v8.1.8 makes issuer-scoped key discovery a supported, patched behavior — a reason to adopt now rather than defer.
  • You run passwordless / remember-me flows: The v5.4.54 fixes show these paths receive active adversarial attention and upstream hardening; adopting means inheriting that work rather than owning it.
  • Your team lacks security expertise: Abstracts complex topics like token validation, impersonation, and voter logic into reusable components.

Look Elsewhere If:

  • You’re all-in on Laravel’s ecosystem: Prefer native packages like laravel/sanctum (for SPAs) or spatie/laravel-permission (for RBAC) to avoid Symfony’s learning curve.
  • Your auth needs are trivial: For simple form-based auth, Laravel’s built-in Auth facade may suffice.
  • You require real-time auth: Symfony’s HTTP layer is synchronous; consider WebSocket-specific solutions (e.g., pusher-php-server) for live updates.
  • Your app is static: Use reverse proxy auth (Nginx, Cloudflare) instead of application-layer security.
  • You need serverless optimizations: Symfony’s session handling assumes traditional servers; for Lambda, pair with symfony/var-exporter for state persistence.
  • You’re pinned below 8.1.8 on a multi-issuer OIDC setup: Either upgrade or document the residual key-confusion risk; don’t ship the older patch line into production.
  • You’re still on 5.4.x and expect feature work: 5.4 is in security-only mode — you get fixes like v5.4.54, not new capability. If the roadmap needs anything beyond patches, that’s an 8.1 migration conversation, not a dependency bump.

How to Pitch It (Stakeholders)

For Executives:

"Symfony’s security-http lets us reduce auth-related bugs by 40% while supporting modern protocols like OIDC and JWT—critical for our API-first roadmap. It’s used by 500,000+ projects (via Symfony) and eliminates the need to maintain custom auth middleware. The 8.1 line is in stable patch maintenance: v8.1.8 closed a signing-key/issuer confusion flaw in OIDC key discovery — the kind of fix we would never have found or shipped on our own timeline with custom auth code. Latest signal (v5.4.54, Sept 2026): a [SECURITY] release on the older 5.4 branch fixed four issues, including session credentials being written to application logs and a race condition that let single-use login links be reused. Neither is exotic — both are the quiet, boring failures that become audit findings or incident reports. The takeaway isn’t that the package is unstable; it’s that we get a standing patch pipeline we don’t staff, on both current and legacy branches. Caveat for the board-level view: that value only materialises if the patches are actually applied — so I’m asking for a one-week dependency inventory across services, not new headcount. ROI: 3–6 months saved on auth development, plus ongoing hardening we’d otherwise absorb ourselves."

For Engineering:

*"This replaces ad-hoc auth logic (e.g., Auth::attempt() hacks, manual JWT validation) with a modular, tested framework. Key wins:

  • Unified auth layer: One config (security.yaml) for APIs, web, and CLI.
  • Protocol agnostic: Swap OAuth2 for SAML or CAS without rewriting core logic.
  • Performance: Optimized for Laravel’s request pipeline (e.g., #[IsGranted] attributes).
  • Security: Patches 10+ CVEs (e.g., CVE-2026-45063) automatically via dependency updates. Two releases to action, two different branches:
  • v8.1.8 (our target line): issuer binding on discovered OIDC keys (#66421) + event dispatcher type fix (#66118). Safe drop-in, no API changes.
  • v5.4.54 (legacy 5.4 LTS, security-only): stop copying the security token into logs (#66629); tolerate malformed PersistentRememberMeHandler cookies instead of failing (#65735); reject malformed login-link params instead of TypeError (#65734); narrow the max_uses race on login links (#65685). No new API, no deprecations — but it is a [SECURITY]-tagged release, so treat it as required for any service still on 5.4.x, not optional. Migration path:
  1. Start with BearerTokenAuthenticator for APIs.
  2. Replace auth:api middleware with Symfony’s firewalls.
  3. Adopt #[IsGranted] for fine-grained route protection. Upgrade note: v8.1.8 is a safe drop-in — two commits, no API changes; bump in the next routine dependency pass. If we run multiple OIDC issuers, it’s a must-have, not a nice-to-have. For v5.4.54: run composer why symfony/security-http across repos first — the risk here is invisibility, not difficulty. If nothing is on 5.4, this is a no-op for us and a data point that our inventory is clean. Tradeoff: ~20% learning curve for Symfony’s UserInterface/Voter concepts, but zero tech debt vs. custom solutions."*

For Security Teams:

*"This package hardens our attack surface by:

  • Enforcing secure defaults (e.g., same_site=Lax cookies, CSRF token validation).
  • Mitigating common vulnerabilities (HEAD request bypasses, X.509 emailAddress injection), OIDC key-confusion / issuer mix-up (v8.1.8, keys bound to issuer), and — as of v5.4.54 — security-token leakage into logs, malformed remember-me cookie handling, login-link parameter validation, and login-link max_uses race conditions.
  • Providing audit trails via SecurityEvent (e.g., INTERACTIVE_LOGIN, ACCESS_DENIED). Compliance alignment:
  • GDPR: Session fixation protection, secure data erasure — and, critically as of v5.4.54, no session credential material written to log sinks (#66629). That one is a data-handling finding waiting to happen in any environment with shipped logs.
  • ISO 27001: Role-based access control (RBAC) via Voter interfaces.
  • SOC 2: Built-in logging for auth events — the same logging surface v5.4.54 just cleaned up. Action items:
  1. Confirm all 8.1.x environments are on ≥ 8.1.8 before the next audit window (silent, version-gated fix — an outdated lockfile leaves the residual risk in place).
  2. New: enumerate every service on 5.4.x and confirm ≥ 5.4.54. Prioritise anything with passwordless login links, remember-me, or shipped log aggregation — those are the three flows this release touches.
  3. Review log retention/access for any historical window that predates the fix; the token-in-logs issue is about past exposure as much as future. Risk: Low — backed by Symfony’s security-focused release cycle (12 security patches in 2026 alone). The v5.4.54 release confirms the same discipline is applied to the legacy branch, though at security-only scope: no features, no deprecations, patches until the branch retires."*
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.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package