CVE-2018-19789: Symfony/symfony Symfony Path Disclosure Vulnerability

MODERATE
Advisory Identifier: GHSA-x3cf-w64x-4cp2
CVSS 5.3
CWE-434
Published
Advisory Summary

CVE-2018-19789 is a MODERATE (CVSS 5.3) symfony path disclosure vulnerability (CWE-434: Unrestricted Upload of File with Dangerous Type) affecting Symfony/symfony libraries in the Packagist ecosystem. The issue involves symfony path disclosure. Remediation is available by upgrading affected packages to version 2.7.50, 2.8.49, 3.4.20, 4.0.15, 4.1.9, 4.2.1.

CVE-2018-19789 at a Glance

CVE Identifier CVE-2018-19789
GHSA Identifier GHSA-x3cf-w64x-4cp2
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-434: Unrestricted Upload of File with Dangerous Type
Affected Product Symfony/symfony
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.3

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:U/C:L/I:N/A:N).

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

How to Fix CVE-2018-19789

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.50
Upgrade symfony/symfony to 2.7.50
symfony/symfony fixed: 2.8.49
Upgrade symfony/symfony to 2.8.49
symfony/symfony fixed: 3.4.20
Upgrade symfony/symfony to 3.4.20
symfony/symfony fixed: 4.0.15
Upgrade symfony/symfony to 4.0.15
symfony/symfony fixed: 4.1.9
Upgrade symfony/symfony to 4.1.9
symfony/symfony fixed: 4.2.1
Upgrade symfony/symfony to 4.2.1
symfony/form fixed: 2.7.50
Upgrade symfony/form to 2.7.50
symfony/form fixed: 2.8.49
Upgrade symfony/form to 2.8.49
symfony/form fixed: 3.4.20
Upgrade symfony/form to 3.4.20
symfony/form fixed: 4.0.15
Upgrade symfony/form to 4.0.15
symfony/form fixed: 4.1.9
Upgrade symfony/form to 4.1.9
symfony/form fixed: 4.2.1
Upgrade symfony/form to 4.2.1
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-19789, 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.50), 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-434: Unrestricted Upload of File with Dangerous Type, where the product allows the upload or transfer of dangerous file types that are automatically processed within its environment. 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 Symfony 2.7.x before 2.7.50, 2.8.x before 2.8.49, 3.x before 3.4.20, 4.0.x before 4.0.15, 4.1.x before 4.1.9, and 4.2.x before 4.2.1. When using the scalar type hint `string` in a setter method (e.g. `setName(string $name)`) of a class that's the `data_class` of a form, and when a file upload is submitted to the corresponding field instead of a normal text input, then `UploadedFile::__toString()` is called which will then return and disclose the path of the uploaded file. If combined with a local file inclusion issue in certain circumstances this could escalate it to a Remote Code Execution.

CVE-2018-19789 Affected Symfony/symfony Versions

12 component(s)
Fixed Versions:
2.7.502.8.493.4.204.0.154.1.94.2.1
Product / Package Ecosystem Affected Versions Fixed Version
symfony/symfony
Packagist
≥ 2.7.0
< 2.7.50
2.7.50
symfony/symfony
Packagist
≥ 2.8.0
< 2.8.49
2.8.49
symfony/symfony
Packagist
≥ 3.0.0
< 3.4.20
3.4.20
symfony/symfony
Packagist
≥ 4.0.0
< 4.0.15
4.0.15
symfony/symfony
Packagist
≥ 4.1.0
< 4.1.9
4.1.9
symfony/symfony
Packagist
≥ 4.2.0
< 4.2.1
4.2.1
symfony/form
Packagist
≥ 2.7.0
< 2.7.50
2.7.50
symfony/form
Packagist
≥ 2.8.0
< 2.8.49
2.8.49
symfony/form
Packagist
≥ 3.0.0
< 3.4.20
3.4.20
symfony/form
Packagist
≥ 4.0.0
< 4.0.15
4.0.15
symfony/form
Packagist
≥ 4.1.0
< 4.1.9
4.1.9
symfony/form
Packagist
≥ 4.2.0
< 4.2.1
4.2.1

References

NVD — CVE-2018-19789 NVD
https://nvd.nist.gov/vuln/detail/CVE-2018-19789
Security Fix Commit FIX COMMIT
https://github.com/symfony/symfony/commit/b65e6f1a47b68f2713b60cdac9cc3a4af62a2d1c
Symfony/symfony Source Repository REPOSITORY
https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/form/CVE-2018-19789.yaml
Symfony/symfony Source Repository REPOSITORY
https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2018-19789.yaml
Symfony/symfony Source Repository REPOSITORY
https://github.com/symfony/symfony
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2019/03/msg00009.html
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4TD3E7FZIXLVFG3SMFJPDEKPZ26TJOW7
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JZMRJ7VTHCY5AZK24G4QGX36RLUDTDKE
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/OA4WVFN5FYPIXAPLWZI6N425JHHDSWAZ
seclists.org/bugtraq/2019/may/21 WEB
https://seclists.org/bugtraq/2019/May/21
symfony.com/blog/cve-2018-19789... WEB
https://symfony.com/blog/cve-2018-19789-disclosure-of-uploaded-files-full-path
symfony.com/cve-2018-19789 WEB
https://symfony.com/cve-2018-19789
Symfony/symfony Security Information SECURITY
https://web.archive.org/web/20210124224817/http://www.securityfocus.com/bid/106249
Symfony/symfony Security Information SECURITY
https://www.debian.org/security/2019/dsa-4441

Frequently Asked Questions

What is CVE-2018-19789?
CVE-2018-19789 is a security vulnerability in Symfony/symfony involving Symfony Path Disclosure under CWE-434: Unrestricted Upload of File with Dangerous Type.
Which Symfony/symfony versions are affected?
Affected versions include releases prior to 2.7.50, 2.8.49, 3.4.20, 4.0.15, 4.1.9, 4.2.1 across affected packages: symfony/symfony, symfony/form.
What version fixes CVE-2018-19789?
Upgrading to 2.7.50, 2.8.49, 3.4.20, 4.0.15, 4.1.9, 4.2.1 (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.50, 2.8.49, 3.4.20, 4.0.15, 4.1.9, 4.2.1. Upgrade your dependency to 2.7.50, 2.8.49, 3.4.20, 4.0.15, 4.1.9, 4.2.1 or later.
Is symfony/form affected?
Yes, symfony/form is affected in releases prior to 2.7.50, 2.8.49, 3.4.20, 4.0.15, 4.1.9, 4.2.1. Upgrade your dependency to 2.7.50, 2.8.49, 3.4.20, 4.0.15, 4.1.9, 4.2.1 or later.
What is the CVSS score of CVE-2018-19789?
CVE-2018-19789 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2018-19789?
CVE-2018-19789 is classified under CWE-434: Unrestricted Upload of File with Dangerous Type (The product allows the upload or transfer of dangerous file types that are automatically processed within its environment.).
How can I check Packagist dependencies for CVE-2018-19789?
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-x3cf-w64x-4cp2",
  "modified" : "2023-10-06T17:56:17Z",
  "published" : "2022-05-14T01:04:20Z",
  "aliases" : [ "CVE-2018-19789" ],
  "summary" : "Symfony Path Disclosure",
  "details" : "An issue was discovered in Symfony 2.7.x before 2.7.50, 2.8.x before 2.8.49, 3.x before 3.4.20, 4.0.x before 4.0.15, 4.1.x before 4.1.9, and 4.2.x before 4.2.1. When using the scalar type hint `string` in a setter method (e.g. `setName(string $name)`) of a class that's the `data_class` of a form, and when a file upload is submitted to the corresponding field instead of a normal text input, then `UploadedFile::__toString()` is called which will then return and disclose the path of the uploaded file. If combined with a local file inclusion issue in certain circumstances this could escalate it to a Remote Code Execution.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.7.0"
      }, {
        "fixed" : "2.7.50"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.8.0"
      }, {
        "fixed" : "2.8.49"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.4.20"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.0.15"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.1.0"
      }, {
        "fixed" : "4.1.9"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.2.0"
      }, {
        "fixed" : "4.2.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/form"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.7.0"
      }, {
        "fixed" : "2.7.50"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/form"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.8.0"
      }, {
        "fixed" : "2.8.49"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/form"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.4.20"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/form"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.0.15"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/form"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.1.0"
      }, {
        "fixed" : "4.1.9"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/form"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.2.0"
      }, {
        "fixed" : "4.2.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-19789"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/b65e6f1a47b68f2713b60cdac9cc3a4af62a2d1c"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/form/CVE-2018-19789.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2018-19789.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/symfony/symfony"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2019/03/msg00009.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4TD3E7FZIXLVFG3SMFJPDEKPZ26TJOW7"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JZMRJ7VTHCY5AZK24G4QGX36RLUDTDKE"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/OA4WVFN5FYPIXAPLWZI6N425JHHDSWAZ"
  }, {
    "type" : "WEB",
    "url" : "https://seclists.org/bugtraq/2019/May/21"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/blog/cve-2018-19789-disclosure-of-uploaded-files-full-path"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/cve-2018-19789"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20210124224817/http://www.securityfocus.com/bid/106249"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2019/dsa-4441"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-434" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-24T19:38:49Z",
    "nvd_published_at" : "2018-12-18T22:29:00Z"
  }
}