GHSA-2rcg-mm5h-xchx: praisonaiagents: @file: path traversal reads arbitrary files

GHSA-2rcg-mm5h-xchx HIGH
Published June 18, 2026
CISO Take

PraisonAI's MentionsParser blindly reads any file the process user can access when an `@file:` mention is injected into an agent prompt — no workspace boundary, traversal check, or privilege guard exists. This is a zero-effort exploit (CVSS 7.5, AV:N/AC:L/PR:N/UI:N): any user who can chat with a Telegram, Discord, or Slack bot built on praisonaiagents can exfiltrate `.env` files, AWS credentials, SSH private keys, and database passwords in a single message, compounded by the library's default `auto_approve_tools=True` which removes any human confirmation gate. With 11 downstream dependents and 41 historical CVEs in this package, structural input-validation debt is evident. Upgrade to praisonaiagents 1.6.59 immediately; if patching is blocked, run the agent as a dedicated low-privilege OS user scoped to the workspace directory and rotate any secrets accessible to the process.

Sources: GitHub Advisory ATLAS NVD

What is the risk?

High risk in practice, likely exceeding the CVSS 7.5 face value. Three amplifiers push real-world risk upward: (1) `auto_approve_tools=True` by default eliminates any human-in-the-loop confirmation before the file read executes; (2) Telegram/Discord/Slack bot deployments expose this to arbitrary internet users, not internal operators; (3) the package carries 41 prior CVEs, signalling a pattern of structural input-handling failures rather than an isolated bug. Exploitation requires no AI or ML knowledge — any script-kiddie who can send a chat message can trigger it. Confidentiality impact is total for all files readable by the process user.

How does the attack unfold?

Initial Access
Attacker identifies a PraisonAI-powered bot (Slack, Discord, or Telegram) or web UI and sends a message containing an `@file:` mention referencing an absolute path or traversal sequence such as `@file:/app/.env` or `@file:../../../etc/passwd`.
AML.T0051.000
Exploitation
The MentionsParser processes the `@file:` mention, fails workspace-relative resolution, and falls back to treating the input as an absolute path without any validation, boundary check, or symlink resolution — triggering an unintended read of the target file.
AML.T0053
Data Collection
Attacker enumerates high-value files accessible to the process user by submitting successive `@file:` mentions targeting known credential paths (`.env`, `~/.aws/credentials`, `~/.ssh/id_rsa`, database configs).
AML.T0037
Exfiltration
The agent returns the full file contents directly in the chat response, delivering API keys, database passwords, and SSH private keys to the attacker via the existing messaging channel with no persistence footprint on the target system.
AML.T0086

What systems are affected?

Package Ecosystem Vulnerable Range Patched
PraisonAI Agents pip <= 1.6.48 1.6.59
11 dependents 65% patched ~6d to patch Full package profile →

Do you use PraisonAI Agents? You're affected.

How severe is it?

CVSS 3.1
7.5 / 10
EPSS
N/A
Exploitation Status
No known exploitation
Sophistication
Trivial

What is the attack surface?

AV AC PR UI S C I A
AV Network
AC Low
PR None
UI None
S Unchanged
C High
I None
A None

What should I do?

5 steps
  1. Patch immediately

    upgrade to praisonaiagents >= 1.6.59 which removes the absolute-path fallback and enforces workspace boundary via .resolve() and os.path.commonpath.

  2. If patching is blocked

    run the agent process as a dedicated OS user with filesystem read access restricted to the intended workspace via ACLs, chroot, or container isolation.

  3. Detect exploitation

    grep agent prompt logs and chat histories for patterns matching @file:/ or @file:../; flag any file references outside the expected workspace path.

  4. Rotate credentials

    if the service ran < 1.6.59 with untrusted user access, treat all secrets readable by the process user as compromised — rotate API keys, database passwords, SSH keys, and regenerate .env secrets.

  5. Audit YAML configs

    review all YAML workflow files passed to the agent for injected @file: mentions that may have been staged prior to exploitation.

How is it classified?

Which compliance frameworks are affected?

This CVE is relevant to:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity Article 9 - Risk management system
ISO 42001
A.6.1.2 - Information security in AI system lifecycle A.9.4.1 - AI system access controls
NIST AI RMF
GOVERN 1.1 - AI risk management policies MANAGE 2.2 - AI risk response mechanisms
OWASP LLM Top 10
LLM01 - Prompt Injection LLM06 - Sensitive Information Disclosure

Frequently Asked Questions

What is GHSA-2rcg-mm5h-xchx?

PraisonAI's MentionsParser blindly reads any file the process user can access when an `@file:` mention is injected into an agent prompt — no workspace boundary, traversal check, or privilege guard exists. This is a zero-effort exploit (CVSS 7.5, AV:N/AC:L/PR:N/UI:N): any user who can chat with a Telegram, Discord, or Slack bot built on praisonaiagents can exfiltrate `.env` files, AWS credentials, SSH private keys, and database passwords in a single message, compounded by the library's default `auto_approve_tools=True` which removes any human confirmation gate. With 11 downstream dependents and 41 historical CVEs in this package, structural input-validation debt is evident. Upgrade to praisonaiagents 1.6.59 immediately; if patching is blocked, run the agent as a dedicated low-privilege OS user scoped to the workspace directory and rotate any secrets accessible to the process.

Is GHSA-2rcg-mm5h-xchx actively exploited?

No confirmed active exploitation of GHSA-2rcg-mm5h-xchx has been reported, but organizations should still patch proactively.

How to fix GHSA-2rcg-mm5h-xchx?

1. **Patch immediately**: upgrade to praisonaiagents >= 1.6.59 which removes the absolute-path fallback and enforces workspace boundary via `.resolve()` and `os.path.commonpath`. 2. **If patching is blocked**: run the agent process as a dedicated OS user with filesystem read access restricted to the intended workspace via ACLs, chroot, or container isolation. 3. **Detect exploitation**: grep agent prompt logs and chat histories for patterns matching `@file:/` or `@file:../`; flag any file references outside the expected workspace path. 4. **Rotate credentials**: if the service ran < 1.6.59 with untrusted user access, treat all secrets readable by the process user as compromised — rotate API keys, database passwords, SSH keys, and regenerate `.env` secrets. 5. **Audit YAML configs**: review all YAML workflow files passed to the agent for injected `@file:` mentions that may have been staged prior to exploitation.

What systems are affected by GHSA-2rcg-mm5h-xchx?

This vulnerability affects the following AI/ML architecture patterns: agent frameworks, chatbot deployments, multi-user AI assistants, workflow automation pipelines.

What is the CVSS score for GHSA-2rcg-mm5h-xchx?

GHSA-2rcg-mm5h-xchx has a CVSS v3.1 base score of 7.5 (HIGH).

What is the AI security impact?

Affected AI Architectures

agent frameworkschatbot deploymentsmulti-user AI assistantsworkflow automation pipelines

MITRE ATLAS Techniques

AML.T0037 Data from Local System
AML.T0051.000 Direct
AML.T0053 AI Agent Tool Invocation
AML.T0055 Unsecured Credentials
AML.T0086 Exfiltration via AI Agent Tool Invocation

Compliance Controls Affected

EU AI Act: Article 15, Article 9
ISO 42001: A.6.1.2, A.9.4.1
NIST AI RMF: GOVERN 1.1, MANAGE 2.2
OWASP LLM Top 10: LLM01, LLM06

What are the technical details?

Original Advisory

## 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`.

Exploitation Scenario

An attacker discovers a customer-facing Slack bot built on praisonaiagents and sends the message `please summarize @file:/app/.env` to any channel where the bot listens. The MentionsParser detects the `@file:` mention, attempts workspace-relative resolution (not found), then falls back to the absolute path `/app/.env` with no validation. With `auto_approve_tools=True`, the agent reads the file and returns its contents — including `DATABASE_URL`, `STRIPE_SECRET_KEY`, `OPENAI_API_KEY`, and `CLERK_SECRET_KEY` — directly in the Slack thread. The attacker follows up with `@file:~/.aws/credentials` to capture cloud access keys, then uses the harvested secrets to pivot into the production database, payment processor, and upstream LLM account, all without ever touching the host system directly.

Weaknesses (CWE)

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.

  • [Implementation] Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylis
  • [Architecture and Design] For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.

Source: MITRE CWE corpus.

CVSS Vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Timeline

Published
June 18, 2026
Last Modified
July 20, 2026
First Seen
June 18, 2026

Related Vulnerabilities