Back to Intelligence

CVE-2026-119977: WordPress Core TOCTOU Race Condition Actively Exploited — Detection and Remediation Guide

SA
Security Arsenal Team
November 3, 2026
12 min read

On November 3, 2026, CISA added CVE-2026-119977 to its Known Exploited Vulnerabilities (KEV) catalog, confirming what many defenders feared: a critical time-of-check time-of-use (TOCTOU) race condition in WordPress Core is being actively exploited in the wild. This isn't theoretical risk — threat actors are currently leveraging this flaw to achieve unauthenticated remote code execution on vulnerable WordPress installations during core upgrade operations.

With WordPress powering over 43% of all websites globally, the attack surface here is massive. The vulnerability exploits predictable, web-accessible staging paths used during full-package core upgrades, creating a narrow but exploitable window where attackers can hijack the upgrade process and execute arbitrary code with web server privileges. CISA's Binding Operational Directive (BOD) 26-04 mandates federal agencies apply vendor mitigations immediately, and the same urgency applies to private sector organizations running WordPress in production.

If your organization operates WordPress sites — especially high-traffic properties, e-commerce platforms, or anything handling sensitive data — treat this as a drop-everything remediation priority. This post provides the technical analysis, detection logic, and hardening steps you need to defend against active exploitation.

Technical Analysis

Affected Products and Versions

CVE-2026-119977 affects WordPress Core during the full-package upgrade process. While specific version ranges are still being clarified by the WordPress Security Team, the vulnerability is inherent to the upgrade mechanism itself rather than a specific release. Organizations running any version of WordPress that has not applied the emergency security patch released in coordination with the CISA KEV listing should assume vulnerability.

Vulnerability Mechanics: The TOCTOU Race Condition

Time-of-check time-of-use (TOCTOU) vulnerabilities occur when a system checks a condition (e.g., file integrity, permissions) and then acts on that check, but an attacker modifies the state between the check and the action. In this case, WordPress Core's upgrade process creates a race window during full-package updates:

  1. Staging Path Creation: During a core upgrade, WordPress extracts the new version to a temporary staging directory with a predictable naming convention (e.g., wordpress-[version] or similar patterns under wp-content/upgrade/ or web-accessible temp paths).

  2. Integrity Check: WordPress performs checksum verification on the staged files before moving them into production paths.

  3. The Race Window: Between extraction and finalization, the staged files exist in a web-accessible location with predictable names. An attacker who can send requests during this window can attempt to write malicious files to the staging path or manipulate the upgrade process.

  4. Code Execution: If the attacker wins the race — replacing or injecting files before WordPress finalizes the upgrade — their malicious code gets moved into the production WordPress directory and executed with the privileges of the web server process (typically www-data, apache, or nginx).

The attack requires precise timing but is entirely feasible with automated tooling. Attackers can monitor target sites for upgrade activity (via version disclosure, behavioral fingerprinting, or simply spraying requests during known maintenance windows) and fire exploit attempts in rapid succession during the upgrade window.

Exploitation Status

Confirmed Active Exploitation: CISA's addition to the KEV catalog is not speculative — it is based on observed in-the-wild exploitation. While specific IOCs and threat actor attribution have not been publicly disclosed as of this writing, the KEV listing confirms that attackers are successfully leveraging this vulnerability to compromise WordPress installations.

Organizations should assume that any unpatched WordPress site performing upgrades is at immediate risk, particularly if the upgrade process is triggered during predictable maintenance windows or if the site is high-value enough to warrant targeted attention.

Detection & Response

Detecting TOCTOU exploitation requires monitoring for anomalous file writes in WordPress staging directories and unexpected code execution originating from web server processes during upgrade windows. The following detection content is designed to identify both successful exploitation and precursor activity.

SIGMA Rules

YAML
---
title: WordPress Core Upgrade Staging Path Web Access
description: Detects HTTP requests to predictable WordPress core upgrade staging paths, which may indicate reconnaissance or exploitation attempts targeting CVE-2026-119977.
author: Security Arsenal
date: 2026/11/03
references:
  - https://www.cisa.gov/known-exploited-vulnerabilities-catalog
logsource:
  category: webserver
  product: apache
  # Also applicable to nginx, IIS, and other web servers hosting WordPress
detection:
  selection:
    cs-uri|contains:
      - '/wp-content/upgrade/'
      - '/wordpress-'
      - '/wp-admin/upgrade.php'
      - '/wp-admin/update-core.php'
    sc-status:
      - 200
      - 403
  filter_legitimate:
    cs-user-agent|contains:
      - 'WordPress/'
      - 'WP-Cron'
  condition: selection and not filter_legitimate
falsepositives:
  - Legitimate WordPress administrative access during upgrades
  - Security scanning tools
level: high
---
title: Suspicious File Write in WordPress Upgrade Directory
description: Detects file creation in WordPress upgrade staging directories by non-WordPress processes, potentially indicating TOCTOU race condition exploitation.
author: Security Arsenal
date: 2026/11/03
references:
  - https://www.cisa.gov/known-exploited-vulnerabilities-catalog
logsource:
  category: file_creation
  product: linux
  # Also applicable to Windows with appropriate log source mapping
detection:
  selection:
    TargetFilename|contains:
      - '/wp-content/upgrade/'
      - '/wordpress-'
    TargetFilename|endswith:
      - '.php'
      - '.phtml'
      - '.phar'
  filter_wordpress:
    Image|contains:
      - 'php'
      - 'php-fpm'
  condition: selection and not filter_wordpress
falsepositives:
  - Legitimate WordPress upgrade processes
  - File integrity monitoring tools
level: critical
---
title: Web Server Process Spawning Shell
description: Detects web server processes (Apache, Nginx, PHP-FPM) spawning command shells or interpreters, which may indicate successful remote code execution via CVE-2026-119977.
author: Security Arsenal
date: 2026/11/03
references:
  - https://www.cisa.gov/known-exploited-vulnerabilities-catalog
logsource:
  category: process_creation
  product: linux
detection:
  selection_parent:
    ParentImage|contains:
      - '/usr/sbin/apache2'
      - '/usr/sbin/nginx'
      - 'php-fpm'
      - '/usr/sbin/httpd'
  selection_child:
    Image|contains:
      - '/bin/bash'
      - '/bin/sh'
      - '/usr/bin/python'
      - '/usr/bin/perl'
      - '/usr/bin/wget'
      - '/usr/bin/curl'
  condition: selection_parent and selection_child
falsepositives:
  - Legitimate administrative scripts
  - Monitoring agents
level: critical

Microsoft Sentinel / Defender KQL

The following KQL query hunts for suspicious file writes to WordPress upgrade directories and subsequent process execution, assuming Syslog or CEF ingestion from web servers:

KQL — Microsoft Sentinel / Defender
// Hunt for suspicious file writes to WordPress upgrade paths
let suspiciousFileWrites = Syslog
    | where TimeGenerated >= ago(7d)
    | where SyslogMessage contains "wp-content/upgrade" or SyslogMessage contains "wordpress-"
    | where SyslogMessage contains "CREATE" or SyslogMessage contains "WRITE"
    | where SyslogMessage contains ".php" or SyslogMessage contains ".phtml"
    | extend FilePath = extract(@"(/[^\s]*wp-content/upgrade/[^\s]*)", 1, SyslogMessage)
    | extend SourceIP = extract(@"from ([0-9.]+)", 1, SyslogMessage)
    | project TimeGenerated, Computer, FilePath, SourceIP, SyslogMessage;

// Hunt for web server spawning unexpected processes
let suspiciousProcesses = Syslog
    | where TimeGenerated >= ago(7d)
    | where SyslogMessage contains "apache2" or SyslogMessage contains "nginx" or SyslogMessage contains "php-fpm"
    | where SyslogMessage contains "bash" or SyslogMessage contains "sh -c" or SyslogMessage contains "wget" or SyslogMessage contains "curl"
    | extend CommandLine = SyslogMessage
    | project TimeGenerated, Computer, CommandLine;

// Correlate file writes with process execution
suspiciousFileWrites
| join kind=inner suspiciousProcesses on Computer, $left.TimeGenerated < $right.TimeGenerated
| extend TimeDelta = datetime_diff('second', TimeGenerated1, TimeGenerated)
| where TimeDelta between (0 .. 300) // 5-minute window
| project FileWriteTime=TimeGenerated, ProcessTime=TimeGenerated1, Computer, FilePath, SourceIP, CommandLine, TimeDelta
| order by FileWriteTime desc;

Velociraptor VQL

For endpoint forensics on Linux web servers hosting WordPress, the following VQL artifact hunts for suspicious files in upgrade directories and processes spawned by web servers:

VQL — Velociraptor
-- Hunt for suspicious PHP files in WordPress upgrade staging paths
SELECT 
    FullPath,
    Size,
    Mtime,
    Ctime,
    Mode,
    Uid,
    Gid
FROM glob(globs="/**/wp-content/upgrade/**/*.php")
WHERE Mtime > timestamp(epoch=now() - 604800) // Last 7 days
   OR Ctime > timestamp(epoch=now() - 604800)
ORDER BY Mtime DESC

-- Correlate with recent process execution
LET processes = SELECT 
    Pid,
    Ppid,
    Name,
    CommandLine,
    Exe,
    Username,
    CreateTime
FROM pslist()
WHERE Username =~ "www-data|apache|nginx"
   AND (CommandLine =~ "bash|sh|wget|curl|python|perl" OR Exe =~ "bash|sh|wget|curl|python|perl")

SELECT * FROM processes
WHERE CreateTime > timestamp(epoch=now() - 604800)

Remediation Script

The following Bash script checks for suspicious files in WordPress upgrade directories, verifies WordPress core integrity, and applies recommended hardening:

Bash / Shell
#!/bin/bash
# CVE-2026-119977 WordPress Core TOCTOU Detection and Hardening Script
# Run as root or with sudo on WordPress hosting servers

set -euo pipefail

echo "[+] CVE-2026-119977 WordPress Core TOCTOU Remediation Script"
echo "[+] Scan started: $(date)"

# Configuration - adjust these paths for your environment
WP_ROOT="/var/www/html"  # Adjust to your WordPress root
UPGRADE_DIR="${WP_ROOT}/wp-content/upgrade"
LOG_FILE="/var/log/wordpress-toctou-scan-$(date +%Y%m%d-%H%M%S).log"

# Function to log and display
log() {
    echo "$1" | tee -a "$LOG_FILE"
}

# Check if WordPress directory exists
if [ ! -d "$WP_ROOT" ]; then
    log "[!] WordPress root not found at $WP_ROOT. Please update WP_ROOT variable."
    exit 1
fi

log "[+] Scanning for suspicious files in upgrade directories..."

# Find PHP files modified in last 7 days in upgrade paths
if [ -d "$UPGRADE_DIR" ]; then
    log "[*] Checking $UPGRADE_DIR for recent PHP files..."
    find "$UPGRADE_DIR" -type f -name "*.php" -mtime -7 -exec ls -la {} \; 2>/dev/null | tee -a "$LOG_FILE"
    
    # Check for files not owned by expected web server user
    log "[*] Checking for files with unexpected ownership..."
    find "$UPGRADE_DIR" -type f ! -user www-data ! -user apache ! -user nginx 2>/dev/null | tee -a "$LOG_FILE"
else
    log "[*] Upgrade directory $UPGRADE_DIR does not exist (may indicate no recent upgrades)"
fi

# Check for suspicious processes running as web server user
log "[+] Checking for suspicious processes running as web server user..."
ps aux | grep -E "(www-data|apache|nginx)" | grep -E "(bash|sh|wget|curl|python|perl)" | grep -v grep | tee -a "$LOG_FILE" || log "[*] No suspicious processes found"

# Verify WordPress core integrity using WP-CLI (if available)
if command -v wp &> /dev/null; then
    log "[+] WP-CLI detected. Verifying WordPress core checksums..."
    cd "$WP_ROOT"
    wp core verify-checksums --allow-root 2>&1 | tee -a "$LOG_FILE" || log "[!] Core checksum verification failed or WP-CLI not configured"
else
    log "[!] WP-CLI not found. Install WP-CLI for automated integrity checking: https://wp-cli.org/"
fi

# Hardening recommendations
log "[+] Applying hardening measures..."

# 1. Disable direct access to upgrade directory via .htaccess
HTACCESS_FILE="${UPGRADE_DIR}/.htaccess"
if [ -d "$UPGRADE_DIR" ] && [ ! -f "$HTACCESS_FILE" ]; then
    log "[*] Creating .htaccess to deny web access to upgrade directory..."
    cat > "$HTACCESS_FILE" << 'EOF'
# Deny all web access to upgrade staging directory
Order allow,deny
Deny from all
EOF
    log "[+] Created $HTACCESS_FILE"
fi

# 2. Set restrictive permissions on upgrade directory
if [ -d "$UPGRADE_DIR" ]; then
    log "[*] Setting restrictive permissions on upgrade directory..."
    chmod 755 "$UPGRADE_DIR"
    chown -R www-data:www-data "$UPGRADE_DIR" 2>/dev/null || chown -R apache:apache "$UPGRADE_DIR" 2>/dev/null || log "[!] Could not set ownership (check web server user)"
fi

# 3. Check for WordPress security patches
log "[+] Checking WordPress version..."
if [ -f "${WP_ROOT}/wp-includes/version.php" ]; then
    WP_VERSION=$(grep -o "wp_version = '[^']*'" "${WP_ROOT}/wp-includes/version.php" | cut -d"'" -f2)
    log "[*] Detected WordPress version: $WP_VERSION"
    log "[!] MANUAL ACTION REQUIRED: Check https://wordpress.org/news/category/security/ for latest security updates"
else
    log "[!] Could not determine WordPress version"
fi

# 4. Recommend immediate actions
log ""
log "=== IMMEDIATE ACTIONS REQUIRED ==="
log "1. Apply the latest WordPress security patch immediately"
log "2. Review $LOG_FILE for suspicious files or processes"
log "3. If compromise is suspected, isolate the server and initiate incident response procedures"
log "4. Implement network-level restrictions to limit access to /wp-admin and upgrade endpoints"
log "5. Enable WordPress automatic updates if not already configured"
log "6. Review CISA guidance: https://www.cisa.gov/known-exploited-vulnerabilities-catalog"
log ""
log "[+] Scan complete: $(date)"
log "[+] Full log saved to: $LOG_FILE"

# Optional: Send alert email (configure your mail server)
# mail -s "WordPress TOCTOU Scan Alert" admin@example.com < "$LOG_FILE"

Remediation

Immediate Actions (Next 24 Hours)

  1. Apply WordPress Security Patch: Monitor the official WordPress Security Team announcements at https://wordpress.org/news/category/security/ for the emergency patch addressing CVE-2026-119977. Apply immediately upon release.

  2. Enable Automatic Updates: Ensure WordPress automatic updates are enabled for core releases. Add the following to wp-config.php if not already present:

    Code

define( 'WP_AUTO_UPDATE_CORE', true );

Code

3. **Restrict Upgrade Directory Access**: Implement web server-level access controls to deny direct HTTP access to `/wp-content/upgrade/` and related staging paths. For Apache, add to `.htaccess`:

<Directory "/wp-content/upgrade"> Order allow,deny Deny from all

Code
   For Nginx, add to your server block:

location ~* ^/wp-content/upgrade/ { deny all; }

Code

4. **Harden Upgrade Process**: Where possible, perform WordPress upgrades via WP-CLI (`wp core update`) rather than the web interface to eliminate the web-accessible staging window entirely.

### CISA Compliance Deadlines

Under BOD 26-04, federal civilian agencies must remediate CVE-2026-119977 within the timeline specified in the KEV catalog entry. While private sector organizations are not legally bound by BOD deadlines, **treat CISA's timeline as your own** — active exploitation means every hour of delay increases risk.

### Long-Term Hardening

1. **Implement Web Application Firewall (WAF)**: Deploy or update WAF rules to detect and block requests to predictable WordPress upgrade staging paths, especially during known upgrade windows.

2. **File Integrity Monitoring**: Deploy FIM solutions (OSSEC, Tripwire, AIDE) to alert on unauthorized changes to WordPress core files and upgrade directories.

3. **Network Segmentation**: Isolate WordPress servers from critical internal systems. Assume compromise is possible and architect accordingly.

4. **Least Privilege**: Ensure web server processes run with minimal privileges. Consider running WordPress under a dedicated user account with filesystem permissions restricted to only necessary directories.

5. **Monitor CISA KEV**: Subscribe to CISA KEV updates and integrate KEV data into your vulnerability management prioritization workflow.

## Conclusion

CVE-2026-119977 represents a clear and present danger to WordPress installations worldwide. The combination of confirmed active exploitation, unauthenticated remote code execution potential, and the massive WordPress install base makes this a critical remediation priority.

The TOCTOU race condition is technically sophisticated but entirely preventable with proper hardening and rapid patching. Organizations that treat this as a routine update cycle will find themselves responding to incidents instead of preventing them.

Act now: patch, harden, monitor, and verify. Your SOC should be actively hunting for the indicators outlined in this post while your infrastructure teams apply the necessary fixes.

## Related Resources

[Security Arsenal Penetration Testing Services](https://securityarsenal.com/services/penetration-testing)
[AlertMonitor Platform](https://securityarsenal.com/products/alertmonitor)
[Book a SOC Assessment](https://securityarsenal.com/contact)
[vulnerability-management Intel Hub](https://securityarsenal.com/intel/incident-response)

Is your security operations ready?

Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.