Back to skill

Security audit

Cerbug45 Email Formatter

Security checks for vulnerabilities and agentic risk

Overview

This email-formatting skill is not clearly malicious, but it asks agents to modify the host environment and run broad security-scanning workflows that are under-scoped for a formatter.

Install only after reviewing the setup steps. Prefer not to let an agent auto-run this skill on first use; use an isolated virtual environment, avoid --break-system-packages, and do not process confidential email drafts unless temporary-file handling is fixed or disabled.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T08 · Insecure Dependencies

Warning
Location
install.sh:46
Finding

Unpinned Third-Party Packages Installed into the Host Python Environment

Content
View full analysis
/dev/null; then echo " Installing optional packages..." # Try with --break-system-packages flag (for newer systems) pip3 install --break-system-packages --quiet language-tool-python textstat 2>/dev/null || \ # Fallback to --user flag pip3 install --user --quiet language-tool-python textstat 2>/dev/null || \ echo " Note: Could not install optional packages (this is OK)" ``` `SKILL.md:43-52`: ```bash # Install Python dependencies echo "📦 Installing Python packages..." pip3 install --break-system-packages --quiet \ language-tool-python \ textstat \ spacy 2>/dev/null || pip3 install --user --quiet \ language-tool-python \ textstat \ spacy ``` ### Technical Analysis The installation procedures retrieve packages from the active pip package index without pinning reviewed versions or validating package hashes. Consequently, the code installed and executed can change after the Skill itself has been audited. Python package installation may execute package-controlled build backend code or setup logic. A compromised package release, maliciously configured package index, dependency-confusion condition, or compromised transitive dependency could therefore execute arbitrary code under the account running the installer. The use of `--break-system-packages` additionally permits pip to alter a Python environment managed by the operating system. This can overwrite or conflict with shared Python components and increases the effect beyond an isolated Skill environment. The fallback to `--user` is safer in scope but remains unpinned and unverified. This does not constitute direct remote payload retrieval by the Skill b ...[truncated 1679 chars]
Remediation
View remediation
--hash=sha256: textstat== --hash=sha256: spacy== --hash=sha256: ``` 3. Install with hash validation and without dependency re-resolution: ```bash "$SKILL_DIR/venv/bin/python" -m pip install \ --require-hashes \ -r requirements.lock ``` 4. Remove `--break-system-packages`. The Skill does not require modification of the operating system’s managed Python environment. 5. Pin and review transitive dependencies, not only the three direct packages. 6. Document the approved package index and use an authenticated internal mirror where possible. 7. Make optional installation opt-in rather than automatically attempting network-based package installation on first use. 8. Run dependency vulnerability and provenance checks whenever the lock file is updated. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:910
Finding

Predictable Temporary Directory Stores Email Content Without Secure Creation or Reliable Cleanup

Content
View full analysis
"$TEMP_DIR/original.txt" ``` `SKILL.md:978-983`: ```bash # STEP 3: TONE ANALYSIS echo "" echo "Step 3/7: Analyzing tone..." python3 ~/.email-formatter-skill/scripts/tone_analyzer.py "$EMAIL_TEXT" > "$TEMP_DIR/tone.txt" cat "$TEMP_DIR/tone.txt" ``` `SKILL.md:1003-1008`: ```bash # STEP 5: READABILITY ANALYSIS echo "" echo "Step 5/7: Analyzing readability..." python3 ~/.email-formatter-skill/scripts/readability.py "$EMAIL_TEXT" > "$TEMP_DIR/readability.txt" cat "$TEMP_DIR/readability.txt" ``` `SKILL.md:1039-1042`: ```bash # Cleanup rm -rf "$TEMP_DIR" ``` ### Technical Analysis The workflow constructs a temporary directory from the process ID: ```bash TEMP_DIR="/tmp/email-formatter-$$" ``` Process identifiers are predictable and have a limited range. `mkdir -p` does not provide atomic, exclusive temporary-directory creation and accepts a path that already exists. On a shared host, another local user may pre-create the expected directory or arrange links inside it before the workflow writes its files. The workflow then writes the complete original email to `original.txt` in plaintext. Emails can contain personal information, confidential business content, financial information, credentials, or other regulated data. No restrictive `umask` or explicit permissions are applied by the workflow. Cle ...[truncated 2545 chars]
Remediation
View remediation
"$TEMP_DIR/tone.txt" chmod 600 "$TEMP_DIR/tone.txt" ``` 5. Do not use PID-derived names or accept pre-existing temporary paths. 6. Handle expected nonzero tool results without allowing `set -e` to bypass status processing. For example: ```bash set +e python3 ~/.email-formatter-skill/scripts/security_scan.py "$EMAIL_TEXT" SECURITY_EXIT=$? set -e ``` Alternatively, place the command directly in an `if` statement and handle each documented exit status. 7. Keep sensitive input in memory and pass it through standard input rather than command-line arguments where practical, because command-line arguments may be visible in process listings on some systems. 8. Add tests covering warning exits, critical blocks, interruption, concurrent execution, restrictive permissions, and guaranteed deletion of temporary artifacts. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
Findings (30)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The skill promises email rewriting, grammar correction, and tone adjustment, but the implementation only performs analysis and shell workflow scaffolding. This is primarily a trust and safety issue: users and orchestrators may expose content to unnecessary processing under false assumptions about what the skill actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The skill promises email rewriting, grammar correction, and tone adjustment, but the implementation only performs analysis and shell workflow scaffolding. This is primarily a trust and safety issue: users and orchestrators may expose content to unnecessary processing under false assumptions about what the skill actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill promises email rewriting, grammar correction, and tone adjustment, but the implementation only performs analysis and shell workflow scaffolding. This is primarily a trust and safety issue: users and orchestrators may expose content to unnecessary processing under false assumptions about what the skill actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill promises email rewriting, grammar correction, and tone adjustment, but the implementation only performs analysis and shell workflow scaffolding. This is primarily a trust and safety issue: users and orchestrators may expose content to unnecessary processing under false assumptions about what the skill actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill promises email rewriting, grammar correction, and tone adjustment, but the implementation only performs analysis and shell workflow scaffolding. This is primarily a trust and safety issue: users and orchestrators may expose content to unnecessary processing under false assumptions about what the skill actually does.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

An email formatter should not install packages, alter the host environment, or download language models at runtime. These instructions enable supply-chain risk, unauthorized persistence, and environment tampering, especially if an agent auto-executes them on first use.

Content

No source excerpt is available for this finding.

YARA rule 'agent_skill_prompt_injection_hidden_instructions': Prompt injection or hidden instructions embedded in AI agent skill text [agent_skills]

High
Category
YARA Match
Confidence
93% confidence
Finding

The skill embeds imperative instructions aimed at AI agents, including first-use installation and execution workflows, inside content that should primarily describe formatting behavior. In an agentic system, such embedded operational instructions can function like prompt injection by steering the host to run shell commands and modify the environment.

Content

Scanner excerpt · SKILL.md (reported line 29)May include surrounding context.

.0.0

Email Formatter - Professional Email Enhancement

Installation & Setup

Prerequisites Check

Before using this skill, verify the environment has required capabilities:

bash
# Check if bash is available
which bash

# Check Python version (3.8+ required)
python3 --version

# Check Node.js (optional, for advanced features)
node --version

Auto-Installation Script

For AI Agents: Run this installation check at first use

bash
#!/bin/bash
# Email Formatter Skill - Auto Setup
# This script installs required dependencies

echo "🔧 Email Formatter Skill - Installation Starting..."

# Create skill workspace
SKILL_DIR="$HOME/.email-formatter-skill"
mkdir -p "$SKILL_DIR"
cd "$SKILL_DIR"

# Install Python dependencies
echo "📦 Installing Python packages..."
pip3 install --break-system-packages --quiet \
    language-tool-python \
    textstat \
    spacy 2>/dev/null || pip3 install --user --quiet \
    language-tool-python \
    textstat \
    spacy

# Down

Instruction Override

High
Category
Prompt Injection
Confidence
90% confidence
Finding

This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 272)May include surrounding context.

THIS SKILL CANNOT:

  • Help with fraudulent communications
  • Bypass security protocols
  • Facilitate illegal activities
  • Enable harassment or threats
text

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The document claims privacy-safe logging with no content retention, but the scanner stores matched patterns and prints them in reports. This contradiction can leak sensitive or incriminating fragments from user emails into logs or console output, undermining the stated privacy guarantees.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This file implements a policy-enforcement scanner that blocks or warns on phishing, harassment, discrimination, academic dishonesty, and other categories far beyond the stated email-formatting purpose. In a formatting skill, this creates an unauthorized control point where the skill can deny service or alter workflow based on content-policy judgments unrelated to formatting, increasing the risk of overreach, false positives, and covert moderation behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README describes the tool as a formatting and analysis utility, but the documented operations focus on analysis and classification rather than transforming drafts into polished emails as promised by the skill metadata. This mismatch is dangerous because agents may select the skill expecting benign text improvement while actually invoking a tool with materially different behavior.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

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.

Content

Scanner excerpt · README.md (reported line 15)May include surrounding context.

text

The installer will:
- Create `~/.email-formatter-skill/` directory
- Copy helper scripts
- Install optional dependencies (if possible)
- Set up executable permissions

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README frames a nominal email-formatting skill as one that must run a security/content blocking pipeline before doing its stated job. This is a capability mismatch that can cause agents to invoke broader content moderation or refusal behavior than the declared skill purpose suggests, creating deceptive behavior and expanding the skill's effective authority.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The skill declares no tool scope, yet the content instructs an agent to use shell commands, install packages, and download models over the network. In an agent environment, this can silently expand the skill from text transformation into host modification and outbound access, increasing attack surface and violating least privilege.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases are very broad and overlap with routine writing requests, increasing the chance the skill is auto-invoked in ordinary contexts. Because this skill also performs installation, file writes, and scanning, overbroad activation materially increases the likelihood of unintended execution and data handling.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

Creating a persistent directory under the user's home folder for an email formatter introduces host-side state that survives the session. Persistent artifacts can accumulate sensitive data, scripts, or modified dependencies and expand the skill's long-term footprint beyond its stated purpose.

Content

Scanner excerpt · SKILL.md (reported line 57)May include surrounding context.

md
echo "📚 Downloading language model..."
python3 -m spacy download en_core_web_sm --quiet 2>/dev/null || true

# Create helper scripts directory
mkdir -p "$SKILL_DIR/scripts"

# Test installation

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill includes extensive threat detection and incident-response behavior beyond the justified scope of formatting. Even if safety-motivated, this broader capability increases data processing, false positive risk, and the chance that the skill takes consequential actions users did not expect from a writing assistant.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · SKILL.md (reported line 127)May include surrounding context.

md
❌ **Academic Fraud**: Plagiarism, cheating, fake credentials, assignment ghostwriting
❌ **Medical Fraud**: Fake prescriptions, unlicensed advice, miracle cures, dangerous treatments
❌ **Legal Violations**: Contract fraud, perjury, witness tampering, obstruction
❌ **Privacy Violations**: Sharing private info without consent, surveillance, stalking
❌ **Malware/Hacking**: Phishing links, malicious attachments, system exploits
❌ **Extortion**: Blackmail, ransomware, threats for money, coercion

Session Persistence

Medium
Category
Rogue Agent
Confidence
91% confidence
Finding

The instruction to create helper scripts in ~/.email-formatter-skill/scripts/ establishes persistent executable content on the host. For a simple formatter, this is disproportionate and can be abused to leave behind tooling or alter later sessions without renewed consent.

Content

Scanner excerpt · SKILL.md (reported line 279)May include surrounding context.

md
## Helper Scripts & Tools

The skill includes utility scripts for AI agents to use. Create these in `~/.email-formatter-skill/scripts/`:

### 1. Grammar Checker (`grammar_check.py`)

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The workflow writes user email content to temporary files and processes it through multiple local scripts, even though the skill is presented as a formatter. This unnecessarily increases exposure of potentially sensitive communications through filesystem artifacts, process arguments, and broader local access paths.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
82% confidence
Finding

Creating a per-run temporary directory is a weaker form of persistence than home-directory writes, but it still places sensitive email data on disk for the duration of execution and possibly longer if cleanup fails. In this context, it is unnecessary for a formatter and increases privacy exposure.

Content

Scanner excerpt · SKILL.md (reported line 922)May include surrounding context.

md
EMAIL_TEXT="$1"
TEMP_DIR="/tmp/email-formatter-$$"
mkdir -p "$TEMP_DIR"

echo "🔒 Starting Secure Email Processing Pipeline..."
echo "================================================"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The workflow stores email content in temporary files but the user-facing description does not warn about this behavior. Users may submit confidential drafts without informed consent to local persistence, creating privacy and compliance concerns if the host is shared, monitored, or backed up.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

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.

Content

Scanner excerpt · SKILL.md (reported line 990)May include surrounding context.

md
echo ""
    echo "   ⚠️  AGGRESSIVE TONE DETECTED"
    echo "   Recommendation: Suggest user wait 24 hours before sending"
    echo "   Offer to rewrite in professional, constructive tone"
    echo ""
    read -p "   Continue anyway? (yes/no): " CONTINUE
    if [ "$CONTINUE" != "yes" ]; then

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The installer reaches out to pip and installs additional Python packages during setup even though the skill is described as an email-formatting tool. Expanding the environment by downloading packages at install time increases supply-chain and environment-modification risk, and the capability is broader than necessary for the stated function.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The installer explicitly verifies, documents, and promotes use of a security_scan.py script, which is outside the manifest's stated email-formatting purpose. Capability mismatch is a real security concern because it normalizes unexpected code paths and can enable collection, inspection, or processing of sensitive user text under a misleading feature label.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.