upatch.dev

CVE-2026-81662

Flowintel Alert Settings Configuration Allows Remote Code Execution via Arbitrary Configuration Keys

Refuses writable opens of Flowintel's conf/config_module.py by Python processes to mitigate CVE-2026-81662.

High 8.6Vetted

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

At a glance

CVE-2026-81662 is a high (CVSS 8.6) vulnerability in Flowintel, published 27 August 2026. A vetted upatch, cve-2026-81662-config-block, blocks it on running Linux machines with shirudo until Flowintel is upgraded.

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

Overview

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

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.

Sources

More references from NVD (1)

Mitigation

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.

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.

The policy

99 lines of BPF C, attached at lsm/file_open.

// 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
#define FMODE_WRITE	0x2

char _license[] SEC("license") = "Dual BSD/GPL";

enum {
	REFUSED_WRITE,
	NR_COUNTERS,
};

struct {
	__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
	__uint(max_entries, NR_COUNTERS);
	__type(key, __u32);
	__type(value, __u64);
} refused SEC(".maps");

static __always_inline void count(__u32 key)
{
	__u64 *value = bpf_map_lookup_elem(&refused, &key);

	if (value)
		__sync_fetch_and_add(value, 1);
}

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

	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 exe_is_python(const struct dentry *exe)
{
	const unsigned char *name = BPF_CORE_READ(exe, d_name.name);
	__u32 len = BPF_CORE_READ(exe, d_name.len);
	char buf[8] = {};

	if (!exe || len < 6 || !name)
		return false;
	if (bpf_probe_read_kernel(buf, 6, name))
		return false;
	return buf[0] == 'p' && buf[1] == 'y' && buf[2] == 't' &&
	       buf[3] == 'h' && buf[4] == 'o' && buf[5] == 'n';
}

static __always_inline bool current_is_python(void)
{
	struct task_struct *task = bpf_get_current_task_btf();
	const struct dentry *exe = BPF_CORE_READ(task, mm, exe_file, f_path.dentry);

	return exe_is_python(exe);
}

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

SEC("lsm/file_open")
int BPF_PROG(cve_2026_81662_open, struct file *file, int ret)
{
	const struct dentry *dentry;
	const struct dentry *parent;

	if (ret)
		return earlier_verdict(ret);
	if (!(file->f_mode & FMODE_WRITE))
		return 0;
	dentry = file->f_path.dentry;
	if (!name_is(dentry, "config_module.py", 16))
		return 0;
	parent = BPF_CORE_READ(dentry, d_parent);
	if (!name_is(parent, "conf", 4) || !current_is_python())
		return 0;
	count(REFUSED_WRITE);
	return -EPERM;
}

Process

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

  1. 27 Aug 2026CVECVE published
  2. 25 Nov 2026Pull requestPull request #82 openedAdd CVE-2026-81662: Refuses writable opens of Flowintel's conf/config_module.py by Python processesromanlab
  3. 25 Nov 2026CIUpdate upatch.devpassed
  4. 25 Nov 2026CICIpassed
  5. 25 Nov 2026ReviewReviewedqodo-code-review[bot] (automated)
  6. 25 Nov 2026MergeMerged #82romanlab

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

Evidence

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
StatePOST /alerts/config writes unvalidated key to conf/config_module.py
Before loadingyes (HTTP 200)
Upatch loadedno (HTTP 500)
After unloadingyes (HTTP 200)
tools-test.log Output of tools/test --setup showing the probe reaching conf/config_module.py before and after the upatch was loaded, and being blocked while loaded.
tools/test --setup, 2026-11-25T14:36:32Z
Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm
cve-2026-81662
  setup   done         FLOWINTEL_URL=http://127.0.0.1:7006 FLOWINTEL_CONFIG_MODULE=/opt/upatch-payload/cve-2026-81662/flowintel-3.3.0/conf/config_module.py
  before  reached      POST /alerts/config wrote UPATCH_PROBE_76350E06 into conf/config_module.py (HTTP 200); restored original file
  loaded  blocked      POST /alerts/config failed with HTTP 500 and left conf/config_module.py unchanged
  after   reached      POST /alerts/config wrote UPATCH_PROBE_2ED695CB into conf/config_module.py (HTTP 200); restored original file
  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-81662
Publish and roll out
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>