Summary
@ai-sdk/harness-cline versions 1.0.0 through 1.0.7 did not properly restrict paths supplied to the Cline harness file tools to the session working directory.
Model-controlled absolute paths and paths containing traversal sequences could escape the workspace through the built-in read, write, edit, grep, glob, and ls tools. Symlinks resolving outside the allowed roots were also not adequately contained.
Impact
An attacker who can influence model input or output, such as through prompt injection, could cause the harness to read files outside the current session working directory without an approval prompt. This could expose files belonging to concurrent sessions, including environment variables, credentials, configuration, and agent state.
When the harness is operating in allow-edits mode, the attacker could also write to or modify files outside the current workspace. In environments where sessions share a sandbox, this could enable cross-session workspace poisoning.
Exploitation requires an application to use the Cline harness file tools and for the attacker to successfully steer the model into invoking a tool with a malicious path.
Patches
The issue is fixed in @ai-sdk/harness-cline 1.0.8.
The fix normalizes requested paths, resolves their sandbox-side real paths, and rejects paths outside the session working directory or explicitly configured readable roots. Writable operations remain restricted to the session working directory, and recursive searches no longer follow symlinks.
Users should upgrade to version 1.0.8 or later.
Workarounds
Until an upgrade is possible, avoid using the Cline harness file tools with untrusted or attacker-controlled content.
Run each agent session in an isolated sandbox that does not contain credentials or files belonging to other sessions. Disabling allow-edits reduces the integrity impact but does not prevent unauthorized reads.
References
Summary
@ai-sdk/harness-clineversions 1.0.0 through 1.0.7 did not properly restrict paths supplied to the Cline harness file tools to the session working directory.Model-controlled absolute paths and paths containing traversal sequences could escape the workspace through the built-in
read,write,edit,grep,glob, andlstools. Symlinks resolving outside the allowed roots were also not adequately contained.Impact
An attacker who can influence model input or output, such as through prompt injection, could cause the harness to read files outside the current session working directory without an approval prompt. This could expose files belonging to concurrent sessions, including environment variables, credentials, configuration, and agent state.
When the harness is operating in
allow-editsmode, the attacker could also write to or modify files outside the current workspace. In environments where sessions share a sandbox, this could enable cross-session workspace poisoning.Exploitation requires an application to use the Cline harness file tools and for the attacker to successfully steer the model into invoking a tool with a malicious path.
Patches
The issue is fixed in
@ai-sdk/harness-cline1.0.8.The fix normalizes requested paths, resolves their sandbox-side real paths, and rejects paths outside the session working directory or explicitly configured readable roots. Writable operations remain restricted to the session working directory, and recursive searches no longer follow symlinks.
Users should upgrade to version 1.0.8 or later.
Workarounds
Until an upgrade is possible, avoid using the Cline harness file tools with untrusted or attacker-controlled content.
Run each agent session in an isolated sandbox that does not contain credentials or files belonging to other sessions. Disabling
allow-editsreduces the integrity impact but does not prevent unauthorized reads.References