May 15, 2026·5 min read·96 visits
Microsoft APM < 0.13.0 on Windows is vulnerable to an arbitrary file overwrite during archive extraction. Exploitation requires user interaction to install a crafted tarball.
A path traversal vulnerability exists in the legacy-bundle probing logic of Microsoft APM, an open-source dependency manager for AI agents. On Windows systems using Python versions prior to 3.12, this allows local attackers to overwrite arbitrary files via a crafted tarball.
Microsoft APM functions as an open-source dependency manager designed specifically for AI agents. The tool allows users to install modules and plugins, frequently distributed as .tar.gz archives, via the apm install <bundle> command. To support backward compatibility, APM implements a probing phase that extracts the contents of a local archive to a temporary directory to check for the presence of a legacy apm.lock.yaml file.
The vulnerability, tracked as CVE-2026-46383, occurs during this probing phase. The extraction logic utilizes the standard Python tarfile library without adequate path sanitization for Windows environments. This oversight results in an arbitrary file overwrite vulnerability, commonly referred to as a "TarSlip" attack.
Because the extraction happens before the bundle's format is validated, the malicious payload is executed regardless of whether the bundle is ultimately accepted as valid. This path traversal vulnerability is categorized under CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) and CWE-73 (External Control of File Name or Path).
The fundamental flaw lies in how the tarfile.extractall() method handles archive members and how Python's os.path.join() interacts with absolute paths on Windows operating systems. By default, tarfile in Python versions prior to 3.12 does not sanitize member names that contain absolute paths or UNC paths.
When tarfile extracts a member, it appends the member's stored path to the target extraction directory using os.path.join(). On Windows, if os.path.join() encounters an absolute path component (e.g., D:/path or \\server\share), it discards all preceding path components. Consequently, an expression like os.path.join('C:/temp/apm_probe', 'D:/evil/startup.bat') resolves directly to D:/evil/startup.bat.
The APM legacy-bundle probe extracts the entire archive contents unconditionally to check for a single lock file. This unrestricted extraction passes attacker-controlled absolute paths directly to the vulnerable os.path.join() operation. The operation completely bypasses the intended temporary directory boundary, resulting in arbitrary file writes anywhere the executing user has permissions.
The vulnerability was mitigated in version 0.13.0 through commit 77d1dda8303c8d7ccb6148788a6274fdece98499. The patch introduces a comprehensive pre-extraction validation loop that inspects every archive member before any data is written to disk.
# src/apm_cli/bundle/local_bundle.py
for member in tar.getmembers():
name = member.name
if (
name.startswith("/")
or PureWindowsPath(name).drive
or PureWindowsPath(name).is_absolute()
):
return False # Reject Windows absolute paths
try:
validate_path_segments(name, context="tar member")
except PathTraversalError:
return FalseThe patched code uses pathlib.PureWindowsPath to accurately parse Windows-specific path semantics regardless of the host OS. It explicitly rejects any archive member where a drive letter (.drive) is specified or where the path is determined to be absolute (.is_absolute()).
Additionally, the code now invokes a validate_path_segments utility to detect and block relative traversal sequences, such as ... For environments running Python 3.12 or newer, the patch also implements the native filter="data" argument in tar.extractall(), as recommended by PEP 706, providing an additional layer of runtime protection against TarSlip attacks.
Exploitation requires social engineering or supply chain poisoning, as the victim must be induced to download and install a crafted archive. The attacker first generates a malicious .tar.gz file containing a member named with a Windows absolute path, such as C:/Users/Public/startup.bat.
The victim executes the command apm install malicious.tar.gz in their local environment. APM begins the installation process by entering the legacy-bundle probe phase, creating a temporary directory for extraction.
During extraction, the tarfile module reads the absolute path from the archive member. The os.path.join() function resolves the extraction path to the attacker's specified absolute path, ignoring the temporary directory base. The file is then written, overwriting any existing file or placing a new file at the specified location.
A successful exploit allows the attacker to write or overwrite arbitrary files on the victim's filesystem with the privileges of the user executing the apm install command. The CVSS v3.1 base score of 5.5 reflects the local attack vector, the requirement for user interaction, and the high impact to data integrity.
If the victim runs APM with administrative privileges, the attacker can overwrite critical system files or drop persistent malware into startup directories. Even under standard user privileges, an attacker can modify user-specific configuration files, overwrite SSH keys, or manipulate localized startup scripts to achieve code execution on the next login.
The vulnerability does not directly impact system availability or confidentiality according to the CVSS vector. The primary consequence is unauthorized data modification, which serves as a stepping stone for further local exploitation and persistence mechanisms.
The primary remediation for CVE-2026-46383 is to upgrade the microsoft/apm package to version 0.13.0 or later. This version contains the logic required to safely validate archive members prior to extraction on all supported platforms.
As a defense-in-depth measure, users should run APM on Python 3.12 or newer. Python 3.12 introduces native protections against TarSlip vulnerabilities via the filter parameter in tarfile.extractall(). The patched version of APM leverages this feature automatically when the modern runtime is detected.
Users who cannot immediately upgrade should strictly avoid installing APM bundles or plugins from unverified third-party sources. Administrators should also enforce least privilege principles, ensuring that the user account executing apm install does not possess administrative rights, thereby limiting the scope of any potential file overwrites.
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
microsoft/apm Microsoft | < 0.13.0 | 0.13.0 |
| Attribute | Detail |
|---|---|
| CVE ID | CVE-2026-46383 |
| CWE ID | CWE-22 |
| CVSS Score | 5.5 |
| Attack Vector | Local (User Interaction Required) |
| Impact | High Integrity (Arbitrary File Overwrite) |
| Exploit Status | Proof of Concept |
| CISA KEV | Not Listed |
The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
A path traversal vulnerability (CWE-22) in termux-sync prior to version 1.2.4 allows an attacker to overwrite arbitrary files within the Termux environment during the backup restoration process. The flaw stems from the application trusting attacker-controlled extraction paths defined in the backup's manifest.json file, failing to validate archive members against directory traversal sequences during tar extraction, and using unsanitized backup names when constructing temporary directories. If a user restores a malicious backup archive from local storage, shared folders, GitHub, or Google Drive, an attacker can overwrite sensitive configuration files such as shell startup scripts or local binaries, resulting in arbitrary code execution under the privileges of the Termux user.
SpamScope mail-parser versions 3.8.0 prior to 4.6.0 contain a path traversal vulnerability (CWE-22) within the write_attachments() and write_sample() functions. The library passes untrusted attachment filenames directly into os.path.join() without stripping directory components, validating path containment, or verifying symbolic links. An attacker can send a crafted email containing relative path traversal sequences or absolute filesystem paths in the Content-Disposition header to write or overwrite arbitrary files accessible to the parsing process.
A Regular Expression Denial of Service (ReDoS) vulnerability exists in SpamScope mail-parser versions 4.2.0 prior to 4.6.1. Two separate regular expressions evaluated during standard email header parsing exhibit quadratic to cubic backtracking complexity when processing headers padded with whitespace or angle brackets. An unauthenticated remote attacker can exploit this flaw by sending a small, RFC-compliant email message, causing parsing worker threads or processes to stall at 100% CPU utilization for extended periods.
CVE-2026-129297 is an origin validation vulnerability (CWE-345) in the Python library mail-parser prior to version 4.6.2. The MailParser.get_server_ipaddress() method fails to properly isolate MTA-recorded client IP addresses from sender-controlled text within email Received headers. Due to naive substring delimiter matching, appearance-based regular expression scanning, and fail-open header traversal, remote attackers can spoof their originating IP address to bypass email security controls, blocklists, and anti-spam attribution.
CVE-2026-129299 (GHSA-24mq-4vc6-2prf) is a parsing and serialization flaw in SpamScope mail-parser prior to version 4.6.2. The library uses reflective Python attribute resolution (getattr) over untrusted email header names and applies caller convenience transformations (such as underscore-to-hyphen folding and _json/_raw suffix stripping) directly to wire headers. An unauthenticated remote attacker can send crafted emails that trigger uncaught TypeError exceptions during JSON serialization or cause security-relevant headers and body content to be silently dropped without setting defect indicators.
CVE-2026-129236 is a command-line argument injection vulnerability (CWE-88) in Kubeshark, an eBPF-based network observability tool for Kubernetes. Located within the Model Context Protocol (MCP) server implementation in cmd/mcpRunner.go, the flaw occurs when handling the start_kubeshark tool request. When the MCP server runs with the --allow-destructive flag, the callStartKubeshark function appends the caller-supplied pod_regex parameter directly to the kubeshark tap argument slice without an end-of-options (--) delimiter. Because Kubeshark uses the Cobra and pflag libraries for command-line parsing, any pod_regex value prefixed with a hyphen is interpreted as a CLI flag rather than a positional regular expression. An attacker capable of influencing MCP tool arguments, such as through indirect prompt injection against a connected Large Language Model (LLM) agent, can inject the --set flag to override Helm chart values like tap.docker.registry. Because Kubeshark deploys its worker DaemonSet with privileged security contexts and host networking enabled, redirecting the container image registry allows arbitrary code execution as root across all Kubernetes cluster nodes.