CVE-2019-6339: Drupal/drupal Arbitrary PHP Code Execution Vulnerability

CRITICAL
Advisory Identifier: GHSA-8cw5-rv98-5c46
CVSS 9.8
CWE-20
Published
Advisory Summary

CVE-2019-6339 is a CRITICAL (CVSS 9.8) arbitrary php code execution vulnerability (CWE-20: Improper Input Validation) affecting Drupal/drupal libraries in the Packagist ecosystem. The issue involves arbitrary php code execution in drupal. Remediation is available by upgrading affected packages to version 7.62.0, 8.5.9, 8.6.6.

CVE-2019-6339 at a Glance

CVE Identifier CVE-2019-6339
GHSA Identifier GHSA-8cw5-rv98-5c46
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-20: Improper Input Validation
Affected Product Drupal/drupal
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 9.8

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:H/I:H/A:H).

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 High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2019-6339

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

drupal/drupal fixed: 7.62.0
Upgrade drupal/drupal to 7.62.0
drupal/drupal fixed: 8.5.9
Upgrade drupal/drupal to 8.5.9
drupal/drupal fixed: 8.6.6
Upgrade drupal/drupal to 8.6.6
drupal/core fixed: 7.62.0
Upgrade drupal/core to 7.62.0
drupal/core fixed: 8.5.9
Upgrade drupal/core to 8.5.9
drupal/core fixed: 8.6.6
Upgrade drupal/core to 8.6.6
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 drupal/drupal

How to Check if You Are Affected

To determine whether your application is affected by CVE-2019-6339, inspect your project dependencies for Drupal/drupal:

inspect dependencies for drupal/drupal

Analyze the terminal output to locate any version of Drupal/drupal in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.62.0), 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 Drupal/drupal, 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

In Drupal Core versions 7.x prior to 7.62, 8.6.x prior to 8.6.6, and 8.5.x prior to 8.5.9; A remote code execution vulnerability exists in PHP's built-in phar stream wrapper when performing file operations on an untrusted phar:// URI. Some Drupal code (core, contrib, and custom) may be performing file operations on insufficiently validated user input, thereby being exposed to this vulnerability. This vulnerability is mitigated by the fact that such code paths typically require access to an administrative permission or an atypical configuration.

CVE-2019-6339 Affected Drupal/drupal Versions

6 component(s)
Fixed Versions:
7.62.08.5.98.6.6
Product / Package Ecosystem Affected Versions Fixed Version
drupal/drupal
Packagist
≥ 7.0.0
< 7.62.0
7.62.0
drupal/drupal
Packagist
≥ 8.0.0
< 8.5.9
8.5.9
drupal/drupal
Packagist
≥ 8.6.0
< 8.6.6
8.6.6
drupal/core
Packagist
≥ 7.0.0
< 7.62.0
7.62.0
drupal/core
Packagist
≥ 8.0.0
< 8.5.9
8.5.9
drupal/core
Packagist
≥ 8.6.0
< 8.6.6
8.6.6

References

Frequently Asked Questions

What is CVE-2019-6339?
CVE-2019-6339 is a security vulnerability in Drupal/drupal involving Arbitrary PHP code execution in Drupal under CWE-20: Improper Input Validation.
Which Drupal/drupal versions are affected?
Affected versions include releases prior to 7.62.0, 8.5.9, 8.6.6 across affected packages: drupal/drupal, drupal/core.
What version fixes CVE-2019-6339?
Upgrading to 7.62.0, 8.5.9, 8.6.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is drupal/drupal affected?
Yes, drupal/drupal is affected in releases prior to 7.62.0, 8.5.9, 8.6.6. Upgrade your dependency to 7.62.0, 8.5.9, 8.6.6 or later.
Is drupal/core affected?
Yes, drupal/core is affected in releases prior to 7.62.0, 8.5.9, 8.6.6. Upgrade your dependency to 7.62.0, 8.5.9, 8.6.6 or later.
What is the CVSS score of CVE-2019-6339?
CVE-2019-6339 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2019-6339?
CVE-2019-6339 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-2019-6339?
Run the dependency tree command: 'inspect dependencies for drupal/drupal'. 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-8cw5-rv98-5c46",
  "modified" : "2022-01-06T19:00:47Z",
  "published" : "2022-01-06T22:30:06Z",
  "aliases" : [ "CVE-2019-6339" ],
  "summary" : "Arbitrary PHP code execution in Drupal",
  "details" : "In Drupal Core versions 7.x prior to 7.62, 8.6.x prior to 8.6.6, and 8.5.x prior to 8.5.9; A remote code execution vulnerability exists in\nPHP's built-in phar stream wrapper when performing file operations on an untrusted phar:// URI. Some Drupal code (core, contrib, and custom) may be performing file operations on insufficiently validated user input, thereby being exposed to this vulnerability. This vulnerability is mitigated by the fact that such code paths typically require access to an administrative permission or an atypical configuration.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "drupal/drupal"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.62.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "drupal/drupal"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.5.9"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "drupal/drupal"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.6.0"
      }, {
        "fixed" : "8.6.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "drupal/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.62.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "drupal/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.5.9"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "drupal/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.6.0"
      }, {
        "fixed" : "8.6.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-6339"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/drupal/core/CVE-2019-6339.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/drupal/drupal/CVE-2019-6339.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2019/02/msg00004.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2019/dsa-4370"
  }, {
    "type" : "WEB",
    "url" : "https://www.drupal.org/sa-core-2019-002"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-01-06T19:00:47Z",
    "nvd_published_at" : null
  }
}