CVE-2019-6340 — Drupal Core Remote Code Execution Vulnerability

CVE-2019-6340

Drupal Core — REST Module Deserialization Flaw Enables PHP Code Execution

What Is Drupal?

Drupal is a widely used open-source content management system (CMS) that powers everything from personal blogs to large government and enterprise websites (Drupal has historically been popular with US federal agencies and universities). Its modular architecture, including the core RESTful Web Services module, allows sites to expose content and functionality via APIs — a convenience that also expands the attack surface if input handling in those modules is flawed.

Overview

CVE-2019-6340 is a critical remote code execution vulnerability in Drupal Core, sometimes referred to informally as part of the "Drupageddon 2" lineage of Drupal deserialization bugs. Some field types in Drupal do not properly sanitize data arriving from non-form sources — such as REST API requests — which, on sites with the RESTful Web Services module enabled (and, depending on configuration, even without it in some scenarios), can lead to arbitrary PHP code execution. CVSS score: 8.1.

Technical Details

The vulnerability (CWE-502, Deserialization of Untrusted Data) arises because certain Drupal field types accept and process serialized data submitted through non-form entry points, like REST endpoints, without applying the same sanitization used for standard form submissions. An attacker who submits a specially crafted payload to a vulnerable REST endpoint can trigger deserialization of attacker-controlled data, ultimately achieving arbitrary PHP code execution on the server. The Drupal Security Team noted that some sites without the RESTful Web Services module enabled could still be vulnerable depending on other enabled modules, which broadened the practical impact well beyond sites obviously running exposed APIs. Attack Complexity is rated High, reflecting some dependency on site configuration for reliable exploitation, but no authentication or user interaction is required.

Discovery

This vulnerability was disclosed and patched by the Drupal Security Team as SA-CORE-2019-003, following the project's standard coordinated disclosure process for core vulnerabilities.

Exploitation Context

CVE-2019-6340 was exploited at scale shortly after public disclosure, with attackers scanning the internet for unpatched Drupal sites to deploy cryptomining malware and web shells — a pattern consistent with prior high-profile Drupal core RCE bugs (such as the original "Drupageddon," CVE-2014-3704, and SA-CORE-2018-002/004, the "Drupalgeddon2" pair). CISA's KEV listing confirms this vulnerability continues to be exploited in the wild years later, reflecting how many Drupal installations remain unpatched or unmaintained long after fixes are available.

Remediation

  1. Upgrade Drupal Core to the patched versions referenced in SA-CORE-2019-003 (Drupal 8.6.10, 8.5.11, or later, as applicable to the release track) — treat any older version as vulnerable.
  2. Disable the RESTful Web Services module if it is not required, and audit any custom or contributed modules that expose non-form data entry points.
  3. Restrict access to REST API endpoints using authentication and network-level controls where they must remain enabled.
  4. Scan for web shells and unauthorized files on any Drupal site that was internet-exposed and unpatched around the February 2019 disclosure window.
  5. Establish a regular Drupal core and module update cadence, given the CMS's recurring history as a target for mass exploitation following core vulnerability disclosures.

Key Details

PropertyValue
CVE ID CVE-2019-6340
Vendor / Product Drupal — Core
NVD Published2019-02-21
NVD Last Modified2025-11-07
CVSS 3.1 Score8.1
CVSS 3.1 VectorCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
SeverityHIGH
CWE CWE-502 find similar ↗
CISA KEV Added2022-03-25
CISA KEV Deadline2022-04-15
Known Ransomware Use No

CVSS 3.1 Breakdown

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Required Action

CISA BOD 22-01 Deadline: 2022-04-15. Apply updates per vendor instructions.

Timeline

DateEvent
2019-02-20Drupal Security Team publishes advisory SA-CORE-2019-003 with patched releases
2019-02-21CVE-2019-6340 published
2019-02Mass exploitation begins against unpatched sites shortly after disclosure
2022-03-25Added to CISA Known Exploited Vulnerabilities catalog
2022-04-15CISA BOD 22-01 remediation deadline

References

ResourceType
NVD — CVE-2019-6340 Vulnerability Database
CISA KEV Catalog Entry US Government