Summary
PraisonAI's recipe registry pull flow previously extracted attacker-controlled .praison tar archives using tar.extractall() without validating file paths inside the archive.
A malicious recipe bundle could include ../ traversal entries, causing files to be written outside the user's chosen output directory when the recipe is pulled, enabling arbitrary file write on the client system.
Affected context
This vulnerability appears when PraisonAI users pull recipes from either the local or HTTP recipe registry.
The client-side pull flow accepts .praison tar archives from a potentially untrusted publisher and extracts them directly onto the user's filesystem.
Because archive members are not checked for unsafe paths or path traversal segments, files can be written outside the intended output directory selected by the user, depending on how the archive was constructed.
Exploit preconditions
- Attack surface: PraisonAI client performing a recipe registry pull (local or HTTP registry).
- Required access: Ability to publish or supply a malicious
.praisonrecipe bundle that the victim will later pull. - Trigger point: User runs a recipe pull command that downloads and extracts the bundle using the vulnerable
tar.extractall()logic. - Why exploitation is possible: The extraction code trusts file paths contained in the tar archive, performing no normalization or validation to ensure members stay within the target directory, so
../or absolute paths can escape the output folder.
Why this happens
The root cause is the use of a generic archive extraction API (tar.extractall()) on untrusted input without validating or constraining the member paths.
This is a classic CWE-22: Path Traversal pattern in the context of archive handling: paths inside the archive, including ../ components or absolute paths, are treated as trustworthy and written directly to disk.
Because the checksum/signature verification covers the malicious payload itself, the system effectively authenticates the dangerous file layout instead of enforcing a safe extraction policy.
Potential impact
- Arbitrary file creation or overwrite in directories outside the chosen recipe output folder.
- Overwriting configuration files or scripts that may influence how PraisonAI or other local applications behave.
- Planting files that could be executed or loaded later by the user or other software, potentially leading to code execution in some environments.
- Tampering with user data, logs, or other sensitive local resources depending on filesystem permissions.
General mitigation guidance
Mitigation centers on treating archive contents as untrusted and enforcing strict path safety before writing to disk.
Common secure patterns include:
- Normalizing and validating all archive member paths to ensure they remain within the intended output directory, rejecting entries containing
.., absolute paths, or path separators that escape the base directory. - Implementing a "safe extract" helper that checks each file's resolved destination path before writing it.
- Restricting where the client can write files, using least-privilege filesystem permissions and avoiding running the tool with elevated privileges.
- Considering sandboxed extraction environments or temporary directories, followed by a controlled, validated move into the final location.
How teams detect issues like this
Detection efforts can focus on both code and runtime behavior:
- Static analysis: Rules that flag direct use of
tar.extractall()or similar archive APIs without surrounding path validation logic. - Code review: Looking for archive extraction flows that do not normalize member paths, check for traversal sequences, or verify that resolved paths remain within the target directory.
- Policy enforcement: Coding standards that mandate safe extraction helpers and forbid raw extraction of untrusted archives.
- Runtime monitoring: Optional filesystem monitoring to detect recipe pulls writing outside expected directories, which can then be investigated.

