Symfony storing cookie headers in HttpCache
Impact
The Symfony HTTP cache system acts as a reverse proxy: it caches HTTP responses (including headers) and returns them to clients.
Source excerpt · OSVAffected packages
Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.
| Affected range | Recorded fix |
|---|---|
| From 2.0.0 before 4.4.50Ecosystem versions | 4.4.50 |
| From 5.0.0 before 5.4.20Ecosystem versions | 5.4.20 |
| From 6.0.0 before 6.0.20Ecosystem versions | 6.0.20 |
| From 6.1.0 before 6.1.12Ecosystem versions | 6.1.12 |
| From 6.2.0 before 6.2.6Ecosystem versions | 6.2.6 |
Version evidence: OSV · GHSA-h7vf-5wrv-9fhv
View original version evidence (617 explicit versions)
| Affected range | Recorded fix |
|---|---|
| From 2.0.0 before 4.4.50Ecosystem versions | 4.4.50 |
| From 5.0.0 before 5.4.20Ecosystem versions | 5.4.20 |
| From 6.0.0 before 6.0.20Ecosystem versions | 6.0.20 |
| From 6.1.0 before 6.1.12Ecosystem versions | 6.1.12 |
| From 6.2.0 before 6.2.6Ecosystem versions | 6.2.6 |
Version evidence: OSV · GHSA-h7vf-5wrv-9fhv
View original version evidence (632 explicit versions)
Original source description
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.
References
- Security advisory github.com/symfony/symfony/security/advisories/GHSA-h7vf-5wrv-9fhv
- Security advisory nvd.nist.gov/vuln/detail/CVE-2022-24894
- Patch github.com/symfony/symfony/commit/d2f6322af9444ac5cd1ef3ac6f280dbef7f9d1fb
- Security advisory github.com/FriendsOfPHP/security-advisories/blob/master/symfony/http-kernel/CVE-2022-24894.yaml
- Security advisory github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2022-24894.yaml
- Source reference github.com/symfony/symfony
- Source reference lists.debian.org/debian-lts-announce/2023/07/msg00014.html
- Security advisory symfony.com/cve-2022-24894