# CVE-2026-87791: Path traversal vulnerability in WordPress theme design-scuole-wordpress-theme

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

## At a glance

CVE-2026-87791 is rated High 8.7 (CVSS 4.0, CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X). It affects Design Scuole WordPress theme (Developers Italia) and was published on 15 Sept 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 0.5%: the estimated chance it is exploited in the next 30 days, as of 25 Nov 2026. The upatch `cve-2026-87791-reserved-file-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-87791, "Path traversal vulnerability in WordPress theme design-scuole-wordpress-theme", was published on 15 September 2026. In `functions.php` of the Developers Italia `design-scuole-wordpress-theme` WordPress theme from version 2.6.0 through 2.18.1, the `init` hook runs `reserved_file_check()`. When `$_GET['action'] == "reservedfilecheck"`, `reserved_file_check()` concatenates `wp_get_upload_dir()['basedir'] . '/' . $_GET['file']` into `$filepath` without resolving or validating the path against the upload directory. When `attachment_url_to_postid()` returns `0` (as it does for any path outside registered media attachments) and `file_exists($filepath)` is true, the function sends the file contents with `readfile($filepath)` and exits, allowing an unauthenticated remote client to download arbitrary files readable by the web server process, such as `wp-config.php`. Commit `c34d83968f5f070ca7e7fc4664db603357d53899` (released in v2.18.2 on 30 May 2026, with further download handler updates in v2.18.3) fixes the flaw by resolving `$basedir` and `$filepath` with `realpath()` and verifying with `strncmp()` that `$realpath` starts with `$realbasedir . DIRECTORY_SEPARATOR`.

### Official description

A path traversal vulnerability exists in the reserved_file_check function of the functions.php file in the WordPress Design Scuole Italia theme. The vulnerability allows an unauthenticated attacker to download arbitrary files accessible by the web server process.

## What the upatch does

It attaches to `cgroup_skb/ingress` at the root of the unified cgroup hierarchy and inspects incoming IPv4 and IPv6 TCP segments carrying an HTTP `GET`, `POST`, or `HEAD` request line. It loads up to the first 512 bytes of the TCP payload into a per-CPU scratch buffer and scans the HTTP request line (up to the first CR or LF byte, `0x0d` or `0x0a`) case-insensitively for the 17-byte token `reservedfilecheck`. When the request line contains `reservedfilecheck`, the program increments key 0 of the `refused` per-CPU counter map and returns `0` to drop the packet before the socket receives it. All other packets return `1`.

The policy: [`cve-2026-87791-reserved-file-block.bpf.c`](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-87791), 165 lines of BPF C attached at `cgroup_skb/ingress`, licensed GPL-2.0 OR BSD-2-Clause.

## Side effects

- Plain-text HTTP requests whose request line contains `reservedfilecheck` (such as `GET /?action=reservedfilecheck&file=...`) are dropped at `cgroup_skb/ingress`, so the client connection times out without reaching `reserved_file_check()`.
- Normal WordPress page views, REST API requests, media downloads, and administrative requests that do not carry `reservedfilecheck` in the request line pass unchanged.
- Not covered: TLS-terminated traffic that reaches the machine encrypted and is decrypted in userspace without forwarding over a local plain-text TCP socket, URL-encoded `action` parameter values (such as `%72eservedfilecheck`), or a request line split across multiple TCP segments or placing `reservedfilecheck` beyond the first 512 bytes of the TCP payload.

## Preemption model and cost

`cgroup_skb/ingress` runs in softirq context with BH disabled on the local CPU, so two runs of the program cannot interleave on the same CPU while accessing the `scratch` per-CPU buffer, and the `refused` per-CPU counter is updated with `__sync_fetch_and_add`. The program is safe under every kernel preemption model, including `PREEMPT_LAZY`, `PREEMPT_DYNAMIC`, and `PREEMPT_RT`. Non-TCP packets, TCP segments with fewer than 24 payload bytes, and TCP segments that do not start with `GET `, `POST `, or `HEAD `return after reading only the protocol headers and the first 8 payload bytes.

## Affected versions

Application versions: Developers Italia `design-scuole-wordpress-theme` from 2.6.0 through 2.18.1, fixed in 2.18.2 (commit `c34d83968f5f070ca7e7fc4664db603357d53899`) and 2.18.3.

Kernels: any Linux kernel supported by shirudo with `CONFIG_CGROUP_BPF` and cgroup v2 mounted at `/sys/fs/cgroup`.

## How it was tested

On WordPress 6.7.2 running design-scuole-wordpress-theme v2.18.1, the loaded upatch dropped the reservedfilecheck traversal request while normal WordPress requests continued to succeed.

- **Tested:** 25 Nov 2026
- **Target:** WordPress 6.7.2 with design-scuole-wordpress-theme v2.18.1 on PHP built-in server, loopback only
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64
- **Distribution:** Ubuntu 26.04

### Results

| State           | reservedfilecheck traversal reads probe file outside uploads | Normal WordPress request |
| --------------- | ------------------------------------------------------------ | ------------------------ |
| Before loading  | yes (HTTP 200)                                               | 200                      |
| Upatch loaded   | no (blocked)                                                 | 200                      |
| After unloading | yes (HTTP 200)                                               | 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-87791
```

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-87791-1.0.0.bee oci://<registry>/<namespace>/cve-2026-87791 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-87791-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-87791 record (CVE API)](https://cveawg.mitre.org/api/cve/CVE-2026-87791)
- [ACN / CSIRT Italia advisory](https://www.acn.gov.it/portale/w/rilevate-vulnerabilita-nel-tema-wordpress-design-scuole-italia-)
- [Fix commit c34d83968f5f](https://github.com/italia/design-scuole-wordpress-theme/commit/c34d83968f5f070ca7e7fc4664db603357d53899)
- [design-scuole-wordpress-theme repository](https://github.com/italia/design-scuole-wordpress-theme)
- [Release v2.18.1](https://github.com/italia/design-scuole-wordpress-theme/releases/tag/v2.18.1)
- [Release v2.18.2](https://github.com/italia/design-scuole-wordpress-theme/releases/tag/v2.18.2)
- [Release v2.18.3](https://github.com/italia/design-scuole-wordpress-theme/releases/tag/v2.18.3)

### Links

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

### More references from NVD (2)

- [github.com](https://github.com/italia/design-scuole-wordpress-theme)
- [acn.gov.it](https://www.acn.gov.it/portale/w/rilevate-vulnerabilita-nel-tema-wordpress-design-scuole-italia-)
