Prevent cache poisoning via a Response Content-Type header in Symfony
Description
When a Response does not contain a Content-Type header, Symfony falls back to the format defined in the Accept header of the request, leading to a possible mismatch between the response's content and Content-Type header. When the response is cached, this can lead to a corrupted cache where the cached format is not the right one.
Resolution
Symfony does not use the Accept header anymore to guess the Content-Type.
The patch for this issue is available here for the 4.4 branch.
Credits
I would like to thank Xavier Lacot from JoliCode for reporting & Yonel Ceruto and Tobias Schultze for fixing the issue.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Composer package | symfony/http-foundation | >= 4.4.0, < 4.4.7, >= 5.0.0, < 5.0.7 | 4.4.7, 5.0.7 |
| Composer package | symfony/symfony | >= 4.4.0, < 4.4.7, >= 5.0.0, < 5.0.7 | 4.4.7, 5.0.7 |
References
- https://github.com/symfony/symfony/security/advisories/GHSA-mcx4-f5f5-4859
- https://nvd.nist.gov/vuln/detail/CVE-2020-5255
- https://github.com/symfony/symfony/commit/dca343442e6a954f96a2609e7b4e9c21ed6d74e6
- https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/http-foundation/CVE-2020-5255.yaml
- https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2020-5255.yaml
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/C36JLPHUPKDFAX6D5WYFC4ALO2K7RDUQ
- https://symfony.com/blog/cve-2020-5255-prevent-cache-poisoning-via-a-response-content-type-header
- https://symfony.com/cve-2020-5255
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:L- Weakness (CWE)
CWE-435- Platform
- Composer
- Package
symfony/http-foundation, symfony/symfony- Disclosed
- 30.03.2020
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-mcx4-f5f5-4859 - CC BY 4.0
Vulnerability history: symfony/http-foundation
All published vulnerabilities of this package (Composer package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 14
- First → latest
- 12.2019 06.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- Critical 1
- High 3
- Medium 8
- Low 2
Disclosures per year
- 2019: 2
- 2020: 1
- 2021: 0
- 2022: 4
- 2023: 0
- 2024: 5
- 2025: 1
- 2026: 1
-
Prevent cache poisoning via a Response Content-Type header in Symfony this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.