# CVE-2026-78088: Contest Gallery <= 32.0.1 - Unauthenticated Arbitrary File Upload  via 'baseUrlForFacebook' Parameter

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

## At a glance

CVE-2026-78088 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 Contest Gallery (contest-gallery) and was published on 16 Sept 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 0.8%: the estimated chance it is exploited in the next 30 days, as of 24 Nov 2026. The upatch `cve-2026-78088-fb-like-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-78088, published on 16 September 2026, affects the Contest Gallery – Upload & Vote Photos, Media, Sell with PayPal & Stripe plugin for WordPress in all versions up to and including 32.0.1. In `v10/v10-admin/gallery/change-gallery/1_content-fb-like.php`, the plugin reads `$_POST['fbcontent'][$imageId]['baseUrlForFacebook']` without validating the file path, opens any existing file at that path for reading, replaces `<title>`, `<meta property="og:title">` and `<meta property="og:description">` lines with unsanitized `title` and `description` values from `$_POST['fbcontent']`, and rewrites the file with `fopen(..., 'w')`. Because `1_content-fb-like.php` in 32.0.1 and earlier also has no `ABSPATH` or capability check and calls only built-in PHP functions, it can be invoked either directly over HTTP or when `0_change-gallery.php` includes it.

### Official description

The Contest Gallery – Upload & Vote Photos, Media, Sell with PayPal & Stripe plugin for WordPress is vulnerable to Unauthenticated Arbitrary File Overwrite in all versions up to, and including, 32.0.1 due to insufficient file path validation in the 'baseUrlForFacebook' parameter. This makes it possible for authenticated attackers, with subscriber-level access and above, to overwrite known files which may lead to remote code execution when certain preconditions are met.

## What the upatch does

A BPF LSM program attached to `lsm/file_open` returns `-EPERM` when a process whose command or executable name starts with `php` or is `apache2` or `httpd` opens `gallery/change-gallery/1_content-fb-like.php`.

The program checks the dentry name length (21 bytes) first and returns `0` immediately on almost every file open. When the length matches, it checks that the file name is `1_content-fb-like.php`, its parent directory is `change-gallery`, its grandparent directory is `gallery`, and the current task is PHP or the web server. A refusal from an earlier BPF LSM program on the same hook is preserved.

The `refused` per-CPU array counts refusals at key 0.

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

## Side effects

- Direct HTTP requests to `v10/v10-admin/gallery/change-gallery/1_content-fb-like.php` fail with `EPERM` when PHP tries to open the script, so no target file is opened or overwritten.
- When `0_change-gallery.php` saves gallery changes in the WordPress backend, its `include('1_content-fb-like.php')` call fails with a non-fatal PHP warning and the rest of `0_change-gallery.php` (`1_content.php`, `2_deactivate.php`, `4_activate.php`, `7_inform.php`) continues normally; updating legacy v10 Facebook Like HTML files (`*413.html`) through `1_content-fb-like.php` is disabled while the upatch is loaded.
- Non-PHP tools (`unzip`, `tar`, `rm`, `cp`, `rsync`, package managers) can still read, replace or delete `1_content-fb-like.php`.
- Not covered: if `1_content-fb-like.php` was already cached in PHP OPcache with `opcache.validate_timestamps=0` before the upatch was loaded so PHP executes the cached bytecode without opening the script file, or if PHP runs under an executable and command name other than `php*`, `apache2` or `httpd`.

## Preemption model and cost

The program keeps no state beyond the `refused` per-CPU counter, which it updates with `__sync_fetch_and_add`, so it is safe under every preemption model, including preemptible RCU and `PREEMPT_RT`. On nearly every `file_open` call, a run costs one `d_name.len` comparison against 21.

## Affected versions

Contest Gallery WordPress plugin (`contest-gallery`):

| Version range | Status   |
| ------------- | -------- |
| <= 32.0.1     | Affected |
| >= 33.0.0     | Fixed    |

Kernels: any Linux kernel supported by shirudo with BPF LSM and BTF enabled.

## How it was tested

On Contest Gallery 32.0.1 served by PHP, the loaded upatch blocked opening 1_content-fb-like.php and prevented overwriting the target file via baseUrlForFacebook, while normal PHP requests continued to work.

- **Tested:** 25 Nov 2026
- **Target:** WordPress plugin Contest Gallery 32.0.1 on PHP CLI built-in web server, loopback only
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64
- **Machine:** shirudo test VM

### Results

| State           | POST to 1_content-fb-like.php overwrites target file | Normal PHP request |
| --------------- | ---------------------------------------------------- | ------------------ |
| Before loading  | yes                                                  | 200                |
| Upatch loaded   | no (EPERM)                                           | 200                |
| After unloading | yes                                                  | 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-78088
```

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-78088-1.0.0.bee oci://<registry>/<namespace>/cve-2026-78088 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-78088-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-78088 record (CVE API)](https://cveawg.mitre.org/api/cve/CVE-2026-78088)
- [Wordfence vulnerability advisory af2115ba-5573-41ce-8d5a-58c57c65c75a](https://www.wordfence.com/threat-intel/vulnerabilities/id/af2115ba-5573-41ce-8d5a-58c57c65c75a?source=cve)
- [WordPress Trac changeset for 1_content-fb-like.php between 32.0.1 and 33.0.0](https://plugins.trac.wordpress.org/changeset?old_path=/contest-gallery/tags/32.0.1/v10/v10-admin/gallery/change-gallery/1_content-fb-like.php\&new_path=/contest-gallery/tags/33.0.0/v10/v10-admin/gallery/change-gallery/1_content-fb-like.php)

### Links

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

### More references from NVD (2)

- [plugins.trac.wordpress.org](https://plugins.trac.wordpress.org/changeset?old_path=/contest-gallery/tags/32.0.1/v10/v10-admin/gallery/change-gallery/1_content-fb-like.php\&new_path=/contest-gallery/tags/33.0.0/v10/v10-admin/gallery/change-gallery/1_content-fb-like.php)
- [wordfence.com](https://www.wordfence.com/threat-intel/vulnerabilities/id/af2115ba-5573-41ce-8d5a-58c57c65c75a?source=cve)
