# CVE-2026-119977: WordPress Core 4.7.0 - 7.1.3 - Unauthenticated Upgrade-Window Staged-Installer Remote Code Execution

The Markdown version of <https://upatch.dev/cve/CVE-2026-119977>. Last updated 25 Nov 2026.

## At a glance

CVE-2026-119977 is rated High 8.1 (CVSS 3.1, CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H). It affects WordPress (WordPress Foundation) and was published on 31 Oct 2026. It is known exploited: CISA added it to its Known Exploited Vulnerabilities catalog on 3 Nov 2026. Its EPSS score is 8.1%: the estimated chance it is exploited in the next 30 days, as of 24 Nov 2026. The upatch `cve-2026-119977-wp-upgrade-block` mitigates it, and is vetted (merged into the registry).

A upatch is a signed BPF program that shirudo loads into a running Linux kernel to block the code path this CVE's exploit takes. It holds the line until the fix ships; it does not replace patching.

## The vulnerability

CVE-2026-119977 affects WordPress Core 4.7.0 through 7.1.3. During a full-package core upgrade (`Core_Upgrader::upgrade` in `src/wp-admin/includes/class-core-upgrader.php`), `WP_Upgrader::unpack_package` (`src/wp-admin/includes/class-wp-upgrader.php`) unpacks the release archive into a predictable directory under `wp-content/upgrade/` named `basename( basename( $package, '.tmp' ), '.zip' )`, such as `wp-content/upgrade/wordpress-7.1.3-no-content/wordpress/`.

Because `wp-content/upgrade/` is inside the web root and the unpacked `wordpress/` tree contains `wp-config-sample.php` and `wp-admin/setup-config.php` but no `wp-config.php`, an unauthenticated client can request `/wp-content/upgrade/<working_dir>/wordpress/wp-admin/setup-config.php?step=2` during the upgrade window. `setup-config.php` sets `ABSPATH` to the staged `wordpress/` directory, connects to the attacker-supplied database host (`$_POST['dbhost']`), and writes a new `wp-config.php` into the staged directory (`fopen( $path_to_wp_config, 'w' )`). In vulnerable versions, `update_core` (`src/wp-admin/includes/update-core.php`) sets `$skip = array( 'wp-content', 'wp-includes/version.php' )` before calling `copy_dir`, so a `wp-config.php` written in the working directory is either loaded by staged scripts or copied over the site's `wp-config.php`.

WordPress 7.1.4 fixes the issue in commit `e7b33f536d308e9656442677edefdcfe1d4fa130` (`b625b2d49c6ad3abfe8ca884e5453966d05790fd` in `WordPress/WordPress`) by adding `WP_Upgrader::get_working_dir_name` to append a 16-character random suffix from `wp_generate_password( 16, false )`, creating `wp-content/upgrade/index.php`, and adding `'wp-config.php'` to `$skip` in `update_core`.

### Official description

WordPress Core is vulnerable to Remote Code Execution in versions 4.7 through 7.1.3. This is due to predictable, web-accessible staging paths used during full-package core upgrades. This makes it possible for unauthenticated attackers to execute code on the server during the upgrade window.

## What the upatch does

Two BPF LSM programs return `-EPERM` to PHP and Apache processes (`comm` matching `php`, `php-*`, `php[0-9]*`, `apache2`, or `httpd`) when targeting a file named `wp-config.php` under `wp-content/upgrade/`:

| Hook               | Refused                                                                                   |
| ------------------ | ----------------------------------------------------------------------------------------- |
| `lsm/inode_create` | Creating `wp-config.php` inside `wp-content/upgrade/` (up to three directory levels deep) |
| `lsm/file_open`    | Opening `wp-config.php` inside `wp-content/upgrade/` (up to three directory levels deep)  |

Each program checks `d_name.len == 13` and `d_name.name == "wp-config.php"` first, returning `0` on all other files before walking `d_parent` or checking the current task's command name. The `lsm/file_open` program also prevents reading or copying a `wp-config.php` planted in `wp-content/upgrade/` before the upatch was loaded.

The `refused` per-CPU array map counts refusals: key 0 (`REFUSED_CREATE`) for `inode_create` and key 1 (`REFUSED_OPEN`) for `file_open`.

The policy: [`cve-2026-119977-wp-upgrade-block.bpf.c`](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-119977), 135 lines of BPF C attached at `lsm/inode_create` and `lsm/file_open`, licensed GPL-2.0 OR BSD-2-Clause.

## Side effects

- Invoking `setup-config.php?step=2` inside `wp-content/upgrade/<working_dir>/wordpress/wp-admin/` fails to write `wp-config.php` and reports `Unable to write to wp-config.php file.`.
- Normal WordPress operation, reading and writing the site's real `wp-config.php` above `wp-content/`, and unpacking and copying core, plugin, and theme upgrades inside `wp-content/upgrade/` keep working because legitimate packages contain `wp-config-sample.php`, never `wp-config.php`.
- Not covered: a PHP runtime whose task `comm` does not start with `php` and is not `apache2` or `httpd`, or a `WP_CONTENT_DIR` whose directory name is not `wp-content`.

## Preemption model and cost

The programs share only the per-CPU `refused` counter, updated with `__sync_fetch_and_add`, and are safe under preemptible RCU, `PREEMPT_LAZY`, and `PREEMPT_RT`. On every file create or open whose name length is not 13, each hook performs one length check and returns.

## Affected versions

WordPress Core:

| Branch     | Affected        | Fixed in         |
| ---------- | --------------- | ---------------- |
| 7.1        | 7.1.0 to 7.1.3  | 7.1.4            |
| 7.0        | 7.0.0 to 7.0.7  | 7.0.8            |
| 6.9        | 6.9.0 to 6.9.10 | 6.9.11           |
| 4.7 to 6.8 | 4.7.0 to 6.8.11 | 4.7.39 to 6.8.12 |

## How it was tested

On WordPress 7.1.3 with a staged core upgrade in wp-content/upgrade/, the loaded upatch refused creating wp-config.php via the staged setup-config.php endpoint while leaving normal WordPress operation intact.

- **Tested:** 25 Nov 2026
- **Target:** WordPress 7.1.3 on PHP CLI built-in web server, loopback only
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64
- **Machine:** shirudo test VM
- **Distribution:** Ubuntu 26.04

### Results

| State           | Staged setup-config.php writes wp-config.php in wp-content/upgrade/ |
| --------------- | ------------------------------------------------------------------- |
| Before loading  | reached (wrote wp-config.php, HTTP 200)                             |
| Upatch loaded   | blocked (could not create wp-config.php)                            |
| After unloading | reached (wrote wp-config.php, HTTP 200)                             |

## How to apply

Build the upatch from source, sign it with your own shirudo key, and publish it to your own OCI registry. Machines that follow your upatch tree load it within about a minute.

Build and sign:

```sh
git clone https://github.com/copper-helm/upatch-registry
cd upatch-registry
tools/build <shirudo-checkout> <keys-dir> 1.0.0 upatches/cve-2026-119977
```

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-119977-1.0.0.bee oci://<registry>/<namespace>/cve-2026-119977 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-119977-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>
```

## Review

- Contributors: romanlab.
- Reviewers: none recorded yet.

## Sources and links

- [CVE-2026-119977 record (CVE API)](https://cveawg.mitre.org/api/cve/CVE-2026-119977)
- [WordPress 7.1.4 release announcement](https://wordpress.org/news/2026/10/wordpress-7-1-4/)
- [Wordfence threat intelligence advisory](https://www.wordfence.com/threat-intel/vulnerabilities/id/4b4da0cf-d9f4-47c4-a0e8-6c4dc5a6f250?source=cve)
- [WordPress/wordpress-develop fix commit e7b33f536d30](https://github.com/WordPress/wordpress-develop/commit/e7b33f536d308e9656442677edefdcfe1d4fa130)
- [WordPress/WordPress fix commit b625b2d49c6a](https://github.com/WordPress/WordPress/commit/b625b2d49c6ad3abfe8ca884e5453966d05790fd)

### Links

- [CVE-2026-119977 on upatch.dev](https://upatch.dev/cve/CVE-2026-119977) (this page, as HTML)
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-119977)
- [CVE.org](https://www.cve.org/CVERecord?id=CVE-2026-119977)
- [CWE-367](https://cwe.mitre.org/data/definitions/367.html)
- Upatch source: [upatches/cve-2026-119977](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-119977)

### More references from NVD (10)

- [core.trac.wordpress.org](https://core.trac.wordpress.org/browser/tags/7.1.4/src/wp-admin/includes/class-wp-upgrader.php#L346) (Patch)
- [core.trac.wordpress.org](https://core.trac.wordpress.org/browser/tags/7.1.4/src/wp-admin/includes/update-core.php#L1545) (Patch)
- [core.trac.wordpress.org](https://core.trac.wordpress.org/browser/tags/7.1.3/src/wp-admin/includes/class-core-upgrader.php#L162) (Product)
- [core.trac.wordpress.org](https://core.trac.wordpress.org/browser/tags/7.1.3/src/wp-admin/includes/class-wp-upgrader.php#L378) (Product)
- [core.trac.wordpress.org](https://core.trac.wordpress.org/browser/tags/7.1.3/src/wp-admin/includes/update-core.php#L1549) (Product)
- [core.trac.wordpress.org](https://core.trac.wordpress.org/browser/tags/7.1.3/src/wp-admin/setup-config.php#L282) (Product)
- [wordpress.org](https://wordpress.org/news/2026/10/wordpress-7-1-4/) (Release Notes)
- [wordfence.com](https://www.wordfence.com/threat-intel/vulnerabilities/id/4b4da0cf-d9f4-47c4-a0e8-6c4dc5a6f250?source=cve) (Third Party Advisory)
- [cisa.gov](https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2026-119977) (US Government Resource)
- [wordfence.com](https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-core/wordpress-core-470-713-unauthenticated-upgrade-window-staged-installer-remote-code-execution) (Third Party Advisory)
