Arbitrary File Write Vulnerability in PraisonAI Agents
The FileMemory component in praisonaiagents versions 1.6.52 and earlier fails to sanitize user-supplied identifiers, enabling path traversal attacks that result in arbitrary JSON file creation or overwriting.
CVE search metadata
CVE search record: CVE-2026-55527. Severity: high. CVSS: 7.1. KEV: no. Product: praisonaiagents. Brief: Arbitrary File Write Vulnerability in PraisonAI Agents. Brief link: https://feed.craftedsignal.io/briefs/2026-08-praisonaiagents-path-traversal/
What's new
PraisonAI Agents (up to version 1.6.52) contains a critical path traversal vulnerability within the FileMemory component, located in praisonaiagents/memory/file_memory.py. The __init__ method accepts a user_id parameter that is directly joined to a base directory without validation or normalization. An attacker able to influence this parameter - through direct API calls, agent configurations, or submitted job manifests - can inject path traversal sequences such as ../. This allows the application to write files to arbitrary locations on the host filesystem that the process has permissions to access. The vulnerability persists in the main branch and is distinct from previously reported issues, posing a significant risk for file manipulation, system configuration corruption, or denial-of-service attacks.
Attack Chain
- Attacker crafts a malicious input containing a traversal payload (e.g.,
user_id: "../../etc/cron.d/malicious") within an agent job submission. - The
agents_generator.pyservice parses the user-submittedagent_yamland extracts the memory configuration. - The
Agentconstructor is invoked, passing the attacker-controlleduser_idto theFileMemoryclass. - The
FileMemory.__init__method concatenates the malicioususer_idwith thebase_pathusing Python'spathlibjoin operator. - The application calls
mkdiron the constructed path, creating the directory structure on the filesystem if it does not exist. - The
FileMemoryinstance performs file operations (e.g.,add_short_term), resulting in the creation of JSON files (e.g.,short_term.json) at the attacker-specified target location. - Successful execution results in unauthorized file writes, potentially allowing an attacker to overwrite sensitive system configurations or package files.
Impact
Successful exploitation allows attackers to perform arbitrary file writes on the host system running the PraisonAI service. Impacts include Denial of Service by disk filling, overwriting critical application configuration files to alter runtime behavior, or attempting to leverage the file write to achieve persistence or code execution by overwriting startup scripts, cron tasks, or system files if the service process runs with sufficient privileges. This is particularly critical in multi-tenant environments where one user could overwrite the memory data or configurations belonging to another user.
Recommendation
- Upgrade
praisonaiagentsto version 1.6.58 or later to incorporate necessary sanitization patches. - Implement strict input validation on
user_idparameters in any application code interacting withFileMemoryto ensure they only contain alphanumeric characters, underscores, and hyphens. - Apply the principle of least privilege to the service account executing PraisonAI agents to minimize the impact of arbitrary file writes on system-level directories.
- If immediate patching is not possible, implement a proxy or validation layer to scan
agent_yamlinputs for directory traversal patterns before processing.
Immediate actions
Upgrade praisonaiagents to 1.6.58
Mitigations
Restrict process filesystem permissions to non-critical directories
CVE-2026-55527