Loading advisory.
Loading advisory.
PraisonAI has Memory State Leakage and Path Traversal in MultiAgent Context Handling
The MultiAgentLedger and MultiAgentMonitor components in the provided code exhibit vulnerabilities that can lead to context leakage and arbitrary file operations.
Published 2026-04-08 19:21 UTC · Modified 2026-11-08 14:05 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score. How tiers work
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| praisonaiagents | PyPI | < 1.5.115 versions 0.0.1, 0.0.10, 0.0.100, 0.0.101, 0.0.102, 0.0.103, 0.0.104, 0.0.105, 0.0.106, 0.0.107, 0.0.108, 0.0.109, 0.0.11, 0.0.110, 0.0.111, 0.0.112, 0.0.113, 0.0.114, 0.0.115, 0.0.116 and 474 more | 1.5.115 | pip install --upgrade 'praisonaiagents>=1.5.115' |
The MultiAgentLedger and MultiAgentMonitor components in the provided code exhibit vulnerabilities that can lead to context leakage and arbitrary file operations. Specifically:
Memory State Leakage via Agent ID Collision: The MultiAgentLedger uses a dictionary to store ledgers by agent ID without enforcing uniqueness. This allows agents with the same ID to share ledger instances, leading to potential leakage of sensitive context data.
Path Traversal in MultiAgentMonitor: The MultiAgentMonitor constructs file paths by concatenating the base_path and agent ID without sanitization. This allows an attacker to escape the intended directory using path traversal sequences (e.g., ../), potentially leading to arbitrary file read/write.
File: examples/context/12_multi_agent_context.py:68
Description: The MultiAgentLedger class uses a dictionary (self.ledgers) to store ledger instances keyed by agent ID. The get_agent_ledger method creates a new ledger only if the agent ID is not present. If two agents are registered with the same ID, they will share the same ledger instance. This violates the isolation policy and can lead to leakage of sensitive context data (system prompts, conversation history) between agents.
Exploitability: An attacker can register an agent with the same ID as a victim agent to gain access to their ledger. This is particularly dangerous in multi-tenant systems where agents may handle sensitive user data.
File: examples/context/12_multi_agent_context.py:106
Description: The MultiAgentMonitor class constructs file paths for agent monitors by directly concatenating the base_path and agent ID. Since the agent ID is not sanitized, an attacker can provide an ID containing path traversal sequences (e.g., ../../malicious). This can result in files being created or read outside the intended directory (base_path).
Exploitability: An attacker can create an agent with a malicious ID (e.g., ../../etc/passwd) to write or read arbitrary files on the system, potentially leading to information disclosure or file corruption.
multi_ledger = MultiAgentLedger()
# Victim agent (user1) registers and tracks sensitive data
victim_ledger = multi_ledger.get_agent_ledger('user1_agent')
victim_ledger.track_system_prompt("Sensitive system prompt")
victim_ledger.track_history([{"role": "user", "content": "Secret data"}])
# Attacker registers with the same ID
attacker_ledger = multi_ledger.get_agent_ledger('user1_agent')
# Attacker now has access to victim's ledger
print(attacker_ledger.get_ledger().system_prompt) # Outputs: "Sensitive system prompt"
print(attacker_ledger.get_ledger().history) # Outputs: [{'role': 'user', 'content': 'Secret data'}]with tempfile.TemporaryDirectory() as tmpdir:
multi_monitor = MultiAgentMonitor(base_path=tmpdir)
# Create agent with malicious ID
malicious_id = '../../malicious'
monitor = multi_monitor.get_agent_monitor(malicious_id)
# The monitor file is created outside the intended base_path
# Example: if tmpdir is '/tmp/safe_dir', the actual path might be '/tmp/malicious'
print(monitor.path) # Outputs: '/tmp/malicious' (or equivalent)Memory State Leakage: This vulnerability can lead to unauthorized access to sensitive agent context, including system prompts and conversation history. In a multi-tenant system, this could result in cross-user data leakage.
Path Traversal: An attacker can read or write arbitrary files on the system, potentially leading to information disclosure, denial of service (by overwriting critical files), or remote code execution (if executable files are overwritten).
Enforce unique agent IDs at the application level. If the application expects unique IDs, add a check during agent registration to prevent duplicates.
Alternatively, modify the MultiAgentLedger to throw an exception if an existing agent ID is reused (unless explicitly allowed).
Sanitize agent IDs before using them in file paths. Replace any non-alphanumeric characters (except safe ones like underscores) or remove path traversal sequences.
Use os.path.join and os.path.realpath to resolve paths, then check that the resolved path starts with the intended base directory.
Example fix for MultiAgentMonitor:
import os
def get_agent_monitor(self, agent_id: str):
# Sanitize agent_id to remove path traversal
safe_id = os.path.basename(agent_id.replace('../', '').replace('..\\', ''))
# Alternatively, use a strict allow-list of characters
# Construct path and ensure it's within base_path
agent_path = os.path.join(self.base_path, safe_id)
real_path = os.path.realpath(agent_path)
real_base = os.path.realpath(self.base_path)
if not real_path.startswith(real_base):
raise ValueError(f"Invalid agent ID: {agent_id}")
...Additionally, consider using a dedicated function for sanitizing filenames.
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
One EPSS score on record: 0.009 on 2026-11-24.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.009 | first score | v2026.06.15 |