Vulnerabilities in pkg:pypi/apm-cli

PACKAGE
Advisory Identifier: GHSA-xhrw-5qxx-jpwr
Advisory Summary

CVE-2026-44641 is a HIGH (CVSS 7.1) microsoft apm cli's plugin.json component vulnerability (CWE-73: External Control of File Name or Path) affecting Apm cli libraries in the PyPI ecosystem. The issue involves microsoft apm cli's plugin.json component paths escape plugin root and copy arbitrary host files during install. Remediation is available by upgrading affected packages to version 0.8.12.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/apm-cli

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/apm-cli. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-xhrw-5qxx-jpwr CVE-2026-44641 HIGH Microsoft APM CLI's plugin.json component paths escape plugin root and copy arbitrary host files during install
GHSA-mq5j-pw29-jcv3 CVE-2026-46383 MODERATE Microsoft APM: Windows absolute-path tar member overwrite during legacy-bundle probing in `apm install`

CVE-2026-44641 at a Glance

CVE Identifier CVE-2026-44641
GHSA Identifier GHSA-xhrw-5qxx-jpwr
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-73: External Control of File Name or Path
Affected Product Apm cli
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-44641

To remediate this vulnerability, upgrade all affected Apm cli dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

apm-cli fixed: 0.8.12
pip install apm-cli>=0.8.12
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show apm-cli

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-44641, inspect your installed packages using pip:

pip show apm-cli

Analyze the terminal output to locate any version of Apm cli in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.8.12), your application is affected.

Note: The pip show apm-cli command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-73: External Control of File Name or Path, where the product allows user input to control or influence paths or file names that are used in filesystem operations. In Apm cli, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary Microsoft APM normalizes marketplace plugins by copying plugin components referenced in `plugin.json` into `.apm/`. The manifest fields `agents`, `skills`, `commands`, and `hooks` are attacker-controlled, but the implementation does not enforce that those paths remain inside the plugin directory. A malicious plugin can therefore use absolute paths or `../` traversal paths to copy arbitrary readable host files or directories from the installer's machine during `apm install`. In the verified primary proof of concept, a malicious plugin sets `plugin.json.commands` to an external markdown file. A single `apm install` copies that outside file into `.apm/prompts/` and then auto-integrates it into `.github/prompts/secret.prompt.md` in the victim project. This is a local supply-chain trust-boundary violation with direct confidentiality and integrity impact. Reviewed version and commit: - `apm-cli` version `0.8.11` - `main` commit `70b34faa16a5a783424698163deeb028854fd23a` ### Details Root cause: - `src/apm_cli/deps/plugin_parser.py:336-348` - `_resolve_sources()` joins manifest-controlled `agents`, `skills`, `commands`, and directory-form `hooks` paths with `plugin_path` - it checks only `exists()` and `is_symlink()` - it does not resolve the candidate and verify containment inside the plugin root - `src/apm_cli/deps/plugin_parser.py:356-395` - copies attacker-selected agent and skill files/directories into `.apm/` - `src/apm_cli/deps/plugin_parser.py:397-452` - copies attacker-selected command and hook files/directories into `.apm/` - `src/apm_cli/deps/plugin_parser.py:436-442` - string-form hook config paths are also copied without a root-containment check There is already a safer precedent in the same module: - `src/apm_cli/deps/plugin_parser.py:195-210` - `_read_mcp_file()` resolves the candidate path - rejects paths escaping the plugin root - rejects symlinks Reachability: - Local install path: - `src/apm_cli/commands/install.py:2007-2015` - local marketplace plugins are normalized through `normalize_plugin_directory(...)` - Remote install path: - `src/apm_cli/deps/github_downloader.py:2224-2230` - downloaded packages are validated through `validate_apm_package(target_path)` - `src/apm_cli/models/validation.py:164-172`, `224-226`, `304-324` - marketplace plugins are normalized through the same vulnerable path after clone Project write-back path: - `src/apm_cli/integration/prompt_integrator.py:38-56` - reads `.apm/prompts/*.prompt.md` - `src/apm_cli/integration/prompt_integrator.py:170-189` - writes prompt files into `.github/prompts/` - `src/apm_cli/commands/install.py:2496-2514` - auto-integrates package primitives after install This means a malicious dependency can cause APM to read from outside the dependency itself and materialize host-local content into managed install output and, in the verified prompt case, directly into the victim project. ### PoC The attached zip contains a complete maintainer-ready proof-of-concept package, including runnable scripts, payload templates, captured output, and the exact validation environment. Primary end-to-end `apm install` reproduction: 1. Install APM from the reviewed source tree (`apm-cli 0.8.11`, commit `70b34faa16a5a783424698163deeb028854fd23a`) into a Python environment. 2. Create an external file outside the malicious plugin directory, for example: ```text victim\secret.md ``` with content: ```md # STOLEN VIA APM INSTALL ``` 3. Create a malicious plugin with this minimal `plugin.json`: ```json { "name": "evil-plugin", "commands": "D:\\absolute\\path\\to\\victim\\secret.md" } ``` 4. Create a minimal `apm.yml` that references the malicious plugin. 5. Run: ```powershell apm install ``` 6. Observe that APM completes successfully and writes: ```text .github/prompts/secret.prompt.md ``` 7. Observe that the resulting prompt file contains the external host file content: ```md # STOLEN VIA APM INSTALL ``` Verified console output from the included PoC: ```text [>] Installing dependencies from apm.yml... [+] ./evil-plugin (local) |-- 1 prompts integrated -> .github/prompts/ [*] Installed 1 APM dependency. PoC succeeded. Integrated into project: ...\.github\prompts\secret.prompt.md Integrated content: # STOLEN VIA APM INSTALL ``` Secondary remote-parity reproduction: - The attached `reproduce-remote-parity.py` exercises `GitHubPackageDownloader.download_package(...)` after clone by replacing only the clone callback to keep the test self-contained. - It confirms the same unsafe normalization path copies an outside host file into: ```text <download-target>/.apm/prompts/secret.prompt.md ``` ### Impact This is a path traversal / arbitrary local file copy issue in the package install flow. Who is impacted: - any user who runs `apm install` against a malicious or compromised plugin dependency - both direct and transitive dependency consumers What an attacker gains: - ability to copy arbitrary readable host files into `.apm/` during install - ability to copy arbitrary readable host directories recursively into `.apm/` - ability to trigger project write-back when the copied content lands in supported primitive locations such as `.apm/prompts/` Practical impact: - local notes, markdown, source material, or configuration files can be staged into repository-controlled paths - copied prompt files are automatically written into `.github/prompts/`, increasing the chance that sensitive or attacker-selected content is committed, synced, or consumed by other tooling - the issue breaks the expected trust boundary that a dependency install should copy only content belonging to the dependency itself ### Mitigation Recommended fix: 1. Resolve every manifest-controlled component path against `plugin_path.resolve()`. 2. Reject absolute or relative paths that escape the plugin root. 3. Apply the same containment check to `agents`, `skills`, `commands`, and both `hooks` code paths. 4. Reject symlinks before copying. 5. Add regression tests for: - absolute file path in `commands` - absolute directory path in `commands` - `../` traversal in `agents` - `../` traversal in `skills` - `../` traversal in `hooks` - confirmation that only in-root files remain accepted ### Attachment [Microsoft_APM_Plugin_Path_Escape_Report_Final.zip](https://github.com/user-attachments/files/26829524/Microsoft_APM_Plugin_Path_Escape_Report_Final.zip)

CVE-2026-44641 Affected Apm cli Versions

1 component(s)
Fixed Versions:
0.8.12
Product / Package Ecosystem Affected Versions Fixed Version
apm-cli
PyPI
< 0.8.12
0.8.12

References

Frequently Asked Questions

What is CVE-2026-44641?
CVE-2026-44641 is a security vulnerability in Apm cli involving Microsoft APM CLI's plugin.json component paths escape plugin root and copy arbitrary host files during install under CWE-73: External Control of File Name or Path.
Which Apm cli versions are affected?
Affected versions include releases prior to 0.8.12 across affected packages: apm-cli.
What version fixes CVE-2026-44641?
Upgrading to 0.8.12 (or the latest patched release for your respective branch) resolves the vulnerability.
Is apm-cli affected?
Yes, apm-cli is affected in releases prior to 0.8.12. Upgrade your dependency to 0.8.12 or later.
What is the CVSS score of CVE-2026-44641?
CVE-2026-44641 has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2026-44641?
CVE-2026-44641 is classified under CWE-73: External Control of File Name or Path (The product allows user input to control or influence paths or file names that are used in filesystem operations.).
How can I check PyPI dependencies for CVE-2026-44641?
Run the dependency tree command: 'pip show apm-cli'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xhrw-5qxx-jpwr",
  "modified" : "2026-05-15T23:51:29Z",
  "published" : "2026-05-07T21:41:08Z",
  "aliases" : [ "CVE-2026-44641" ],
  "summary" : "Microsoft APM CLI's plugin.json component paths escape plugin root and copy arbitrary host files during install",
  "details" : "### Summary\nMicrosoft APM normalizes marketplace plugins by copying plugin components referenced in `plugin.json` into `.apm/`. The manifest fields `agents`, `skills`, `commands`, and `hooks` are attacker-controlled, but the implementation does not enforce that those paths remain inside the plugin directory. A malicious plugin can therefore use absolute paths or `../` traversal paths to copy arbitrary readable host files or directories from the installer's machine during `apm install`.\n\nIn the verified primary proof of concept, a malicious plugin sets `plugin.json.commands` to an external markdown file. A single `apm install` copies that outside file into `.apm/prompts/` and then auto-integrates it into `.github/prompts/secret.prompt.md` in the victim project. This is a local supply-chain trust-boundary violation with direct confidentiality and integrity impact.\n\nReviewed version and commit:\n\n- `apm-cli` version `0.8.11`\n- `main` commit `70b34faa16a5a783424698163deeb028854fd23a`\n\n### Details\nRoot cause:\n\n- `src/apm_cli/deps/plugin_parser.py:336-348`\n  - `_resolve_sources()` joins manifest-controlled `agents`, `skills`, `commands`, and directory-form `hooks` paths with `plugin_path`\n  - it checks only `exists()` and `is_symlink()`\n  - it does not resolve the candidate and verify containment inside the plugin root\n- `src/apm_cli/deps/plugin_parser.py:356-395`\n  - copies attacker-selected agent and skill files/directories into `.apm/`\n- `src/apm_cli/deps/plugin_parser.py:397-452`\n  - copies attacker-selected command and hook files/directories into `.apm/`\n- `src/apm_cli/deps/plugin_parser.py:436-442`\n  - string-form hook config paths are also copied without a root-containment check\n\nThere is already a safer precedent in the same module:\n\n- `src/apm_cli/deps/plugin_parser.py:195-210`\n  - `_read_mcp_file()` resolves the candidate path\n  - rejects paths escaping the plugin root\n  - rejects symlinks\n\nReachability:\n\n- Local install path:\n  - `src/apm_cli/commands/install.py:2007-2015`\n  - local marketplace plugins are normalized through `normalize_plugin_directory(...)`\n- Remote install path:\n  - `src/apm_cli/deps/github_downloader.py:2224-2230`\n  - downloaded packages are validated through `validate_apm_package(target_path)`\n  - `src/apm_cli/models/validation.py:164-172`, `224-226`, `304-324`\n  - marketplace plugins are normalized through the same vulnerable path after clone\n\nProject write-back path:\n\n- `src/apm_cli/integration/prompt_integrator.py:38-56`\n  - reads `.apm/prompts/*.prompt.md`\n- `src/apm_cli/integration/prompt_integrator.py:170-189`\n  - writes prompt files into `.github/prompts/`\n- `src/apm_cli/commands/install.py:2496-2514`\n  - auto-integrates package primitives after install\n\nThis means a malicious dependency can cause APM to read from outside the dependency itself and materialize host-local content into managed install output and, in the verified prompt case, directly into the victim project.\n\n### PoC\nThe attached zip contains a complete maintainer-ready proof-of-concept package, including runnable scripts, payload templates, captured output, and the exact validation environment.\n\nPrimary end-to-end `apm install` reproduction:\n\n1. Install APM from the reviewed source tree (`apm-cli 0.8.11`, commit `70b34faa16a5a783424698163deeb028854fd23a`) into a Python environment.\n2. Create an external file outside the malicious plugin directory, for example:\n\n```text\nvictim\\secret.md\n```\n\nwith content:\n\n```md\n# STOLEN VIA APM INSTALL\n```\n\n3. Create a malicious plugin with this minimal `plugin.json`:\n\n```json\n{\n  \"name\": \"evil-plugin\",\n  \"commands\": \"D:\\\\absolute\\\\path\\\\to\\\\victim\\\\secret.md\"\n}\n```\n\n4. Create a minimal `apm.yml` that references the malicious plugin.\n5. Run:\n\n```powershell\napm install\n```\n\n6. Observe that APM completes successfully and writes:\n\n```text\n.github/prompts/secret.prompt.md\n```\n\n7. Observe that the resulting prompt file contains the external host file content:\n\n```md\n# STOLEN VIA APM INSTALL\n```\n\nVerified console output from the included PoC:\n\n```text\n[>] Installing dependencies from apm.yml...\n  [+] ./evil-plugin (local)\n  |-- 1 prompts integrated -> .github/prompts/\n\n[*] Installed 1 APM dependency.\nPoC succeeded.\nIntegrated into project: ...\\.github\\prompts\\secret.prompt.md\nIntegrated content:\n# STOLEN VIA APM INSTALL\n```\n\nSecondary remote-parity reproduction:\n\n- The attached `reproduce-remote-parity.py` exercises `GitHubPackageDownloader.download_package(...)` after clone by replacing only the clone callback to keep the test self-contained.\n- It confirms the same unsafe normalization path copies an outside host file into:\n\n```text\n<download-target>/.apm/prompts/secret.prompt.md\n```\n\n### Impact\nThis is a path traversal / arbitrary local file copy issue in the package install flow.\n\nWho is impacted:\n\n- any user who runs `apm install` against a malicious or compromised plugin dependency\n- both direct and transitive dependency consumers\n\nWhat an attacker gains:\n\n- ability to copy arbitrary readable host files into `.apm/` during install\n- ability to copy arbitrary readable host directories recursively into `.apm/`\n- ability to trigger project write-back when the copied content lands in supported primitive locations such as `.apm/prompts/`\n\nPractical impact:\n\n- local notes, markdown, source material, or configuration files can be staged into repository-controlled paths\n- copied prompt files are automatically written into `.github/prompts/`, increasing the chance that sensitive or attacker-selected content is committed, synced, or consumed by other tooling\n- the issue breaks the expected trust boundary that a dependency install should copy only content belonging to the dependency itself\n\n### Mitigation\nRecommended fix:\n\n1. Resolve every manifest-controlled component path against `plugin_path.resolve()`.\n2. Reject absolute or relative paths that escape the plugin root.\n3. Apply the same containment check to `agents`, `skills`, `commands`, and both `hooks` code paths.\n4. Reject symlinks before copying.\n5. Add regression tests for:\n   - absolute file path in `commands`\n   - absolute directory path in `commands`\n   - `../` traversal in `agents`\n   - `../` traversal in `skills`\n   - `../` traversal in `hooks`\n   - confirmation that only in-root files remain accepted\n\n### Attachment\n[Microsoft_APM_Plugin_Path_Escape_Report_Final.zip](https://github.com/user-attachments/files/26829524/Microsoft_APM_Plugin_Path_Escape_Report_Final.zip)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "apm-cli"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.8.12"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.8.11"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/microsoft/apm/security/advisories/GHSA-xhrw-5qxx-jpwr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-44641"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/microsoft/apm"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-73" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-07T21:41:08Z",
    "nvd_published_at" : "2026-05-15T17:16:47Z"
  }
}