CVE-2020-5255: Symfony/http foundation Prevent Cache Poisoning Vulnerability

LOW
Advisory Identifier: GHSA-mcx4-f5f5-4859
CVSS 2.6
CWE-435
Published
Advisory Summary

CVE-2020-5255 is a LOW (CVSS 2.6) prevent cache poisoning vulnerability (CWE-435: Improper Interaction Between Multiple Correctly-Behaving Entities) affecting Symfony/http foundation libraries in the Packagist ecosystem. The issue involves prevent cache poisoning via a response content-type header in symfony. Remediation is available by upgrading affected packages to version 4.4.7, 5.0.7.

CVE-2020-5255 at a Glance

CVE Identifier CVE-2020-5255
GHSA Identifier GHSA-mcx4-f5f5-4859
Severity LOW
CVSS v3.1 Base Score 2.6
CWE Classification CWE-435: Improper Interaction Between Multiple Correctly-Behaving Entities
Affected Product Symfony/http foundation
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 2.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2020-5255

To remediate this vulnerability, upgrade all affected Symfony/http foundation dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

symfony/http-foundation fixed: 4.4.7
Upgrade symfony/http-foundation to 4.4.7
symfony/http-foundation fixed: 5.0.7
Upgrade symfony/http-foundation to 5.0.7
symfony/symfony fixed: 4.4.7
Upgrade symfony/symfony to 4.4.7
symfony/symfony fixed: 5.0.7
Upgrade symfony/symfony to 5.0.7
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for symfony/http-foundation

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-5255, inspect your project dependencies for Symfony/http foundation:

inspect dependencies for symfony/http-foundation

Analyze the terminal output to locate any version of Symfony/http foundation in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.4.7), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-435: Improper Interaction Between Multiple Correctly-Behaving Entities, where an interaction error occurs when two entities have correct behavior when running independently of each other, but when they are integrated as components in a larger system or process, they introduce incorrect behaviors that may cause resultant weaknesses. In Symfony/http foundation, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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](https://github.com/symfony/symfony/commit/dca343442e6a954f96a2609e7b4e9c21ed6d74e6) 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.

CVE-2020-5255 Affected Symfony/http foundation Versions

4 component(s)
Fixed Versions:
4.4.75.0.7
Product / Package Ecosystem Affected Versions Fixed Version
symfony/http-foundation
Packagist
≥ 4.4.0
< 4.4.7
4.4.7
symfony/http-foundation
Packagist
≥ 5.0.0
< 5.0.7
5.0.7
symfony/symfony
Packagist
≥ 4.4.0
< 4.4.7
4.4.7
symfony/symfony
Packagist
≥ 5.0.0
< 5.0.7
5.0.7

References

Frequently Asked Questions

What is CVE-2020-5255?
CVE-2020-5255 is a security vulnerability in Symfony/http foundation involving Prevent cache poisoning via a Response Content-Type header in Symfony under CWE-435: Improper Interaction Between Multiple Correctly-Behaving Entities.
Which Symfony/http foundation versions are affected?
Affected versions include releases prior to 4.4.7, 5.0.7 across affected packages: symfony/http-foundation, symfony/symfony.
What version fixes CVE-2020-5255?
Upgrading to 4.4.7, 5.0.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is symfony/http-foundation affected?
Yes, symfony/http-foundation is affected in releases prior to 4.4.7, 5.0.7. Upgrade your dependency to 4.4.7, 5.0.7 or later.
Is symfony/symfony affected?
Yes, symfony/symfony is affected in releases prior to 4.4.7, 5.0.7. Upgrade your dependency to 4.4.7, 5.0.7 or later.
What is the CVSS score of CVE-2020-5255?
CVE-2020-5255 has a CVSS v3.1 base score of 2.6 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2020-5255?
CVE-2020-5255 is classified under CWE-435: Improper Interaction Between Multiple Correctly-Behaving Entities (An interaction error occurs when two entities have correct behavior when running independently of each other, but when they are integrated as components in a larger system or process, they introduce incorrect behaviors that may cause resultant weaknesses.).
How can I check Packagist dependencies for CVE-2020-5255?
Run the dependency tree command: 'inspect dependencies for symfony/http-foundation'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mcx4-f5f5-4859",
  "modified" : "2021-01-08T20:25:26Z",
  "published" : "2020-03-30T20:09:16Z",
  "aliases" : [ "CVE-2020-5255" ],
  "summary" : "Prevent cache poisoning via a Response Content-Type header in Symfony",
  "details" : "Description\n-----------\n\nWhen 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.\n\nResolution\n----------\n\nSymfony does not use the `Accept` header anymore to guess the `Content-Type`.\n\nThe patch for this issue is available [here](https://github.com/symfony/symfony/commit/dca343442e6a954f96a2609e7b4e9c21ed6d74e6) for the 4.4 branch.\n\nCredits\n-------\n\nI would like to thank Xavier Lacot from JoliCode for reporting & Yonel Ceruto and Tobias Schultze for fixing the issue.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/http-foundation"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.4.0"
      }, {
        "fixed" : "4.4.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/http-foundation"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.0.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.4.0"
      }, {
        "fixed" : "4.4.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.0.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/security/advisories/GHSA-mcx4-f5f5-4859"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-5255"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/dca343442e6a954f96a2609e7b4e9c21ed6d74e6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/http-foundation/CVE-2020-5255.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2020-5255.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/C36JLPHUPKDFAX6D5WYFC4ALO2K7RDUQ"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/blog/cve-2020-5255-prevent-cache-poisoning-via-a-response-content-type-header"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/cve-2020-5255"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-435" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-03-30T19:28:58Z",
    "nvd_published_at" : null
  }
}