Symfony storing cookie headers in HttpCache
Published 1 Feb 2023 · Updated 13 Feb 2025
Affected packages
- Affected
- >=2.0.0 <4.4.50
- Fixed in
- 4.4.50
composer require symfony/http-kernel:^4.4.50- Affected
- >=5.0.0 <5.4.20
- Fixed in
- 5.4.20
composer require symfony/http-kernel:^5.4.20- Affected
- >=6.0.0 <6.0.20
- Fixed in
- 6.0.20
composer require symfony/http-kernel:^6.0.20- Affected
- >=6.1.0 <6.1.12
- Fixed in
- 6.1.12
composer require symfony/http-kernel:^6.1.12- Affected
- >=6.2.0 <6.2.6
- Fixed in
- 6.2.6
composer require symfony/http-kernel:^6.2.6- Affected
- >=2.0.0 <4.4.50
- Fixed in
- 4.4.50
composer require symfony/symfony:^4.4.50- Affected
- >=5.0.0 <5.4.20
- Fixed in
- 5.4.20
composer require symfony/symfony:^5.4.20- Affected
- >=6.0.0 <6.0.20
- Fixed in
- 6.0.20
composer require symfony/symfony:^6.0.20- Affected
- >=6.1.0 <6.1.12
- Fixed in
- 6.1.12
composer require symfony/symfony:^6.1.12- Affected
- >=6.2.0 <6.2.6
- Fixed in
- 6.2.6
composer require symfony/symfony:^6.2.6Details
Description -----------
The Symfony HTTP cache system acts as a reverse proxy: it caches HTTP responses (including headers) and returns them to clients.
In a recent AbstractSessionListener change, the response might now contain a Set-Cookie header. If the Symfony HTTP cache system is enabled, this header might be stored and returned to some other clients. An attacker can use this vulnerability to retrieve the victim's session.
Resolution ----------
The HttpStore constructor now takes a parameter containing a list of private headers that are removed from the HTTP response headers.
The default value for this parameter is Set-Cookie, but it can be overridden or extended by the application.
The patch for this issue is available here for branch 4.4.
Credits -------
We would like to thank Soner Sayakci for reporting the issue and Nicolas Grekas for fixing it.
Is GHSA-h7vf-5wrv-9fhv in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected symfony/http-kernel, and gives you the command that fixes it.
References
- Linkgithub.com/symfony/symfony/security/advisories/GHSA-h7vf-5wrv-9fhv
- Advisorynvd.nist.gov/vuln/detail/CVE-2022-24894
- Linkgithub.com/symfony/symfony/commit/d2f6322af9444ac5cd1ef3ac6f280dbef7f9d1fb
- Linkgithub.com/FriendsOfPHP/security-advisories/blob/master/symfony/http-kernel/CVE-2022-24894.yaml
- Linkgithub.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2022-24894.yaml
- Packagegithub.com/symfony/symfony
- Linklists.debian.org/debian-lts-announce/2023/07/msg00014.html
- Linksymfony.com/cve-2022-24894
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.