/

CVE-2026-39306

Severity:

HIGH RISK

(7.3)

Path Traversal File Write in PraisonAI Recipe Registry Pull

CVE-2026-39306

Analyzed

Vulnerability type

Category:

Path Traversal / Arbitrary File Write

CWE:

CWE-22

Impact:

Arbitrary File Write on Client Systems

Severity:

HIGH RISK

(7.3)

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 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 .praison recipe 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.

Sources

SourceLink
github.comgithub.com/MervinPraison/PraisonAI/security/advisories/GHSA-4rx4-4r3x-6534

Frequently asked

questions

It can be triggered remotely if an attacker can host or publish a malicious recipe in a registry that users pull from over HTTP, but the actual impact occurs on the client machine when the user performs the pull.

The attacker needs the ability to supply a crafted .praison tar bundle that the victim will trust and pull, such as by publishing a recipe in a registry or otherwise convincing the user to use their bundle.

The robust fix is to implement safe archive extraction: normalize each member path, reject traversal or absolute paths, and ensure that the final resolved path is always within the intended output directory before writing files.

Treat all external archives and bundles as untrusted, use centralized safe-extraction utilities instead of raw extractall()-style calls, enforce coding guidelines around path normalization and validation, and integrate static analysis or automated checks that flag unsafe archive handling during development.

Find out what's already
exploitable in your codebase.