# CVE-2026-94104: NivoCart through 2.4.0 Arbitrary File Upload RCE via filemanager

The Markdown version of <https://upatch.dev/cve/CVE-2026-94104>. Last updated 25 Nov 2026.

## At a glance

CVE-2026-94104 is rated High 8.7 (CVSS 4.0, CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X). It affects NivoCart (nivocart) and was published on 20 Sept 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 0.7%: the estimated chance it is exploited in the next 30 days, as of 24 Nov 2026. The upatch `cve-2026-94104-upload-block` mitigates it, and is vetted (merged into the registry).

A upatch is a signed BPF program that shirudo loads into a running Linux kernel to block the code path this CVE's exploit takes. It holds the line until the fix ships; it does not replace patching.

## The vulnerability

CVE-2026-94104 was published on 20 September 2026. In NivoCart through 2.4.0, the `multi()` method in `upload/admin/controller/common/filemanager.php` and `upload/admin/controller/common/filemanager_full.php` handles chunked file uploads into `image/data/` without checking `hasPermission('modify', 'common/filemanager')`, and gates its file extension whitelist check behind `if ($chunks < 2 && file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName))`. Any filename that does not already exist in the target directory, or any upload request with `chunks` set to 2 or higher, bypasses the extension filter and is written directly with `fopen(..., $chunk === 0 ? "wb" : "ab")`. An authenticated back-office user with view-only access to the file manager can therefore upload a `.php` file into the web-accessible `image/data/` directory and request it over HTTP to execute arbitrary PHP code.

### Official description

NivoCart through 2.4.0 contains an arbitrary file upload vulnerability in the File Manager multi() endpoint that fails to validate file extensions for new filenames or when chunks parameter is 2 or higher. Attackers with view-only back-office access can upload PHP files to the web-accessible image/data/ directory and execute them for remote code execution.

## What the upatch does

Two BPF LSM programs return `-EPERM` to processes whose executable name starts with `php` (such as `php`, `php8.3`, `php8.4`, `php-fpm8.4` or `php-cgi`) or is `apache2` or `httpd`, when the target file is in `image/data/` (or up to three subdirectory levels beneath it) and its name ends with `.php`, `.php[0-9]`, `.pht`, `.phtml`, `.phar` or `.phps` (case-insensitive):

| Hook               | Refused                                                                                                                                       |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `lsm/inode_create` | Creating a PHP script file in `image/data/`                                                                                                   |
| `lsm/file_open`    | Opening a PHP script file in `image/data/`, whether to overwrite or append chunks or to execute a script planted before the upatch was loaded |

Each program checks the file extension first and returns `0` immediately when the name does not carry a PHP extension, before walking up to four parent dentries for `image/data` and checking the current task's executable. A refusal from an earlier BPF LSM program on the same hook is passed on.

The `refused` per-CPU array counts refusals: key 0 for creates, key 1 for opens.

The policy: [`cve-2026-94104-upload-block.bpf.c`](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-94104), 163 lines of BPF C attached at `lsm/inode_create` and `lsm/file_open`, licensed GPL-2.0 OR BSD-2-Clause.

## Side effects

- Uploading a file with a `.php`, `.php[0-9]`, `.pht`, `.phtml`, `.phar` or `.phps` extension into `image/data/` through NivoCart's file manager fails in `fopen()` and returns JSON-RPC error `102` (`Failed to open output stream.`).
- Any PHP script placed in `image/data/` before the upatch was loaded can no longer be opened or executed by PHP or Apache.
- Uploading and serving allowed static media files (`.jpg`, `.jpeg`, `.png`, `.gif`, `.mp3`, `.mp4`, `.pdf`, `.zip` and the rest of NivoCart's whitelist) in `image/data/` continues to work, as does executing NivoCart's own PHP files in `admin/`, `catalog/`, `system/` and `install/`.
- Not covered: files uploaded into a subdirectory nested more than three levels below `image/data/`, or served by a web server binary whose executable name does not start with `php` and is neither `apache2` nor `httpd`.

## Preemption model and cost

The programs keep no state beyond the per-CPU refusal counter, which they update with an atomic fetch-and-add, so they are safe under every preemption model, including `PREEMPT_LAZY`, preemptible RCU and `PREEMPT_RT`. On every file create or open whose name does not end with a PHP extension, a run costs a length check and one 4-byte kernel read of the suffix.

## Affected versions

Application vulnerability: NivoCart through 2.4.0 is affected, and NivoCart 2.5.0 fixes the issue.

Kernels: the program uses the `inode_create` and `file_open` LSM hooks on kernels with BPF LSM and BTF enabled, including Linux 7.4.

## How it was tested

On a vulnerable NivoCart 2.4.0 instance, a view-only user uploaded a .php file into image/data/ through common/filemanager/multi before and after the upatch was loaded, while the loaded upatch refused the file creation (JSON-RPC error 102) and wrote no file.

- **Tested:** 25 Nov 2026
- **Target:** NivoCart 2.4.0 on PHP and MariaDB, view-only back-office user with access on common/filemanager, loopback only
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64
- **Machine:** shirudo test VM
- **Distribution:** Ubuntu 26.04

### Results

| State           | common/filemanager/multi .php upload in image/data/ |
| --------------- | --------------------------------------------------- |
| Before loading  | reached (wrote .php file, HTTP 200)                 |
| Upatch loaded   | blocked (error 102, no file written)                |
| After unloading | reached (wrote .php file, HTTP 200)                 |

## How to apply

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:

```sh
git clone https://github.com/copper-helm/upatch-registry
cd upatch-registry
tools/build <shirudo-checkout> <keys-dir> 1.0.0 upatches/cve-2026-94104
```

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-94104-1.0.0.bee oci://<registry>/<namespace>/cve-2026-94104 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-94104-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>
```

## Review

- Contributors: romanlab.
- Reviewers: none recorded yet.

## Sources and links

- [CVE-2026-94104 record (CVE API)](https://cveawg.mitre.org/api/cve/CVE-2026-94104)
- [NivoCart issue #25: Multiple vulnerabilities in NivoCart v2.4.0](https://github.com/nivocart/nivocart/issues/25)
- [Vulnerable `multi()` in `upload/admin/controller/common/filemanager.php` (v2.4.0)](https://github.com/nivocart/nivocart/blob/6ea6600cda1263ae70c0aab0a70d31091a32c46b/upload/admin/controller/common/filemanager.php#L527-L562)
- [Vulnerable `multi()` in `upload/admin/controller/common/filemanager_full.php` (v2.4.0)](https://github.com/nivocart/nivocart/blob/6ea6600cda1263ae70c0aab0a70d31091a32c46b/upload/admin/controller/common/filemanager_full.php)
- [Fix commits: e59286762835](https://github.com/nivocart/nivocart/commit/e59286762835a46ec86a1e36b7832a288974c374), [03978a75634a](https://github.com/nivocart/nivocart/commit/03978a75634acea4cb1b69e9d670ba838c944e09), [66478db723be](https://github.com/nivocart/nivocart/commit/66478db723be4e400324ad49123936b4d3c41d1d)
- [NivoCart v2.5.0 release](https://github.com/nivocart/nivocart/releases/tag/v2.5.0)
- [VulnCheck advisory](https://www.vulncheck.com/advisories/nivocart-through-2.4.0-arbitrary-file-upload-rce-via-filemanager)

### Links

- [CVE-2026-94104 on upatch.dev](https://upatch.dev/cve/CVE-2026-94104) (this page, as HTML)
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-94104)
- [CVE.org](https://www.cve.org/CVERecord?id=CVE-2026-94104)
- [CWE-434](https://cwe.mitre.org/data/definitions/434.html)
- Upatch source: [upatches/cve-2026-94104](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-94104)

### More references from NVD (5)

- [github.com](https://github.com/nivocart/nivocart)
- [github.com](https://github.com/nivocart/nivocart/blob/6ea6600cda1263ae70c0aab0a70d31091a32c46b/upload/admin/controller/common/filemanager.php#L527-L562)
- [github.com](https://github.com/nivocart/nivocart/blob/6ea6600cda1263ae70c0aab0a70d31091a32c46b/upload/admin/controller/common/filemanager_full.php)
- [github.com](https://github.com/nivocart/nivocart/issues/25)
- [vulncheck.com](https://www.vulncheck.com/advisories/nivocart-through-2.4.0-arbitrary-file-upload-rce-via-filemanager)
