The Drupal security team has confirmed what defenders dread most: a critical remote code execution (RCE) vulnerability in Drupal is being actively exploited in the wild, with attacks observed since at least Thursday of last week. Threat actors are using the flaw to hijack unpatched sites — which in practice means webshell deployment, credential theft, SEO spam injection, cryptomining, and pivot points into internal networks.
If you run Drupal — any exposed instance, including forgotten staging sites, marketing microsites, and vendor-managed portals — you are in scope. Drupal powers a significant share of government, higher education, healthcare, and enterprise web properties, and mass exploitation of critical Drupal RCEs historically begins within hours of public disclosure and continues for years against unpatched stragglers. Automated scanners are already sweeping the internet for vulnerable versions.
This post gives you the defender's playbook: what's happening, how to tell if you're already hit, and exactly what to do about it.
Technical Analysis
What's affected
Per the Drupal security team's confirmation, the flaw is a critical remote code execution vulnerability in Drupal core that allows attackers to execute arbitrary code on unpatched sites — effectively handing over the underlying web server process (typically running as www-data, apache, or nginx on Linux, or the IIS app pool identity on Windows).
Key characteristics defenders should internalize:
- Pre-authentication or low-barrier exploitation: Critical Drupal RCEs of this class are typically exploitable by unauthenticated remote attackers via crafted HTTP requests. Treat any internet-facing Drupal instance as exposed.
- Arbitrary PHP code execution: Successful exploitation results in attacker-controlled PHP executing in the context of the web server. Everything the web server can read or write — the Drupal database credentials in
settings.php, uploaded files, session data — is fair game. - Site hijacking at scale: Observed post-exploitation behavior in Drupal compromise campaigns includes webshell drops in writable directories (especially
sites/default/files/), malicious admin account creation, database dumps, injected JavaScript skimmers, and spam/SEO poisoning.
Exploitation status
- Confirmed active exploitation: The Drupal security team states the flaw has been exploited since at least Thursday. This is not theoretical — treat it as an incident, not a patching exercise.
- Mass scanning follows fast: Once exploitation is public, both opportunistic criminal groups and more patient actors add the exploit to their toolkits. Internet-wide scanning for vulnerable Drupal instances is essentially guaranteed.
- Patching is NOT sufficient on its own: If your site was exposed and unpatched during the exploitation window, you must assume compromise and hunt. Attackers who got in before you patched leave persistence behind — a patched site can still be a compromised site.
Why Drupal RCEs are so damaging
Drupal's architecture concentrates risk: the application holds database credentials in cleartext in settings.php, the sites/default/files directory is web-accessible and writable by design, and many deployments allow PHP execution in upload paths due to misconfiguration. A single RCE becomes full database compromise, persistent backdoor access, and — where the web server is over-privileged or the host is unsegmented — lateral movement into the internal network.
Detection & Response
The detections below target the highest-fidelity observable behaviors of Drupal RCE exploitation and post-exploitation: the web server process spawning shells or download tools, PHP files appearing in upload directories, and known-bad reconnaissance patterns in web logs. These are deliberately scoped tight — a veteran analyst should be able to deploy them without drowning in noise.
Sigma Rules
---
title: Web Server Process Spawning Shell or Download Utility
id: 3f9c1a72-8b4d-4e21-a9c6-2d7e5f0a1b34
status: experimental
description: Detects a web server or PHP-FPM worker process spawning command shells, download utilities, or scripting interpreters — a hallmark of Drupal RCE exploitation and webshell activity.
references:
- https://attack.mitre.org/techniques/T1190/
- https://attack.mitre.org/techniques/T1059/
author: Security Arsenal
date: 2026/04/06
tags:
- attack.initial_access
- attack.t1190
- attack.execution
logsource:
category: process_creation
product: linux
detection:
selection_parent:
ParentImage|endswith:
- '/apache2'
- '/httpd'
- '/php-fpm'
- '/nginx'
selection_child_img:
Image|endswith:
- '/sh'
- '/bash'
- '/dash'
- '/zsh'
- '/curl'
- '/wget'
- '/perl'
- '/python'
- '/python3'
- '/nc'
- '/ncat'
- '/base64'
- '/chmod'
condition: selection_parent and selection_child_img
falsepositives:
- Legitimate CMS modules invoking system utilities (rare; tune per deployment)
- Web application backup or maintenance jobs running under the web server user
level: high
---
title: PHP File Created in Drupal Public Files Directory
id: 8e2d4b61-5c7a-4f39-b1d8-6a0c3e9f2745
status: experimental
description: Detects creation of PHP files inside Drupal's web-accessible files directory (sites/default/files), a common webshell drop location after RCE exploitation.
references:
- https://attack.mitre.org/techniques/T1505/003/
author: Security Arsenal
date: 2026/04/06
tags:
- attack.persistence
- attack.t1505.003
logsource:
category: file_event
product: linux
detection:
selection:
TargetFilename|contains:
- '/sites/default/files/'
TargetFilename|endswith:
- '.php'
- '.phtml'
- '.phar'
- '.php5'
- '.php7'
condition: selection
falsepositives:
- Rare; legitimate Drupal modules should never place executable PHP in the public files directory
level: critical
KQL — Microsoft Sentinel / Defender
This query hunts Syslog-ingested Linux web hosts for the web server user spawning interactive tooling — the single most reliable post-exploitation signal for CMS RCE. It assumes you're forwarding auth/syslog or process events from your web tier into Sentinel (via the Syslog/CEF connector or AMA).
let WebUsers = dynamic(["www-data", "apache", "nginx", "httpd", "wwwrun"]);
let SuspiciousTools = dynamic(["/bin/sh", "/bin/bash", "/usr/bin/curl", "/usr/bin/wget", "/usr/bin/perl", "/usr/bin/python", "ncat", "/bin/nc", "base64", "crontab", "useradd"]);
Syslog
| where TimeGenerated > ago(7d)
| where Computer has_any ("web", "drupal", "www") // tune to your web host naming
| where SyslogMessage has_any (SuspiciousTools)
| where SyslogMessage has_any (WebUsers)
| summarize FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated), SampleCommands = make_set(SyslogMessage, 10) by Computer, ProcessName
| order by FirstSeen asc;
// Pivot: hunt outbound connections from web servers (unexpected egress = C2 or payload staging)
CommonSecurityLog
| where TimeGenerated > ago(7d)
| where DeviceProduct has_any ("web", "proxy", "firewall")
| where SourceHostName has_any ("web", "drupal", "www") // tune to your environment
| where DestinationPort !in (80, 443, 53, 123, 25)
| summarize ConnectionCount = count(), DistinctDestinations = dcount(DestinationIP) by SourceHostName, DestinationIP, DestinationPort
| where ConnectionCount < 50 // low-and-slow beaconing or one-off payload pulls
| order by DistinctDestinations desc;
Velociraptor VQL — Endpoint Hunt
Deploy this hunt across your Linux web tier to find two things at once: (1) executable PHP files sitting in Drupal's public files directories, and (2) suspicious processes currently running under the web server user. Tighten the glob path to match your actual docroot layout (/var/www/html, /srv/www, etc.).
-- Hunt: Drupal post-exploitation artifacts on Linux web servers
-- 1) PHP executables in Drupal public files directories (webshell indicator)
SELECT FullPath, Size, Mtime, Ctime
FROM glob(globs='/var/www/**/sites/default/files/**/*.php')
ORDER BY Mtime DESC
-- 2) Processes running as the web server user that should not be
SELECT Pid, Ppid, Name, Exe, CommandLine, Username, CreateTime
FROM pslist()
WHERE Username =~ 'www-data|apache|nginx'
AND (
Name =~ '^(sh|bash|dash|curl|wget|nc|ncat|perl|python|python3|crontab)$'
OR CommandLine =~ '(base64 -d|/dev/tcp/|eval\(|assert\(|passthru|shell_exec)'
)
Remediation and Verification Script
Run this on each Drupal host to confirm patch state, sweep for the most common post-exploitation artifacts, and harden the files directory against PHP execution. It is read-mostly by design — review output before making changes in production.
#!/bin/bash
# Drupal RCE response: version check, compromise sweep, and hardening verification
# Run as root or with sudo on each Drupal web host.
DOCROOT="/var/www/html" # <-- set to your Drupal docroot
FILES_DIR="$DOCROOT/sites/default/files"
echo "===== [1] Drupal core version ====="
if command -v drush &>/dev/null; then
drush -r "$DOCROOT" status --field=drupal-version 2>/dev/null || echo "drush status failed - check manually"
fi
if [ -f "$DOCROOT/core/lib/Drupal.php" ]; then
grep -m1 "const VERSION" "$DOCROOT/core/lib/Drupal.php"
fi
echo "===== [2] PHP files in public files directory (webshell sweep) ====="
find "$FILES_DIR" -type f \( -name "*.php" -o -name "*.phtml" -o -name "*.phar" \) -printf '%T@ %p\n' 2>/dev/null | sort -rn | head -50
echo "===== [3] Recently modified PHP files across docroot (last 14 days) ====="
find "$DOCROOT" -type f -name "*.php" -mtime -14 -printf '%T@ %p\n' 2>/dev/null | sort -rn | head -100
echo "===== [4] Suspicious processes under web server user ====="
ps -eo user,pid,ppid,comm,args | awk 'NR==1 || $1 ~ /^(www-data|apache|nginx)$/'
echo "===== [5] Drupal admin users (check for rogue accounts) ====="
if command -v drush &>/dev/null; then
drush -r "$DOCROOT" user:list --roles=administrator 2>/dev/null || echo "drush user:list failed"
fi
echo "===== [6] Persistence: cron and systemd units for web user ====="
crontab -u www-data -l 2>/dev/null || echo "no crontab for www-data"
ls -la /var/spool/cron/ 2>/dev/null
grep -rl "www-data\|apache\|nginx" /etc/systemd/system/ 2>/dev/null | head -20
echo "===== [7] PHP execution hardening in files directory ====="
if [ -f "$FILES_DIR/.htaccess" ]; then
grep -i "php\|engine\|handler" "$FILES_DIR/.htaccess" || echo ".htaccess present but no PHP restrictions found"
else
echo "WARNING: no .htaccess in $FILES_DIR - PHP execution may be possible (Apache)"
fi
echo "===== [8] Outbound connections from web server processes ====="
ss -tnp 2>/dev/null | grep -E "apache2|httpd|php-fpm|nginx" | head -30
echo "===== Done. Review output; any unexpected PHP in files/, rogue admins, or odd egress = escalate to IR. ====="
Remediation
Execute in this order. Speed matters more than elegance — hours count when exploitation is confirmed.
1. Patch immediately.
Apply the security update referenced in the official Drupal security advisory at drupal.org/security (and the PSA/sa-core advisory matching this release). Update via Composer for modern Drupal (composer update drupal/core-recommended drupal/core-composer-scaffold --with-all-dependencies followed by drush updatedb and drush cache:rebuild), or follow the manual update path for legacy installs. If you run a distribution or hosted Drupal (Acquia, Pantheon, Platform.sh), confirm your provider has applied the mitigation — most push platform-level protections, but verify, don't assume.
2. Take exposed instances offline if you can't patch today. A maintenance-mode page or a WAF deny is better than an exploitable production site. There is no acceptable "we'll patch next sprint" for a confirmed-exploited critical RCE.
3. Assume compromise; hunt before you trust. If the site was internet-facing and unpatched during the exploitation window:
- Run the sweep script above on every web node.
- Audit Drupal user accounts for rogue administrators (
drush user:list --roles=administrator) and unexpected password/email changes. - Review the Drupal watchdog log and web server access logs for the exploitation window — look for anomalous POST requests, requests to paths that shouldn't exist, and any request immediately preceding file writes in the files directory.
- Check for new or modified files across the entire docroot, not just
sites/default/files— sophisticated actors backdoor core and module files (grep -rn "eval\|assert\|base64_decode\|shell_exec" --include="*.php"is a blunt but useful first pass against a known-clean baseline or a fresh core download).
4. Rotate everything the site could touch.
A successful RCE exposes settings.php — which means your database credentials are burned. Rotate the DB password, any API keys in configuration, Drupal's hash salt, and session secrets. Force password resets for all privileged Drupal users. If the web server could reach internal services, treat those credentials as exposed too.
5. Harden against the next one.
- Disable PHP execution in upload directories. For Apache, ship an
.htaccessinsites/default/fileswithphp_flag engine off/SetHandler none; for Nginx, add alocationblock denying\.php$under the files path. This single control neuters most webshell drops. - Deploy a WAF with virtual patching (ModSecurity + OWASP CRS at minimum; cloud WAF rulesets from your CDN provider typically ship emergency rules for critical Drupal CVEs within hours).
- Segment the web tier. The web server should have no route to internal management networks, and its database grants should be least-privilege.
- Subscribe to Drupal security advisories (drupal.org/security RSS/mail) and wire them into your patch SLA — critical core advisories should trigger same-day emergency change windows.
- Inventory your Drupal estate. Forgotten microsites, legacy event pages, and vendor-hosted instances are where these compromises live for years. An external attack surface scan for Drupal fingerprints is a worthwhile afternoon.
6. If you find webshells or rogue accounts: escalate to full IR. Preserve disk and log evidence before rebuilding, establish a compromise timeline from web logs, and scope database exposure (what data did the attacker touch — user PII, payment data, credentials?). Rebuild from known-clean artifacts rather than cleaning in place wherever feasible.
The Bottom Line
Confirmed in-the-wild exploitation of a critical Drupal RCE compresses your response window to hours, not days. Patch first, but don't stop there — the sites compromised before patching are the ones that become next quarter's breach disclosure. Sweep for webshells, rotate credentials, lock down PHP execution in upload paths, and treat every forgotten Drupal instance in your estate as an open door.
Related Resources
Security Arsenal Penetration Testing Services AlertMonitor Platform Book a SOC Assessment vulnerability-management Intel Hub
Is your security operations ready?
Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.