Skip to content

09 Security CVE 2026 119977

Mikhail Deynekin edited this page Nov 6, 2026 · 1 revision

Security advisory: CVE-2026-119977

A race condition in the WordPress core update mechanism lets an unauthenticated attacker execute arbitrary code on a site while that site is updating. It is exploited in the wild, and Bash WP-CLI Update 8.1.0 exists in part to make the exposure measurable and the upgrade directory unreachable while you fix it.

Summary

Item Detail
Identifier CVE-2026-119977
Component WordPress core, the update mechanism
Class Race condition leading to arbitrary code execution
Attack vector Unauthenticated, remote, during an update of the site
Severity CVSS 8.1 (high)
Exploitation In the wild; added to the CISA KEV catalogue on 2026-11-03; mass scanning observed
Affected core 4.7 through 7.1.3 inclusive
Fixed core 7.1.4 (recommended), 7.0.8 on 7.0, 6.9.11 on 6.9, 4.7.39 on 4.7
Unsupported 4.6 and older: no fix, upgrade to 7.1.4 or retire the site
Tool support 8.1.0: --security, --harden, --harden-upgrade-dir, HARDEN_UPGRADE_DIR, CVE column in --health

What happened

The WordPress core updater stages files in wp-content/upgrade/ and moves them into place from there. That directory is reachable over the web, and the sequence that fills and empties it is not atomic: for a moment the staging directory holds files that the site will execute, while the code that performs the move is still running.

A race condition in that sequence is the defect. An attacker who reaches the staging directory during the window can have code executed by the site, without an account and without any interaction from the administrator. The site has to be updating at that moment, which is exactly what a maintenance window, an automatic background update and the days after a WordPress security release are full of. Because the trigger is a request rather than a login, the attacker does not need to know anything about the site beyond its address.

This is why the advisory asks for two things at once: update, and deny web access to wp-content/upgrade/ in the meantime. A site is exposed while its core version is below the fixed release, whether or not anybody has noticed the updater running.

Severity and exploitation status

  • CVSS 8.1 (high). The defect needs no credentials and no interaction from an administrator; the only precondition is that the site be updating. That is a timing condition, not a permission, and timing conditions are what an attacker automates.
  • In CISA KEV since 2026-11-03. The catalogue lists vulnerabilities that are exploited in the wild, so the entry is a statement about attacks that happened, not about a theoretical weakness — and it carries a remediation expectation rather than a notice.
  • Mass scanning observed. Scanning is the reconnaissance step before an attempt: a host whose logs show probes for wp-content/upgrade/ has been looked at, and the answer to "was anyone here before us" is worth recording.

Affected versions

Every WordPress core release from 4.7 through 7.1.3 inclusive is affected. That is the whole 4.7, 4.8, 4.9, 5.x, 6.x and 7.x range up to and including 7.1.3, across every branch: a site is not protected by running an older, "stable" branch.

Fixed versions, and the branches that get nothing

Branch Fixed release
7.1 7.1.4 (recommended: the current release and the shortest path out)
7.0 7.0.8
6.9 6.9.11
4.7 4.7.39
4.6 and older none: no fix is being issued

4.6 and older will not be fixed. A site on one of those releases has to be upgraded to 7.1.4 or taken out of service; there is no patch to wait for.

The tool records exactly the fixed releases above and compares each site against the one for its branch. A branch that is not in that table, or a version below 7.1.4 whose branch has no recorded fix, is reported as needing an upgrade rather than assumed safe. A false "safe" is the expensive error here, so the tool does not make it: if it cannot vouch for a version, it says so and exits non-zero.

What to do now

  1. Assess with the tool, read-only. Run --security and read the verdict per site. It reads the core version, compares it with the fixed releases, needs no lock and no backup, and exits 1 when at least one site is exposed or its version cannot be read. If you have no tooling at hand, at minimum check each site under Dashboard, Updates: do not rely on automatic updates, which may be disabled, may be failing on file permissions, or may be overridden by a plugin.

  2. Back up before changing anything. --backup db dumps each database in the same run; for a site with a large or fragile tree use --backup full once, or take a host-level snapshot. A failed backup stops the site instead of updating it unprotected, which is the behaviour you want here.

  3. Update core to the fixed release. 7.1.4 for a 7.1 site, or the fixed release of the branch the site actually runs: 7.0.8, 6.9.11 or 4.7.39. A site on 4.6 or older has to move to 7.1.4. Do the plugins and themes in the same pass: a stale plugin is its own incident, and a core-only run leaves them behind.

  4. Verify that the version really moved. Run --security again and require exit 0. The number in the report is the version WP-CLI reported after the update, not the one it intended to install; a site whose update silently did nothing is still exposed and the tool keeps naming it.

  5. Update plugins and themes. --full covers core, plugins, themes, the database schema and cron in one pass; if you ran --core, run --plugins and --themes separately.

  6. Harden the upgrade directory. --harden appends a marker-guarded block to each site's root .htaccess, which Apache and LiteSpeed read. It copies an existing .htaccess once to .htaccess.wp-cli-update.bak and is idempotent, so running it twice is harmless. --harden-upgrade-dir does the same during any writing mode, and HARDEN_UPGRADE_DIR=1 does it from the configuration file.

  7. nginx owners: add the directive. nginx never reads .htaccess, so the block above does nothing on an nginx host. Add this to every server block and reload nginx:

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

    The tool prints the directive at the end of a hardening run; it does not edit nginx configuration.

  8. Look inside wp-content/upgrade/. Check every site that may have been exposed for stray .php files. A file there that the site owner did not put there is an incident, not a cleanup task: preserve it, treat the host as compromised, and follow your incident process before you delete anything.

If a third party maintains the site, send them this URL and the verdict for their site rather than a summary of it.

Fleet commands

Assess, update, verify. The assessment is read-only, the update dumps each database first and hardens in the same pass, and the second assessment is the proof.

wp-cli-update --security --json-lines                  # read-only assessment, exit 1 when a site needs an update
wp-cli-update --full -j 4 --backup db --harden-upgrade-dir --report /var/log/wp-cli-update/cve-run.json
wp-cli-update --security --json-lines                  # verify the versions really moved

One site, dry run first, is the rehearsal that costs nothing:

wp-cli-update --full --site /var/www/example.com --backup db --dry-run --harden-upgrade-dir

--security --json-lines emits one {"type":"security",...} object per site with site, core, cve, status (safe, needs-update or unknown) and, when a site needs an update, the fix release to reach. The command exits 1 when any site needs an update or its version cannot be read, so it works as a pipeline gate and as a monitoring probe. The --health table carries the same verdict as a column (safe, UPDATE, ?) and still exits 0.

Agent prompt

Hand this to an AI agent that operates the host. It is deliberately narrow: assess, back up, update, verify, harden, report evidence — and do not declare a site patched without the tool's verdict.

You are responding to WordPress CVE-2026-119977: a race condition in the WordPress core
update mechanism, exploitable without authentication while a site updates, CVSS 8.1, in
CISA KEV since 2026-11-03. Affected: core 4.7 through 7.1.3. Fixed: 7.1.4 (recommended),
7.0.8 on the 7.0 branch, 6.9.11 on the 6.9 branch, 4.7.39 on the 4.7 branch. 4.6 and older
have no fix.

Use Bash WP-CLI Update (wp-cli-update) for every step. Do not improvise with ad-hoc wp
calls, and do not call a site patched without the tool's verdict.

1. Assess, read-only: wp-cli-update --security --json-lines
   Record each site's core version and status. Treat "unknown" as exposed.
2. Confirm that a database backup is configured, and that the target filesystem has free
   space. Never start a mutating run without one.
3. Rehearse on one site: wp-cli-update --full --site <SITE> --backup db --dry-run
   --harden-upgrade-dir, then run the same command without --dry-run.
4. Update the fleet: wp-cli-update --full -j 4 --backup db --harden-upgrade-dir
   --report <REPORT PATH>
5. Verify: wp-cli-update --security --json-lines must exit 0, and the core version of every
   updated site must have changed. If a site is still below the fixed release, the run log
   says another core update is required; report that site, do not hide it.
6. Harden: the run above already applied the .htaccess deny block to every site it touched.
   For a site that was skipped, or to harden without an update, run
   wp-cli-update --harden --site <SITE>. It is idempotent and copies the original .htaccess
   to .htaccess.wp-cli-update.bak before the first change.
7. On nginx hosts, add "location ^~ /wp-content/upgrade/ { deny all; }" to every server
   block and reload nginx. .htaccess does nothing on nginx, and the tool does not edit nginx
   configuration.
8. Check <SITE>/wp-content/upgrade/ for stray .php files. If you find one, stop, preserve it,
   and treat the host as compromised.
9. Report: before and after core versions per site, the exit code of both --security runs,
   the sites that still need an update and why, the .htaccess backup paths, the nginx change
   you made, and anything you could not verify — stated as unverified, not assumed.

Verification

A run is only finished when all of these hold:

  • wp-cli-update --security --json-lines exits 0. That is the tool's own statement that every site it examined is at or above the fixed release for its branch.
  • Every updated site's core version in that output is the fixed release, not the version it had before. Keep both runs; the diff is the evidence.
  • wp-cli-update --health shows safe in the CVE column for every site, with nothing pending for a site that reported OK.
  • The report file from the update run (--report) holds a .changes entry for core on each site that moved, and no site is in .sites with status FAILED.
  • Each hardened site has .htaccess.wp-cli-update.bak next to its .htaccess if it had one before, and the marker block appears once.
  • nginx hosts answer a request for /wp-content/upgrade/ with 403, not 200 and not 404 from the application.

What the tool cannot do

  • It does not edit nginx configuration. The directive is printed; adding it to every server block is the operator's job, by hand or by an agent. A hardened Apache site on a host that also serves nginx is hardened only where .htaccess is read.
  • It does not patch WordPress for you. --security reports, --harden blocks one directory; the fix itself is the core update, and only WordPress ships that.
  • It does not hide a site that stays below the fixed release. A failed core update, a pinned version or a manual copy leaves the site exposed, and the tool says so: the run log names another required update, --health keeps its column at UPDATE, and --security keeps exiting 1. That is deliberate — a green report over an exposed site is worse than a red one.
  • It cannot vouch for a version it does not know. Only the fixed releases listed above are recorded. Any other branch below 7.1.4 is reported as needing an upgrade rather than assumed safe.
  • It does not clean up after a compromise. Finding a stray file under wp-content/upgrade/ is an incident; the tool reports states, it does not perform forensics.

Defence in depth, not a substitute

The .htaccess block and the nginx location close wp-content/upgrade/ over HTTP. That removes the easiest way to reach the staging directory during the update window, and it is worth having: it costs one file per site, it is reversible from the copy the tool keeps, and it stays right if a future update reopens a similar window.

It is not the fix. An attacker who can write into the upgrade directory by another route, or who reaches the site while a plugin performs a similar staging step, is not stopped by a rule that denies one path. The fix is the core update to the fixed release — 7.1.4, or the fixed release of your branch — and the hardening exists to protect the minutes before that update lands and the sites you cannot update tonight.

Update first. Harden while you wait.

Clone this wiki locally