Severity by source
AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N
Network vector applies if agent is service-exposed; AC:H reflects need for crafted input; both C and I are High since read and write primitives are both bypassed; A:N as no availability impact is described.
Primary rating from Vendor (TuranSec).
CVSS VectorVendor: TuranSec
Lifecycle Timeline
4DescriptionCVE.org
The pocketflow-coding-agent cookbook example in The-Pocket/PocketFlow implements a _path(workdir, p) helper as a thin os.path.join(workdir, p) wrapper with no canonicalization or containment check, used unguarded by the ReadFile, ListFiles, PatchRead, and PatchApply file-access tools. Because os.path.join returns an absolute p unchanged (ignoring workdir) and does not resolve '../' sequences, an agent invocation whose file-tool arguments include an absolute path or a traversal sequence can read or write files outside the configured working directory. Severity reflects that this affects an illustrative cookbook example rather than a core library API; applications that copy this pattern into production are affected.
AnalysisAI
Path traversal in the PocketFlow pocketflow-coding-agent cookbook example exposes arbitrary filesystem reads and writes to any caller who can influence the file-tool arguments supplied to an agent invocation. The vulnerable _path(workdir, p) helper wraps os.path.join without canonicalization, meaning Python's own documented behavior - returning an absolute p unchanged and not resolving ../ sequences - silently discards the intended working-directory containment. Affected file tools include ReadFile, ListFiles, PatchRead, and PatchApply. A publicly available proof-of-concept exists; this is not confirmed in CISA KEV, but the trivial nature of the bypass (standard Python behavior) makes exploitation straightforward wherever the pattern has been copied into production.
Technical ContextAI
The affected component is the pocketflow-coding-agent cookbook example published under The-Pocket/PocketFlow (CPE: cpe:2.3:a:the-pocket:pocketflow_(pocketflow-coding-agent_cookbook_example):*:*:*:*:*:*:*:*). The root cause is CWE-22 (Improper Limitation of a Pathname to a Restricted Directory - Path Traversal), manifesting through a well-documented Python quirk: os.path.join('/safe/workdir', '/etc/passwd') returns /etc/passwd because Python treats the second argument as the new root if it is absolute. Additionally, relative traversal sequences such as ../../etc/shadow are passed through unresolved. The _path() helper performs neither os.path.realpath() normalization nor a prefix check to verify the resolved path remains under the workdir tree. This flaw propagates to four distinct file-access tools (ReadFile, ListFiles, PatchRead, PatchApply), meaning both read and write primitives are affected. The issue is classified as illustrative example code rather than a core library API, but any production system that copied or adapted this pattern is identically vulnerable.
RemediationAI
No vendor-released patched version is independently confirmed from the available data - the GitHub repository (https://github.com/The-Pocket/PocketFlow) should be monitored for a fix. Developers who have copied the _path() pattern into production must replace os.path.join(workdir, p) with a safe equivalent: first resolve the full path with os.path.realpath(os.path.join(workdir, p)), then assert that the result starts with os.path.realpath(workdir) + os.sep before permitting any file operation. Failing that assertion must raise an exception and abort the tool call. As a compensating control where immediate code changes are not feasible, restrict the OS user account running the agent to read/write permissions only on the intended workdir subtree using filesystem ACLs or a chroot/container sandbox - this limits blast radius if traversal occurs but does not eliminate the vulnerability. Running the agent inside a container with a minimal, read-only root filesystem and only the workdir volume mounted is the strongest available workaround until a patch is released.
Same weakness CWE-22 – Path Traversal
View allSame technique Path Traversal
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-53195
GHSA-8v55-7p5p-6r5c