PraisonAI Has Path Traversal in FileTools
Date: 2026-04
Affected: pip/PraisonAI
Attack vector: path-traversal
Category: vulnerability-disclosure
Severity: Critical
CVE: CVE-2026-35615
CVE-2026-39305
CVE-2026-39306
CVE-2026-39307
CVE-2026-39308
CWE: CWE-22
CWE-23
CVSS:  (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L)

### Executive Summary: The path validation has a critical logic bug: it checks for `..` AFTER `normpath()` has already collapsed all `..` sequences. This makes the check completely useless and allows trivial path traversal to any file on the system. The path validation function also does not resolve the symlink wich could potentially cause path traversal. ### Details: `_validate_path()` calls `os.path.normpath()` first, which collapses `..` sequences, then checks for `'..'` in normalized. Since `..` is already collapsed, the check always passes. **Vulnerable File:** `src/praisonai-agents/praisonaiagents/tools/file_tools.py` **Lines:** 42-49 ```python class FileTools: """Tools for file operations including read, write, list, and information.""" @staticmethod def _validate_path(filepath: str) -> str: # Normalize the path normalized = os.path.normpath(filepath) absolute = os.path.abspath(normalized) # Check for path traversal attempts (.. after normalization) # We check the original input for '..' to catch traversal attempts if '..' in normalized: raise ValueError(f"Path traversal detected: {filepath}") return absolute ``` **Severity:** CRITICAL **CVSS v3.1:** 9.2 (CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N **CWE:** CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') ### Proof of concept (PoC) **Prerequisites:** -


Mitigations:

Architectural layers (MAESTRO):