Summary
PraisonAI contains a command injection weakness where shell command allowlisting can be bypassed using the find command's built-in -exec, -execdir, and -delete actions.
An attacker who can influence command input to PraisonAI may execute non-allowlisted binaries, read restricted files, or delete data without triggering shell metacharacter filters.
Affected context
This vulnerability appears in PraisonAI deployments that rely on shell-based command execution with an allowlist and metacharacter filtering for security.
It is relevant when user-controlled or semi-trusted input is used to build find command invocations, while assuming that blocking certain binaries and shell metacharacters is sufficient to prevent abuse.
The risk is most pronounced where PraisonAI is integrated with file system operations, diagnostics, or automation workflows that run in environments with access to sensitive files or system utilities.
Exploit preconditions
- Attack surface: Interfaces or features that accept command-like input or parameters that are translated into
findshell commands. - Required access: Ability to supply or influence arguments used in PraisonAI's shell command execution (e.g., user input, configuration fields, task definitions).
- Trigger point: Execution of
findcommands that include-exec,-execdir, or-deleteoptions under PraisonAI's command runner. - Why exploitation is possible: The allowlist and shell metacharacter filters are applied to obvious commands and symbols, but they do not account for
find's built-in actions, which can internally invoke binaries, read files, or delete paths, effectively bypassing the intended restrictions.
Why this happens
At its core, this issue is a form of command injection (CWE-78) caused by trusting partially sanitized command strings that still expose powerful sub-features of a utility.
PraisonAI attempts to constrain shell execution through an allowlist and metacharacter filtering, but treats find as a safe command without restricting its advanced options.
Because find's -exec, -execdir, and -delete actions are interpreted by the utility itself, they bypass filters that only look for shell metacharacters or disallowed top-level binaries.
The abstract pattern is: user-controlled input is concatenated into command lines for a powerful system utility, and only superficial checks are performed, leaving semantic capabilities within that utility available for abuse.
Potential impact
- Attackers may execute non-allowlisted binaries via
find -execor-execdir. - Attackers may read or traverse files that were intended to be blocked by the allowlist or filters.
- Attackers could delete files and directories using
find -delete, leading to data loss. - Attackers might chain file access and command execution to escalate privileges or pivot inside the environment.
General mitigation guidance
Effective mitigation typically focuses on reducing reliance on free-form shell command construction and on strictly constraining utility capabilities.
Recommended patterns include:
- Avoid building shell commands from user-controlled strings; use high-level APIs or language-native file operations instead of utilities like
findwhere possible. - If
findmust be used, treat its advanced options (-exec,-execdir,-delete, and similar) as sensitive and disallow or strip them from any user-influenced input. - Implement a structured command execution layer that parses and validates intended operations against a strict schema, rather than passing raw command fragments to a shell.
- Run command execution components with least privilege, isolating them from sensitive directories and system utilities to limit blast radius.
- Adopt a deny-by-default policy for command features: explicitly enumerate allowed subcommands and options, and reject everything else.
How teams detect issues like this
Detection can rely on both code-level and runtime strategies:
- Static analysis rules that flag dynamic shell command construction, especially where user input is concatenated into strings that call utilities like
find. - Code review checklists that require inspection of all command-building logic, verifying that dangerous options (
-exec,-execdir,-delete) are never controllable by user input. - Logging and monitoring of executed commands, with alerts for patterns that include
findin combination with-exec,-execdir, or-deletein high-risk contexts. - Policy enforcement in CI/CD pipelines ensuring that new or modified features do not introduce raw shell execution paths or unvalidated command parameters.

