Path Traversal Vulnerability in Plandex
Plandex version 2.2.1 contains a path traversal vulnerability in the ApplyFiles function allowing arbitrary file writes via manipulated model outputs, potentially leading to remote code execution.
CVE search metadata
CVE search record: CVE-2026-85690. Severity: high. CVSS: 7.8. KEV: no. Product: Plandex (2.2.1). Brief: Path Traversal Vulnerability in Plandex. Brief link: https://feed.craftedsignal.io/briefs/2026-09-plandex-path-traversal/
Plandex version 2.2.1 contains a critical path traversal vulnerability within its ApplyFiles function. This flaw arises from insufficient validation of file paths during the file application process, which is intended to update or create files within a designated project directory. An attacker who can influence the model's output, either through poisoned repository files or by supplying malicious context to the AI model, can force Plandex to write files to arbitrary locations on the host filesystem. By targeting sensitive directories, such as those containing shell initialization scripts (.bashrc, .zshrc) or cron job configurations, an attacker can achieve unauthorized code execution under the context of the user running the Plandex tool. This vulnerability represents a significant security risk for developers using Plandex in environments where the AI model's context might be influenced by untrusted sources.
Attack Chain
- The attacker identifies or creates a malicious repository file or manipulates the Plandex project context.
- The attacker triggers the Plandex model to generate a file update or creation action involving the ApplyFiles function.
- The model output is crafted to include path traversal sequences (e.g., ../../../) within the filename parameter.
- The ApplyFiles function fails to sanitize the provided path, allowing the write operation to escape the target project directory.
- The Plandex process performs an unauthorized write to a sensitive system or user location, such as ~/.bashrc.
- The target system or user triggers the malicious file (e.g., upon new shell login or cron execution).
- Arbitrary code defined by the attacker is executed on the host system.
Impact
Successful exploitation allows attackers to gain remote code execution on the host machine running Plandex. This can lead to full system compromise, data exfiltration, or the establishment of persistent backdoors. Targeted environments include any developer workstation or server instance where Plandex is used to process code or configuration files.
Recommendation
- Upgrade Plandex to a version addressing CVE-2026-85690 immediately once available from the vendor.
- Review logs for unexpected file write operations originating from the Plandex process.
- Isolate Plandex operations in a containerized or sandboxed environment with restricted filesystem access to mitigate the impact of path traversal.
Immediate actions
Upgrade Plandex to a patched version once released.
Mitigations
Run Plandex within restricted containers to limit filesystem exposure.
CVE-2026-85690