CVE-2026-129919

Kunai Mount Namespace Cache TOCTOU Allows Incorrect Event Resolution Against Host Files

Published Nov 16, 2026 CVSS 4.0 · 2 Low EPSS n/a KEV · Not listed
Description
Kunai, a security monitoring tool, contains a time-of-check to time-of-use (TOCTOU) race condition in its mount namespace (mnt ns) caching logic. When resolving a security event that references a specific process PID and an expected mount namespace, the Switcher::new function read /proc/<pid>/ns/mnt to determine the target namespace and cached the result under the expected namespace key without verifying that the resolved namespace actually matched the expected one.

An attacker with local access could exploit this by either (1) arranging for the referenced PID to be reused by a process in a different namespace (e.g., the host namespace) before Kunai resolves it, or (2) calling unshare or setns on the target process after the event is generated but before the namespace is resolved. In either case, the wrong namespace (potentially the host's own namespace) would be cached under the container's namespace key.

The security impact is that subsequent container security events would be resolved against host filesystem paths rather than container paths. This undermines the integrity of the security monitoring data: container activity could be misattributed to the host, host activity could be misattributed to a container, and file-path-based detections or alerts would reference incorrect paths. An attacker could potentially use this to obscure malicious activity within a container by making it appear as benign host activity, or to generate misleading security alerts.

The vulnerability requires local access to the system and a specific timing window between event generation and namespace resolution. No remote attack vector or user interaction is required.

Remediation

Vendor Solution

The fix eliminates the TOCTOU race by opening the namespace file once to obtain a stable file descriptor, then reading the inode number from that fd via fstat/metadata and comparing it against the expected namespace's inode number. If the inodes do not match, the switcher creation is rejected with an UnexpectedNsInode error and nothing is cached, so the event is simply not enriched. This ensures the cached namespace identity is verified atomically from the opened fd rather than from a separate /proc lookup that could be affected by PID reuse or namespace changes.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Kunai, a security monitoring tool, contains a time-of-check to time-of-use (TOCTOU) race condition in its mount namespace (mnt ns) caching logic. When resolving a security event that references a specific process PID and an expected mount namespace, the Switcher::new function read /proc/<pid>/ns/mnt to determine the target namespace and cached the result under the expected namespace key without verifying that the resolved namespace actually matched the expected one. An attacker with local access could exploit this by either (1) arranging for the referenced PID to be reused by a process in a different namespace (e.g., the host namespace) before Kunai resolves it, or (2) calling unshare or setns on the target process after the event is generated but before the namespace is resolved. In either case, the wrong namespace (potentially the host's own namespace) would be cached under the container's namespace key. The security impact is that subsequent container security events would be resolved against host filesystem paths rather than container paths. This undermines the integrity of the security monitoring data: container activity could be misattributed to the host, host activity could be misattributed to a container, and file-path-based detections or alerts would reference incorrect paths. An attacker could potentially use this to obscure malicious activity within a container by making it appear as benign host activity, or to generate misleading security alerts. The vulnerability requires local access to the system and a specific timing window between event generation and namespace resolution. No remote attack vector or user interaction is required.
Title Kunai Mount Namespace Cache TOCTOU Allows Incorrect Event Resolution Against Host Files
First Time appeared Kunai-project
Kunai-project kunai
Weaknesses CWE-20
CWE-367
CPEs cpe:2.3:a:kunai-project:kunai:*:*:*:*:*:*:*:*
Vendors & Products Kunai-project
Kunai-project kunai
References
Metrics cvssV4_0

{'score': 2, 'vector': 'CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:L/SA:N'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
CIRCL
Published
Updated
Nov 16, 2026, 2:50 PM
Reserved
Nov 16, 2026, 1:49 PM
Status
Received
Published
Nov 16, 2026, 2:17 PM
Modified
Nov 16, 2026, 3:17 PM