upatch.dev

CVE-2026-94562

NukeViet CMS: Remote Code Execution via unrestricted custom field validation callback in the `users` module

Refuses child process execution by PHP processes serving a NukeViet installation to mitigate CVE-2026-94562.

High 7.2Vetted

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

At a glance

CVE-2026-94562 is a high (CVSS 7.2) vulnerability in NukeViet, published 20 November 2026. A vetted upatch, cve-2026-94562-exec-block, blocks it on running Linux machines with shirudo until NukeViet is upgraded.

Severity
High 7.2 CVSS 3.1
Chance of exploitation
1.0% in the next 30 days (EPSS, 24 Nov 2026)
Known exploited
No, not on CISA’s KEV list
Weakness
CWE-94, CWE-470, CWE-749
Affected software
NukeViet
Upatch status
Vetted, merged into the registry
How to apply
Build, sign and roll out with shirudo

Overview

CVE-2026-94562 affects NukeViet CMS prior to 4.6.01. In modules/users/admin/fields.php, a super-administrator satisfying NV_IS_SPADMIN can configure the func_callback setting of a custom user profile field (match_type set to callback) to any existing PHP function name because the handler only checks function_exists($dataform['func_callback']) without restricting callbacks to an allowlist. When a user registers or edits their profile, or an administrator edits user data, modules/users/fields.check.php validates the custom field by calling call_user_func($row_f['func_callback'], $value). Setting func_callback to a command-execution function such as system, exec, or passthru executes operating-system commands as the web-server user when the field is validated. NukeViet 4.6.01 fixes the issue in commit 1aa773c7feb41ffe95b53501df5a6956002ca61b by requiring func_callback to be listed in $global_config['user_field_callbacks'] in config.php.

Official description

NukeViet CMS is a multi Content Management System. Prior to 4.6.01, a super-administrator satisfying the NV_IS_SPADMIN gate can use modules/users/admin/fields.php to store an arbitrary existing PHP function in the func_callback setting for a custom profile field because the callback name is checked only with function_exists() and no allowlist restricts which function may be selected. modules/users/fields.check.php later invokes that function through call_user_func() when the field is validated through registration, profile editing, or administrator editing. Selecting a command-execution function crosses the super-administrator to operating-system boundary and executes commands as the web-server account, while ordinary users can trigger the stored callback after it is configured. Because the remediation validates callbacks only when they are written, upgrading does not remove a malicious callback already stored in the database, which must be cleaned manually. This issue is fixed in version 4.6.01.

Affected versions

The upatch targets NukeViet CMS versions prior to 4.6.01 (fixed in 4.6.01) on any Linux kernel with BPF LSM and BTF enabled, including Linux 7.4.

Sources

More references from NVD (4)

Mitigation

cve-2026-94562-exec-block attaches to lsm/bprm_check_security and returns -EPERM when either the current task or its parent task (real_parent) has an executable whose name begins with php and a current working directory (within 5 directory levels) whose name contains nukeviet. PHP functions such as system(), exec(), and passthru() fork a child process while still running the php binary and invoke execve() for /bin/sh -c ...; matching both current and real_parent stops both direct execve() from the forked PHP child and any sub-command it attempts to spawn. Refusals are counted in the refused per-CPU array map.

Side effects

  • PHP processes serving a NukeViet installation in a directory named nukeviet cannot spawn external operating-system commands (execve fails with EPERM).
  • Normal NukeViet web requests, database queries, user registration, and built-in PHP validation callbacks continue to work because they run in-process without executing external binaries.
  • Not covered: PHP callbacks that do not spawn a child process, or NukeViet installations whose directory path does not contain nukeviet.

Preemption model and cost

The program is written for preemptible RCU (PREEMPT_LAZY, PREEMPT_DYNAMIC, and PREEMPT_RT). It holds no locks and updates only a per-CPU counter with __sync_fetch_and_add on refusal. lsm/bprm_check_security runs only on execve, where checking the current and parent exe_file dentry prefix (php) takes a few pointer reads and returns immediately for all non-PHP processes.

The policy

102 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_refusal(void)
{
	__u32 key = 0;
	__u64 *value = bpf_map_lookup_elem(&refused, &key);

	if (value)
		__sync_fetch_and_add(value, 1);
}

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

static __always_inline bool dentry_starts_with_php(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 (!name || len < 3)
		return false;
	if (bpf_probe_read_kernel(buf, 3, name))
		return false;
	return buf[0] == 'p' && buf[1] == 'h' && buf[2] == 'p';
}

static __always_inline bool dentry_contains_nukeviet(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[32] = {};

	if (!name || len < 8)
		return false;
	if (bpf_probe_read_kernel_str(buf, sizeof(buf), name) < 0)
		return false;
	for (__u32 i = 0; i <= 23; i++) {
		if (buf[i] == 'n' && buf[i + 1] == 'u' && buf[i + 2] == 'k' &&
		    buf[i + 3] == 'e' && buf[i + 4] == 'v' && buf[i + 5] == 'i' &&
		    buf[i + 6] == 'e' && buf[i + 7] == 't')
			return true;
	}
	return false;
}

static __always_inline bool task_Or_parent_is_nukeviet_php(const struct task_struct *task)
{
	const struct dentry *exe = BPF_CORE_READ(task, mm, exe_file, f_path.dentry);
	const struct dentry *pwd = BPF_CORE_READ(task, fs, pwd.dentry);

	if (!dentry_starts_with_php(exe))
		return false;
	for (int depth = 0; depth < 5; depth++) {
		if (!pwd)
			break;
		if (dentry_contains_nukeviet(pwd))
			return true;
		pwd = BPF_CORE_READ(pwd, d_parent);
	}
	return false;
}

SEC("lsm/bprm_check_security")
int BPF_PROG(cve_2026_94562_exec, struct linux_binprm *bprm, int ret)
{
	struct task_struct *task;
	struct task_struct *parent;

	if (ret)
		return earlier_verdict(ret);
	task = bpf_get_current_task_btf();
	if (task_Or_parent_is_nukeviet_php(task)) {
		count_refusal();
		return -EPERM;
	}
	parent = BPF_CORE_READ(task, real_parent);
	if (parent && task_Or_parent_is_nukeviet_php(parent)) {
		count_refusal();
		return -EPERM;
	}
	return 0;
}

Process

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

  1. 20 Nov 2026CVECVE published
  2. 25 Nov 2026Pull requestPull request #43 openedAdd CVE-2026-94562: Refuses child process execution by PHP processes serving a NukeViet installationromanlab
  3. 25 Nov 2026MergeMerged #43romanlab
  4. 25 Nov 2026ReviewReviewedqodo-code-review[bot] (automated)

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

Evidence

On NukeViet 4.6.00 with a custom profile field callback set to system, the upatch blocked command execution during registration field validation while normal NukeViet requests continued to work.

Tested
25 Nov 2026
Target
NukeViet 4.6.00 on PHP and MariaDB, custom user field in nv4_users_field with match_type=callback and func_callback=system, loopback only
Kernel
7.4-shirudo-ci-20261123
Architecture
x86_64
Distribution
Ubuntu 26.04
Results
StateCallback command execution blocked
Before loadingno
Upatch loadedyes
After unloadingno
tools-test.log Output of tools/test --setup before, while, and after loading the upatch.
tools/test --setup, 2026-11-25T12:08:23Z
Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm
cve-2026-94562
  setup   done         NUKEVIET_URL=http://127.0.0.1:18080
  before  reached      custom profile field callback executed echo command
  loaded  blocked      custom profile field callback failed to execute external command
  after   reached      custom profile field callback executed echo command
  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-94562
Publish and roll out
shirudo bpm push build/packages/cve-2026-94562-1.0.0.bee oci://<registry>/<namespace>/cve-2026-94562 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-94562-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>