Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-108599 Overview
CVE-2026-108599 affects the phi AI coding agent, versions 0.1.1 through 0.28.4. The vulnerability is an improper link resolution flaw [CWE-59] in the permission gate that enforces the workspace_only_writes restriction. The gate performs lexical-only path checks and does not resolve symbolic links before authorizing write operations. A malicious repository can commit symlinks that point outside the workspace. Combined with prompt injection, attackers can direct the write tool to modify attacker-influenced content in files outside the workspace without user approval.
Critical Impact
Attackers can bypass the workspace write boundary and modify arbitrary files reachable by the user running phi, enabling tampering with configuration, startup scripts, or other sensitive files on the host.
Affected Products
- phi versions 0.1.1 through 0.28.4 (pulseaiclub/phi)
- Installations relying on the workspace_only_writes permission mode
- Developer workstations that clone untrusted repositories into a phi workspace
Discovery Timeline
- 2026-10-10 - CVE-2026-108599 published to the National Vulnerability Database (NVD)
- 2026-10-16 - Last updated in the NVD database
Technical Details for CVE-2026-108599
Vulnerability Analysis
The flaw sits in phi's permission gate, which decides whether a tool invocation is allowed under the workspace_only_writes policy. The gate compares the requested path to the workspace root using string-level checks only. It never calls a path resolution function that would follow symlinks to their final target. The write tool then opens the path, and the operating system transparently follows the symlink to a destination outside the workspace. The result is a classic time-of-check versus time-of-use mismatch between the policy decision and the actual filesystem operation.
An attacker exploits this by publishing a repository containing both a symlink inside the workspace and instructions that steer the agent. When the user clones the repository and interacts with phi, prompt injection embedded in repository content directs the agent to write to the symlinked path. The gate approves the write because the lexical path still looks workspace-local.
Root Cause
The permission check implemented in internal/permission/gate.go validates write targets by string prefix rather than resolving the real filesystem path. The write handler in internal/tools/writetool/write.go performs the write without re-validating the resolved destination. See the referenced gate.go code review and write.go code review for the vulnerable code paths.
Attack Vector
Exploitation requires local execution of phi against a malicious repository and user interaction with the agent. The attack chain is: (1) victim clones a repository containing a symlink such as ./notes -> /home/victim/.ssh/authorized_keys; (2) the repository contains hidden instructions that trigger prompt injection; (3) the agent calls the write tool against the symlink path; (4) the gate approves the lexical path; (5) attacker-chosen content lands at the external target. Refer to the VulnCheck advisory and the HackMD symlink analysis for a full chain walkthrough.
// No verified exploit code published. See the HackMD symlink permission boundary analysis
// for a conceptual walkthrough of the symlink + prompt-injection chain.
Detection Methods for CVE-2026-108599
Indicators of Compromise
- Symbolic links inside a phi workspace whose targets resolve outside the workspace root, especially pointing to dotfiles, SSH keys, shell profiles, or CI configuration.
- Unexpected modifications to files outside the workspace with timestamps aligned to phi agent activity.
- Repository content containing instruction-like text in README, markdown, or comment fields that reference writing to specific file paths.
Detection Strategies
- Scan cloned repositories for symlinks with find <workspace> -type l -lname '*' and alert when readlink -f resolves outside the intended root.
- Audit phi tool invocation logs for write operations whose resolved paths differ from the originally requested paths.
- Correlate agent write events with filesystem change events on sensitive paths such as ~/.ssh/, ~/.bashrc, ~/.aws/, and /etc/.
Monitoring Recommendations
- Enable filesystem auditing (auditd on Linux, FSEvents on macOS) for user home directories and configuration paths.
- Log every write tool call made by phi with both the requested path and the fully resolved real path for post-hoc review.
- Alert when a developer workstation performs writes to credential or startup files outside active development directories.
How to Mitigate CVE-2026-108599
Immediate Actions Required
- Upgrade phi to a release later than 0.28.4 that resolves symlinks before the permission check.
- Do not run phi against untrusted repositories until the fixed version is deployed.
- Review recent phi sessions for writes outside the intended workspace and restore any tampered files from backup.
Patch Information
At time of publication, the vendor repository at pulseaiclub/phi is the authoritative source for a patched release. Monitor the project's release notes and the VulnCheck advisory for the fixed version string. The required fix is to canonicalize paths using a function such as Go's filepath.EvalSymlinks inside the permission gate and reject targets whose resolved real path escapes the workspace root.
Workarounds
- Run phi inside a restrictive sandbox such as a container, chroot, or user namespace that cannot reach sensitive host files.
- Pre-scan every cloned repository and remove or reject symlinks before invoking the agent.
- Launch phi as a dedicated low-privilege user whose home directory contains no credentials or sensitive configuration.
- Disable or do not rely on workspace_only_writes as a security boundary until the fix is confirmed; require explicit per-write approval instead.
# Pre-flight check: reject repositories containing symlinks escaping the workspace
WORKSPACE="$(pwd)"
find "$WORKSPACE" -type l | while read link; do
target="$(readlink -f "$link")"
case "$target" in
"$WORKSPACE"/*) ;;
*) echo "UNSAFE symlink: $link -> $target"; exit 1 ;;
esac
done
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

