# CVE-2026-9559: A path traversal vulnerability exists in the campaign import feature of Mautic 7.

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

## At a glance

CVE-2026-9559 is rated Critical 9.9 (CVSS 3.1, CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H). It affects Mautic and was published on 29 May 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 0.6%: the estimated chance it is exploited in the next 30 days, as of 24 Nov 2026. The upatch `cve-2026-9559-import-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-9559 (GHSA-6r9h-4h75-7q4x) is a path traversal vulnerability in the campaign import feature of Mautic 7.0.0 through 7.1.1, published on 29 May 2026. When `Mautic\CoreBundle\Helper\ImportHelper::readZipFile()` validates entries in an uploaded campaign ZIP archive, its private `normalizePath()` helper pops segments on `..` when the stack is non-empty and silently drops `..` when the stack is empty. A ZIP entry such as `../escape.php` or `assets/../../escape.php` normalizes to `escape.php`, contains no `..`, and passes validation. During extraction and asset copying, `readZipFile()` concatenates the unnormalized `$filename` with `$tempDir` (`var/tmp`) and `$mediaPath` (`media/files/`), allowing an authenticated user with `campaign:imports:create` permission to write arbitrary files outside `var/tmp` and `media/files/`.

### Official description

A path traversal vulnerability exists in the campaign import feature of Mautic 7. When extracting uploaded ZIP files during campaign imports, a flaw in the validation logic allows file paths to escape the intended temporary directories. An authenticated user with campaign import privileges (campaign:imports:create) can write arbitrary PHP files to sensitive system directories. An attacker can exploit this to overwrite critical internal configuration or cache components, resulting in Remote Code Execution (RCE) under the context of the web server user.

## What the upatch does

Two BPF LSM programs return `-EPERM` to processes whose executable name starts with `php` when creating or opening for write a regular file directly inside `<mautic>/var/` or `<mautic>/media/` (where `<mautic>` is a directory whose name starts with `mautic` or `Mautic`):

| Hook               | Refused                                                                            |
| ------------------ | ---------------------------------------------------------------------------------- |
| `lsm/inode_create` | Creating a regular file directly in `<mautic>/var/` or `<mautic>/media/`           |
| `lsm/file_open`    | Opening a file with `FMODE_WRITE` directly in `<mautic>/var/` or `<mautic>/media/` |

Because `normalizePath()` only drops `..` when the path segment stack is empty and preserves any remaining `..` when a deeper subdirectory follows (which the `str_contains($normalizedFilename, '..')` check then rejects), any traversal entry that bypasses validation in `readZipFile()` resolves to a single filename with no `/` after the leading `../` or `assets/../../` prefix. The kernel resolves `$tempDir.'/../<name>'` to a file directly inside `var/` (parent of `var/tmp`) and `$mediaPath.'../../<name>'` to a file directly inside `media/` (parent of `media/files/`), or into `var/tmp` before the second `..` in the assets copy step. Refusing regular file creation and write-open directly in `var/` and `media/` stops both bypasses before `fopen($sourcePath, 'wb')` or `copy($sourcePath, $destinationPath)` can write outside the intended subdirectories.

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

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

## Side effects

- A PHP process cannot create or open for write regular files directly in `<mautic>/var/` or `<mautic>/media/`. Mautic keeps temporary files in `var/tmp/`, cache files in `var/cache/`, logs in `var/logs/`, and media in `media/files/`, `media/images/`, `media/css/` and `media/js/`, so normal operation and legitimate campaign imports without path traversal keep working.
- Subdirectories under `var/` and `media/`, and `mkdir` of those subdirectories (`inode_mkdir`), are untouched.
- Not covered: a Mautic checkout whose root directory name does not start with `mautic` or `Mautic`, or a custom `tmp_path` or `media_path` configured outside `var/tmp` and `media`.

## Preemption model and cost

The programs keep no state beyond the per-CPU refusal counter, updated with an atomic fetch-and-add, so they are safe under every preemption model, including preemptible RCU, `PREEMPT_LAZY` and `PREEMPT_RT`. On `file_open`, read-only opens return immediately after testing `FMODE_WRITE`. On creates and write opens, the program checks the parent dentry's length and 3- or 5-byte name (`var` or `media`) before reading the grandparent dentry or the task's executable.

## Affected versions

Mautic:

| Branch | Affected       | Fixed in |
| ------ | -------------- | -------- |
| 7.x    | 7.0.0 to 7.1.1 | 7.1.2    |

Kernels: any Linux kernel with BPF LSM and BTF supporting the four-argument `inode_create` LSM hook prototype (`idmap`, `dir`, `dentry`, `mode`) and `file_open`.

## How it was tested

On a vulnerable Mautic 7.1.1 instance, the loaded upatch refused the campaign import ZIP path traversal write into var/ (HTTP 400), while before loading and after unloading the traversal wrote outside var/tmp (HTTP 201).

- **Tested:** 25 Nov 2026
- **Target:** Mautic 7.1.1 on PHP and MariaDB, API and Basic authentication enabled, loopback only
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64
- **Distribution:** Ubuntu 26.04

### Results

| State           | Campaign import ZIP traversal writes into var/ |
| --------------- | ---------------------------------------------- |
| Before loading  | yes (HTTP 201)                                 |
| Upatch loaded   | no (HTTP 400)                                  |
| After unloading | yes (HTTP 201)                                 |

## 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-9559
```

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-9559-1.0.0.bee oci://<registry>/<namespace>/cve-2026-9559 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-9559-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-9559 record (CVE API)](https://cveawg.mitre.org/api/cve/CVE-2026-9559)
- [Mautic Security Advisory GHSA-6r9h-4h75-7q4x](https://github.com/mautic/mautic/security/advisories/GHSA-6r9h-4h75-7q4x)
- [Mautic 7.1.2 release notes](https://github.com/mautic/mautic/releases/tag/7.1.2)
- [Fix commit 9af8ed36fef8](https://github.com/mautic/mautic/commit/9af8ed36fef8baed6a2903ae99b967e3581bd786)

### Links

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

### More references from NVD (1)

- [github.com](https://github.com/mautic/mautic/security/advisories/GHSA-6r9h-4h75-7q4x)
