upatch.dev

CVE-2026-77751

Path Traversal in MISP Object Template Resolution During STIX Import and Export in misp-stix library

Refuses opening definition.json outside pymisp's objects directory to mitigate CVE-2026-77751.

High 8.8Vetted

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

At a glance

CVE-2026-77751 is a high (CVSS 8.8) vulnerability in misp-stix, published 21 August 2026. A vetted upatch, cve-2026-77751-misp-stix-block, blocks it on running Linux machines with shirudo until misp-stix is upgraded.

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

Overview

CVE-2026-77751, "Path Traversal in MISP Object Template Resolution During STIX Import and Export in misp-stix library", was published on 21 August 2026. During STIX 2 import (STIX2CustomObjectConverter._parse_custom_object) and MISP-to-STIX 2 export (MISPtoSTIX2Parser.parse_misp_event, parse_misp_object, parse_misp_objects), misp-stix passes untrusted MISP object template names (x_misp_name or name) to PyMISP's object-template resolution, which joins the configured MISP object-template directory (data/misp-objects/objects), the object name, and definition.json. An object name containing path separators or .. segments escapes the objects/<template>/ directory and opens a definition.json file elsewhere on the filesystem, copying its fields onto the converted object.

Official description

A path traversal vulnerability existed in the handling of MISP object template names during STIX 2 import and MISP-to-STIX 2 export. MISP object names are passed to PyMISP's object-template resolution mechanism, which constructs a filesystem path by joining the configured MISP object-template directory, the object name, and definition.json. An object name originating from untrusted STIX or MISP content was not sufficiently restricted before being used in this filesystem path. An attacker able to supply a crafted object name containing path separators or traversal sequences such as ../ could therefore cause template resolution to escape the expected template directory and attempt to load a definition.json file from another location accessible to the process. During STIX 2 import, an attacker-controlled x_misp_name from a custom STIX object could directly reach this template-resolution mechanism. The issue could also become persistent. A malicious object name stored in a MISP event could later be processed again during STIX 2 export. Consequently, content originally introduced in one security context could trigger filesystem access later when the event is exported by a process operating with different or greater privileges. If a suitable definition.json file exists outside the intended template directory, its contents may be interpreted as a MISP object template and fields from that file copied into the converted object. This can result in unintended disclosure of locally accessible data represented by the template file and modification of the resulting object's metadata or semantics. The patches introduce strict validation of object-template names. Valid names are restricted to a single path component containing letters, digits, hyphens, or underscores. Names that do not meet these requirements are replaced with the generic unknown-template name before reaching PyMISP template resolution. The original rejected name is preserved in the object's comment and a warning is generated, preventing traversal while retaining the source information.

Affected versions

Package Affected Fixed in
misp-stix up to and including 2026.7.8 2026.9.8

Affected kernels: all kernels with BPF LSM support.

Sources

More references from NVD (2)

Mitigation

The lsm/file_open program returns -EPERM when a process whose executable name starts with python opens a file named definition.json whose grandparent directory (d_parent->d_parent) is not named objects. In the kernel VFS, .. components are resolved during path walk before security_file_open runs, so file->f_path.dentry points to the target definition.json at its real location. Built-in MISP object templates live at data/misp-objects/objects/<template>/definition.json, where d_parent->d_parent is objects. Any traversal that escapes objects/<template>/ resolves to a definition.json whose grandparent is not objects and is refused. A refusal from an earlier BPF LSM program on the same hook is passed on. The refused per-CPU array counts refusals at key 0.

Side effects

  • Any attempt by a Python process to open a file named definition.json whose grandparent directory is not named objects fails with EPERM.
  • In misp-stix 2026.7.8, a STIX 2 import or MISP-to-STIX 2 export whose object name traverses to an external definition.json fails with PermissionError instead of loading the external file.
  • Normal MISP object templates under objects/<template>/definition.json open normally.
  • Non-Python processes are untouched.

Preemption model and cost

The program keeps no state beyond the per-CPU refusal counter, which it updates with an atomic add, so it is correct under every preemption model, including preemptible RCU and PREEMPT_RT. On every file_open for a file whose name is not 15 bytes long, a run costs one length check on dentry->d_name.len. Only files named definition.json proceed to the grandparent and executable checks.

The policy

97 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

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

	if (!dentry || BPF_CORE_READ(dentry, d_name.len) != 15)
		return false;
	if (!name || bpf_probe_read_kernel(buf, 15, name))
		return false;
	return buf[0] == 'd' && buf[1] == 'e' && buf[2] == 'f' &&
	       buf[3] == 'i' && buf[4] == 'n' && buf[5] == 'i' &&
	       buf[6] == 't' && buf[7] == 'i' && buf[8] == 'o' &&
	       buf[9] == 'n' && buf[10] == '.' && buf[11] == 'j' &&
	       buf[12] == 's' && buf[13] == 'o' && buf[14] == 'n';
}

static __always_inline bool is_objects_dir(const struct dentry *dentry)
{
	const unsigned char *name = BPF_CORE_READ(dentry, d_name.name);
	char buf[8] = {};

	if (!dentry || BPF_CORE_READ(dentry, d_name.len) != 7)
		return false;
	if (!name || bpf_probe_read_kernel(buf, 7, name))
		return false;
	return buf[0] == 'o' && buf[1] == 'b' && buf[2] == 'j' &&
	       buf[3] == 'e' && buf[4] == 'c' && buf[5] == 't' &&
	       buf[6] == 's';
}

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);
	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 int earlier_verdict(int ret)
{
	return ret >= -4095 && ret < 0 ? ret : -EPERM;
}

SEC("lsm/file_open")
int BPF_PROG(cve_2026_77751_open, struct file *file, int ret)
{
	const struct dentry *dentry = file->f_path.dentry;
	const struct dentry *grandparent;

	if (ret)
		return earlier_verdict(ret);
	if (!is_definition_json(dentry))
		return 0;
	grandparent = BPF_CORE_READ(dentry, d_parent, d_parent);
	if (is_objects_dir(grandparent))
		return 0;
	if (!current_is_python())
		return 0;
	count_refused();
	return -EPERM;
}

Process

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

  1. 21 Aug 2026CVECVE published
  2. 25 Nov 2026Pull requestPull request #68 openedAdd CVE-2026-77751: Refuses opening definition.json outside pymisp's objects directoryromanlab
  3. 25 Nov 2026CIUpdate upatch.devpassed
  4. 25 Nov 2026CICIpassed
  5. 25 Nov 2026MergeMerged #68romanlab

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

Evidence

On misp-stix 2026.7.8, the loaded upatch refused opening a definition.json outside pymisp's objects/<template>/ directory with EPERM when exporting a MISP event whose object name used .. traversal, while normal template resolution kept working.

Tested
25 Nov 2026
Target
misp-stix 2026.7.8 on Python 3.12, listening on 127.0.0.1
Kernel
7.4-shirudo-ci-20261123
Architecture
x86_64
Machine
shirudo test VM
Results
StateTraversal object name loads outside definition.jsonNormal file object template resolution
Before loadingyesyes
Upatch loadedno (EPERM)yes
After unloadingyesyes
tools-test.log Output of tools/test --setup showing the payload reached before, blocked while the upatch was loaded, and reached again after unloading.
tools/test --setup, 2026-11-25T13:58:52Z
Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm
cve-2026-77751
  setup   done         MISP_STIX_URL=http://127.0.0.1:38873 MISP_OBJECTS_DIR=/opt/upatch-payload/cve-2026-77751/venv/lib/python3.12/site-packages/pymisp/data/misp-objects/objects MISP_PROBE_DIR=/opt/upatch-payload/cve-2026-77751/probe
  before  reached      traversal object name loaded outside definition.json into the STIX bundle
  loaded  blocked      opening definition.json outside objects/ failed with PermissionError (EPERM)
  after   reached      traversal object name loaded outside definition.json into the STIX bundle
  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-77751
Publish and roll out
shirudo bpm push build/packages/cve-2026-77751-1.0.0.bee oci://<registry>/<namespace>/cve-2026-77751 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-77751-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>