Summary
Symfony's method-level authorization and integrity attributes can be configured to apply only to GET requests, but HEAD requests are internally routed to the same controller method without enforcing these checks.
Under these conditions, a HEAD request can invoke a controller that should be protected, potentially leaking sensitive headers or triggering unintended side effects on the server.
Affected context
This vulnerability appears in Symfony applications that:
- Use method-scoped attributes such as #[IsGranted], #[IsSignatureValid], or #[IsCsrfTokenValid]
- Configure these attributes to guard GET requests on specific controller actions
- Rely on Symfony's routing behavior where HEAD requests are transparently handled by the GET action
In such setups, HEAD requests reach the same controller logic as GET, but the method-level attribute checks are not consistently enforced.
Exploit preconditions
- Attack surface: Public or internal HTTP endpoints implemented with Symfony controllers.
- Required access: Ability to send crafted HEAD requests to routes intended to be restricted or protected.
- Trigger point: A HEAD request targeting a controller action that has method-level attributes configured for GET-only checks.
- Why exploitation is possible: Symfony routes HEAD requests to the corresponding GET handler, but the method-scoped security attributes are skipped for HEAD, effectively bypassing the intended authorization, signature, or CSRF validation.
Why this happens
The root cause lies in inconsistent enforcement of method-scoped security attributes across HTTP verbs.
Symfony's routing layer forwards HEAD requests to the same controller method used for GET, but the attribute system that enforces #[IsGranted], #[IsSignatureValid], and #[IsCsrfTokenValid] was designed and configured to trigger only for GET.
This mismatch between routing behavior and authorization logic maps to CWE-863: Incorrect Authorization, where access control checks are incomplete or incorrectly applied to certain request types, leaving an unintended path without safeguards.
Potential impact
- Unauthorized invocation of controller methods that were assumed to be protected.
- Leakage of sensitive or security-relevant HTTP headers via HEAD responses.
- Execution of side effects (logging, state changes, calls to downstream services) without proper authorization.
- Potential abuse of business logic that relies on method-level attributes for access control or integrity validation.
General mitigation guidance
Mitigation generally focuses on aligning routing behavior with authorization and validation rules.
Useful patterns include:
- Ensuring that method-scoped attributes are applied consistently to all relevant HTTP methods that reach the same controller logic (e.g., both GET and HEAD).
- Centralizing authorization and integrity checks in shared middleware or controller base classes, rather than relying solely on verb-specific attributes.
- Designing routes so that state-changing or sensitive operations are not reachable via methods that might bypass standard checks.
- Explicitly reviewing HTTP method handling policies to confirm that alternate verbs (HEAD, OPTIONS) cannot access more privileged logic than intended.
These measures reduce exposure to inconsistent access control across HTTP methods.
How teams detect issues like this
High-level detection approaches include:
- Static analysis or code search for controllers using #[IsGranted], #[IsSignatureValid], or #[IsCsrfTokenValid] with logic reachable by multiple HTTP verbs.
- Reviewing routing configurations to identify cases where HEAD is implicitly mapped to GET handlers without equivalent authorization safeguards.
- Establishing code review guidelines that flag method-level security attributes which apply only to a subset of verbs while the route is callable with others.
- Applying automated policy checks in CI that compare route definitions and security annotations to ensure all reachable paths enforce consistent authorization.

