# CVE-2026-81662: Flowintel Alert Settings Configuration Allows Remote Code Execution via Arbitrary Configuration Keys

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

## At a glance

CVE-2026-81662 is rated High 8.6 (CVSS 4.0, CVSS:4.0/AV:N/AC:L/AT:N/PR:H/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 Flowintel (flowintel) and was published on 27 Aug 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 0.5%: the estimated chance it is exploited in the next 30 days, as of 25 Nov 2026. The upatch `cve-2026-81662-config-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-81662, "Flowintel Alert Settings Configuration Allows Remote Code Execution", was published on 27 August 2026. In affected versions of Flowintel, `update_config()` in `app/alerts/alerts.py` handles `POST /alerts/config` by reading `conf/config_module.py`, substituting or appending `f'{key} = {py_val}'` for every key-value pair in the JSON request body without validating `key`, writing the modified source back with `open("conf/config_module.py", "w")`, and calling `importlib.reload(ConfigModule)`. Because requester-controlled keys are interpolated directly into the Python source of `conf/config_module.py` before the module is reloaded, an authenticated administrator can inject arbitrary Python statements that execute in the Flowintel server process.

### Official description

Affected versions of Flowintel improperly trust configuration keys supplied to the alerts settings update endpoint. While configuration values were normalized to Python literals, the corresponding keys were used directly when constructing and replacing lines in conf/config_module.py.

The vulnerable code used requester-controlled keys in both the regular expression and the generated assignment:

f'{key} = {py_val}'

and appended an assignment if the key was not already present. The modified Python configuration module was subsequently reloaded using importlib.reload(). This creates a code-generation boundary in which specially crafted configuration keys can alter the Python source structure and result in execution of attacker-controlled Python statements.

Version impacted >=3.3.0

## What the upatch does

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

| Check            | Condition                                                          |
| ---------------- | ------------------------------------------------------------------ |
| Access mode      | `file->f_mode` has `FMODE_WRITE` (`0x2`) set                       |
| File name        | `file->f_path.dentry` is `config_module.py` (length 16)            |
| Parent directory | `dentry->d_parent` is `conf` (length 4)                            |
| Executable       | The current task's `mm->exe_file` dentry name begins with `python` |

Read-only opens of `conf/config_module.py` (when Python imports or reads the configuration module) do not set `FMODE_WRITE` and pass after the first check. The `refused` per-CPU array counts refused writable opens at key 0.

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

## Side effects

- Saving webhook or IMAP alert settings through `POST /alerts/config` fails with HTTP 500 because `open("conf/config_module.py", "w")` raises `PermissionError`.
- Existing alert settings in `conf/config_module.py` remain readable and can still be edited on disk by an operator using a non-Python editor or shell tool while the upatch is loaded.
- Other Flowintel features, including cases, tasks, logins, alerts viewing, and SQLite or PostgreSQL database updates, continue to work normally.

## Preemption model and cost

The program keeps no state beyond the per-CPU refusal counter, which it updates with `__sync_fetch_and_add`, so it is safe under all preemption models including `PREEMPT_LAZY`, `PREEMPT_DYNAMIC`, and `PREEMPT_RT`. On every read-only `file_open` event, the program checks `file->f_mode & FMODE_WRITE` and returns immediately; on writable opens, it checks that the target dentry's 4-byte length is 16 before reading any file name or task executable.

## Affected versions

Flowintel:

| Versions       | Status                                                                                                                                               |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| 3.2.0 to 3.3.0 | Affected (`app/alerts/alerts.py` introduced in commit `fb739b9214ec3eeab34064665f4db20f3e7e3786`)                                                    |
| 4.0.0          | Fixed by commit `d36171e22aed99055539260bec75e6355ada7d0c`, which restricts keys to `ALLOWED_CONFIG_KEYS` and escapes keys in the regular expression |

Kernels: any Linux kernel supported by shirudo with BPF LSM and BTF enabled.

## How it was tested

On Flowintel 3.3.0, the loaded upatch refused the writable open of conf/config_module.py so POST /alerts/config failed with HTTP 500 and wrote no unvalidated key; before loading and after unloading, the request succeeded with HTTP 200 and wrote the probe key.

- **Tested:** 25 Nov 2026
- **Target:** Flowintel 3.3.0 on Python 3.12, listening on 127.0.0.1:7006
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64
- **Machine:** shirudo test VM
- **Distribution:** Ubuntu 26.04

### Results

| State           | POST /alerts/config writes unvalidated key to conf/config_module.py |
| --------------- | ------------------------------------------------------------------- |
| Before loading  | yes (HTTP 200)                                                      |
| Upatch loaded   | no (HTTP 500)                                                       |
| After unloading | yes (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-81662
```

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-81662-1.0.0.bee oci://<registry>/<namespace>/cve-2026-81662 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-81662-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-81662 record (CVE API)](https://cveawg.mitre.org/api/cve/CVE-2026-81662)
- [Fix commit d36171e22aed](https://github.com/flowintel/flowintel/commit/d36171e22aed99055539260bec75e6355ada7d0c)
- [Flowintel 3.3.0 release](https://github.com/flowintel/flowintel/releases/tag/3.3.0)
- [Flowintel 4.0.0 release](https://github.com/flowintel/flowintel/releases/tag/4.0.0)

### Links

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

### More references from NVD (1)

- [github.com](https://github.com/flowintel/flowintel/commit/d36171e22aed99055539260bec75e6355ada7d0c)
