Summary
PraisonAI's Action Orchestrator previously allowed path traversal in file write operations, enabling writes to locations outside the configured workspace directory.
By embedding relative path segments (../) in target paths, an attacker or compromised agent could overwrite sensitive files or drop executable payloads on the host system.
Affected context
This vulnerability arises in PraisonAI deployments that rely on the Action Orchestrator to perform file writes on behalf of agents within a designated workspace or sandbox directory.
The issue becomes relevant when:
- Agents can request file creation or modification using user-controllable paths, and
- The orchestrator assumes the configured workspace path is always enforced without normalizing or validating the final resolved path.
In such environments, any agent execution flow that accepts arbitrary filenames or paths can become a vehicle for escaping the workspace and reaching the broader filesystem.
Exploit preconditions
- Attack surface: File write APIs exposed through the Action Orchestrator to agents or higher-level workflows.
- Required access: Ability to influence or control the path parameter used for file writes (either as a direct attacker or via a compromised/malicious agent).
- Trigger point: Invocation of a file-writing action with path arguments containing traversal sequences (e.g., "../") that resolve outside the intended workspace directory.
- Why exploitation is possible: The implementation trusts the provided path and joins it with the workspace root without canonicalizing and validating the resolved absolute path, allowing traversal segments to escape the sandbox boundary.
Why this happens
The core issue maps to CWE-22: Path Traversal, where user-influenced paths are not properly sanitized or constrained before being used in filesystem operations.
Instead of resolving the complete path (e.g., via canonicalization) and enforcing that it remains within the configured workspace directory, the orchestration logic likely concatenates or joins the workspace base path with the user-provided relative segments.
This pattern permits ../ sequences to navigate to parent directories and target arbitrary locations on the host, breaking the intended isolation between the AI agents' workspace and the rest of the filesystem.
Potential impact
- Overwriting application configuration files that the PraisonAI process can access.
- Dropping executable payloads or scripts in locations that may later be executed by the system or other software.
- Tampering with log files, audit trails, or other operational artifacts to obscure malicious activity.
- Modifying security-related files, such as access control configurations, where permissions permit.
- Facilitating privilege escalation when combined with other misconfigurations or insecure file consumers.
General mitigation guidance
Effective mitigation focuses on constraining file operations to a well-defined sandbox and treating all path input as untrusted:
- Canonicalize and normalize file paths (e.g., resolving symlinks and ".." segments) before use, then enforce that the resolved absolute path resides within the configured workspace directory.
- Implement a strict allowlist of permitted operations and directories, refusing any path that attempts to navigate outside the sandbox or uses unexpected constructs.
- Prefer high-level filesystem abstractions that are designed around sandboxed roots rather than raw OS path concatenation.
- Run the PraisonAI service under least-privilege OS accounts, limiting which parts of the filesystem are writable even if path validation fails.
- Treat agent-generated paths as fully untrusted, applying the same validation logic regardless of whether the source is an external user or an internal agent.
How teams detect issues like this
Detection often involves a combination of code-level analysis and runtime monitoring:
- Use static analysis or linters to identify direct filesystem calls where user- or agent-supplied strings are concatenated with directory paths without normalization and boundary checks.
- During code review, flag any component that:
- Joins a "workspace" or "sandbox" root with caller-supplied relative paths, or
- Fails to verify that the final resolved path starts with the expected base directory.
- Introduce unit and integration tests that attempt to use "../" sequences in file paths to ensure sandbox enforcement is robust.
- Monitor logs for suspicious file access patterns, such as write attempts to system directories by components that are supposed to be confined to workspaces.
- Incorporate security-focused automated review tools into CI pipelines to alert on path traversal patterns and unsafe filesystem APIs.

