Anatomy of a working exploit: the WordPress core upgrade race (CVE-2026-119977)
The KEV catalog gained a rare class of bug on 2026-11-03: a time-of-check to time-of-use race in WordPress core's own upgrade pipeline, tracked as CVE-2026-119977. CISA's entry describes it tersely as allowing "unauthenticated attackers to execute code on the server during the upgrade window," caused by "predictable, web-accessible staging paths used during full-package core upgrades." That description hides a mechanism worth unpacking. This post is a defender-oriented walkthrough of what must be true for the bug to fire, what the exploit window looks like, and the concrete checks blue teams can run across their fleet.
The upgrade pipeline, in one minute
A full-package core upgrade in WordPress is not an in-place patch. The admin flow (or wp-cron, for sites running automatic background updates) fetches the signed zip of the target release, extracts it into a staging directory inside wp-content, and moves files over the live tree. The staging directory sits under the document root. Anything written there is, by default, reachable over HTTP as soon as the webserver can stat it. That property is the primitive the TOCTOU race turns into code execution.
Normal flow:
- Fetch the core zip into an upgrade cache.
- Extract to a staging path such as wp-content/upgrade/wordpress-<version>/wordpress/ (illustrative shape).
- Validate the contents.
- Copy or rename extracted files over the live tree, preserving wp-config.php.
- Delete the staging directory.
Steps 2 through 5 are not a single atomic operation. Between extraction and the integrity check, an attacker who can predict the staging path can request a PHP file inside it. PHP will interpret it. The staged core files are legitimate, signed WordPress files, but they are also executable PHP, served from a URL the attacker can reach without logging in. That is the "check" (file is a trusted core artifact) diverging from the "use" (file is served by the public webserver before it reaches its final, access-controlled location).
The race window
Call the extraction time T0 and the completion of the overwrite phase T1. For any URL under the staging directory, the window (T0, T1) is the exploit window. On a mid-range VPS with SSD storage, that window spans seconds for a core upgrade. On shared hosting with slower I/O, it can stretch to tens of seconds. An unauthenticated attacker polling the predictable path at scanner rates will reliably land a request inside the window.
Two factors widen the window:
- Any pre-move validation step that reads or hashes the whole extracted tree before any file moves.
- Automatic background updates via WP_AUTO_UPDATE_CORE, which run on wp-cron and give an attacker repeated opportunities across the release cadence.
The "predictable" half of the advisory matters because the attacker needs no side channel to learn where to send the request. Version strings in the staging path appear in public release notes. The directory name shape is part of core's open-source implementation. With auto-updates enabled, the attacker can race every published point release.
What the attacker needs
The preconditions are narrower than the raw "unauthenticated RCE" framing suggests:
- The site must be mid-upgrade when the attacker's request arrives.
- The webserver must serve the staging path (the default on Apache and nginx with a stock WordPress vhost).
- PHP must be configured to execute files under wp-content (again, the default).
The attacker needs no credentials, no valid nonce, and no prior session. They need timing and the published path shape. The proof-of-concept skeleton polls for the staging tree and probes an extracted PHP file:
#!/usr/bin/env bash
TARGET="https://example.com"
VERSION="6.9.1" # the version being rolled out
STAGING="/wp-content/upgrade/wordpress-${VERSION}/wordpress"
PROBE="/wp-login.php" # any PHP file present in the extracted tree
while true; do
code=$(curl -s -o /dev/null -w "%{http_code}" "${TARGET}${STAGING}${PROBE}")
if [ "$code" = "200" ]; then
echo "staging reachable at $(date -u +%FT%TZ)"
# window is open: race a write or an already-planted artifact
break
fi
sleep 0.2
done
The working exploit class enabled by CVE-2026-119977 builds on that primitive. Because the staging path is both predictable and web-visible during step 2 (archive extraction is not instantaneous; intermediate files are reachable), an attacker with any secondary mechanism for placing content into the staging directory (a plugin upload race, an FTP misconfiguration, an auxiliary bug on the same host) can plant PHP for the webserver to execute. The pure unauthenticated path depends on the extraction ordering of specific files inside the official zip and the ability to coerce the right execution order of core bootstrap files; that is the "working exploit" shape referenced by the KEV entry.
Am I exposed?
Three fast checks against your fleet:
- Is WP_AUTO_UPDATE_CORE enabled? Grep wp-config.php and any mu-plugins that set the constant. If yes, exposure is continuous across the release calendar.
- Can the public reach wp-content/upgrade? From an off-network host, request /wp-content/upgrade/ and /wp-content/upgrade/index.html. If you get anything other than a 403 or a 404 from the webserver (not from WordPress's own 404 handler), the staging directory is inside the served tree.
- Are your webserver logs retained for the upgrade windows? You need to reconstruct who hit wp-content/upgrade/* in the minutes around every core bump.
A minimal nginx hardening rule that blocks the staging tree without interfering with upgrades:
location ~* ^/wp-content/upgrade/ {
deny all;
return 403;
}
The upgrade routine reads staging via filesystem APIs, not HTTP, so blocking HTTP access does not break the update. It does close the window.
Fit with CISA's current directive
CVE-2026-119977 is on KEV, which means federal civilian agencies must treat it under BOD 26-04 (Prioritizing Security Updates Based on Risk), the directive that carries the KEV criteria forward and supersedes BOD 22-01. The published WordPress update that closes the race is the remediation of record. Compensating controls (blocking wp-content/upgrade at the edge, disabling WP_AUTO_UPDATE_CORE until the patched release is pinned, scheduling manual upgrades inside a maintenance window with the admin interface firewalled to known operator IPs) reduce residual risk while the fleet patches.
Takeaways
TOCTOU bugs in upgrade code are a recurring pattern: upgrade code runs with high privilege, touches the document root, and is exercised rarely enough that its invariants drift silently between releases. The lesson from CVE-2026-119977 is not "disable updates." Keep the staging directory outside anything your webserver can reach, ensure the window between extraction and installation is monitored and blocked at the edge, and treat the upgrade path as a privileged execution boundary. Model the attacker as an unauthenticated client who already knows exactly where to look.
Verifiable security.