CVE DatabaseCVE-2019-6340
한국어 권고문 →
CVE-2019-63408.1/HIGHCISA KEVCWE-502CWE-502

Drupal Core Remote Code Execution (RCE) Vulnerability Advisory (CVE-2019-6340)

⚡ Jump to Patch
Affected Vendors
drupal
Affected Components
drupal
Published Date
2019-02-21
CVSS v3.1
8.1
HIGH
EPSS (30d)
92.0%
FIRST.org
CISA KEV
Exploited

Executive & SecOps Summary

SECOPS ASSESSMENT
Affected Scope

Drupal 8.5.x before 8.5.11, Drupal 8.6.x before 8.6.10, and Drupal 7 environments utilizing web services modules such as RESTful Web Services or JSON:API

Impact

Unauthenticated remote attackers can execute arbitrary PHP code on the target server by sending specially crafted REST API requests, potentially leading to full system compromise

Mitigation

Immediately upgrade Drupal Core to the latest secure versions (8.5.11, 8.6.10, or later) or disable vulnerable REST/JSON:API modules as a temporary workaround

Affected Products & Version Scope

Drupal 8.5.x before 8.5.11 and Drupal 8.6.x before 8.6.10. Drupal 7 is also affected if the Services or RESTful Web Services modules are enabled.

Remediation & Live Workaround Commands

PATCH & WORKAROUND

1. Official Patch & Version Upgrade Commands

Upgrade your Drupal Core installation to a secure version using Composer. Run the following commands in your terminal:

bash
# Update Drupal Core to the latest secure version
composer update drupal/core-recommended --with-dependencies

# Apply database updates and clear cache
drush dbup -y
drush cr

2. Temporary Workaround & Hardening Configuration

If patching cannot be applied immediately, disable the RESTful Web Services module or restrict HTTP methods (PATCH/POST) on API endpoints. Below is an Nginx configuration snippet to block unauthorized write requests to REST endpoints:

nginx
# Nginx configuration file (/etc/nginx/nginx.conf)
server {
    listen 80;
    server_name your-drupal-site.com;

    # Block PATCH and POST requests to REST endpoints
    location ~* ^/(node|user|taxonomy/term)/.+ {
        limit_except GET {
            deny all;
        }
    }
}

3. Log Audit & IoC Verification Commands

Inspect your web server access logs for indicators of compromise (IoCs), such as requests containing 'hal+json' or serialized PHP gadget keywords.

bash
# Search access logs for suspicious serialization payloads
grep -Ei 'hal\+json|FnStream|LinkItem' /var/log/nginx/access.log /var/log/apache2/access.log

# Verify the current Drupal Core version
drush status --fields=drupal-version
Interactive SecOps Remediation Checklist
0/4 (0%)
Recommended Security Control & Mitigation Partner
Cloudflare Enterprise & Pro WAF
Immediately upgrade Drupal Core to 8.5.11 / 8.6.10 or later, and disable unused REST/JSON:API modules to mitigate active exploitation risks.

Block Exploits Instantly with Managed Virtual Patching Rules

Can't patch production immediately? Deploy managed WAF rules at the edge to intercept RCE, SQLi, and deserialization payloads before they hit your origin server.

3-min setup · Automated Zero-Day Managed Rules
Practice Exploiting & Patching This Web Vulnerability in an Interactive Lab
Launch Hands-On Security Lab

Technical Root Cause & Exploitation Mechanics

1. Vulnerability Overview & Root Cause

This vulnerability (CVE-2019-6340) arises because certain field types in Drupal Core do not properly sanitize and validate input data originating from non-form sources, such as RESTful APIs. This lack of sanitization leads to an unsafe deserialization vulnerability (CWE-502) when processing structured data payloads, allowing arbitrary PHP object injection and subsequent code execution.

2. Exploitation Mechanics & Attack Scenario

An attacker targets Drupal sites that have the RESTful Web Services (rest) module enabled and allow PATCH or POST requests. By sending a crafted HTTP request with a payload formatted in 'application/hal+json', the attacker injects serialized PHP objects containing known gadget chains (such as 'GuzzleHttp\Psr7\FnStream'). When Drupal attempts to deserialize this input, the object's destructor or magic methods are triggered, executing arbitrary system commands under the privileges of the web server user.

3. Infrastructure & Business Impact

As a highly critical vulnerability listed in the CISA KEV catalog with an EPSS score exceeding 0.92, this flaw is actively exploited in the wild. Successful exploitation allows complete takeover of the underlying web server, enabling attackers to exfiltrate sensitive database contents, deploy ransomware, or pivot into internal networks, posing severe risks to business continuity and data confidentiality.

Official Vendor Advisories & References

NVD Original English 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.)

Frequently Asked SecOps Questions (CVE-2019-6340)

FAQ

Q1. How critical is CVE-2019-6340 and is it actively exploited in the wild?

CVE-2019-6340 is rated CVSS 8.1 (HIGH) with a 30-day EPSS exploitation probability of 92.0%. It is listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, requiring immediate emergency remediation.

Q2. Which vendors and products are affected by CVE-2019-6340?

Primary impacted vendors include drupal across drupal. Scope summary: Drupal 8.5.x before 8.5.11 and Drupal 8.6.x before 8.6.10. Drupal 7 is also affected if the Services or RESTful Web Services modules are enabled.

Q3. What temporary mitigations or workarounds exist for CVE-2019-6340 before patching?

[Mitigation] Immediately upgrade Drupal Core to the latest secure versions (8.5.11, 8.6.10, or later) or disable vulnerable REST/JSON:API modules as a temporary workaround Follow the CLI remediation commands and interactive SecOps checklist on this page to restrict exposure prior to your maintenance window.

SECOPS WORKBENCH INTEGRATION

Generate an Internal Engineering Notice or CISO Report for CVE-2019-6340

Instantly format this advisory into an executive CISO summary or engineering patch ticket.

Generate Report →

🔗 Related Advisories in Similar Stack (drupal)

View Category →
SecOps Advisory Dispatch & RSS Feed

Subscribe to Daily Vulnerability Briefings & KEV Alerts

Concise morning briefings for SecOps, DevSecOps, and SRE teams covering newly exploited CVEs and mitigation priorities.

Slack / Teams / RSS Feed:
PatchKO
CVE-2019-6340 Drupal Core Remote Code Execution (RCE) Vulnerability Advisory (CVE-2019-6340) (CVSS 8.1) - Patch & Workaround | CVE Pulse