upatch.dev

CVE-2026-77005

Code Monkeys Proposals <= 1.0.1 - Subscriber+ Arbitrary File Deletion via Path Traversal

Refuses arbitrary file deletion by the Code Monkeys Proposals WordPress plugin to mitigate CVE-2026-77005.

Critical 9.6Vetted

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

At a glance

CVE-2026-77005 is a critical (CVSS 9.6) vulnerability in Code Monkeys Proposals, published 12 September 2026. A vetted upatch, cve-2026-77005-unlink-block, blocks it on running Linux machines with shirudo until Code Monkeys Proposals is upgraded.

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

Overview

CVE-2026-77005, "Code Monkeys Proposals <= 1.0.1 - Subscriber+ Arbitrary File Deletion via Path Traversal", was published on 12 September 2026. In ajax-functions.php, the code_monkeys_proposals_delete_pdf handler is registered on both wp_ajax_code_monkeys_proposals_delete_pdf and wp_ajax_nopriv_code_monkeys_proposals_delete_pdf, checks only the cm-proposals-nonce nonce (which enqueue.php localizes into cmProposalsAdminScript on every admin page, including for Subscribers), performs no capability check, and passes plugin_dir_path(__FILE__) . 'proposals/' . sanitize_text_field($_REQUEST['file']) directly to unlink(). Because sanitize_text_field() leaves ../ sequences intact, an attacker can traverse out of wp-content/plugins/code-monkeys-proposals/proposals/ to unlink wp-config.php (forcing WordPress back into its installation wizard for site takeover) or plugin files.

Official description

The CODE MONKEYS PROPOSALS WordPress plugin through 1.0.1 does not validate a user-supplied file path before deleting a file, and does not check the capability of the user making the request, allowing any authenticated user, such as a subscriber, to delete arbitrary files on the server, which can lead to a site takeover.

Affected versions

The vulnerability is in the Code Monkeys Proposals WordPress plugin through version 1.0.1 (closed on WordPress.org on 28 August 2026 with no patched release). The upatch uses the standard two-argument inode_unlink LSM hook (struct inode *dir, struct dentry *dentry) supported across mainline Linux kernels with BPF LSM enabled.

Sources

More references from NVD (1)

Mitigation

The program attaches to lsm/inode_unlink and returns -EPERM when a PHP or web-server process (php*, apache2*, httpd*, or litespeed*) attempts to unlink:

  • wp-config.php or .htaccess, the primary site-takeover and configuration targets reached by traversing out of the plugin directory, or
  • any file directly inside code-monkeys-proposals/ or code-monkeys-proposals/proposals/ whose name does not end in .pdf (the plugin's code_monkeys_proposals_generate_pdf function only ever writes <templateName>-<time>.pdf into proposals/).

A refusal from an earlier BPF LSM program on the same hook is passed on unchanged, and the refused per-CPU array map counts refused unlink attempts.

Side effects

  • PHP processes cannot unlink wp-config.php or .htaccess, or unlink non-.pdf files inside code-monkeys-proposals/ and code-monkeys-proposals/proposals/.
  • Generating and deleting .pdf proposal files in code-monkeys-proposals/proposals/ continues to work normally.
  • Unlinking files in code-monkeys-proposals/ from WordPress's web-based plugin deletion UI fails while the upatch is loaded; administrators can remove the plugin from a shell (such as via rm or wp-cli if run outside the PHP binary, or after unloading the upatch).

Preemption model and cost

The program keeps no shared state beyond a single per-CPU counter updated with __sync_fetch_and_add, making it safe under every preemption model, including preemptible RCU (PREEMPT_LAZY and PREEMPT_DYNAMIC) and PREEMPT_RT. On each inode_unlink call, the program checks the target dentry's length and name first before inspecting parent dentries or the current task's executable.

The policy

138 lines of BPF C, attached at lsm/inode_unlink.

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

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

	if (!dentry || len < prefix_len || prefix_len > sizeof(buf))
		return false;
	if (bpf_probe_read_kernel(buf, prefix_len, name))
		return false;
	for (__u32 i = 0; i < sizeof(buf); i++) {
		if (i == prefix_len)
			return true;
		if (buf[i] != prefix[i])
			return false;
	}
	return false;
}

static __always_inline bool ends_with_pdf(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 tail[4] = {};

	if (!dentry || len < 5 || len > 255)
		return false;
	if (bpf_probe_read_kernel(tail, sizeof(tail), name + len - 4))
		return false;
	return tail[0] == '.' && tail[1] == 'p' && tail[2] == 'd' &&
	       tail[3] == 'f';
}

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 (name_starts_with(exe, "php", 3) ||
	    name_starts_with(exe, "apache2", 7) ||
	    name_starts_with(exe, "httpd", 5) ||
	    name_starts_with(exe, "litespeed", 9))
		return true;
	if (bpf_get_current_comm(&comm, sizeof(comm)) == 0) {
		if (comm[0] == 'p' && comm[1] == 'h' && comm[2] == 'p')
			return true;
	}
	return false;
}

static __always_inline bool in_cm_proposals_dir(const struct dentry *dentry)
{
	const struct dentry *parent = BPF_CORE_READ(dentry, d_parent);
	const struct dentry *plugin = BPF_CORE_READ(parent, d_parent);

	if (name_is(parent, "code-monkeys-proposals", 22))
		return true;
	if (name_is(parent, "proposals", 9) &&
	    name_is(plugin, "code-monkeys-proposals", 22))
		return true;
	return false;
}

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

SEC("lsm/inode_unlink")
int BPF_PROG(cve_2026_77005_unlink_block, struct inode *dir,
	     struct dentry *dentry, int ret)
{
	bool bad_unlink = false;

	if (ret)
		return earlier_verdict(ret);
	if (name_is(dentry, "wp-config.php", 13) ||
	    name_is(dentry, ".htaccess", 9)) {
		bad_unlink = true;
	} else if (in_cm_proposals_dir(dentry) && !ends_with_pdf(dentry)) {
		bad_unlink = true;
	}
	if (!bad_unlink || !current_is_php())
		return 0;
	count_refused();
	return -EPERM;
}

Process

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

  1. 12 Sept 2026CVECVE published
  2. 25 Nov 2026Pull requestPull request #102 openedAdd CVE-2026-77005: Refuses arbitrary file deletion by the Code Monkeys Proposals WordPress pluginromanlab
  3. 25 Nov 2026CICheck entriespassed
  4. 25 Nov 2026CICompile with clang 23passed
  5. 25 Nov 2026MergeMerged #102romanlab

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

Evidence

On WordPress 6.7.2 with Code Monkeys Proposals 1.0.1, the loaded upatch refused the subscriber path-traversal file deletion outside proposals/ while allowing normal PDF deletion inside proposals/.

Tested
25 Nov 2026
Target
Code Monkeys Proposals 1.0.1 on WordPress 6.7.2 (SQLite 2.1.16, PHP CLI built-in web server), loopback only
Kernel
7.4-shirudo-ci-20261123
Architecture
x86_64
Results
StatePath traversal unlink (../upatch-probe-<token>.txt)Normal PDF deletion in proposals/
Before loadingdeleted (reached)deleted
Upatch loadedrefused with EPERM (blocked)deleted
After unloadingdeleted (reached)deleted
tools-test.log Output of tools/test --setup on the shirudo test VM across before, loaded and after states.
tools/test --setup, 2026-11-25T16:21:40Z
Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm
cve-2026-77005
  setup   done         WP_URL=http://127.0.0.1:8080 WP_PLUGIN_DIR=/opt/upatch-payload/cve-2026-77005/wordpress/wp-content/plugins/code-monkeys-proposals WP_USER=sub WP_PASS=subpass
  before  reached      path traversal in code_monkeys_proposals_delete_pdf deleted upatch-probe-77be69eebf87.txt outside proposals/
  loaded  blocked      upatch-probe-c3470245c7a6.txt remained in place while normal PDF deletion succeeded
  after   reached      path traversal in code_monkeys_proposals_delete_pdf deleted upatch-probe-ae371c4e4e2c.txt outside proposals/
  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-77005
Publish and roll out
shirudo bpm push build/packages/cve-2026-77005-1.0.0.bee oci://<registry>/<namespace>/cve-2026-77005 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-77005-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>