# CVE-2026-9843: Database for Contact Form 7, WPforms, Elementor forms <= 1.5.1 - Unauthenticated Arbitrary File Deletion via CF7 File Field POST Value

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

## At a glance

CVE-2026-9843 is rated High 8.1 (CVSS 3.1, CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H). It affects Database for Contact Form 7, WPforms, El… (crmperks) and was published on 20 Jun 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 1.0%: the estimated chance it is exploited in the next 30 days, as of 24 Nov 2026. The upatch `cve-2026-9843-unlink-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-9843, published on 20 June 2026, is an unauthenticated arbitrary file deletion vulnerability (CWE-22) in the "Database for Contact Form 7, WPforms, Elementor forms" (`contact-form-entries`) WordPress plugin in all versions up to and including 1.5.1. In `includes/plugin-pages.php`, `view_page()` processes form entry updates when an administrator saves an entry (`$_POST['vxcf_leads_submit']`). For each field of type `file`, it loads stored attachment paths from the entry detail table (`$detail[$name]['value']`) and checks whether `isset($_POST['files_'.$name][$k])` holds. In `templates/view.php` (line 559), the hidden input name is rendered as `files_<?php echo esc_html($f_name.'['.$k.']') ?>` without stripping `[` or `]` from the stored key `$k`. An unauthenticated attacker who submits a poisoned entry with a bracketed key and a relative traversal path (such as `../../../../wp-config.php`) causes PHP's bracket parser to reshape `$_POST['files_'.$name]` when the administrator edits and saves the entry, so `isset($_POST['files_'.$name][$k])` evaluates to false and `view_page()` executes `@unlink($upload['dir'].$file)` (line 1197) on the traversal target. Version 1.5.2 (changeset 3578556) fixed this by sanitizing `[` and `]` in `templates/view.php` and resolving `$real_file = realpath($upload['dir'].$file)` in `includes/plugin-pages.php` before checking `strpos($real_file, '/crm_perks_uploads/') !== false`.

### Official description

The Database for Contact Form 7, WPforms, Elementor forms plugin for WordPress is vulnerable to arbitrary file deletion due to insufficient file path validation in the view_page function in all versions up to, and including, 1.5.1. This makes it possible for unauthenticated attackers to delete arbitrary files on the server, which can easily lead to remote code execution when the right file is deleted (such as wp-config.php). Successful exploitation requires an administrator to view or edit the poisoned form entry, at which point PHP's bracket parser reshapes the attacker-crafted JSON key to bypass the stored-path isset check and trigger deletion of the traversal-specified file.

## What the upatch does

The BPF LSM program attaches to `lsm/inode_unlink` and inspects unlink attempts by tasks whose executable basename starts with `php` (matching `php`, `php8.3`, `php-fpm8.3`, and `php-cgi`):

| Hook               | Refused                                                                                                                         |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
| `lsm/inode_unlink` | Unlinking any file by a `php*` executable unless one of its ancestor directories (within 6 levels) is named `crm_perks_uploads` |

When the kernel resolves the path passed to `unlink()`, any `..` traversal components are already resolved in the VFS before `security_inode_unlink()` runs, so `dentry` and its `d_parent` chain reflect the real target location on disk. Legitimate attachment deletions under `wp-content/uploads/crm_perks_uploads/<random_folder>/<YYYY>/<MM>/<file>` have `crm_perks_uploads` as the third parent directory and are allowed; traversal targets outside `crm_perks_uploads` (such as `wp-config.php`) lack `crm_perks_uploads` in their ancestor chain and are refused with `-EPERM`. The `refused` per-CPU array map counts refused unlink attempts at key 0.

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

## Side effects

- While the upatch is loaded, PHP processes (`php*`) cannot unlink files outside a `crm_perks_uploads` directory subtree. WordPress core updates, plugin uninstalls, media deletions outside `crm_perks_uploads`, and temporary file unlinks performed directly by PHP fail with `EPERM` until the plugin is upgraded to 1.5.2 and the upatch is unloaded.
- Viewing, editing, saving entries, and removing legitimate entry attachments inside `crm_perks_uploads` continue to work normally.
- Non-PHP processes (including root shells, `sshd`, package managers, and web servers running outside a `php*` binary) are unaffected.

## Preemption model and cost

The program uses a single `BPF_MAP_TYPE_PERCPU_ARRAY` counter updated with `__sync_fetch_and_add` only on refused operations, so it is safe under all preemption models including `PREEMPT_LAZY`, `PREEMPT_DYNAMIC`, and `PREEMPT_RT`. For non-PHP tasks, each `inode_unlink` call exits after checking the current task's executable prefix (3 bytes). For PHP tasks, it walks at most 6 `d_parent` pointers.

## Affected versions

- WordPress plugin `contact-form-entries` (Database for Contact Form 7, WPforms, Elementor forms): all versions up to and including 1.5.1; fixed in 1.5.2.
- Affected kernels: any Linux kernel supporting BPF LSM (`lsm/inode_unlink`) with BTF enabled.

## How it was tested

On WordPress Contact Form Entries (contact-form-entries) 1.5.1, the loaded upatch blocked the path-traversal file deletion in view_page() outside crm_perks_uploads while allowing legitimate attachment deletion inside crm_perks_uploads.

- **Tested:** 25 Nov 2026
- **Target:** WordPress Contact Form Entries (contact-form-entries) 1.5.1 on PHP CLI built-in web server, loopback only
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64
- **Distribution:** Ubuntu 26.04

### Results

| State           | Path-traversal unlink outside crm_perks_uploads blocked | Legitimate attachment unlink inside crm_perks_uploads works |
| --------------- | ------------------------------------------------------- | ----------------------------------------------------------- |
| Before loading  | no                                                      | yes                                                         |
| Upatch loaded   | yes                                                     | yes                                                         |
| After unloading | no                                                      | yes                                                         |

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

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-9843-1.0.0.bee oci://<registry>/<namespace>/cve-2026-9843 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-9843-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

- [Wordfence vulnerability record for CVE-2026-9843](https://www.wordfence.com/threat-intel/vulnerabilities/id/4169b390-0972-4aa9-ae04-f5f67afe15ef?source=cve)
- [WordPress Plugin Trac changeset 3578556](https://plugins.trac.wordpress.org/changeset/3578556/contact-form-entries)
- [Vulnerable unlink in includes/plugin-pages.php (tag 1.5.1, line 1197)](https://plugins.trac.wordpress.org/browser/contact-form-entries/tags/1.5.1/includes/plugin-pages.php#L1197)
- [Vulnerable hidden input in templates/view.php (tag 1.5.1, line 559)](https://plugins.trac.wordpress.org/browser/contact-form-entries/tags/1.5.1/templates/view.php#L559)
- [Entry data handling in includes/data.php (tag 1.5.1, line 539)](https://plugins.trac.wordpress.org/browser/contact-form-entries/tags/1.5.1/includes/data.php#L539)
- [Form entry handling in contact-form-entries.php (tag 1.5.1, lines 435 and 747)](https://plugins.trac.wordpress.org/browser/contact-form-entries/tags/1.5.1/contact-form-entries.php#L435)

### Links

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

### More references from NVD (7)

- [plugins.trac.wordpress.org](https://plugins.trac.wordpress.org/browser/contact-form-entries/tags/1.5.1/contact-form-entries.php#L435)
- [plugins.trac.wordpress.org](https://plugins.trac.wordpress.org/browser/contact-form-entries/tags/1.5.1/contact-form-entries.php#L747)
- [plugins.trac.wordpress.org](https://plugins.trac.wordpress.org/browser/contact-form-entries/tags/1.5.1/includes/data.php#L539)
- [plugins.trac.wordpress.org](https://plugins.trac.wordpress.org/browser/contact-form-entries/tags/1.5.1/includes/plugin-pages.php#L1197)
- [plugins.trac.wordpress.org](https://plugins.trac.wordpress.org/browser/contact-form-entries/tags/1.5.1/templates/view.php#L559)
- [plugins.trac.wordpress.org](https://plugins.trac.wordpress.org/changeset/3578556/contact-form-entries)
- [wordfence.com](https://www.wordfence.com/threat-intel/vulnerabilities/id/4169b390-0972-4aa9-ae04-f5f67afe15ef?source=cve)
