CVE-2018-7602: Drupal/core Remote Code Execution Vulnerability

CRITICAL
Advisory Identifier: GHSA-297x-j9pm-xjgg
CVSS 9.8
CWE-94
Published
Advisory Summary

CVE-2018-7602 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Drupal/core libraries in the Packagist ecosystem. The issue involves drupal core remote code execution vulnerability. Remediation is available by upgrading affected packages to version 7.59, 8.4.8, 8.5.3.

CVE-2018-7602 at a Glance

CVE Identifier CVE-2018-7602
GHSA Identifier GHSA-297x-j9pm-xjgg
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Drupal/core
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.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E: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-2018-7602

To remediate this vulnerability, upgrade all affected Drupal/core 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/core fixed: 7.59
Upgrade drupal/core to 7.59
drupal/core fixed: 8.4.8
Upgrade drupal/core to 8.4.8
drupal/core fixed: 8.5.3
Upgrade drupal/core to 8.5.3
drupal/drupal fixed: 7.59
Upgrade drupal/drupal to 7.59
drupal/drupal fixed: 8.4.8
Upgrade drupal/drupal to 8.4.8
drupal/drupal fixed: 8.5.3
Upgrade drupal/drupal to 8.5.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 drupal/core

How to Check if You Are Affected

To determine whether your application is affected by CVE-2018-7602, inspect your project dependencies for Drupal/core:

inspect dependencies for drupal/core

Analyze the terminal output to locate any version of Drupal/core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.59), 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Drupal/core, 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

A remote code execution vulnerability exists within multiple subsystems of Drupal 7.x and 8.x. This potentially allows attackers to exploit multiple attack vectors on a Drupal site, which could result in the site being compromised. This vulnerability is related to Drupal core - Highly critical - Remote Code Execution - SA-CORE-2018-002. Both SA-CORE-2018-002 and this vulnerability are being exploited in the wild.

CVE-2018-7602 Affected Drupal/core Versions

6 component(s)
Fixed Versions:
7.598.4.88.5.3
Product / Package Ecosystem Affected Versions Fixed Version
drupal/core
Packagist
≥ 7.0
< 7.59
7.59
drupal/core
Packagist
≥ 8.0
< 8.4.8
8.4.8
drupal/core
Packagist
≥ 8.5
< 8.5.3
8.5.3
drupal/drupal
Packagist
≥ 7.0
< 7.59
7.59
drupal/drupal
Packagist
≥ 8.0
< 8.4.8
8.4.8
drupal/drupal
Packagist
≥ 8.5
< 8.5.3
8.5.3

References

Frequently Asked Questions

What is CVE-2018-7602?
CVE-2018-7602 is a security vulnerability in Drupal/core involving Drupal Core Remote Code Execution Vulnerability under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Drupal/core versions are affected?
Affected versions include releases prior to 7.59, 8.4.8, 8.5.3 across affected packages: drupal/core, drupal/drupal.
What version fixes CVE-2018-7602?
Upgrading to 7.59, 8.4.8, 8.5.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is drupal/core affected?
Yes, drupal/core is affected in releases prior to 7.59, 8.4.8, 8.5.3. Upgrade your dependency to 7.59, 8.4.8, 8.5.3 or later.
Is drupal/drupal affected?
Yes, drupal/drupal is affected in releases prior to 7.59, 8.4.8, 8.5.3. Upgrade your dependency to 7.59, 8.4.8, 8.5.3 or later.
What is the CVSS score of CVE-2018-7602?
CVE-2018-7602 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:H.
What CWE is associated with CVE-2018-7602?
CVE-2018-7602 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check Packagist dependencies for CVE-2018-7602?
Run the dependency tree command: 'inspect dependencies for drupal/core'. 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-297x-j9pm-xjgg",
  "modified" : "2025-10-22T17:37:59Z",
  "published" : "2024-04-23T22:36:09Z",
  "aliases" : [ "CVE-2018-7602" ],
  "summary" : "Drupal Core Remote Code Execution Vulnerability",
  "details" : "A remote code execution vulnerability exists within multiple subsystems of Drupal 7.x and 8.x. This potentially allows attackers to exploit multiple attack vectors on a Drupal site, which could result in the site being compromised. This vulnerability is related to Drupal core - Highly critical - Remote Code Execution - SA-CORE-2018-002. Both SA-CORE-2018-002 and this vulnerability are being exploited in the wild.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "drupal/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0"
      }, {
        "fixed" : "7.59"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "drupal/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0"
      }, {
        "fixed" : "8.4.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "drupal/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.5"
      }, {
        "fixed" : "8.5.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "drupal/drupal"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0"
      }, {
        "fixed" : "7.59"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "drupal/drupal"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0"
      }, {
        "fixed" : "8.4.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "drupal/drupal"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.5"
      }, {
        "fixed" : "8.5.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-7602"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/drupal/core/CVE-2018-7602.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/drupal/drupal/CVE-2018-7602.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/drupal/core"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2018/04/msg00030.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2018-7602"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2018/dsa-4180"
  }, {
    "type" : "WEB",
    "url" : "https://www.drupal.org/sa-core-2018-004"
  }, {
    "type" : "WEB",
    "url" : "https://www.exploit-db.com/exploits/44542"
  }, {
    "type" : "WEB",
    "url" : "https://www.exploit-db.com/exploits/44557"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-23T22:36:09Z",
    "nvd_published_at" : "2018-07-19T17:29:00Z"
  }
}