CVE-2026-78088
Contest Gallery <= 32.0.1 - Unauthenticated Arbitrary File Upload via 'baseUrlForFacebook' Parameter
Refuses opening the Contest Gallery 1_content-fb-like.php script in PHP to mitigate CVE-2026-78088.
High 8.8Vetted
EPSS 0.8%: the estimated chance this CVE is exploited in the next 30 days, as of 24 Nov 2026.
At a glance
CVE-2026-78088 is a high (CVSS 8.8) vulnerability in Contest Gallery, published 16 September 2026. A vetted upatch, cve-2026-78088-fb-like-block, blocks it on running Linux machines with shirudo until Contest Gallery is upgraded.
- Severity
- High 8.8 CVSS 3.1
- Chance of exploitation
- 0.8% in the next 30 days (EPSS, 24 Nov 2026)
- Known exploited
- No, not on CISA’s KEV list
- Weakness
- CWE-434
- Affected software
- Contest Gallery (contest-gallery)
- Upatch status
- Vetted, merged into the registry
- How to apply
- Build, sign and roll out with shirudo
Overview
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.
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.
Sources
More references from NVD (2)
Mitigation
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.
Side effects
- Direct HTTP requests to
v10/v10-admin/gallery/change-gallery/1_content-fb-like.phpfail withEPERMwhen PHP tries to open the script, so no target file is opened or overwritten. - When
0_change-gallery.phpsaves gallery changes in the WordPress backend, itsinclude('1_content-fb-like.php')call fails with a non-fatal PHP warning and the rest of0_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) through1_content-fb-like.phpis disabled while the upatch is loaded. - Non-PHP tools (
unzip,tar,rm,cp,rsync, package managers) can still read, replace or delete1_content-fb-like.php. - Not covered: if
1_content-fb-like.phpwas already cached in PHP OPcache withopcache.validate_timestamps=0before 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 thanphp*,apache2orhttpd.
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.
The policy
105 lines of BPF C, attached at lsm/file_open.
// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
#include "vmlinux.h"
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>
#include <bpf/bpf_core_read.h>
#define EPERM 1
char _license[] SEC("license") = "Dual BSD/GPL";
struct {
__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
__uint(max_entries, 1);
__type(key, __u32);
__type(value, __u64);
} refused SEC(".maps");
static __always_inline void count_refused(void)
{
__u32 key = 0;
__u64 *value = bpf_map_lookup_elem(&refused, &key);
if (value)
__sync_fetch_and_add(value, 1);
}
static __always_inline bool name_eq(const struct dentry *dentry,
const char *want, __u32 want_len)
{
const unsigned char *name = BPF_CORE_READ(dentry, d_name.name);
char buf[24] = {};
if (!dentry || BPF_CORE_READ(dentry, d_name.len) != want_len ||
want_len > sizeof(buf) - 1)
return false;
if (bpf_probe_read_kernel_str(buf, sizeof(buf), name) < 0)
return false;
for (__u32 i = 0; i < sizeof(buf) - 1; i++) {
if (i == want_len)
return true;
if (buf[i] != want[i])
return false;
}
return false;
}
static __always_inline bool is_php_name(const char *s)
{
if (s[0] == 'p' && s[1] == 'h' && s[2] == 'p')
return true;
if (s[0] == 'a' && s[1] == 'p' && s[2] == 'a' && s[3] == 'c' &&
s[4] == 'h' && s[5] == 'e' && s[6] == '2' && s[7] == '\0')
return true;
if (s[0] == 'h' && s[1] == 't' && s[2] == 't' && s[3] == 'p' &&
s[4] == 'd' && s[5] == '\0')
return true;
return false;
}
static __always_inline bool current_is_php(void)
{
char comm[16] = {};
struct task_struct *task;
const struct dentry *exe;
const unsigned char *name;
char exe_name[16] = {};
if (bpf_get_current_comm(comm, sizeof(comm)) == 0 && is_php_name(comm))
return true;
task = bpf_get_current_task_btf();
exe = BPF_CORE_READ(task, mm, exe_file, f_path.dentry);
name = BPF_CORE_READ(exe, d_name.name);
if (name && bpf_probe_read_kernel_str(exe_name, sizeof(exe_name), name) > 0)
return is_php_name(exe_name);
return false;
}
static __always_inline int earlier_verdict(int ret)
{
return ret >= -4095 && ret < 0 ? ret : -EPERM;
}
SEC("lsm/file_open")
int BPF_PROG(cve_2026_78088_open, struct file *file, int ret)
{
const struct dentry *dentry = file->f_path.dentry;
const struct dentry *parent;
if (ret)
return earlier_verdict(ret);
if (!dentry || BPF_CORE_READ(dentry, d_name.len) != 21)
return 0;
if (!name_eq(dentry, "1_content-fb-like.php", 21))
return 0;
parent = BPF_CORE_READ(dentry, d_parent);
if (!name_eq(parent, "change-gallery", 14) ||
!name_eq(BPF_CORE_READ(parent, d_parent), "gallery", 7))
return 0;
if (!current_is_php())
return 0;
count_refused();
return -EPERM;
}
The package: name, license, the program and the CVE it fixes.
[package]
name = "cve-2026-78088"
description = "Refuses opening the Contest Gallery 1_content-fb-like.php script in PHP to mitigate CVE-2026-78088"
license = "GPL-2.0 OR BSD-2-Clause"
[[upatches]]
source = "cve-2026-78088-fb-like-block.bpf.c"
[upatches.tree]
id = "cve-2026-78088-fb-like-block"
fixes = ["CVE-2026-78088"]
Process
How this upatch was written, checked and reviewed, from the registry’s history.
- 16 Sept 2026CVECVE published
- 25 Nov 2026Pull requestPull request #45 openedAdd CVE-2026-78088: Refuses opening the Contest Gallery 1_content-fb-like.php script in PHPromanlab
- 25 Nov 2026MergeMerged #45romanlab
- 25 Nov 2026ReviewReviewedqodo-code-review[bot] (automated)
No human review is recorded on GitHub for this upatch yet.
Evidence
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
| 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 |
tools-test.log Output of tools/test --setup before, while and after loading the upatch.
tools/test --setup, 2026-11-25T12:08:29Z Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm cve-2026-78088 setup done CG_URL=http://127.0.0.1:8080 CG_PROBE_FILE=/opt/upatch-payload/cve-2026-78088/probe.html before reached 1_content-fb-like.php overwrote probe.html via baseUrlForFacebook (HTTP 200, normal PHP HTTP 200); restored it loaded blocked opening 1_content-fb-like.php was refused (HTTP 200, normal PHP HTTP 200) and probe.html was untouched after reached 1_content-fb-like.php overwrote probe.html via baseUrlForFacebook (HTTP 200, normal PHP HTTP 200); restored it PASS: reached before, blocked while loaded, reached again after
Use it
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.
git clone https://github.com/copper-helm/upatch-registry
cd upatch-registry
tools/build <shirudo-checkout> <keys-dir> 1.0.0 upatches/cve-2026-78088shirudo 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>