CVE-2018-14774: Symfony/symfony Symfony Host Header Injection Vulnerability

HIGH
Advisory Identifier: GHSA-66p6-7p29-55p9
CVSS 7.2
CWE-20
Published
Advisory Summary

CVE-2018-14774 is a HIGH (CVSS 7.2) symfony host header injection vulnerability (CWE-20: Improper Input Validation) affecting Symfony/symfony libraries in the Packagist ecosystem. The issue involves symfony host header injection. Remediation is available by upgrading affected packages to version 2.7.49, 2.8.44, 3.3.18, 3.4.14, 4.0.14, 4.1.3.

CVE-2018-14774 at a Glance

CVE Identifier CVE-2018-14774
GHSA Identifier GHSA-66p6-7p29-55p9
Severity HIGH
CVSS v3.1 Base Score 7.2
CWE Classification CWE-20: Improper Input Validation
Affected Product Symfony/symfony
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 7.2

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

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

How to Fix CVE-2018-14774

To remediate this vulnerability, upgrade all affected Symfony/symfony 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/symfony fixed: 2.7.49
Upgrade symfony/symfony to 2.7.49
symfony/symfony fixed: 2.8.44
Upgrade symfony/symfony to 2.8.44
symfony/symfony fixed: 3.3.18
Upgrade symfony/symfony to 3.3.18
symfony/symfony fixed: 3.4.14
Upgrade symfony/symfony to 3.4.14
symfony/symfony fixed: 4.0.14
Upgrade symfony/symfony to 4.0.14
symfony/symfony fixed: 4.1.3
Upgrade symfony/symfony to 4.1.3
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/symfony

How to Check if You Are Affected

To determine whether your application is affected by CVE-2018-14774, inspect your project dependencies for Symfony/symfony:

inspect dependencies for symfony/symfony

Analyze the terminal output to locate any version of Symfony/symfony in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.7.49), 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Symfony/symfony, 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

An issue was discovered in HttpKernel in Symfony 2.7.0 through 2.7.48, 2.8.0 through 2.8.43, 3.3.0 through 3.3.17, 3.4.0 through 3.4.13, 4.0.0 through 4.0.13, and 4.1.0 through 4.1.2. When using HttpCache, the values of the X-Forwarded-Host headers are implicitly set as trusted while this should be forbidden, leading to potential host header injection.

CVE-2018-14774 Affected Symfony/symfony Versions

6 component(s)
Fixed Versions:
2.7.492.8.443.3.183.4.144.0.144.1.3
Product / Package Ecosystem Affected Versions Fixed Version
symfony/symfony
Packagist
≥ 2.7.0
< 2.7.49
2.7.49
symfony/symfony
Packagist
≥ 2.8.0
< 2.8.44
2.8.44
symfony/symfony
Packagist
≥ 3.3.0
< 3.3.18
3.3.18
symfony/symfony
Packagist
≥ 3.4.0
< 3.4.14
3.4.14
symfony/symfony
Packagist
≥ 4.0.0
< 4.0.14
4.0.14
symfony/symfony
Packagist
≥ 4.1.0
< 4.1.3
4.1.3

References

Frequently Asked Questions

What is CVE-2018-14774?
CVE-2018-14774 is a security vulnerability in Symfony/symfony involving Symfony Host Header Injection under CWE-20: Improper Input Validation.
Which Symfony/symfony versions are affected?
Affected versions include releases prior to 2.7.49, 2.8.44, 3.3.18, 3.4.14, 4.0.14, 4.1.3 across affected packages: symfony/symfony.
What version fixes CVE-2018-14774?
Upgrading to 2.7.49, 2.8.44, 3.3.18, 3.4.14, 4.0.14, 4.1.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is symfony/symfony affected?
Yes, symfony/symfony is affected in releases prior to 2.7.49, 2.8.44, 3.3.18, 3.4.14, 4.0.14, 4.1.3. Upgrade your dependency to 2.7.49, 2.8.44, 3.3.18, 3.4.14, 4.0.14, 4.1.3 or later.
What is the CVSS score of CVE-2018-14774?
CVE-2018-14774 has a CVSS v3.1 base score of 7.2 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2018-14774?
CVE-2018-14774 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Packagist dependencies for CVE-2018-14774?
Run the dependency tree command: 'inspect dependencies for symfony/symfony'. 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-66p6-7p29-55p9",
  "modified" : "2023-10-06T17:52:44Z",
  "published" : "2022-05-14T02:20:59Z",
  "aliases" : [ "CVE-2018-14774" ],
  "summary" : "Symfony Host Header Injection",
  "details" : "An issue was discovered in HttpKernel in Symfony 2.7.0 through 2.7.48, 2.8.0 through 2.8.43, 3.3.0 through 3.3.17, 3.4.0 through 3.4.13, 4.0.0 through 4.0.13, and 4.1.0 through 4.1.2. When using HttpCache, the values of the X-Forwarded-Host headers are implicitly set as trusted while this should be forbidden, leading to potential host header injection.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.7.0"
      }, {
        "fixed" : "2.7.49"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.7.48"
    }
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.8.0"
      }, {
        "fixed" : "2.8.44"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.8.43"
    }
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.3.0"
      }, {
        "fixed" : "3.3.18"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.3.17"
    }
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.4.0"
      }, {
        "fixed" : "3.4.14"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.4.13"
    }
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.0.14"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.0.13"
    }
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.1.0"
      }, {
        "fixed" : "4.1.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.1.2"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-14774"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/725dee4cd8b4ccd52e335ae4b4522242cea9bd4a"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/7f912bbb78377c2ea331b3da28363435fbd91337"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/96504fb8c9f91204727d2930eb837473ce154956"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/974240e178bb01d734bf1df1ad5c3beba6a2f982"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/9cfcaba0bf71f87683510b5f47ebaac5f5d6a5ba"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/bcf5897bb1a99d4acae8bf7b73e81bfdeaac0922"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/symfony/symfony"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/blog/cve-2018-14774-possible-host-header-injection-when-using-httpcache"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-25T19:14:01Z",
    "nvd_published_at" : "2018-08-03T17:29:00Z"
  }
}