APM CLI Symlink Vulnerability Leads to File Content Disclosure (CVE-2026-45539)
A vulnerability in the `apm-cli` tool allows a malicious APM package to include symlinks that, when installed, can lead to file-content disclosure, by dereferencing symlinks under `.apm/prompts/` and `.apm/agents/` during `apm install`, and copying host-local file contents into the project tree.
A vulnerability exists in the apm-cli tool (versions 0.5.4 through 0.12.4) where symbolic links within APM packages are mishandled during the installation process. Specifically, when an APM package containing symlinks under the .apm/prompts/ or .apm/agents/ directories is installed, the apm install command dereferences these symlinks. This leads to the contents of the linked files being copied into the project’s deployment directories. This vulnerability, identified as CVE-2026-45539, allows a malicious APM package author to potentially disclose sensitive file contents from the system running the apm install command if the user running the command has read access to them. The issue stems from the PromptIntegrator and AgentIntegrator classes, which lack proper symlink handling.
Attack Chain
- Attacker creates a malicious APM package.
- The package includes a symbolic link within the
.apm/agents/or.apm/prompts/directory. The symlink points to a sensitive file on the victim’s system (e.g.,/etc/shadowor/proc/self/environ). - The attacker publishes this malicious package to a repository or otherwise distributes it to victims.
- Victim adds the malicious package as a dependency in their
apm.ymlfile. - Victim runs the
apm installcommand. - The
apm installcommand clones the package and, due to vulnerable code inPromptIntegratororAgentIntegrator, dereferences the symbolic link. - The content of the file pointed to by the symlink is copied into the victim project’s deployment directories (e.g.,
.github/,.claude/). - The attacker gains access to the disclosed file content, potentially leading to credential theft or other unauthorized access.
Impact
Successful exploitation of this vulnerability (CVE-2026-45539) leads to arbitrary file content disclosure. An attacker can craft a malicious APM package to read and exfiltrate the content of any file readable by the user running the apm install command. The observed result is that the files in the deploy directories will contain the content of the linked file. This could include sensitive information like environment variables, configuration files, or even credentials. This allows the attacker to perform lateral movement or privilege escalation within the victim’s environment.
Recommendation
- Apply the recommended fix provided in the advisory by routing affected finders through the existing safe helper (
BaseIntegrator.find_files_by_glob()) to mitigate CVE-2026-45539. - Deploy the Sigma rule “Detect APM CLI Installation with Suspicious Symlink Targets” to identify attempts to exploit this vulnerability via
process_creationlogs. - Implement the optional defense-in-depth measures suggested in the advisory, such as raising an exception on
source.is_symlink()withincopy_prompt,copy_agent,_write_codex_agent, and_write_windsurf_agent_skillfunctions. - Treat any symlink under a dependency’s
.apm/tree as a security finding during scanning.
Detection coverage 2
Detect APM CLI Installation with Suspicious Symlink Targets
highDetects CVE-2026-45539 exploitation — Flags APM CLI installations where the command line contains paths suggestive of symlink exploitation, especially those targeting sensitive files.
Detect APM CLI Writing Files Containing Credential-Looking Content
mediumDetects writing files containing credential-looking content in known apm deploy paths
Detection queries are available on the platform. Get full rules →