T09 · Insecure Skill Coding Practices
- Location
scripts/email-negotiator.sh:40- Finding
Arbitrary Python Code Execution Through Unsafe Heredoc Interpolation
- Content
View full analysis
" msg['To'] = """$to""" part = MIMEText("""$body""", 'plain', 'utf-8') msg.attach(part) with smtplib.SMTP('${SMTP_HOST}', ${SMTP_PORT}) as server: server.starttls() server.login('${SMTP_USER}', '${SMTP_PASS}') server.sendmail('${SMTP_USER}', """$to""", msg.as_string()) print(f"[OK] 邮件已发送至 $to") PYEOF } ``` The mailbox parser uses the same unsafe pattern for its output path and configuration values: ```bash python3 - <- Remediation
View remediation
