Так как Symfony 7.4, CachingHttpClient может кэшировать ответы клиентов HTTP, например, когда кэширование включено в framework.http_client. Его метод withOptions() передает опции только украшенному клиенту. Таким образом, учетные данные, установленные с withOptions(), такие как auth_bearer, auth_basic, заголовок авторизации или заголовок Cookie, достигают сервера, но CachingHttpClient их не видит.
Они отсутствуют в кэш-ключе. Они также пропускают правило, которое удерживает общий кэш от хранения ответов на запросы с заголовком авторизации. Кэшируемый ответ, полученный для одного пользователя, затем подается следующим пользователям: $client->withOptions(['auth_bearer' $aliceToken])->request('GET', 'https://api.example.com/me'); // Alice's профиль $client->withOptions(['auth_bearer' $bobToken])->request('GET', 'https://api.example.com/me'); // Alice's профиль из кэша Applications подвергается воздействию, когда они включают кэширование на клиенте, устанавливают учетные данные для пользователя с withOptions(), и запрашивают URLs, чьи ответы кэшируются.
Полномочия, переданные в request(), не затрагиваются. Большинство других параметров, установленных с withOptions(), также игнорировались при включении кэширования, поскольку CachingHttpClient пересылал каждый запрос со своими собственными значениями по умолчанию. Это включает в себя max_redirects, прокси, peer_fingerprint, local_cert, тайм-аут, on_progress и корпус. CachingHttpClient::withOptions() теперь также объединяет стандартные опции в собственные опции по умолчанию.
Ключ кэша, правила общих кэшей и запросы, которые он пересылает, учитывают их. Варианты, которые знают только украшенные клиенты, такие как max_retries, по-прежнему передаются только им. Клиентские сертификаты, прокси и auth_ntlm теперь также являются частью кэш-ключа.
Когда несколько клиентов HTTP из FrameworkBundle используют один и тот же пул кэша, каждый клиент получает свое собственное пространство имен в этом пуле. Таким образом, клиенты с разными пользовательскими заголовками больше не получают ответы друг друга.
Показать оригинальное описание (EN)
Since Symfony 7.4, CachingHttpClient can cache the responses of HTTP clients, for example when caching is enabled in framework.http_client. Its withOptions() method passes the options to the decorated client only. So credentials set with withOptions(), like auth_bearer, auth_basic, an Authorization header or a Cookie header, reach the server, but CachingHttpClient doesn't see them. They're missing from the cache key. They also miss the rule that keeps a shared cache from storing the responses to requests with an Authorization header. A cacheable response fetched for one user is then served to the next users: $client->withOptions(['auth_bearer' => $aliceToken])->request('GET', 'https://api.example.com/me'); // Alice's profile $client->withOptions(['auth_bearer' => $bobToken])->request('GET', 'https://api.example.com/me'); // Alice's profile, from the cache Applications are affected when they enable caching on a client, set per-user credentials with withOptions(), and request URLs whose responses are cacheable. Credentials passed to request() aren't affected. Most other options set with withOptions() were ignored too when caching was enabled, because CachingHttpClient forwarded each request with its own defaults. This includes max_redirects, proxy, peer_fingerprint, local_cert, timeout, on_progress and body. CachingHttpClient::withOptions() now also merges the standard options into its own default options. The cache key, the rules of shared caches and the requests it forwards take them into account. Options that only decorated clients know, like max_retries, are still passed to them only. Client certificates, proxies and auth_ntlm are now part of the cache key too. When several HTTP clients of FrameworkBundle use the same cache pool, each client gets its own namespace in that pool. So clients with different custom headers don't get the responses of each other anymore.
Характеристики атаки
Последствия
Строка CVSS v4.0