pdfkit-py

Fail

Audited by Gen Agent Trust Hub on Sep 8, 2026

Risk Level: HIGHDYNAMIC_EXECUTIONEXTERNAL_DOWNLOADSCOMMAND_EXECUTION
Full Analysis
  • [DYNAMIC_EXECUTION]: The module scripts/pdfkit/commands/exec_python.py implements a command that allows for the execution of arbitrary Python code via compile() and exec(). Although the skill attempts to sandbox this environment by whitelisting modules and restricting built-in functions, the execution of user-controlled code remains a significant security risk for the host environment.
  • [DYNAMIC_EXECUTION]: The entry script scripts/pdfkit.py features an extension discovery mechanism that dynamically imports and executes Python files located in a sibling directory (../pdfkit-extension/scripts/) using importlib.util.spec_from_file_location and exec_module. This design could allow for the execution of unauthorized code if a malicious actor or another skill is able to write to that directory.
  • [COMMAND_EXECUTION]: Several components, such as convert.py, compress.py, smart_edit.py, and pdf_to_word.py, use subprocess.run() to interact with system utilities like Ghostscript (gs), LibreOffice (soffice), and Tesseract. These processes take arguments derived from JSON input, which may lead to command injection if input parameters are not strictly validated.
  • [EXTERNAL_DOWNLOADS]: The initialization scripts setup.sh and setup.bat download a standalone Python distribution from GitHub (astral-sh/python-build-standalone) and a CJK font from Tencent's CDN (docs.gtimg.com). While these are well-known services, the practice of fetching and installing binaries at runtime constitutes an external dependency risk that bypasses typical package manager audits.
Recommendations
  • AI detected serious security threats
Audit Metadata
Risk Level
HIGH
Analyzed
Sep 8, 2026, 10:15 AM