upatch.dev

CVE-2026-92980

HortusFox-Web < 6.1 Remote Code Execution via Import/Export

Refuses creating dot files and PHP scripts in HortusFox-Web public/img and public/attachments directories to mitigate CVE-2026-92980.

High 8.6Vetted

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

At a glance

CVE-2026-92980 is a high (CVSS 8.6) vulnerability in HortusFox, published 17 September 2026. A vetted upatch, cve-2026-92980-import-block, blocks it on running Linux machines with shirudo until HortusFox is upgraded.

Severity
High 8.6 CVSS 4.0
Chance of exploitation
1% in the next 30 days (EPSS, 24 Nov 2026)
Known exploited
No, not on CISA’s KEV list
Weakness
CWE-434
Affected software
HortusFox (danielbrendel)
Upatch status
Vetted, merged into the registry
How to apply
Build, sign and roll out with shirudo

Overview

CVE-2026-92980, published on 17 September 2026, is an unrestricted file upload vulnerability (CWE-434) in HortusFox-Web prior to version 6.1. In app/modules/ImportModule.php, the importLocations, importPlants, importPlantAttachments, importGallery, and importInventory methods extract a backup .zip archive into public/backup/hf_import_<timestamp>/ and call copy() to move referenced asset files (icon, photo, file, thumb, and original) into public/img/ or public/attachments/ without validating the file names. An authenticated administrator—or an administrator tricked into importing a crafted backup archive—can deploy .htaccess files or executable PHP scripts into public/img/ or public/attachments/ and execute arbitrary OS commands as the web server user. Version 6.1 fixes this in commit 1c7108f23fa30759d6f3bf62f0cfbf975bdc0a3b by adding UtilsModule::checkUnsafeFileName(), which rejects file names starting with / or . or ending with .php, .php5, .php7, .php8, or .phtml.

Official description

HortusFox-Web prior to version 6.1 contains a remote code execution vulnerability that allows authenticated administrators to execute arbitrary OS commands as the web server user by abusing the Import/Export functionality. Attackers can leverage the Import/Export feature, which is intended solely for data portability, to deploy and execute malicious code on the underlying application server host.

Affected versions

The vulnerable software is HortusFox-Web prior to version 6.1 (fixed in version 6.1).

For the Linux kernel, the BPF program uses the four-argument inode_create LSM hook prototype (const struct mnt_idmap *idmap, struct inode *dir, struct dentry *dentry, umode_t mode) with BPF LSM enabled.

Sources

More references from NVD (3)

Mitigation

One BPF LSM program attached to lsm/inode_create returns -EPERM when all of the following hold:

  • The target file name being created starts with . (such as .htaccess) or ends case-insensitively with .php, .php5, .php7, .php8, or .phtml.
  • The parent directory is named img or attachments and its parent directory is named public (public/img or public/attachments).
  • The calling process has a command name or executable name starting with php (such as php, php-fpm, or php-cgi), apache2, or httpd.

Note that any path containing a / in the JSON asset name (such as ../foo.php) resolves outside the flat img/ or attachments/ directory of the extracted archive unless subdirectories exist, and when copy() attempts to create a file in a parent directory or another directory outside public/img or public/attachments, copy() either fails if intermediate directories do not exist or targets public/img / public/attachments directly when placing web-accessible files there. Matching the upstream UtilsModule::checkUnsafeFileName() filter on public/img and public/attachments stops the creation of dot files and PHP scripts in those directories.

The refused per-CPU array map counts refused file creations at key 0.

Side effects

  • PHP and Apache web server processes cannot create files starting with . or ending with .php, .php5, .php7, .php8, or .phtml inside any public/img or public/attachments directory.
  • Normal HortusFox-Web backup imports and uploads of images and attachments (such as .png, .jpg, .pdf, or .txt) into public/img and public/attachments continue to work.
  • When an imported backup archive references a blocked file name, PHP's copy() fails to create the destination file in public/img/ or public/attachments/, and ImportModule::import() still cleans up the temporary public/backup/hf_import_<timestamp> directory.
  • Other processes on the machine, including root shells, cp, tar, and package managers, are unaffected.

Preemption model and cost

The program holds no state other than the refused per-CPU counter updated with __sync_fetch_and_add, making it safe under all preemption models including PREEMPT_LAZY, preemptible RCU, and PREEMPT_RT. On every inode_create call, the program checks the new dentry's name length and suffix/prefix first; almost all file creations return immediately after inspecting the dentry name without walking parent dentries or checking the current task.

The policy

161 lines of BPF C, attached at lsm/inode_create.

// 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 char lower_ascii(char c)
{
	if (c >= 'A' && c <= 'Z')
		return c + ('a' - 'A');
	return c;
}

static __always_inline bool is_unsafe_import_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 first = 0;
	char tail[6] = {};

	if (!name || len == 0 || len > 255)
		return false;
	if (bpf_probe_read_kernel(&first, sizeof(first), name))
		return false;
	if (first == '.')
		return true;
	if (len >= 4) {
		if (bpf_probe_read_kernel(tail, 4, name + len - 4))
			return false;
		if (tail[0] == '.' &&
		    lower_ascii(tail[1]) == 'p' &&
		    lower_ascii(tail[2]) == 'h' &&
		    lower_ascii(tail[3]) == 'p')
			return true;
	}
	if (len >= 5) {
		if (bpf_probe_read_kernel(tail, 5, name + len - 5))
			return false;
		if (tail[0] == '.' &&
		    lower_ascii(tail[1]) == 'p' &&
		    lower_ascii(tail[2]) == 'h' &&
		    lower_ascii(tail[3]) == 'p' &&
		    (tail[4] == '5' || tail[4] == '7' || tail[4] == '8'))
			return true;
	}
	if (len >= 6) {
		if (bpf_probe_read_kernel(tail, 6, name + len - 6))
			return false;
		if (tail[0] == '.' &&
		    lower_ascii(tail[1]) == 'p' &&
		    lower_ascii(tail[2]) == 'h' &&
		    lower_ascii(tail[3]) == 't' &&
		    lower_ascii(tail[4]) == 'm' &&
		    lower_ascii(tail[5]) == 'l')
			return true;
	}
	return false;
}

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[16] = {};

	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_hortusfox_public_asset_dir(const struct dentry *dir)
{
	const struct dentry *parent = BPF_CORE_READ(dir, d_parent);

	if (!name_is(parent, "public", 6))
		return false;
	return name_is(dir, "img", 3) || name_is(dir, "attachments", 11);
}

static __always_inline bool is_php_or_apache_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')
		return true;
	if (s[0] == 'h' && s[1] == 't' && s[2] == 't' && s[3] == 'p' &&
	    s[4] == 'd')
		return true;
	return false;
}

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

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

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

	if (ename && bpf_probe_read_kernel_str(ebuf, sizeof(ebuf), ename) > 0)
		return is_php_or_apache_name(ebuf);
	return false;
}

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

SEC("lsm/inode_create")
int BPF_PROG(cve_2026_92980_create, const struct mnt_idmap *idmap,
	     struct inode *dir, struct dentry *dentry, umode_t mode, int ret)
{
	if (ret)
		return earlier_verdict(ret);
	if (!is_unsafe_import_name(dentry))
		return 0;
	if (!is_hortusfox_public_asset_dir(BPF_CORE_READ(dentry, d_parent)))
		return 0;
	if (!current_is_php_web())
		return 0;
	count_refused();
	return -EPERM;
}

Process

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

  1. 17 Sept 2026CVECVE published
  2. 25 Nov 2026Pull requestPull request #27 openedAdd CVE-2026-92980: Refuses creating dot files and PHP scripts in HortusFox-Web public/img andromanlab
  3. 25 Nov 2026MergeMerged #27romanlab
  4. 25 Nov 2026ReviewReviewedqodo-code-review[bot] (automated)

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

Evidence

On a vulnerable HortusFox-Web 6.0 instance, the loaded upatch refused creating a .php file in public/img during backup import while allowing a .png image in the same backup archive to be imported.

Tested
25 Nov 2026
Target
HortusFox-Web 6.0 on PHP and MariaDB, listening on 127.0.0.1:8080
Kernel
7.4-shirudo-ci-20261123
Architecture
x86_64
Distribution
Ubuntu 26.04
Results
StateBackup import writes .php file in public/imgBackup import writes .png file in public/img
Before loadingyesyes
Upatch loadednoyes
After unloadingyesyes
tools-test.log Output of tools/test --setup showing the backup import probe reached before and after the upatch was loaded and was blocked while loaded.
tools/test --setup, 2026-11-25T11:22:51Z
Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm
cve-2026-92980
  setup   done         HORTUSFOX_URL=http://127.0.0.1:8080 HORTUSFOX_PUBLIC_IMG=/dev/shm/upatch-payload/cve-2026-92980/hortusfox-web-6.0/public/img HORTUSFOX_EMAIL=admin@example.com HORTUSFOX_PASSWORD=adminpass
  before  reached      backup import wrote upatch-probe-14d6f6f5b3a7.php and upatch-probe-14d6f6f5b3a7.png into public/img; removed both
  loaded  blocked      backup import wrote upatch-probe-19a1950e1970.png into public/img while creating upatch-probe-19a1950e1970.php was refused
  after   reached      backup import wrote upatch-probe-11f6a9cd268a.php and upatch-probe-11f6a9cd268a.png into public/img; removed both
  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-92980
Publish and roll out
shirudo bpm push build/packages/cve-2026-92980-1.0.0.bee oci://<registry>/<namespace>/cve-2026-92980 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-92980-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>