/

CVE-2026-85690

Severity:

HIGH RISK

(7.8)

Path Traversal (CWE-22) in Plandex ApplyFiles Function

CVE-2026-85690

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write and Potential Code Execution

Severity:

HIGH RISK

(7.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Plandex contains a path traversal vulnerability in its ApplyFiles function, allowing attacker-influenced model output or repository context to cause files to be written outside the intended project directory. If sensitive filesystem locations are reachable and the affected process has sufficient permissions, this could enable code execution through modified shell or scheduled-task configuration.

Affected context

The issue occurs in Plandex deployments that use the ApplyFiles function to apply file changes generated from model output or repository-derived context. Risk increases when repository contents or contextual inputs can be poisoned, when generated paths are not confined to the project directory, and when the Plandex process has write access to user or system execution-related files.

Exploit preconditions

  • Attack surface: The ApplyFiles file-writing functionality
  • Required access: The ability to influence repository files, task context, or model-directed file changes
  • Trigger point: Processing and writing attacker-influenced file paths
  • Why exploitation is possible: File paths are insufficiently constrained to the intended project directory, allowing traversal outside the permitted root
  • Privilege dependency: The resulting impact depends on the filesystem permissions of the Plandex process

Why this happens

The vulnerability is caused by accepting attacker-influenced paths without reliably canonicalizing them and enforcing containment within the designated project directory. Relative traversal sequences or equivalent path representations can cause file operations to escape the intended directory boundary. This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal.

Potential impact

  • Attackers may overwrite files outside the project directory
  • Shell startup or scheduled-task files could be modified
  • The affected user account may execute attacker-controlled commands
  • Application data, source code, or configuration could be tampered with
  • The incident could enable persistence or broader compromise depending on process privileges

General mitigation guidance

Mitigation generally focuses on treating generated paths and repository-derived filenames as untrusted input.

Common defensive patterns include:

  • Canonicalizing candidate paths before file operations
  • Enforcing a strict project-root containment check after canonicalization
  • Rejecting absolute paths, traversal components, and ambiguous path encodings
  • Allowing writes only to an explicit list of expected files or directories
  • Separating model output from privileged filesystem operations through approval or policy checks
  • Running the application with the minimum filesystem permissions required
  • Using isolated workspaces and read-only access to sensitive locations where practical

How teams detect issues like this

Organizations can look for:

  • Static analysis rules identifying file writes that use unsanitized or model-controlled paths
  • Code review signals involving path joins without canonicalization and root-containment checks
  • Tests covering absolute paths, traversal segments, symbolic links, and alternate path representations
  • Runtime audit events for writes outside the configured project directory
  • Policy enforcement that restricts automated agents from modifying shell, scheduler, credential, or system configuration files

Automated security review tools may help identify unsafe path handling, but findings should be confirmed against deployment permissions and filesystem behavior.

Sources

SourceLink
github.comgithub.com/plandex-ai/plandex
github.comgithub.com/plandex-ai/plandex/blob/cli/v2.2.1/app/cli/lib/apply.go
github.comgithub.com/plandex-ai/plandex/issues/352
vulncheck.comvulncheck.com/advisories/plandex-2.2.1-path-traversal-via-applyfiles

Frequently asked

questions

Exploitability depends on how Plandex is exposed and whether an attacker can influence repository contents, task context, or model-directed changes. It is not necessarily reachable as an unauthenticated network issue.

The attacker generally needs a way to affect inputs consumed by ApplyFiles. The final impact also depends on which files the Plandex process can write.

Treat every generated or repository-derived path as untrusted, canonicalize it, and enforce that it remains inside an explicitly permitted project directory before writing.

Combine strict path-containment checks with least-privilege execution, isolated workspaces, allowlisted write targets, and monitoring for writes to sensitive configuration or execution-related files.

Find out what's already
exploitable in your codebase.