/

CVE-2026-61445

Severity:

CRITICAL RISK

(9.9)

Path Traversal (CWE-22) in PraisonAI AICoder Tools

CVE-2026-61445

Deferred

Vulnerability type

Category:

Path Traversal / Command Injection

CWE:

CWE-22

Impact:

Arbitrary File Write and Command Execution as Root

Severity:

CRITICAL RISK

(9.9)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

PraisonAI's AICoder component allows arbitrary file writes and command execution via LLM tool calls that lack proper path validation and command sanitization.

When an attacker can inject crafted prompts through the chat interface, they may direct the AI to write files to unintended filesystem locations and run shell commands with root privileges, turning a conversational interface into a high-impact attack vector.

Affected context

This vulnerability appears in PraisonAI deployments where the AICoder feature is enabled and integrated with local tooling that can write to the filesystem and invoke shell commands.

It is most relevant when:

  • LLM tool calls are wired directly to file-write and command-execution functions
  • The runtime is executed with elevated privileges (e.g., root)
  • There is no strict validation of requested file paths or sanitization of command arguments derived from user prompts

In such contexts, a seemingly benign chat conversation can become a control channel for the underlying operating system.

Exploit preconditions

  • Attack surface: The PraisonAI chat interface or any API endpoint that forwards user instructions to the AICoder tools.
  • Required access: Ability to send prompts as a user or via any integrated client; no special system-level access is needed beyond chat access.
  • Trigger point: Invocation of AICoder tools that perform filesystem writes or shell command execution based on natural-language instructions.
  • Why exploitation is possible: File operations trust user-controlled paths without normalization or restriction, and command execution routines accept unsanitized text from the LLM, enabling crafted prompts to escape intended boundaries and run arbitrary shell commands with root privileges.

Why this happens

The underlying bug class combines improper path handling with unsafe command invocation in an AI-assisted coding workflow.

From a CWE-22 perspective, file-write tools treat user-influenced paths as trusted, failing to normalize, restrict, or enforce directory boundaries, which enables path traversal and arbitrary file placement.

In parallel, command execution tools accept raw strings derived from user prompts and LLM outputs, invoking shells or system utilities without validation or contextual escaping.

The abstraction around "AI tools" hides traditional security responsibilities, but the core issue remains: untrusted text is mapped directly to powerful OS operations without guardrails.

Potential impact

  • Attackers may write files to arbitrary locations on the filesystem, including configuration files, startup scripts, or application code.
  • Malicious prompts could result in arbitrary shell command execution with root privileges.
  • The host operating system can be fully compromised, including installation of backdoors and persistence mechanisms.
  • Sensitive data on the machine may be accessed, modified, or exfiltrated.
  • Other services running on the same host may be targeted for lateral movement.

General mitigation guidance

Effective mitigation focuses on constraining what AI tools are allowed to do and how they interpret user-controlled input.

Common patterns include:

  • Restricting file-write operations to a carefully scoped, pre-defined directory tree, with strict path normalization and rejection of any traversal outside allowed roots.
  • Enforcing robust validation on all paths, rejecting absolute paths, parent-directory segments (e.g., ..), and unexpected file types.
  • Avoiding direct shell invocation for AI-generated commands; instead, provide high-level, parameterized operations with rigorous argument checking.
  • Running AI tooling under least-privilege accounts, ensuring the process does not require root and has minimal filesystem access.
  • Introducing a policy layer that inspects and approves potentially dangerous operations before they are executed, reducing the trust placed on raw LLM outputs.

How teams detect issues like this

Detection typically combines code-level analysis with runtime monitoring:

  • Static analysis and code review can flag direct use of file-write APIs and command execution functions where parameters originate from user prompts or LLM outputs without validation or normalization.
  • Security reviewers should look for tool implementations that accept arbitrary paths, shell snippets, or command strings, particularly when executed with elevated privileges.
  • Logging and alerting around high-risk operations (e.g., writes outside approved directories, executions of unexpected commands) can surface abuse at runtime.
  • Policy enforcement in CI/CD and configuration management can ensure any new AI tools follow strict input validation and privilege separation guidelines, supported by automated checks where possible.

Sources

SourceLink
github.comgithub.com/MervinPraison/PraisonAI/security/advisories/GHSA-9mp3-24cc-77mg
vulncheck.comvulncheck.com/advisories/praisonai-before-arbitrary-file-write-and-command-execution

Frequently asked

questions

Yes. If PraisonAI's chat or API interface is accessible over the network, an attacker can exploit the issue remotely by sending crafted prompts that reach the AICoder tools.

The attacker typically only needs the ability to interact with the AI interface as a user or client. No direct shell or filesystem access is required, because the vulnerable tools bridge the gap between the chat and the operating system.

Constrain tools to operate within strict, predefined boundaries: limit file writes to specific directories with normalized paths, replace free-form command execution with vetted, parameterized operations, and ensure the tooling runs under non-root, least-privilege accounts.

Treat AI-generated instructions as untrusted input, apply traditional validation and sanitization before mapping them to system calls, design tools around narrow, well-defined capabilities, and bake security-focused code review and automated checks into the process for any new AI-driven operations.

Find out what's already
exploitable in your codebase.