# CVE-2026-9860: Offload, AI & Optimize with Cloudflare Images <= 1.10.2 - Authenticated (Author+) Remote Code Execution via 'api-key' / 'account-id' Parameters in cf_images_do_setup AJAX Action

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

## At a glance

CVE-2026-9860 is rated High 8.8 (CVSS 3.1, CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H). It affects Offload, AI & Optimize with Cloudflare I… (vanyukov) and was published on 18 Jun 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 0.6%: the estimated chance it is exploited in the next 30 days, as of 24 Nov 2026. The upatch `cve-2026-9860-wp-config-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-9860, published on 18 June 2026, is an authenticated (Author+) remote code execution vulnerability in the Offload, AI & Optimize with Cloudflare Images (`cf-images`) plugin for WordPress in versions up to and including 1.10.2. In `CF_Images\App\Settings::ajax_do_setup()` (registered for the `wp_ajax_cf_images_do_setup` action), versions up to 1.10.1 call `check_ajax_request()` in `CF_Images\App\Traits\Ajax`, which verifies the `cf-images-nonce` nonce and checks only `current_user_can( 'upload_files' )` rather than `manage_options`. Because `CF_Images\App\Media::enqueue_scripts()` localizes `cf-images-nonce` in the `CFImages` JavaScript object on `wp-admin/upload.php`, any Author-level or higher user can obtain the nonce and call `cf_images_do_setup`. In versions up to and including 1.10.2, `ajax_do_setup()` reads `$_POST['data']['account-id']` and `$_POST['data']['api-key']` via `filter_input( INPUT_POST, 'data', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY )` (bypassing `wp_magic_quotes()`) and passes them through `sanitize_text_field()`, which does not strip single quotes, to `write_config()`. `write_config()` formats `define( '$name', '$value' );` and calls `write()`, which opens `ABSPATH . 'wp-config.php'` with `fopen( $wp_config_path, 'w' )` and writes the unescaped string, allowing single quotes in `account-id` or `api-key` to break out of the single-quoted string literal and inject arbitrary PHP code into `wp-config.php`. Version 1.10.2 added a `current_user_can( 'manage_options' )` check to `ajax_do_setup()`, and version 1.10.3 (changeset 3564001) restricted `account-id` and `api-key` to `/^[A-Za-z0-9_\-]+$/` and escaped backslashes and single quotes in `write_config()`.

### Official description

The Offload, AI & Optimize with Cloudflare Images plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1.10.2 via the 'account-id' parameter parameter. This is due to insufficient privilege enforcement on the cf_images_do_setup AJAX handler, which requires only the upload_files capability (Author+) rather than manage_options before writing to wp-config.php, combined with the absence of single-quote escaping — sanitize_text_field() does not strip single quotes, and filter_input(INPUT_POST) bypasses wp_magic_quotes() slashing — allowing a single quote in the account-id or api-key parameter to break out of the single-quoted PHP string literal in the write_config() define() statement. This makes it possible for authenticated attackers, with author-level access and above, to execute code on the server. This is possible because the 'cf-images-nonce' nonce required by the AJAX handler is exposed to all Author-level and above users on wp-admin/upload.php via the CFImages JavaScript object, meaning any upload-capable user can satisfy the nonce check and reach the vulnerable wp-config.php write path.

## What the upatch does

One BPF LSM program attaches to `lsm/file_open` and returns `-EPERM` when all of the following hold:

| Check     | Condition                                                                                    |
| --------- | -------------------------------------------------------------------------------------------- |
| Open mode | `file->f_mode & FMODE_WRITE` is non-zero                                                     |
| File name | `file->f_path.dentry` has length 13 and name `wp-config.php`                                 |
| Process   | The current task's `comm` or `mm->exe_file` basename starts with `php`, `apache`, or `httpd` |

Reads of `wp-config.php` (`FMODE_WRITE` clear) pass after the first bit test. Writes to any file whose name is not 13 bytes long pass after reading `d_name.len`. Refusals are counted in the `refused` per-CPU array map at key 0.

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

## Side effects

- WordPress plugins and core code running under PHP or Apache (`php*`, `apache*`, `httpd*`) cannot open `wp-config.php` for writing. In `cf-images`, initial setup and disconnect operations that write or remove `CF_IMAGES_ACCOUNT_ID` and `CF_IMAGES_KEY_TOKEN` defines in `wp-config.php` fail to modify the file unless compatibility mode (`compat`, which stores credentials in database site options instead of `wp-config.php`) is used.
- Normal WordPress page loads, media uploads, database option updates, and reading `wp-config.php` are unaffected.
- Administrators editing `wp-config.php` over SSH with editors or shell utilities (`vim`, `nano`, `sed`, `cp`, `mv`) are unaffected because their executable and command names do not match `php*`, `apache*`, or `httpd*`.

## Preemption model and cost

The program keeps no shared state beyond the per-CPU `refused` counter, which is updated with `__sync_fetch_and_add`, making it safe under all preemption models including preemptible RCU, `PREEMPT_LAZY`, and `PREEMPT_RT`. On read opens (`!(file->f_mode & FMODE_WRITE)`), the program returns immediately after one field check; on write opens, it checks `d_name.len == 13` before reading the file name or inspecting the current task.

## Affected versions

The vulnerability is in the WordPress plugin `cf-images` up to and including version 1.10.2, and is fixed in version 1.10.3. The upatch uses `SEC("lsm/file_open")` with CO-RE reads of `struct file`, `struct dentry`, and `struct task_struct`, which are present on all Linux kernels supported by shirudo with BPF LSM enabled.

## How it was tested

On a vulnerable Offload, AI & Optimize with Cloudflare Images (cf-images) 1.10.1 setup, the loaded upatch refused PHP's write open of wp-config.php in cf_images_do_setup (HTTP 500, file unchanged).

- **Tested:** 25 Nov 2026
- **Target:** Offload, AI & Optimize with Cloudflare Images (cf-images) 1.10.1 on PHP, loopback only
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64

### Results

| State           | cf_images_do_setup writes wp-config.php |
| --------------- | --------------------------------------- |
| Before loading  | yes (reached)                           |
| Upatch loaded   | no (blocked, HTTP 500)                  |
| After unloading | yes (reached)                           |

## 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-9860
```

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-9860-1.0.0.bee oci://<registry>/<namespace>/cve-2026-9860 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-9860-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-9860 record (CVE API)](https://cveawg.mitre.org/api/cve/CVE-2026-9860)
- [Wordfence vulnerability advisory](https://www.wordfence.com/threat-intel/vulnerabilities/id/a772041e-015e-48e8-9fab-79f1fcdb265c?source=cve)
- [WordPress Trac: `app/class-settings.php` in 1.10.1](https://plugins.trac.wordpress.org/browser/cf-images/tags/1.10.1/app/class-settings.php#L75)
- [WordPress Trac: `app/traits/trait-ajax.php` in 1.10.1](https://plugins.trac.wordpress.org/browser/cf-images/tags/1.10.1/app/traits/trait-ajax.php#L36)
- [WordPress Trac: `app/class-media.php` in 1.10.1](https://plugins.trac.wordpress.org/browser/cf-images/tags/1.10.1/app/class-media.php#L94)
- [WordPress Trac fix changeset 3564001](https://plugins.trac.wordpress.org/changeset?sfp_email=\&sfph_mail=\&reponame=\&old=3564001%40cf-images\&new=3564001%40cf-images\&sfp_email=\&sfph_mail=)

### Links

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

### More references from NVD (6)

- [plugins.trac.wordpress.org](https://plugins.trac.wordpress.org/browser/cf-images/tags/1.10.1/app/class-media.php#L94)
- [plugins.trac.wordpress.org](https://plugins.trac.wordpress.org/browser/cf-images/tags/1.10.1/app/class-settings.php#L123)
- [plugins.trac.wordpress.org](https://plugins.trac.wordpress.org/browser/cf-images/tags/1.10.1/app/class-settings.php#L75)
- [plugins.trac.wordpress.org](https://plugins.trac.wordpress.org/browser/cf-images/tags/1.10.1/app/traits/trait-ajax.php#L36)
- [plugins.trac.wordpress.org](https://plugins.trac.wordpress.org/changeset?sfp_email=\&sfph_mail=\&reponame=\&old=3564001%40cf-images\&new=3564001%40cf-images\&sfp_email=\&sfph_mail=)
- [wordfence.com](https://www.wordfence.com/threat-intel/vulnerabilities/id/a772041e-015e-48e8-9fab-79f1fcdb265c?source=cve)
