T09 · Insecure Skill Coding Practices
- Location
setup.sh:141- Finding
Sensitive email content and API credentials may be transmitted to arbitrary or insecure LLM endpoints
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill does what it claims, but it needs Review because it reads and changes mailbox state on a schedule and has unsafe AppleScript and LLM handling that could expose email or cause unintended actions.
Install only if you are comfortable with a scheduled tool reading your Apple Mail inbox, sending email content to your chosen LLM/report destination, and changing unread status. Prefer a dedicated bot mailbox, local-only LLM mode, no Full Disk Access, no auto cron until reviewed, and manual review of every generated reply before sending.
setup.sh:141Sensitive email content and API credentials may be transmitted to arbitrary or insecure LLM endpoints
scripts/email/checker.py:369Indirect prompt injection through untrusted email content
scripts/email/send_reply.py:42AppleScript injection through interpolated recipient and subject values
setup.sh:308LLM API key stored in plaintext without enforced restrictive permissions
setup.sh:376Full Disk Access guidance exceeds the minimum privileges required
scripts/email/checker.py:217Broad subject matching may disclose unrelated email threads to the LLM
scripts/email/checker.py:638All unread messages are marked read even when report delivery fails
The skill claims chat-based management via Telegram or WhatsApp, but the visible setup instead emphasizes cron installation and Apple Mail automation, with no declared trigger/permission model for those powerful behaviors. Hidden persistence via scheduled execution and OS-level Mail control materially increases risk because the skill can repeatedly process mailbox contents or act on the user's behalf after initial installation.
The skill claims chat-based management via Telegram or WhatsApp, but the visible setup instead emphasizes cron installation and Apple Mail automation, with no declared trigger/permission model for those powerful behaviors. Hidden persistence via scheduled execution and OS-level Mail control materially increases risk because the skill can repeatedly process mailbox contents or act on the user's behalf after initial installation.
The skill claims chat-based management via Telegram or WhatsApp, but the visible setup instead emphasizes cron installation and Apple Mail automation, with no declared trigger/permission model for those powerful behaviors. Hidden persistence via scheduled execution and OS-level Mail control materially increases risk because the skill can repeatedly process mailbox contents or act on the user's behalf after initial installation.
The skill claims chat-based management via Telegram or WhatsApp, but the visible setup instead emphasizes cron installation and Apple Mail automation, with no declared trigger/permission model for those powerful behaviors. Hidden persistence via scheduled execution and OS-level Mail control materially increases risk because the skill can repeatedly process mailbox contents or act on the user's behalf after initial installation.
The skill claims chat-based management via Telegram or WhatsApp, but the visible setup instead emphasizes cron installation and Apple Mail automation, with no declared trigger/permission model for those powerful behaviors. Hidden persistence via scheduled execution and OS-level Mail control materially increases risk because the skill can repeatedly process mailbox contents or act on the user's behalf after initial installation.
The code sends email bodies and thread history to the configured LLM service to generate replies, with no explicit consent, warning, redaction, or data-minimization controls visible here. In inbox-processing context, this can expose sensitive personal, legal, financial, or corporate communications to third-party or local model services and may violate privacy expectations or policy.
The skill silently marks all unread inbox emails as read after sending the report, which is a materially impactful side effect not implied by a simple checker/reporting workflow. This can cause users to miss messages, interfere with triage rules, and destroy the unread-state signal relied on for security or business operations.
The README explicitly states the tool fetches unread emails, sends a report, and marks messages as read, but it does not clearly warn users that private email content may be processed, summarized, transmitted, and that mailbox state will be modified automatically. In this context, the lack of informed-consent messaging increases the risk of accidental exposure of sensitive communications and unintended inbox changes, especially when paired with optional remote LLM use.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
Default: every hour. Change by editing crontab (crontab -e):
# Every hour (default)
The README documents a workflow where remote Telegram/WhatsApp instructions can trigger outbound email replies, but it does not prominently warn about the risk of mis-triggered, spoofed, or over-broad commands causing unintended email transmission. Because email sending is an externally visible action with reputational and data-loss consequences, documenting remote-control behavior without strong safety caveats is security-significant.
The skill advertises capabilities that imply filesystem, shell, network, environment, and Mail automation access, but it does not declare an explicit tool scope or permissions model. That makes the skill harder to review safely and can enable overbroad execution in an agent environment, especially because it interacts with local mail data and external LLM providers.
The description omits a clear privacy warning that the skill reads mailbox contents, drafts replies, and may send that data to external LLM providers or messaging platforms. For an email-processing skill, this omission is dangerous because users may expose sensitive personal or corporate data without informed consent.
The installation and setup section does not clearly warn that setup auto-discovers Mail accounts, writes persistent configuration, and installs a crontab for recurring execution. These side effects affect privacy and system persistence, so failing to disclose them reduces informed consent and may surprise users with ongoing background processing.
The description advertises broad autonomous behavior like scoring priority, drafting replies, and sending reports on a schedule without stating clear trigger boundaries, approval gates, or scope limits. In an email-handling skill, vague invocation language can lead to over-broad execution, unintended processing of sensitive messages, or actions occurring without sufficiently explicit user expectation.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"""Get unread emails from Inbox using AppleScript (includes content)."""
script_path = SCRIPT_DIR / "get_unread_emails.scpt"
result = subprocess.run(
['osascript', str(script_path), MAIL_ACCOUNT_ID],
capture_output=True, text=True
)
This code builds AppleScript source by interpolating email-derived subject text and MAIL_ACCOUNT_ID directly into an osascript -e command. Although quotes in the subject are escaped, AppleScript source injection is still a concern because untrusted content is embedded into executable script text, and malformed inputs can alter script behavior or cause unintended Mail automation.
'''
try:
result = subprocess.run(
['osascript', '-e', applescript],
capture_output=True, text=True,
timeout=30
Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.
# ─────────────────────────────────────────────────────────────────────────────
# call_llm (was call_lm_studio in v2, call_ollama in v1)
# ─────────────────────────────────────────────────────────────────────────────
def call_llm(prompt, model=None, timeout=None):
"""
Send a prompt to the configured LLM and return generated text.
The skill embeds prior thread content and current email bodies into LLM prompts and also includes message previews/drafts in emailed reports, creating broad plaintext exposure of potentially sensitive data. Because email commonly contains secrets, personal data, and business context, this context makes the exposure significantly more dangerous than in a generic summarization tool.
This AppleScript is dynamically assembled with MAIL_ACCOUNT_ID embedded in the script body and then executed. If configuration can be modified by an attacker or another local process, this creates an injection path into AppleScript-driven Mail actions.
end tell'''
try:
result = subprocess.run(
['osascript', '-e', script],
capture_output=True, text=True,
timeout=30
The manifest promises management from Telegram or WhatsApp and says the skill drafts AI replies, implying some workflow for user interaction around those drafts. In this implementation, the observable output path is an email report sent via Apple Mail, with no Telegram or WhatsApp handling present in the code shown.
Executing do shell script "cat {report_file}" inside AppleScript is unnecessary for the stated purpose and introduces shell-command injection risk through a path value embedded in executable script text. Because the path originates from runtime/environment-controlled filesystem locations, this expands the attack surface beyond simple email reporting.
The report-sending AppleScript interpolates subject, REPORT_RECIPIENT, and especially report_file into executable AppleScript that runs do shell script "cat ...". This creates command/script injection risk if config or file paths contain unsafe characters, and it combines Mail automation with shell execution.
end tell'''
try:
result = subprocess.run(
['osascript', '-e', applescript],
capture_output=True, text=True,
timeout=30
Automatically changing unread messages to read without confirmation is a risky hidden action in an email assistant. In this context, unread state is operationally meaningful, so silently altering it can conceal important or suspicious messages and reduce user awareness.
The reply body is written to a predictable workspace file on disk before sending, which creates local data persistence for potentially sensitive email content. On a multi-user system, shared workspace, backup target, or compromised host, drafts may be recoverable after sending and could expose confidential information.
The script builds AppleScript by directly interpolating untrusted --subject and --to values into quoted AppleScript string literals, then executes it via osascript. An attacker who can influence those fields can break out of the string and inject arbitrary AppleScript commands, which may lead to unauthorized email actions or local command execution through AppleScript features such as do shell script.
end tell'''
try:
result = subprocess.run(
['osascript', '-e', applescript],
capture_output=True, text=True,
timeout=30