← cd ../blog

CVE-2026-119977: the WordPress core upgrade-window race that turns updating into RCE

A TOCTOU race in WordPress core's updater (CVSS 8.1, on CISA KEV) exposes a predictable, web-reachable staging install during upgrades. Root cause, fixed versions, hunting and safe updating.

This one is awkward: the act of updating WordPress is the vulnerable moment. CVE-2026-119977 is a time-of-check/time-of-use race in WordPress core’s upgrader. While a core update runs, the new release is unpacked into a predictable, web-reachable folder, and an unauthenticated attacker who gets there first can run code. WordPress fixed it in 7.1.4 on 28 October 2026, and CISA added it to KEV on 3 November. Because the update to the fixed version still runs the old updater code, how you update matters. WordPress runs on PHP, so make sure the interpreter itself isn’t exposed to PHP2Shell either.

Scope and ethics. This post covers architecture, exposure checks, detection and remediation for sites you own or are authorized to assess. It contains no exploit requests, race harnesses or payloads. Lab validation means checking versions and web server rules on a VM you control.

At a glance

   
CVE CVE-2026-119977
Severity CVSS 3.1 8.1 High, AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H (Wordfence CNA, via NVD)
CWE CWE-367 Time-of-check Time-of-use (TOCTOU) Race Condition
Affected WordPress 4.7 through 7.1.3 (NVD). Picus says the underlying behavior goes back to 2.7.0. Branches 2.7–4.6 get no fix
Fixed in 7.1.4 (28 Oct 2026), backported to every branch down to 4.7: see the table below
Exploited? Yes. CISA KEV added 3 Nov 2026 (federal due date 6 Nov), with forensic triage required. Wordfence reported blocking 13,095 attacks in 24 hours
Auth / interaction None / none, but the attacker has to hit the window while an update is running

Description: how the bug works

When WordPress installs a core update, the upgrader works in stages. Per Picus Security (whose researcher, Umut Bayram, reported the bug):

  1. Unpack. WP_Upgrader::unpack_package() (class-wp-upgrader.php) extracts the release zip under wp-content/upgrade/<package-name>/. On a normal install wp-content is under the document root and PHP runs there, so for a while there’s a second, complete copy of WordPress reachable over HTTP.
  2. Predictable name. In 5.9.0–7.1.3 the staging folder name comes from the package filename (via Content-Disposition), so an attacker can work out the path. In 4.4.0–5.8.18 a six-character random suffix makes this depend on a path leak such as a verbose error.
  3. The orphaned installer. The staged copy includes setup-config.php, the “create wp-config.php” installer. Run from inside the staging tree, it checks only that tree for a config file, doesn’t find the live site’s wp-config.php, and starts the normal unauthenticated setup flow.
  4. The copy. update_core() (update-core.php) then copies staged files over the live site. Its skip logic relied on the checksum manifest, which doesn’t list wp-config.php, so a wp-config.php created in staging could overwrite the live one.

That’s the TOCTOU: the site is in a known-good state when the update starts (the check), but between extract and copy (the use), an attacker can change what gets installed. Controlling wp-config.php means controlling the database the site connects to, and from there code execution. The window only exists during an update, which is why it’s rated AC:H.

Which updates are exposed. Picus says full, no_content and new_bundled packages contain the installer files. partial and rollback packages qualify only if that specific archive happens to include setup-config.php, wp-config-sample.php, wp-settings.php and related files. Picus also says WP-CLI’s wp core update uses the same code path, so it isn’t a safe alternative on an unpatched site.

What 7.1.4 changed

Per Picus: the staging folder gets a 16-character random suffix, wp-content/upgrade/index.php is preserved (and recreated) to stop directory listing, and update_core() now explicitly skips wp-config.php.

The catch: extraction happens with the updater code you already have. Picus notes that when going from, say, 7.0.7 to 7.1.4, the staging path is still predictable and the installer is still reachable during that one update. The new wp-config.php skip protects the live config, but an attacker could still run PHP in the temporary installer before cleanup. So put the web-server block below in place before you update.

Impact

Remote code execution as the web server / PHP-FPM user, plus everything that follows: database access, admin account creation, malicious plugins and web shells, and credential theft from wp-config.php. CISA’s KEV entry requires forensic triage, so treat this as a compromise-assessment item, not only a patch.

Fixed versions by branch

From NVD’s configuration for CVE-2026-119977. WordPress’s release post says fixes went to “all branches eligible to receive security fixes (currently through 4.7)” but doesn’t list them:

Branch Fixed in Branch Fixed in Branch Fixed in
7.1 7.1.4 6.3 6.3.14 5.5 5.5.24
7.0 7.0.8 6.2 6.2.15 5.4 5.4.25
6.9 6.9.11 6.1 6.1.16 5.3 5.3.27
6.8 6.8.12 6.0 6.0.18 5.2 5.2.30
6.7 6.7.11 5.9 5.9.20 5.1 5.1.28
6.6 6.6.11 5.8 5.8.19 5.0 5.0.31
6.5 6.5.14 5.7 5.7.21 4.9 4.9.35
6.4 6.4.14 5.6 5.6.23 4.8 / 4.7 4.8.34 / 4.7.39

WordPress itself only actively supports the latest release. Backports are a courtesy, so the real fix is getting to 7.1.4+.

Identifying affected systems

On hosts you administer:

# 1) Core version (per site; add --path=... or loop over your docroots)
wp core version --extra
grep "^\$wp_version" wp-includes/version.php

# 2) Are core files intact? (flags modified or extra files in wp-admin / wp-includes)
wp core verify-checksums

# 3) Fleet: every WordPress install under /var/www and its version
find /var/www -name version.php -path '*wp-includes*' -exec grep -H "^\$wp_version" {} \;

# 4) Is the staging dir reachable over HTTP? (run against your own site)
curl -s -o /dev/null -w '%{http_code}\n' https://www.example.com/wp-content/upgrade/

For step 4, 403 is what you want. A 200 (empty page from index.php) or a directory listing means wp-content/upgrade/ is web-reachable.

Also note when your sites update: automatic background updates, a managed host’s update schedule, or a CI job running wp core update. Those are your exposure windows.

Safe validation in an isolated lab

  1. On an isolated VM, install a pre-fix version (e.g. 7.1.3) behind the same web server config you run in production.
  2. Apply the wp-content/upgrade/ block below, drop a harmless text file into that folder yourself, and confirm a request to it returns 403.
  3. Update to 7.1.4 and confirm the version, wp core verify-checksums, and that wp-config.php is unchanged (sha256sum before/after).
  4. Confirm your logging captures requests to /wp-content/upgrade/. The hunting queries below depend on it.

Detection and threat hunting

No hashes, IPs or domains have been published in the sources I read, so hunt on behavior and paths:

# Any HTTP request into the staging area is suspicious; legitimate updates never fetch it over HTTP
grep -E '/wp-content/upgrade/' /var/log/nginx/access.log* /var/log/apache2/access.log* 2>/dev/null

# Especially the installer from inside staging
grep -E '/wp-content/upgrade/.*(setup-config|install)\.php' /var/log/nginx/access.log* /var/log/apache2/access.log* 2>/dev/null

# wp-config.php changed recently? Compare against your backup / config management
stat -c '%y %n' wp-config.php
find . -maxdepth 2 -name 'wp-config.php' -mtime -30

# Leftovers in the staging dir after an update finished
find wp-content/upgrade -mindepth 1 -maxdepth 2 ! -name index.php

Then the usual post-compromise checks:

  • wp-config.php: DB_HOST, DB_NAME or DB_USER you don’t recognize, or changed salts. An unexpected database host is a strong sign of this specific attack.
  • Users: wp user list --role=administrator --fields=ID,user_login,user_registered, looking for admins created around update times.
  • Code: unknown plugins or mu-plugins (wp-content/mu-plugins/), wp core verify-checksums failures, and .php files under wp-content/uploads/.
  • Process lineage: php-fpm / www-data spawning sh, curl, wget or python.
  • Network: NGFW/IPS signatures. Picus lists Palo Alto IPS 97739 and FortiGate IPS 62806, plus Check Point coverage. Verify them in your own environment.

Remediation

  1. Block the staging area first. WordPress never needs to serve wp-content/upgrade/ over HTTP (Picus):
    • nginx: location ^~ /wp-content/upgrade/ { deny all; } (placed so it wins over your PHP location)
    • Apache: a <Directory> block for that path with Require all denied, or a RedirectMatch 403 rule in the root .htaccess
    • Don’t put the .htaccess inside upgrade/. Picus warns the unpatched updater clears that folder before extracting.
    • Confirm /wp-content/upgrade/ returns 403.
  2. Then update to 7.1.4 (or your branch’s fixed release above). Background auto-updates will deliver it to sites that support them.
  3. Alternative for high-value sites: update manually, outside the web root. Extract the release elsewhere and copy core files in, excluding wp-config.php and wp-content. Picus points out WP-CLI’s wp core update uses the same vulnerable path, so it isn’t a substitute here.
  4. Hunt using the checks above, especially on any internet-facing site that ran a core update before 7.1.4 was installed, and on anything still unpatched after the 3 Nov KEV listing.
  5. If compromised: restore wp-config.php from a known-good copy, rotate DB credentials and salts, remove rogue admins/plugins, and rebuild if you can’t scope it.
  6. Get off 2.7–4.6. Those branches get no fix.

Keep the wp-content/upgrade/ block in place after patching. It costs nothing and removes this whole class of staging-area bugs.

References

Verify every version against the vendor advisory before acting. Published 09 Nov 2026.