CVE-2026-57129: PraisonAI Path Traversal Vulnerability

HIGH
Advisory Identifier: GHSA-2rcg-mm5h-xchx
CVSS 7.5
CWE-22
Published
Advisory Summary

CVE-2026-57129 is a HIGH (CVSS 7.5) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting PraisonAI libraries in the PyPI ecosystem. The issue involves arbitrary file read via `@file:` mention path traversal. Remediation is available by upgrading affected packages to version 1.6.59.

CVE-2026-57129 at a Glance

CVE Identifier CVE-2026-57129
GHSA Identifier GHSA-2rcg-mm5h-xchx
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product PraisonAI
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-57129

To remediate this vulnerability, upgrade all affected PraisonAI dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

praisonaiagents fixed: 1.6.59
pip install praisonaiagents>=1.6.59
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show praisonaiagents

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-57129, inspect your installed packages using pip:

pip show praisonaiagents

Analyze the terminal output to locate any version of PraisonAI in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.6.59), your application is affected.

Note: The pip show praisonaiagents command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In PraisonAI, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary The MentionsParser in `src/praisonai-agents/praisonaiagents/tools/mentions.py` processes `@file:` mentions in agent prompts by reading arbitrary files from the filesystem. When a file path is not found relative to the workspace, the parser falls back to using the path as an absolute path without any validation or boundary check. This allows an attacker who can influence agent prompts (via chat messages, Telegram/Discord/Slack bot inputs, or YAML workflow configs) to read any file on the filesystem accessible to the process user. ## Details **Vulnerable code (lines 165–178):** ```python def _process_file_mention(self, file_path: str) -> Optional[str]: """Process @file:path mention.""" try: # Resolve path relative to workspace full_path = self.workspace_path / file_path if not full_path.exists(): # Try as absolute path full_path = Path(file_path) if not full_path.exists(): self._log(f"File not found: {file_path}", logging.WARNING) return f"# File: {file_path}\n[File not found]" content = full_path.read_text(encoding="utf-8") ``` **The vulnerability is in the fallback at line 171–172:** When the file is not found relative to `workspace_path`, the code constructs `full_path = Path(file_path)`, which accepts any absolute or relative path without validation. There is no: - `..` path traversal check - Workspace boundary validation - Symlink resolution against workspace - Protected path guard The `file_path` parameter originates from parsing `@file:` mentions in user/LLM prompts. The `MentionsParser` is used across the framework to process mentions in agent instructions and user messages. **Contrast with `skill_tools.py` `read_skill_file`** (lines 140–193), which properly validates: ```python # skill_tools.py line 179 — proper validation if os.path.commonpath([full_path, skill_path]) != skill_path: return f"Error: Path traversal detected - {file_path} is outside skill directory" ``` ## PoC **Setup:** Clean checkout at commit `d5f1114a`. **Positive trigger — arbitrary file read via @file: mention:** ```python import sys sys.path.insert(0, 'src/praisonai-agents') from praisonaiagents.tools.mentions import MentionsParser parser = MentionsParser() # Test 1: Absolute path read (bypasses workspace resolution) result = parser._process_file_mention('/etc/hostname') print(f'Absolute path read: {result[:80]}...') # Test 2: Relative path with traversal result = parser._process_file_mention('../../../etc/hostname') print(f'Traversal read: {result[:80]}...') ``` **Expected output:** ``` Absolute path read: # File: /etc/hostname ```linux <hostname> ```... Traversal read: # File: ../../../etc/hostname ```linux <hostname> ```... ``` **Negative control — non-existent file:** ```python result = parser._process_file_mention('/nonexistent/secret.txt') # Returns: "# File: /nonexistent/secret.txt\n[File not found]" ``` **Cleanup:** No persistence or side effects — read-only operation. ## Impact An attacker who can inject `@file:` mentions into agent prompts (via chat messages in Telegram/Discord/Slack bots, user input in web UI, or YAML workflow configurations) can read any file accessible to the process user, including: - **Secrets and credentials:** `.env` files, `~/.aws/credentials`, `~/.ssh/id_rsa`, API keys - **Configuration files:** Database passwords, JWT secrets, OAuth tokens - **Source code:** Application internals, database schemas - **System files:** `/etc/passwd`, `/etc/shadow` (if process has read access) This is particularly dangerous in bot deployments where `auto_approve_tools` defaults to `True` and untrusted users can send messages containing `@file:` mentions. ## Suggested remediation 1. **Remove the absolute path fallback.** Only resolve files within `workspace_path`: ```python def _process_file_mention(self, file_path: str) -> Optional[str]: full_path = (self.workspace_path / file_path).resolve() # Ensure resolved path is within workspace if not str(full_path).startswith(str(self.workspace_path.resolve())): return f"# File: {file_path}\n[Access denied: path outside workspace]" if not full_path.exists(): return f"# File: {file_path}\n[File not found]" content = full_path.read_text(encoding="utf-8") ``` 2. Add symlink resolution via `.resolve()` to prevent symlink-based traversal. 3. Add a protected path guard (`.env`, `.git`, `.ssh`, keys, credentials). 4. Apply the same `os.path.commonpath` pattern used by `skill_tools.py`. ### Credits - Thai Son Dinh from VinSOC Labs (R&D)

CVE-2026-57129 Affected PraisonAI Versions

1 component(s)
Fixed Versions:
1.6.59
Product / Package Ecosystem Affected Versions Fixed Version
praisonaiagents
PyPI
< 1.6.59
1.6.59

References

Frequently Asked Questions

What is CVE-2026-57129?
CVE-2026-57129 is a security vulnerability in PraisonAI involving Arbitrary File Read via `@file:` Mention Path Traversal under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which PraisonAI versions are affected?
Affected versions include releases prior to 1.6.59 across affected packages: praisonaiagents.
What version fixes CVE-2026-57129?
Upgrading to 1.6.59 (or the latest patched release for your respective branch) resolves the vulnerability.
Is praisonaiagents affected?
Yes, praisonaiagents is affected in releases prior to 1.6.59. Upgrade your dependency to 1.6.59 or later.
What is the CVSS score of CVE-2026-57129?
CVE-2026-57129 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-57129?
CVE-2026-57129 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check PyPI dependencies for CVE-2026-57129?
Run the dependency tree command: 'pip show praisonaiagents'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2rcg-mm5h-xchx",
  "modified" : "2026-07-20T21:26:29Z",
  "published" : "2026-06-18T13:57:00Z",
  "aliases" : [ "CVE-2026-57129" ],
  "summary" : "PraisonAI: Arbitrary File Read via `@file:` Mention Path Traversal",
  "details" : "## Summary\n\nThe MentionsParser in `src/praisonai-agents/praisonaiagents/tools/mentions.py` processes `@file:` mentions in agent prompts by reading arbitrary files from the filesystem. When a file path is not found relative to the workspace, the parser falls back to using the path as an absolute path without any validation or boundary check. This allows an attacker who can influence agent prompts (via chat messages, Telegram/Discord/Slack bot inputs, or YAML workflow configs) to read any file on the filesystem accessible to the process user.\n\n## Details\n**Vulnerable code (lines 165–178):**\n```python\ndef _process_file_mention(self, file_path: str) -> Optional[str]:\n    \"\"\"Process @file:path mention.\"\"\"\n    try:\n        # Resolve path relative to workspace\n        full_path = self.workspace_path / file_path\n        if not full_path.exists():\n            # Try as absolute path\n            full_path = Path(file_path)\n        \n        if not full_path.exists():\n            self._log(f\"File not found: {file_path}\", logging.WARNING)\n            return f\"# File: {file_path}\\n[File not found]\"\n        \n        content = full_path.read_text(encoding=\"utf-8\")\n```\n\n**The vulnerability is in the fallback at line 171–172:** When the file is not found relative to `workspace_path`, the code constructs `full_path = Path(file_path)`, which accepts any absolute or relative path without validation. There is no:\n- `..` path traversal check\n- Workspace boundary validation\n- Symlink resolution against workspace\n- Protected path guard\n\nThe `file_path` parameter originates from parsing `@file:` mentions in user/LLM prompts. The `MentionsParser` is used across the framework to process mentions in agent instructions and user messages.\n\n**Contrast with `skill_tools.py` `read_skill_file`** (lines 140–193), which properly validates:\n```python\n# skill_tools.py line 179 — proper validation\nif os.path.commonpath([full_path, skill_path]) != skill_path:\n    return f\"Error: Path traversal detected - {file_path} is outside skill directory\"\n```\n\n## PoC\n\n**Setup:** Clean checkout at commit `d5f1114a`.\n\n**Positive trigger — arbitrary file read via @file: mention:**\n```python\nimport sys\nsys.path.insert(0, 'src/praisonai-agents')\nfrom praisonaiagents.tools.mentions import MentionsParser\n\nparser = MentionsParser()\n\n# Test 1: Absolute path read (bypasses workspace resolution)\nresult = parser._process_file_mention('/etc/hostname')\nprint(f'Absolute path read: {result[:80]}...')\n\n# Test 2: Relative path with traversal\nresult = parser._process_file_mention('../../../etc/hostname')\nprint(f'Traversal read: {result[:80]}...')\n```\n\n**Expected output:**\n```\nAbsolute path read: # File: /etc/hostname\n```linux\n<hostname>\n```...\nTraversal read: # File: ../../../etc/hostname\n```linux\n<hostname>\n```...\n```\n\n**Negative control — non-existent file:**\n```python\nresult = parser._process_file_mention('/nonexistent/secret.txt')\n# Returns: \"# File: /nonexistent/secret.txt\\n[File not found]\"\n```\n\n**Cleanup:** No persistence or side effects — read-only operation.\n\n## Impact\n\nAn attacker who can inject `@file:` mentions into agent prompts (via chat messages in Telegram/Discord/Slack bots, user input in web UI, or YAML workflow configurations) can read any file accessible to the process user, including:\n\n- **Secrets and credentials:** `.env` files, `~/.aws/credentials`, `~/.ssh/id_rsa`, API keys\n- **Configuration files:** Database passwords, JWT secrets, OAuth tokens\n- **Source code:** Application internals, database schemas\n- **System files:** `/etc/passwd`, `/etc/shadow` (if process has read access)\n\nThis is particularly dangerous in bot deployments where `auto_approve_tools` defaults to `True` and untrusted users can send messages containing `@file:` mentions.\n\n## Suggested remediation\n\n1. **Remove the absolute path fallback.** Only resolve files within `workspace_path`:\n```python\ndef _process_file_mention(self, file_path: str) -> Optional[str]:\n    full_path = (self.workspace_path / file_path).resolve()\n    # Ensure resolved path is within workspace\n    if not str(full_path).startswith(str(self.workspace_path.resolve())):\n        return f\"# File: {file_path}\\n[Access denied: path outside workspace]\"\n    if not full_path.exists():\n        return f\"# File: {file_path}\\n[File not found]\"\n    content = full_path.read_text(encoding=\"utf-8\")\n```\n\n2. Add symlink resolution via `.resolve()` to prevent symlink-based traversal.\n\n3. Add a protected path guard (`.env`, `.git`, `.ssh`, keys, credentials).\n\n4. Apply the same `os.path.commonpath` pattern used by `skill_tools.py`.\n\n### Credits\n- Thai Son Dinh from VinSOC Labs (R&D)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "praisonaiagents"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.6.59"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.6.48"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-2rcg-mm5h-xchx"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/MervinPraison/PraisonAI"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-18T13:57:00Z",
    "nvd_published_at" : null
  }
}