CVE-2019-6340 Drupal Core Remote Code Execution

Exploited in the wild High 8.1 Published Updated

Remote attackers can execute arbitrary PHP code via unsanitized data in specific field types when web services modules are enabled.

Exploited in the wild
Since 25 Mar 2022
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2019-6340?

CVE-2019-6340 is a high-severity unsafe deserialization vulnerability in Drupal Drupal, published on 21 Feb 2019. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.)

Weakness: CWE-502

Which versions are affected by CVE-2019-6340?

13 open source packages ship an affected version, including drupal/core and drupal/drupal. It affects 1 product.

PackageAffectedFixed in
drupal/core PackagistFrom 7.0.07.62.0
drupal/core PackagistFrom 7.0.07.62.0
drupal/core PackagistFrom 8.0.08.5.11, 8.6.10
drupal/core PackagistFrom 8.0.08.5.11
drupal/core PackagistFrom 8.0.08.5.11
drupal/core PackagistFrom 8.6.08.6.10
7 more packages
drupal/core PackagistFrom 8.6.08.6.10
drupal/drupal PackagistFrom 7.0.07.62.0
drupal/drupal PackagistFrom 7.0.07.62.0
drupal/drupal PackagistFrom 8.0.08.5.11
drupal/drupal PackagistFrom 8.0.08.5.11
drupal/drupal PackagistFrom 8.6.08.6.10
drupal/drupal PackagistFrom 8.6.08.6.10

Products include Drupal Drupal.

How do I fix CVE-2019-6340?

Upgrade drupal/core to a fixed version for your release line: 7.62.0, 8.5.11 or 8.6.10. US federal agencies must fix it by 15 Apr 2022.

Upgrade, and only deserialise data from trusted sources or with an allow-list of types. More about Unsafe deserialization.

Is CVE-2019-6340 being exploited?

Yes. Attackers have exploited CVE-2019-6340 in the wild since at least 25 Mar 2022.

Public exploit code: 1 Metasploit module, 4 Exploit-DB entries, 1 Nuclei template and 11 proofs of concept on GitHub.

All Drupal Drupal vulnerabilities

Sources

Also known as DRUPAL-CORE-2019-003, GHSA-3gx6-h57h-rm27.

Is CVE-2019-6340 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free