upatch.dev

CVE-2026-77009

WatchMan-Site7 3.1.1 - 4.2.0 - Subscriber+ RCE via Debug Console

Refuses subprocess execution by PHP processes inside a WordPress tree to mitigate WatchMan-Site7 CVE-2026-77009.

Critical 9.9Vetted

EPSS 0.5%: the estimated chance this CVE is exploited in the next 30 days, as of 25 Nov 2026.

At a glance

CVE-2026-77009 is a critical (CVSS 9.9) vulnerability in WatchMan-Site7, published 2 September 2026. A vetted upatch, cve-2026-77009-exec-block, blocks it on running Linux machines with shirudo until WatchMan-Site7 is upgraded.

Severity
Critical 9.9 CVSS 3.1
Chance of exploitation
0.5% in the next 30 days (EPSS, 25 Nov 2026)
Known exploited
No, not on CISA’s KEV list
Weakness
CWE-94
Affected software
WatchMan-Site7
Upatch status
Vetted, merged into the registry
How to apply
Build, sign and roll out with shirudo

Overview

CVE-2026-77009, published on 2 September 2026, is an authenticated remote code execution vulnerability (CWE-94, CVSS 9.9) in the WatchMan-Site7 (watchman-site7) WordPress plugin in versions 3.1.1 through 4.2.0. In watchman-site7.php, the plugin unconditionally includes includes/wms7-query.php and registers wms7_query() on the wp_ajax_query WordPress AJAX hook (add_action("wp_ajax_query", "wms7_query")), along with includes/wms7-common.php (wms7_parse_code()). Because WordPress dispatches wp_ajax_* actions in wp-admin/admin-ajax.php for every logged-in user and wms7_query() performs no capability or nonce check, any authenticated user (including a low-privilege Subscriber) can send a POST request to wp-admin/admin-ajax.php?action=query with a query parameter. wms7_parse_code() tokenizes $_POST['query'], stores it in the wms7_console option under code, and wms7_query() passes $wms7_console['code'] directly to eval(). No fixed version exists because the plugin was permanently closed on WordPress.org at the author's request.

Official description

The WatchMan-Site7 WordPress plugin through 4.2.0 does not restrict access to its debugging console, which executes user-supplied PHP code, allowing any authenticated user, such as a subscriber, to run arbitrary code on the server.

Affected versions

The vulnerability is in the WatchMan-Site7 (watchman-site7) WordPress plugin, not the Linux kernel:

Software Affected Fixed in
WatchMan-Site7 (watchman-site7) 3.1.1 to 4.2.0 never (plugin closed)

The BPF program uses lsm/bprm_check_security with CO-RE reads of task_struct, mm_struct, fs_struct, and dentry, which are present on all Linux kernels supported by shirudo.

Sources

More references from NVD (1)

Mitigation

One BPF LSM program on lsm/bprm_check_security returns -EPERM when:

  1. The current task's executable name or task comm begins with php (matching php, php8.3, php-fpm8.3, php-cgi, and similar PHP runtimes).
  2. The current task's working directory (current->fs->pwd.dentry), or one of its parent directories up to six levels deep, is named watchman-site7, wp-content, wp-admin, or wp-includes.

When PHP code evaluated by wms7_query() during an admin-ajax.php request invokes a command-execution function (system, exec, passthru, shell_exec, popen, or proc_open), the kernel refuses the execve system call with -EPERM before the child program or shell starts. Any non-zero refusal returned by an earlier BPF LSM program on the same hook is preserved, and the refused per-CPU array map counts refused executions at key 0.

Side effects

  • Any PHP process whose current working directory is inside watchman-site7, wp-content, wp-admin, or wp-includes cannot spawn external binaries via execve.
  • Normal WatchMan-Site7 visitor tracking, country statistics, blacklists, and WordPress page rendering run inside PHP and talk to the database over sockets without spawning external programs.
  • WordPress plugins or administrative actions running inside wp-admin or wp-content that invoke external CLI binaries (such as sendmail or convert) fail with EPERM while the upatch is loaded.
  • Not covered: in-process PHP evaluation inside wms7_query() that does not call execve (such as reading or modifying WordPress options or database rows in PHP memory), or a PHP runtime whose executable and comm do not start with php.

Preemption model and cost

The program keeps no shared mutable state beyond the per-CPU refused counter, updated with __sync_fetch_and_add, making it safe under every kernel preemption model including preemptible RCU (PREEMPT_LAZY, PREEMPT_DYNAMIC) and PREEMPT_RT. The hook runs only on execve, checks the current process executable and comm first, and returns immediately for every non-PHP process.

The policy

143 lines of BPF C, attached at lsm/bprm_check_security.

// 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 is_php_name(const struct dentry *dentry)
{
	const unsigned char *name = BPF_CORE_READ(dentry, d_name.name);
	__u32 len = BPF_CORE_READ(dentry, d_name.len);
	char buf[4] = {};

	if (!dentry || len < 3 || !name)
		return false;
	if (bpf_probe_read_kernel(buf, 3, name))
		return false;
	if (buf[0] != 'p' || buf[1] != 'h' || buf[2] != 'p')
		return false;
	if (len == 3)
		return true;
	if (bpf_probe_read_kernel(&buf[3], 1, name + 3))
		return false;
	return (buf[3] >= '0' && buf[3] <= '9') || buf[3] == '-' || buf[3] == '.';
}

static __always_inline bool current_is_php(void)
{
	struct task_struct *task = bpf_get_current_task_btf();
	const struct dentry *exe = BPF_CORE_READ(task, mm, exe_file, f_path.dentry);
	char comm[16] = {};

	if (is_php_name(exe))
		return true;
	if (bpf_get_current_comm(&comm, sizeof(comm)))
		return false;
	if (comm[0] != 'p' || comm[1] != 'h' || comm[2] != 'p')
		return false;
	return comm[3] == '\0' || (comm[3] >= '0' && comm[3] <= '9') ||
	       comm[3] == '-' || comm[3] == '.';
}

static __always_inline bool dentry_is_wp_dir(const struct dentry *dentry)
{
	const unsigned char *name = BPF_CORE_READ(dentry, d_name.name);
	__u32 len = BPF_CORE_READ(dentry, d_name.len);
	char buf[15] = {};

	if (!dentry || !name)
		return false;
	if (len == 14) {
		if (bpf_probe_read_kernel(buf, 14, name))
			return false;
		return buf[0] == 'w' && buf[1] == 'a' && buf[2] == 't' &&
		       buf[3] == 'c' && buf[4] == 'h' && buf[5] == 'm' &&
		       buf[6] == 'a' && buf[7] == 'n' && buf[8] == '-' &&
		       buf[9] == 's' && buf[10] == 'i' && buf[11] == 't' &&
		       buf[12] == 'e' && buf[13] == '7';
	}
	if (len == 10) {
		if (bpf_probe_read_kernel(buf, 10, name))
			return false;
		return buf[0] == 'w' && buf[1] == 'p' && buf[2] == '-' &&
		       buf[3] == 'c' && buf[4] == 'o' && buf[5] == 'n' &&
		       buf[6] == 't' && buf[7] == 'e' && buf[8] == 'n' &&
		       buf[9] == 't';
	}
	if (len == 8) {
		if (bpf_probe_read_kernel(buf, 8, name))
			return false;
		return buf[0] == 'w' && buf[1] == 'p' && buf[2] == '-' &&
		       buf[3] == 'a' && buf[4] == 'd' && buf[5] == 'm' &&
		       buf[6] == 'i' && buf[7] == 'n';
	}
	if (len == 11) {
		if (bpf_probe_read_kernel(buf, 11, name))
			return false;
		return buf[0] == 'w' && buf[1] == 'p' && buf[2] == '-' &&
		       buf[3] == 'i' && buf[4] == 'n' && buf[5] == 'c' &&
		       buf[6] == 'l' && buf[7] == 'u' && buf[8] == 'd' &&
		       buf[9] == 'e' && buf[10] == 's';
	}
	return false;
}

static __always_inline bool cwd_in_wordpress(void)
{
	struct task_struct *task = bpf_get_current_task_btf();
	const struct dentry *d = BPF_CORE_READ(task, fs, pwd.dentry);

	for (int i = 0; i < 6; i++) {
		const struct dentry *parent;

		if (!d)
			return false;
		if (dentry_is_wp_dir(d))
			return true;
		parent = BPF_CORE_READ(d, d_parent);
		if (!parent || parent == d)
			break;
		d = parent;
	}
	return false;
}

static __always_inline int earlier_verdict(int ret)
{
	return ret >= -4095 && ret < 0 ? ret : -EPERM;
}

SEC("lsm/bprm_check_security")
int BPF_PROG(cve_2026_77009_exec_block, struct linux_binprm *bprm, int ret)
{
	if (ret)
		return earlier_verdict(ret);
	if (!current_is_php())
		return 0;
	if (!cwd_in_wordpress())
		return 0;
	count_refused();
	return -EPERM;
}

Process

How this upatch was written, checked and reviewed, from the registry’s history.

  1. 2 Sept 2026CVECVE published
  2. 25 Nov 2026Pull requestPull request #80 openedAdd CVE-2026-77009: Refuses subprocess execution by PHP processes inside a WordPress tree toromanlab
  3. 25 Nov 2026CIUpdate upatch.devpassed
  4. 25 Nov 2026CICIpassed
  5. 25 Nov 2026MergeMerged #80romanlab

No human review is recorded on GitHub for this upatch yet.

Evidence

On WatchMan-Site7 4.2.0 served by PHP on loopback, the loaded upatch refused subprocess execution triggered via wms7_query() on wp_ajax_query while normal WordPress AJAX requests continued to work.

Tested
25 Nov 2026
Target
WatchMan-Site7 4.2.0 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
Statewp_ajax_query (wms7_query) spawns /bin/echoNormal WordPress AJAX request
Before loadingyes200
Upatch loadedno (EPERM)200
After unloadingyes200
tools-test.log Output of tools/test --setup before, while and after loading the upatch.
tools/test --setup, 2026-11-25T14:37:21Z
Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm
cve-2026-77009
  setup   done         WMS7_AJAX_URL=http://127.0.0.1:18709/wp-admin/admin-ajax.php
  before  reached      wp_ajax_query (wms7_query) ran /bin/echo via passthru (HTTP 200, heartbeat HTTP 200)
  loaded  blocked      wp_ajax_query (wms7_query) evaluated PHP but /bin/echo execve was refused (HTTP 200, heartbeat HTTP 200)
  after   reached      wp_ajax_query (wms7_query) ran /bin/echo via passthru (HTTP 200, heartbeat HTTP 200)
  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.

Build and sign
git clone https://github.com/copper-helm/upatch-registry
cd upatch-registry
tools/build <shirudo-checkout> <keys-dir> 1.0.0 upatches/cve-2026-77009
Publish and roll out
shirudo bpm push build/packages/cve-2026-77009-1.0.0.bee oci://<registry>/<namespace>/cve-2026-77009 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-77009-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>