CVE-2026-91925
Polyaxon through 2.16.4 Server-Side Template Injection via Unsandboxed Jinja2 Engine
Refuses program execution from Polyaxon haupt server processes to mitigate CVE-2026-91925.
High 8.7Vetted
EPSS 0.8%: the estimated chance this CVE is exploited in the next 30 days, as of 24 Nov 2026.
At a glance
CVE-2026-91925 is a high (CVSS 8.7) vulnerability in Polyaxon, published 15 September 2026. A vetted upatch, cve-2026-91925-exec-block, blocks it on running Linux machines with shirudo until Polyaxon is upgraded.
- Severity
- High 8.7 CVSS 4.0
- Chance of exploitation
- 0.8% in the next 30 days (EPSS, 24 Nov 2026)
- Known exploited
- No, not on CISA’s KEV list
- Weakness
- CWE-1336
- Affected software
- Polyaxon
- Upatch status
- Vetted, merged into the registry
- How to apply
- Build, sign and roll out with shirudo
Overview
CVE-2026-91925 is a server-side template injection vulnerability in Polyaxon through 2.16.4, published on 15 September 2026. During server-side run preparation (SchedulingManager.runs_prepare in haupt/orchestration/scheduler/manager.py), Polyaxon resolves operation specifications by calling PolyaxonfileParser.parse_operation() and render_template() in cli/polyaxon/_polyaxonfile/specs/libs/engine.py. Because get_engine() constructs an unsandboxed jinja2.Environment(), an authenticated user who submits a run with a Jinja2 expression in queue, namespace, conditions, presets, or dependencies can traverse Python object attributes (namespace.__init__.__globals__['__builtins__']) and execute operating system commands in the context of the haupt server or scheduler process.
Official description
Polyaxon through 2.16.4 renders operation specification fields with an unsandboxed Jinja2 environment during server-side run preparation, allowing authenticated users to execute arbitrary code. Attackers can submit runs with Jinja2 payloads in queue, namespace, conditions, presets, or dependencies fields to execute operating system commands in the scheduler process context, exposing database credentials and service tokens.
Affected versions
Affected software: Polyaxon (polyaxon and haupt) through 2.16.4; fixed in Polyaxon 2.19 by switching get_engine() to jinja2.sandbox.SandboxedEnvironment() in commit 5e61f8caa59ee4ea3a017c3a8532c22080fd4193.
Kernels: any Linux kernel with BPF LSM enabled (lsm/bprm_check_security) and BTF support.
Sources
More references from NVD (5)
Mitigation
The lsm/bprm_check_security program cve_2026_91925_exec_block returns -EPERM whenever a process whose command name (comm) is haupt, or whose parent or grandparent has command name haupt, attempts to execute a binary:
| Hook | Refused |
|---|---|
lsm/bprm_check_security |
Any execve by haupt or a child worker spawned by haupt |
Because bprm_check_security runs before begin_new_exec updates current->comm, starting haupt itself from a shell is unaffected. Once haupt is running, both single-process mode and multi-worker mode handle run preparation in Python without executing external binaries, whereas an injected OS command (os.popen or subprocess) forks a child and calls execve, which the hook refuses with -EPERM. The refused per-CPU array counts refused executions at key 0.
Side effects
- Any attempt by a running
hauptprocess or its worker children to spawn an external operating system binary fails withEPERM. - Starting a
hauptserver with multipleuvicornworker processes while the upatch is already loaded will fail ifhauptspawns new worker processes viaexecve; single-workerhauptor workers started before loading continue to serve requests normally. - In-process Python evaluation inside the unsandboxed Jinja2 environment that does not call
execveis not stopped by a kernel hook; upgrading to Polyaxon 2.19 or later is required to sandbox template rendering in Python.
Preemption model and cost
The program holds no shared mutable state beyond the per-CPU refusal counter, which it increments with __sync_fetch_and_add, making it safe under all preemption models including PREEMPT_LAZY, PREEMPT_DYNAMIC, and PREEMPT_RT. It runs only on execve (bprm_check_security), where it reads current->comm and two parent task_struct pointers via CO-RE.
The policy
73 lines of BPF C, attached at lsm/bprm_check_security.
// 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
char _license[] SEC("license") = "Dual BSD/GPL";
struct {
__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
__uint(max_entries, 1);
__type(key, __u32);
__type(value, __u64);
} refused SEC(".maps");
static __always_inline void count_refused(void)
{
__u32 key = 0;
__u64 *value = bpf_map_lookup_elem(&refused, &key);
if (value)
__sync_fetch_and_add(value, 1);
}
static __always_inline bool is_haupt_comm(const char comm[16])
{
return comm[0] == 'h' && comm[1] == 'a' && comm[2] == 'u' &&
comm[3] == 'p' && comm[4] == 't' && comm[5] == '\0';
}
static __always_inline bool task_is_haupt(const struct task_struct *task)
{
char comm[16] = {};
if (!task || BPF_CORE_READ_INTO(&comm, task, comm))
return false;
return is_haupt_comm(comm);
}
static __always_inline bool current_from_haupt(void)
{
char comm[16] = {};
struct task_struct *task;
struct task_struct *parent;
if (bpf_get_current_comm(&comm, sizeof(comm)) == 0 && is_haupt_comm(comm))
return true;
task = bpf_get_current_task_btf();
parent = BPF_CORE_READ(task, real_parent);
if (task_is_haupt(parent))
return true;
return task_is_haupt(BPF_CORE_READ(parent, real_parent));
}
static __always_inline int earlier_verdict(int ret)
{
return ret >= -4095 && ret < 0 ? ret : -EPERM;
}
SEC("lsm/bprm_check_security")
int BPF_PROG(cve_2026_91925_exec_block, struct linux_binprm *bprm, int ret)
{
if (ret)
return earlier_verdict(ret);
if (!current_from_haupt())
return 0;
count_refused();
return -EPERM;
}
The package: name, license, the program and the CVE it fixes.
[package]
name = "cve-2026-91925"
description = "Refuses program execution from Polyaxon haupt server processes to mitigate CVE-2026-91925"
license = "GPL-2.0 OR BSD-2-Clause"
[[upatches]]
source = "cve-2026-91925-exec-block.bpf.c"
[upatches.tree]
id = "cve-2026-91925-exec-block"
fixes = ["CVE-2026-91925"]
Process
How this upatch was written, checked and reviewed, from the registry’s history.
- 15 Sept 2026CVECVE published
- 25 Nov 2026Pull requestPull request #67 openedAdd CVE-2026-91925: Refuses program execution from Polyaxon haupt server processesromanlab
- 25 Nov 2026CIUpdate upatch.devpassed
- 25 Nov 2026CICIpassed
- 25 Nov 2026MergeMerged #67romanlab
- 25 Nov 2026ReviewReviewedqodo-code-review[bot] (automated)
No human review is recorded on GitHub for this upatch yet.
Evidence
On Polyaxon 2.16.4 (haupt 2.16.4), the loaded upatch refused OS command execution triggered via Jinja2 template rendering in the operation queue field while allowing normal API requests; in-process Python evaluation that does not invoke execve requires upgrading Polyaxon.
- Tested
- 25 Nov 2026
- Target
- Polyaxon haupt 2.16.4 and polyaxon 2.16.4 on Python 3.12, sandbox mode on 127.0.0.1:18000
- Kernel
- 7.4-shirudo-ci-20261123
- Architecture
- x86_64
- Distribution
- Ubuntu 26.04
| State | Template command execution (/bin/echo) blocked | Run submission API works |
|---|---|---|
| Before loading | no (reached) | yes |
| Upatch loaded | yes (EPERM) | yes |
| After unloading | no (reached) | yes |
tools-test.log Output of tools/test --setup showing the payload reaching before, blocked while loaded, and reaching after.
tools/test --setup, 2026-11-25T13:56:45Z Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm cve-2026-91925 setup done POLYAXON_URL=http://127.0.0.1:18000 POLYAXON_OWNER=default POLYAXON_PROJECT=poc-project before reached Polyaxon rendered the queue template via /bin/echo (upatch-probe-0e90ac51f0fa) loaded blocked Polyaxon template execution of /bin/echo was refused with EPERM after reached Polyaxon rendered the queue template via /bin/echo (upatch-probe-8cb0e0ca98bf) 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.
git clone https://github.com/copper-helm/upatch-registry
cd upatch-registry
tools/build <shirudo-checkout> <keys-dir> 1.0.0 upatches/cve-2026-91925shirudo bpm push build/packages/cve-2026-91925-1.0.0.bee oci://<registry>/<namespace>/cve-2026-91925 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-91925-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>