os.system() or os exec-family call
High
- Category
- Dangerous Code Execution
- Content
try: import openpyxl except ImportError: os.system("pip install openpyxl -q") import openpyxl- Confidence
- 98% confidence
- Finding
- os.system("pip install openpyxl -q")
Security checks across malware telemetry and agentic risk
This finance report skill has a coherent purpose, but it uses sensitive Feishu credentials, can send financial reports externally, and installs packages at runtime without enough safeguards.
Install only if you are comfortable with the skill using Feishu app credentials and transmitting financial files or generated reports through Feishu. Before use, require pinned preinstalled dependencies, confirm every outbound recipient and file, avoid confidential spreadsheets unless the destination workspace is approved, and run PDF conversion in a sandboxed environment.
try:
import openpyxl
except ImportError:
os.system("pip install openpyxl -q")
import openpyxlexcept (FileNotFoundError, subprocess.CalledProcessError):
pass
try:
os.system("pip install markdownify -q")
from markdownify import markdownify
with open(html_path) as f:
md = markdownify(f.read(), heading_style="ATX")["wkhtmltopdf", "--quiet", "--enable-local-file-access", "--page-size", "A4", "--orientation", "Landscape", html_path, pdf_path],
]:
try:
subprocess.run(cmd, check=True, capture_output=True)
return True
except (FileNotFoundError, subprocess.CalledProcessError):
passpass
for browser in ["chromium-browser", "chromium", "google-chrome"]:
try:
subprocess.run([browser, "--headless", "--disable-gpu", "--no-sandbox", f"--print-to-pdf={pdf_path}", html_path], check=True, capture_output=True)
return True
except (FileNotFoundError, subprocess.CalledProcessError):
continue1. **Feishu chat file attachment** — Download via API:
```bash
# Get token
TOKEN=$(curl -s -X POST 'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal' \
-H 'Content-Type: application/json' \
-d '{"app_id":"APP_ID","app_secret":"APP_SECRET"}' | python3 -c "import json,sys; print(json.load(sys.stdin)['tenant_access_token'])")
# Get file_key from messageFILE_KEY=$(echo "$UPLOAD" | python3 -c "import json,sys; print(json.load(sys.stdin)['data']['file_key'])")
# 2. Send file message to chat
curl -s -X POST 'https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=chat_id' \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d "{\"receive_id\":\"CHAT_ID\",\"msg_type\":\"file\",\"content\":\"{\\\"file_key\\\":\\\"$FILE_KEY\\\"}\"}"66/66 vendors flagged this skill as clean.