upatch.dev

CVE-2026-77806

SPIP before 4.4.21 allows unauthenticated remote attackers to execute arbitrary code, as exploited in the wild in Augus…

Refuses subprocess execution by PHP processes to mitigate SPIP CVE-2026-77806.

Critical 9.8Vetted

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

At a glance

CVE-2026-77806 is a critical (CVSS 9.8) vulnerability in SPIP, published 21 August 2026. A vetted upatch, cve-2026-77806-exec-block, blocks it on running Linux machines with shirudo until SPIP is upgraded.

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

Overview

CVE-2026-77806, published on 21 August 2026, is an unauthenticated remote code execution vulnerability in SPIP before 4.4.21 that was exploited in the wild in August 2026. In SPIP's template rendering engine, analyse_resultat_skel() parses rendered skeleton output for <?php header("X-Spip-Filtre: ..."); ?> patterns and invokes the listed functions as filters on the page body. By injecting a newline and a header("X-Spip-Filtre: ...") call into a parameter that reaches the compiled skeleton, or through a forum preview field, an unauthenticated attacker can supply a filter chain such as intval|_request|system and execute arbitrary shell commands via a request parameter. SPIP's security screen (ecran_securite.php) does not stop this vector.

Official description

SPIP before 4.4.21 allows unauthenticated remote attackers to execute arbitrary code, as exploited in the wild in August 2026. This is related to code injection via an X-Spip-Filtre HTTP request header that is mishandled by analyse_resultat_skel.

Affected versions

Every kernel supported by shirudo with BPF LSM enabled. The vulnerable software is SPIP before 4.4.21 (including 4.4.19 and 4.4.20), fixed in SPIP 4.4.21.

Sources

More references from NVD (4)

Mitigation

The program attaches to lsm/bprm_check_security and returns -EPERM when the calling task's command name or executable name starts with php (matching php, php-fpm*, php-cgi*, and versioned binaries such as php8.3 or php8.4). When SPIP processes an injected X-Spip-Filtre filter chain that invokes a command-execution function (system, exec, passthru, shell_exec, popen, proc_open), PHP spawns a child process and calls execve(), which reaches bprm_check_security while the current task is still the PHP process. A refusal from an earlier BPF LSM program on the same hook is passed on unchanged.

Side effects

  • PHP processes (php, php-fpm, php-cgi) cannot execute external binaries via execve().
  • Any SPIP plugin or feature that relies on external command-line tools (such as external image conversion binaries rather than PHP's GD or Imagick extensions) fails while the upatch is loaded.
  • Normal SPIP page rendering, template compilation, SQLite/MySQL database queries, and HTTP responses work without change.
  • In-process PHP functions that do not call execve() are not intercepted by bprm_check_security.
  • Not covered: SPIP running inside mod_php under an apache2 or httpd worker whose task command name and executable are not php*.

Preemption model and cost

The program keeps no maps and no shared or per-CPU state, so it is safe under every preemption model, including preemptible RCU (PREEMPT_LAZY, PREEMPT_DYNAMIC) and PREEMPT_RT. It runs only on execve() calls (bprm_check_security), checks the current task's command name and executable dentry name, and returns 0 immediately for non-PHP processes.

The policy

54 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";

static __always_inline bool starts_with_php(const char *s, __u32 len)
{
	return len >= 3 && s[0] == 'p' && s[1] == 'h' && s[2] == 'p' &&
	       (len == 3 || s[3] == 0 || s[3] == '-' ||
		(s[3] >= '0' && s[3] <= '9'));
}

static __always_inline bool current_is_php(void)
{
	char comm[16] = {};

	if (bpf_get_current_comm(comm, sizeof(comm)) == 0 &&
	    starts_with_php(comm, sizeof(comm)))
		return true;

	struct task_struct *task = bpf_get_current_task_btf();
	const struct dentry *exe = BPF_CORE_READ(task, mm, exe_file, f_path.dentry);
	const unsigned char *name = BPF_CORE_READ(exe, d_name.name);
	__u32 len = BPF_CORE_READ(exe, d_name.len);
	char buf[16] = {};

	if (!name || len < 3)
		return false;
	if (bpf_probe_read_kernel_str(buf, sizeof(buf), name) < 0)
		return false;
	return starts_with_php(buf, len);
}

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_77806_exec_block, struct linux_binprm *bprm, int ret)
{
	if (ret)
		return earlier_verdict(ret);
	if (!current_is_php())
		return 0;
	return -EPERM;
}

Process

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

  1. 21 Aug 2026CVECVE published
  2. 25 Nov 2026Pull requestPull request #15 openedAdd CVE-2026-77806: Refuses subprocess execution by PHP processes to mitigate SPIP CVE-2026-77806romanlab
  3. 25 Nov 2026MergeMerged #15romanlab
  4. 25 Nov 2026ReviewReviewedqodo-code-review[bot] (automated)

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

Evidence

On SPIP 4.4.20 running under PHP's built-in server on loopback, the loaded upatch refused subprocess execution triggered through the X-Spip-Filtre filter chain in analyse_resultat_skel(), while in-process SPIP requests continued to work.

Tested
25 Nov 2026
Target
SPIP 4.4.20 on PHP built-in server with SQLite 3, loopback only
Kernel
7.4-shirudo-ci-20261123
Architecture
x86_64
Distribution
Ubuntu 26.04
Results
StateX-Spip-Filtre subprocess exec (intval|_request|system)In-process SPIP request (intval|phpinfo)
Before loadingreached (HTTP 200)yes
Upatch loadedblocked (EPERM)yes
After unloadingreached (HTTP 200)yes
tools-test.log Output of tools/test --setup showing the payload reached before, blocked while the upatch was loaded, and reached again after unload.
tools/test --setup, 2026-11-25T10:37:32Z
Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm
cve-2026-77806
  setup   done         SPIP_URL=http://127.0.0.1:18080 SPIP_DIR=/opt/upatch-payload/cve-2026-77806/spip
  before  reached      X-Spip-Filtre spawned subprocess via system() (HTTP 200)
  loaded  blocked      X-Spip-Filtre ran in PHP but subprocess execution was refused (HTTP 0)
  after   reached      X-Spip-Filtre spawned subprocess via system() (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-77806
Publish and roll out
shirudo bpm push build/packages/cve-2026-77806-1.0.0.bee oci://<registry>/<namespace>/cve-2026-77806 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-77806-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>