Vulnerability record · PyPI
PYSEC-2026-4261
Description
PraisonAI's new file-based custom command feature auto-discovers project commands from .praisonai/commands/*.md. When a user runs praisonai run --command <name> inside a repository, the command body is interpolated before it is sent as the model prompt.
The interpolation code expands @path references by reading files relative to the current working directory, but it does not canonicalize the target or require it to stay inside the project. A repository-controlled command can therefore include @../outside_secret.txt or an absolute path and cause PraisonAI to copy process-readable files outside the workspace into the prompt.
This is a confidentiality issue in the untrusted-repository workflow: a project can make a normal-looking custom command exfiltrate local files to whichever model/provider receives the generated prompt.
The feature was introduced by commit 88cf0c29 (feat: file-based custom agents and reusable commands with auto-discovery (#2035)) and is present on current main:
current commit: 3aa9cbc2bd49c23a32be0a89a5e620d13d843eab
current describe: v4.6.64-8-g3aa9cbc2
src/praisonai/praisonai/cli/features/custom_definitions.py discovers project-level definitions by walking upward from Path.cwd() to the git root and loading .praisonai/commands/*.md. Project commands override user-global commands.
interpolate_command_template() loads the selected command and passes the command body to the interpolator with Path.cwd() as the working directory:
return interpolator.interpolate(command.template, arguments, Path.cwd())
TemplateInterpolator._interpolate_files() then matches every @([^\s]+) token and reads the referenced file:
if working_dir:
file_path = working_dir / file_path_str
else:
file_path = Path(file_path_str)
if file_path.exists() and file_path.is_file():…
Manual fix · PyPI
pip install --upgrade "praisonai>=4.6.78"Sources