Vulnerability record · CVE-2019-6340 · published 21 February 2019
CVE-2019-6340: Drupal Core field types fail to sanitize non-form data, enabling PHP code execution
DDrupal · Drupal
Some field types in Drupal 8.5.x before 8.5.11 and 8.6.x before 8.6.10 do not properly sanitize data arriving from non-form sources, which can lead to arbitrary PHP code execution. The flaw is only reachable on sites that expose a web services module accepting PATCH or POST requests, such as core REST, JSON:API, or the Drupal 7 Services/RESTful Web Services modules.
Description
Some field types do not properly sanitize data from non-form sources in Drupal 8.5.x before 8.5.11 and Drupal 8.6.x before 8.6.10. This can lead to arbitrary PHP code execution in some cases. A site is only affected by this if one of the following conditions is met: The site has the Drupal 8 core RESTful Web Services (rest) module enabled and allows PATCH or POST requests, or the site has another web services module enabled, like JSON:API in Drupal 8, or Services or RESTful Web Services in Drupal 7. (Note: The Drupal 7 Services module itself does not require an update at this time, but you should apply other contributed updates associated with this advisory if Services is in use.)
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Automated analysis
critical priorityIt is in CISA KEV with public exploits and a very high EPSS score, and successful exploitation yields remote PHP code execution.
What it is
Some field types in Drupal 8.5.x before 8.5.11 and 8.6.x before 8.6.10 do not properly sanitize data arriving from non-form sources, which can lead to arbitrary PHP code execution. The flaw is only reachable on sites that expose a web services module accepting PATCH or POST requests, such as core REST, JSON:API, or the Drupal 7 Services/RESTful Web Services modules.
Impact
An attacker can execute arbitrary PHP code on the affected Drupal site, leading to full compromise of the web application and its data. Depending on the deployment, this can extend to the underlying host.
Attack surface
Reached over the network through enabled web services endpoints that accept PATCH or POST requests; no authentication or user interaction is required per the CVSS vector (AV:N/AC:H/PR:N/UI:N). Sites without such a module enabled are not affected.
Exploitation
CVE-2019-6340 is listed in CISA KEV with a 2022-03-25 addition date, and EPSS shows a 30-day probability of 0.92017 (99.8th percentile). Multiple public Exploit-DB entries are tagged as exploits, indicating weaponized code is available.
What to do
- Upgrade Drupal 8.5.x to 8.5.11 or later and Drupal 8.6.x to 8.6.10 or later, per the vendor advisory sa-core-2019-003.
- If immediate patching is not possible, disable or restrict the core REST, JSON:API, and other web services modules, or block PATCH/POST requests to their endpoints at the web server or WAF.
- Apply the contributed module updates referenced in the same Drupal advisory, including Services-related updates for Drupal 7 sites.
- Review Drupal 7 sites using Services or RESTful Web Services and confirm the associated contributed updates are applied.
- After patching, audit for signs of prior compromise given the long window since public exploits appeared.
Detection
- Monitor web server and Drupal logs for PATCH or POST requests to REST, JSON:API, or Services endpoints, especially from unexpected source addresses.
- Inspect for unexpected PHP files, modified core or contributed module files, and anomalous child processes spawned by the web server user.
- Alert on outbound network connections or new scheduled tasks originating from the Drupal host.
- Use file integrity monitoring on the Drupal codebase to catch post-exploitation changes.
This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.
Exploitation in the wild
CISA added CVE-2019-6340 to the Known Exploited Vulnerabilities catalog on 25 March 2022 as "Drupal Core Remote Code Execution Vulnerability". Required action: Apply updates per vendor instructions. Federal deadline 15 April 2022.
Affected products
1 vulnerable configurations from NVD's CPE data, grouped by vendor and product.
References
Track CVE-2019-6340 inside VULONE
Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.
Related vulnerabilities
Same products first, then exploited flaws of the same weakness class.
Source: NIST National Vulnerability Database (record CVE-2019-6340), CISA KEV, FIRST EPSS (scores of 2026-09-25). This page is refreshed as NVD updates the record.