All ArticlesSecurity2026-11-14T17:49:13+08:00

WordPress Update Finished but Strange Files in wp-content/upgrade? Check for CVE-2026-119977 Exploitation

Your WordPress update completed successfully but you notice unexpected files or new admin accounts you didn't create, possibly from the TOCTOU race condition in CVE-2026-119977. After reading, you will know how to inspect wp-content/upgrade/, temp directories, and access logs to confirm or rule out exploitation during the upgrade window.

Your WordPress update completed without errors. Dashboard says you are on the latest version. Everything looks normal, except wp-content/upgrade/ still has files in it that you did not put there, or worse, there is a new administrator account in your user list that nobody created. Before assuming leftover update debris, check whether your site was targeted during the upgrade window by CVE-2026-119977.

This vulnerability (CVSS 8.1) is a Time-of-Check to Time-of-Use (TOCTOU) race condition in how WordPress handles full-package core updates. It affects WordPress Core versions 4.7 through 7.1.3 and was patched in 7.1.4. CISA added it to the Known Exploited Vulnerabilities (KEV) catalog due to active exploitation in the wild. The short version: during the brief window when WordPress unpacks and processes update files, an unauthenticated attacker can probe predictable paths and interact with temporary installer scripts like setup-config.php to execute arbitrary code or plant a modified wp-config.php.

The diagnostic walkthrough below helps you confirm or rule out exploitation.

What should and should not be in wp-content/upgrade/

WordPress uses wp-content/upgrade/ as a staging directory during core updates. Normally, after a successful update, this directory is either empty or contains only a .maintenance file that gets cleaned up. Some hosting environments or update interruptions leave behind a directory named after the version (like wordpress-7.1.4/), which is benign leftover packaging.

What is not normal:

  • PHP files with names unrelated to WordPress core (random strings, encoded names, or files like cache.php, db-check.php, x.php)
  • A modified setup-config.php or wp-config.php sitting inside the upgrade directory
  • Files with ownership or permissions that differ from your normal WordPress files
  • Files with modification timestamps that fall outside the window when you actually ran the update

Start by listing everything in that directory with timestamps:

ls -la wp-content/upgrade/
find wp-content/upgrade/ -type f -printf '%T+ %p\
' | sort

Compare those timestamps against when you actually triggered the update. If you updated at 14:00 UTC and there are files created at 14:02 UTC with names you do not recognize, that warrants investigation.

Check access logs for probing during the upgrade window

The exploit works by hitting predictable temporary paths while the update is in progress. Attackers do not need authentication. They send automated requests to paths like /wp-content/upgrade/wordpress-*/wp-admin/setup-config.php hoping to catch the brief window when those files exist and are accessible.

Security telemetry recorded tens of thousands of automated probing requests after disclosure. Your server likely received some of these. The question is whether any arrived during an actual upgrade.

Grep your access log for requests to the upgrade directory. The exact log path depends on your web server and hosting setup, but common locations are /var/log/apache2/access.log, /var/log/nginx/access.log, or domain-specific logs under your hosting panel.

grep 'wp-content/upgrade' /var/log/apache2/access.log | head -50

Sample output format:

203.0.113.45 - - [28/Oct/2026:14:01:33 +0000] "GET /wp-content/upgrade/wordpress-714/wp-admin/setup-config.php HTTP/1.1" 200 4832
198.51.100.12 - - [28/Oct/2026:14:01:34 +0000] "POST /wp-content/upgrade/wordpress-714/wp-admin/setup-config.php HTTP/1.1" 200 312

What matters here:

  • HTTP 200 responses to requests for files inside the upgrade directory, especially setup-config.php or any PHP file. A 404 means the file was not there when the request arrived (attacker missed the window). A 200 means the file was served.
  • POST requests are more concerning than GET. A POST to setup-config.php suggests the attacker attempted to submit configuration data.
  • Timing overlap with your actual update. Probes that arrived hours before or after your update are harmless noise. Probes that arrived during the 10-to-60-second update window with 200 responses need immediate attention.

If your logs rotated, check compressed archives (access.log.1.gz, etc.) for the date range around your last update.

Look for rogue admin accounts

Successful exploitation can result in new administrative user accounts. Check your WordPress user table directly in the database rather than trusting the dashboard, since a compromised site might hide accounts from the admin UI.

wp user list --role=administrator --fields=ID,user_login,user_registered --allow-root

Or query MySQL directly:

mysql -u root -p -e "SELECT ID, user_login, user_registered FROM wp_users WHERE ID IN (SELECT user_id FROM wp_usermeta WHERE meta_key = 'wp_capabilities' AND meta_value LIKE '%administrator%');" your_database_name

Note: the table prefix (wp_) may differ on your installation. Adjust accordingly.

Any administrator account you do not recognize, especially one registered around the time of your last update, is a strong indicator of compromise. Pay attention to accounts with generic-sounding names or names that mimic legitimate plugins.

Verify wp-config.php integrity

The TOCTOU exploit can plant a modified wp-config.php. Compare your current file against a known-good backup or check for suspicious additions:

  • Extra require, include, or eval statements you did not add
  • Database credentials pointing to an external host
  • Modified authentication keys and salts (compare against your backup)
  • Added lines at the very top or bottom of the file, before <?php or after the closing logic

If you have a file integrity monitoring tool or a recent backup, diff the two versions. If you do not have a backup to compare against, review the file manually and look for anything that does not match standard WordPress wp-config.php structure.

For deeper background on rotating secrets in wp-config.php after a potential TOCTOU exposure, see Rotate Secrets in wp-config.php After a TOCTOU CVE Window.

Eliminate the red herrings

Not every leftover file in wp-content/upgrade/ means compromise. Common false positives:

  • Interrupted updates: if the update process was killed (server timeout, PHP memory limit, manual browser close), WordPress may leave behind a partial extraction. These files will have standard WordPress core filenames and correct ownership.
  • Plugin or theme updaters: some plugins use wp-content/upgrade/ as a temporary workspace. Check whether the files belong to a known plugin.
  • Caching plugins: certain caching or optimization plugins create files in unexpected locations. Cross-reference filenames with your installed plugins.

The distinguishing factor is always the combination of: unexpected filenames, timestamps matching the update window, and corresponding 200-status log entries from external IPs hitting upgrade paths.

Confirming exploitation and next steps

If your investigation shows:

  1. HTTP 200 responses to POST requests against temporary installer scripts during your update window
  2. Unrecognized admin accounts created around that time
  3. Modified wp-config.php or unknown PHP files in wp-content/upgrade/

Then treat the site as compromised. Patching to WordPress 7.1.4 or later closes the vulnerability for future updates but does not undo damage already done. You need to:

  • Remove rogue admin accounts immediately
  • Restore wp-config.php from a known-good backup and regenerate all authentication keys and salts
  • Delete all unexpected files from wp-content/upgrade/ and scan the rest of the installation for backdoors (check wp-content/uploads/ and theme directories as well, since attackers often drop secondary webshells)
  • Review your full wp-content/ directory for planted malware. Reinstalling WordPress core alone does not clean files in wp-content/ — for more on that pattern, see Reinstalled WordPress Core After a Hack, but the Malware Is Still in wp-content
  • Change all database passwords
  • Check server-level access (SSH keys, cron jobs) if the attacker achieved code execution

If your investigation shows only 404 responses to upgrade-path probes, no unexpected users, and a clean wp-config.php, you were probed but not exploited. Update to 7.1.4 or later to ensure the window cannot be exploited on future updates.

The core lesson: a successful WordPress update does not mean a safe one. The update process itself was the attack surface. Checking the result of the update is not enough — you need to check what happened during it.