high

CVE

CVE-2026-119977

CWE

CWE-367, CWE-330

Affected Surface

  • WordPress Core versions `4.7.0` through `7.1.3` across all branches (`< 4.7.39`, `< 4.8.34`, `< 4.9.35`, `< 5.0.31`, `< 5.1.28`, `< 5.2.30`, `< 5.3.27`, `< 5.4.25`, `< 5.5.24`, `< 5.6.23`, `< 5.7.21`, `< 5.8.19`, `< 5.9.20`, `< 6.0.18`, `< 6.1.16`, `< 6.2.15`, `< 6.3.14`, `< 6.4.14`, `< 6.5.14`, `< 6.6.11`, `< 6.7.11`, `< 6.8.12`, `< 6.9.11`, `< 7.0.8`, `< 7.1.4`)
  • Internet-facing WordPress servers where `/wp-content/upgrade/` is directly reachable over HTTP/HTTPS during manual, WP-CLI, control-panel, or automatic core upgrades

TL;DR

On 3 November 2026, CISA added CVE-2026-119977 (CVSS 3.1 8.1 High, CWE-367 Time-of-check Time-of-use Race Condition, reported by Umut Bayram of Picus Security) to the Known Exploited Vulnerabilities (KEV) catalog with a 6 November 2026 remediation due date and a Binding Operational Directive (BOD) 26-04 forensic triage mandate.

The bug affects WordPress Core 4.7.0 through 7.1.3. When a site runs a full-package core upgrade, WP_Upgrader::unpack_package() extracts the downloaded release archive into a predictable directory inside wp-content/upgrade/ (derived directly from the package filename, such as wp-content/upgrade/wordpress-7.1.4/) before update_core() copies the extracted tree over the live installation and deletes the staging directory. Because a full WordPress release ZIP includes wp-admin/setup-config.php and does not include wp-config.php, an unauthenticated attacker who polls the predictable staging URL while the extraction is on disk can hit the staged setup-config.php installer directly over HTTP, write an attacker-controlled wp-config.php inside the staging directory, or execute arbitrary PHP before cleanup finishes.

Wordfence (the assigning CNA) reported that automated polling began immediately after the patch shipped: its firewall rule recorded its first match 9 minutes after deployment and blocked more than 18,500 requests targeting staged installer paths under wp-content/upgrade/ in the first 21 hours, with individual scanning sources polling target sites continuously for up to 14.5 hours to catch an upgrade window.

What to do now:

  1. Block external HTTP access to /wp-content/upgrade/ at Nginx, Apache, or your CDN/WAF BEFORE running the upgrade. Because the currently installed (<= 7.1.3) WP_Upgrader::unpack_package() code is what unpacks the 7.1.4 release archive, the upgrade that installs the patch still uses the old predictable directory name on disk.
  2. Upgrade WordPress Core to 7.1.4 (or the corresponding security release on your branch, 4.7.39 through 7.0.8).
  3. Audit web access logs and host files for any HTTP 200 or POST requests to /wp-content/upgrade/*.php (especially setup-config.php), unexpected administrator accounts, modified wp-config.php files, or rogue PHP files created since 28 October 2026.

Affected packages and branches

Ecosystem / ComponentAffected versionsPatched version (released 28 Oct 2026)Vulnerable files
WordPress Core (7.1 branch)7.1.0 to 7.1.37.1.4wp-admin/includes/class-wp-upgrader.php, wp-admin/includes/update-core.php
WordPress Core (7.0 branch)7.0.0 to 7.0.77.0.8wp-admin/includes/class-wp-upgrader.php, wp-admin/includes/update-core.php
WordPress Core (6.6 to 6.9 branches)6.6.0..6.6.10, 6.7.0..6.7.10, 6.8.0..6.8.11, 6.9.0..6.9.106.6.11, 6.7.11, 6.8.12, 6.9.11wp-admin/includes/class-wp-upgrader.php, wp-admin/includes/update-core.php
WordPress Core (6.0 to 6.5 branches)6.0.0..6.0.17, 6.1.0..6.1.15, 6.2.0..6.2.14, 6.3.0..6.3.13, 6.4.0..6.4.13, 6.5.0..6.5.136.0.18, 6.1.16, 6.2.15, 6.3.14, 6.4.14, 6.5.14wp-admin/includes/class-wp-upgrader.php, wp-admin/includes/update-core.php
WordPress Core (4.7 to 5.9 branches)4.7.0..4.7.38 through 5.9.0..5.9.194.7.39 through 5.9.20wp-admin/includes/class-wp-upgrader.php, wp-admin/includes/update-core.php

Technical analysis

1. Why the upgrade staging directory was both predictable and executable

When WordPress performs a core update (Core_Upgrader::upgrade()), it downloads the release ZIP and calls WP_Upgrader::unpack_package(). Prior to WordPress 7.1.4 (commit b625b2d49c6a), unpack_package() did two things that exposed the unpacked core files to unauthenticated HTTP requests during the extraction-and-copy window:

  1. It deleted every file inside wp-content/upgrade/ at the start of the run, including any index.php guard, leaving directory listing enabled on servers without Options -Indexes or autoindex off.
  2. It constructed $working_dir deterministically by stripping .tmp and .zip from the downloaded archive basename (basename( basename( $package, '.tmp' ), '.zip' )), producing a predictable path under wp-content/upgrade/.

When the update uses a full release package, the unpacked tree under wp-content/upgrade/<working_dir>/wordpress/ contains a fresh copy of wp-admin/setup-config.php. In a normal installed site, wp-admin/setup-config.php refuses to run because it checks file_exists( ABSPATH . 'wp-config.php' ) || file_exists( dirname( ABSPATH ) . '/wp-config.php' ). Inside the staged subdirectory (wp-content/upgrade/<working_dir>/wordpress/wp-admin/setup-config.php), however, ABSPATH resolves to the staged wordpress/ directory, and dirname( ABSPATH ) resolves to wp-content/upgrade/<working_dir>/. Neither directory contains a wp-config.php file.

As a result, an unauthenticated request hitting the staged setup-config.php?step=2 during the few seconds that the unpacked files sit in wp-content/upgrade/ passes the wp-config.php existence check and writes a new wp-config.php into the staged tree (or injects PHP code into the configuration constants). Worse, in wp-admin/includes/update-core.php, update_core() only skipped wp-content and wp-includes/version.php when copying the staged tree over the live site root ($from -> $to), so a wp-config.php created inside the staging directory during the race window would be copied straight over the live site’s wp-config.php.

2. The WordPress 7.1.4 fix diff (b625b2d49c6a)

Commit b625b2d49c6ad3abfe8ca884e5453966d05790fd closes both the predictable staging path and the wp-config.php promotion sink across wp-admin/includes/class-wp-upgrader.php and wp-admin/includes/update-core.php:

--- a/wp-admin/includes/class-wp-upgrader.php
+++ b/wp-admin/includes/class-wp-upgrader.php
@@ -343,6 +343,21 @@ public function download_package( $package, $check_signatures = false, $hook_ext
 		return $download_file;
 	}
 
+	/**
+	 * Builds an unpredictable name for the directory a package is unpacked into.
+	 *
+	 * @since 7.1.4
+	 *
+	 * @param string $package The full local path or URI of the package.
+	 * @return string The directory name, without a path.
+	 */
+	private function get_working_dir_name( $package ) {
+		// Strip off any .tmp or .zip suffixes.
+		$name = basename( basename( $package, '.tmp' ), '.zip' );
+
+		return $name . '-' . wp_generate_password( 16, false );
+	}
+
 	/**
 	 * Unpacks a compressed package file.
@@ -366,16 +381,32 @@ public function unpack_package( $package, $delete_package = true ) {
 
 		$upgrade_folder = $wp_filesystem->wp_content_dir() . 'upgrade/';
 
-		// Clean up contents of upgrade directory beforehand.
+		// Clean up contents of upgrade directory beforehand, keeping its index.php.
 		$upgrade_files = $wp_filesystem->dirlist( $upgrade_folder );
 		if ( ! empty( $upgrade_files ) ) {
 			foreach ( $upgrade_files as $file ) {
+				if ( 'index.php' === $file['name'] ) {
+					continue;
+				}
+
 				$wp_filesystem->delete( $upgrade_folder . $file['name'], true );
 			}
 		}
 
-		// We need a working directory - strip off any .tmp or .zip suffixes.
-		$working_dir = $upgrade_folder . basename( basename( $package, '.tmp' ), '.zip' );
+		if ( ! $wp_filesystem->is_dir( $upgrade_folder ) ) {
+			$wp_filesystem->mkdir( $upgrade_folder, FS_CHMOD_DIR );
+		}
+		if ( ! $wp_filesystem->exists( $upgrade_folder . 'index.php' ) ) {
+			$wp_filesystem->put_contents( $upgrade_folder . 'index.php', "<?php\n// Silence is golden.\n", FS_CHMOD_FILE );
+		}
+
+		// We need a working directory.
+		$working_dir = $upgrade_folder . $this->get_working_dir_name( $package );
--- a/wp-admin/includes/update-core.php
+++ b/wp-admin/includes/update-core.php
@@ -1545,8 +1545,9 @@ function update_core( $from, $to ) {
 	/*
 	 * Don't copy wp-content, we'll deal with that below.
 	 * We also copy version.php last so failed updates report their old version.
+	 * Never copy a wp-config.php, which could have been written to the working directory.
 	 */
-	$skip              = array( 'wp-content', 'wp-includes/version.php' );
+	$skip              = array( 'wp-content', 'wp-includes/version.php', 'wp-config.php' );
 	$check_is_writable = array();

3. The bootstrap trap when upgrading from <= 7.1.3 to 7.1.4

Pay close attention to how WordPress core updates execute:

  1. The already-installed (<= 7.1.3) WP_Upgrader::unpack_package() runs first to extract the 7.1.4 ZIP archive into wp-content/upgrade/. Because that step uses the old code in memory, the final upgrade that takes a site from 7.1.3 to 7.1.4 still unpacks into the predictable staging directory name.
  2. Once unpacked, WordPress loads the newly extracted wp-admin/includes/update-core.php from the staging folder and calls update_core( $from, $to ). Because the new update_core.php includes 'wp-config.php' in $skip, it refuses to copy a staged wp-config.php over the live root, but the staged setup-config.php is still briefly reachable on disk unless /wp-content/upgrade/ is blocked at the web server or WAF before the upgrade runs.
  3. Also note that plugin-based WordPress WAFs running in standard mode are not loaded when an attacker requests /wp-content/upgrade/.../wp-admin/setup-config.php directly, because setup-config.php defines WP_INSTALLING and never loads active plugins (wp-settings.php is only loaded after configuration). Only web-server rules (Nginx/Apache), edge WAFs, or PHP auto_prepend_file firewalls intercept direct requests to the staged installer.

IOCs and in-the-wild telemetry

Neither CISA nor Wordfence published attacker IP lists, as scanning is distributed across opportunistic polling infrastructure. Instead, detection relies on HTTP request telemetry and filesystem artifacts:

  • HTTP URI patterns polled in the wild (observed by Wordfence across 18,500+ blocked requests in the first 21 hours):
    • Direct GET and POST requests to /wp-content/upgrade/*.php, specifically targeting /wp-content/upgrade/<package-name>/wordpress/wp-admin/setup-config.php and /wp-content/upgrade/<package-name>/wp-admin/setup-config.php
    • High-frequency polling from a single source IP against /wp-content/upgrade/ over multi-hour windows (up to 14.5 hours per target group in Wordfence telemetry)
  • Filesystem indicators of compromise:
    • Any leftover directory or .php file inside wp-content/upgrade/ other than the 30-byte index.php (<?php // Silence is golden.)
    • Modification timestamp (mtime / ctime) changes on the live wp-config.php matching the timestamp of a recent core upgrade (auto_core_update_notified option)

Detection and remediation

1. Check installed WordPress versions and hunt for /wp-content/upgrade/ exploitation in logs

# 1. Check WordPress versions across all sites on the host
for dir in /var/www/*/ /srv/www/*/; do
  [ -f "${dir}wp-includes/version.php" ] && \
    printf "%-40s %s\n" "$dir" "$(grep -ho "\$wp_version = '[^']*'" "${dir}wp-includes/version.php")"
done

# 2. Search Nginx / Apache access logs for any HTTP requests to /wp-content/upgrade/
rg -n '/wp-content/upgrade/' /var/log/nginx/*access*.log /var/log/apache2/*access*.log /var/log/httpd/*access*.log 2>/dev/null

# 3. Inspect wp-content/upgrade/ contents, wp-config.php mtime, and core checksums (via WP-CLI)
ls -la wp-content/upgrade/ 2>/dev/null
stat wp-config.php
wp core verify-checksums --include-root
wp user list --role=administrator --fields=ID,user_login,user_email,user_registered
find wp-content -name '*.php' -newermt '2026-10-28' -ls 2>/dev/null

If access logs show any HTTP 200 or 302 responses for /wp-content/upgrade/.*\.php (especially setup-config.php), treat the WordPress instance and database as compromised: preserve wp-content/upgrade/ and web logs for forensic triage, rebuild from a known-good backup, and rotate database credentials, wp-config.php authentication salts, administrator passwords, and any API keys stored in the WordPress database or environment.

2. Block /wp-content/upgrade/ at the web server, then update to 7.1.4

Do not place a .htaccess file inside wp-content/upgrade/ itself, because WP_Upgrader::unpack_package() deletes every file inside wp-content/upgrade/ except index.php at the start of each upgrade. Apply the block in the parent configuration before running wp core update:

Nginx (inside the server block, using ^~ so regex .php$ FastCGI locations cannot match):

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

Apache (in the VirtualHost config or root .htaccess above # BEGIN WordPress):

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^wp-content/upgrade/ - [F,L]
</IfModule>

Verify that curl -I https://example.com/wp-content/upgrade/index.php returns 403 Forbidden, and then apply the core update:

wp core update
wp core version

Timeline

  • 2026-10-28 (17:13 UTC): WordPress releases 7.1.4 and backports commit b625b2d49c6ad3abfe8ca884e5453966d05790fd across all branches down to 4.7.39.
  • 2026-10-28 (20:30 UTC): Wordfence deploys a WAF rule for CVE-2026-119977 and records the first live exploitation attempt 9 minutes later.
  • 2026-10-29 (21:58 UTC): Wordfence reports more than 18,500 blocked requests targeting staged installer paths under /wp-content/upgrade/ in the first 21 hours.
  • 2026-10-31 (05:33 to 06:16 UTC): Wordfence and NVD publish CVE-2026-119977 (CVSS 8.1 High).
  • 2026-11-03: CISA adds CVE-2026-119977 to the Known Exploited Vulnerabilities (KEV) catalog with a 6 November 2026 remediation deadline; the Canadian Centre for Cyber Security (AV26-1117) and Centre for Cybersecurity Belgium issue national alerts.

From research to remediation

Check whether this pattern exists in your codebase

Turn this research into a remediation workflow. Use AI-native static analysis to find similar application vulnerabilities and generate review-ready fixes.

References