The vulnerability exists in several Symfony event listeners responsible for enforcing security attributes: IsGranted, IsCsrfTokenValid, and IsSignatureValid. These attributes can be configured to apply only to specific HTTP methods, such as ['GET'].
Symfony's routing component treats HEAD requests as a variant of GET requests, executing the same controller logic but omitting the response body. However, the event listeners for the security attributes did not account for this behavior. When an attribute was configured with methods: ['GET'], the listener would check the request method. For a HEAD request, the check !in_array('HEAD', ['GET']) would pass, causing the listener to skip the security validation (authorization, CSRF token, or signature check).
This allowed an attacker to bypass these security controls by sending a HEAD request to an endpoint that was intended to be protected for GET requests. Although the attacker would not receive the response body, the controller action would still execute, potentially leading to unauthorized state changes (e.g., database writes) or leakage of sensitive information through response headers.
The patch addresses this by modifying the constructors of the IsGranted, IsCsrfTokenValid, and IsSignatureValid attributes. The new logic automatically adds HEAD to the list of methods whenever GET is specified, ensuring that the security checks are correctly applied to both GET and HEAD requests by the respective listeners.
The identified vulnerable functions are the onKernelControllerArguments methods within the listeners, as these are the exact locations in the code where the faulty method check occurs, leading to the bypass.