Back to skill

Security audit

Newsletter Writer

Security checks for vulnerabilities and agentic risk

Overview

This newsletter helper is mostly a template generator, but one bundled command script quietly keeps a local plaintext history of user-entered topics.

Review the actual command entrypoint before installing. Avoid entering confidential campaign plans, unreleased product details, customer segments, or audience data unless the history logging in scripts/script.sh is removed or clearly controlled with restrictive permissions and a deletion path.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:5
Finding

Undisclosed Plaintext Persistence of User-Supplied Content

Content
View full analysis

Vulnerability Details

File Location: scripts/script.sh:5-7, 32, 38-82
Vulnerability Type: Plaintext storage of potentially sensitive user input and unsafe log-file handling
Risk Level: Medium

Vulnerable Code

bash
DATA_DIR="${NEWSLETTER_WRITER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/newsletter-writer}"
DB="$DATA_DIR/data.log"
mkdir -p "$DATA_DIR"

_log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; }

cmd_draft() {
    echo "  Draft: $1
      Target: ${2:-800} words"
    _log "draft" "${1:-}"
}

cmd_headline() {
    echo "  1. How to $1
      2. $1: Complete Guide
      3. Why $1 Matters"
    _log "headline" "${1:-}"
}

cmd_outline() {
    echo "  1. Intro | 2. Problem | 3. Solution | 4. Examples | 5. CTA"
    _log "outline" "${1:-}"
}

cmd_seo() {
    echo "  Keywords: $1 | Title tag | Meta desc | H1-H3 | Internal links"
    _log "seo" "${1:-}"
}

cmd_schedule() {
    echo "  Mon: Research | Tue: Write | Wed: Edit | Thu: Publish | Fri: Promote"
    _log "schedule" "${1:-}"
}

cmd_hooks() {
    echo "  Question | Statistic | Story | Bold claim | Controversy"
    _log "hooks" "${1:-}"
}

cmd_cta() {
    echo "  Subscribe | Share | Comment | Try it | Learn more"
    _log "cta" "${1:-}"
}

cmd_repurpose() {
    echo "  Blog -> Thread -> Video -> Carousel -> Newsletter"
    _log "repurpose" "${1:-}"
}

cmd_metrics() {
    echo "  Views | Clicks | Shares | Time on page | Conversions"
    _log "metrics" "${1:-}"
}

cmd_ideas() {
    echo "  How-to | Listicle | Case study | Interview | Comparison"
    _log "ideas" "${1:-}"
}

Technical Analysis

Most content commands pass their first user-controlled argument to _log, which appends it to history.log in plaintext. Newsletter topics and keywords can contain confidential campaign plans, unreleased product names, customer information, or other commercially ...[truncated 2249 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove history logging unless it is required for a documented feature.
  2. Make persistence explicitly opt-in and clearly document what is stored, where it is stored, and how long it is retained.
  3. Create the data directory with restrictive permissions:
    bash
    umask 077
    mkdir -p -- "$DATA_DIR"
    chmod 700 -- "$DATA_DIR"
    
  4. Validate that the log destination is not a symbolic link and is a regular file owned by the expected user before writing. Prefer opening a securely created file rather than relying on shell append redirection.
  5. Reject untrusted or unsafe values of NEWSLETTER_WRITER_DIR, especially when the script may run in an elevated or automated environment.
  6. Encode log records using a structured format and remove or escape carriage returns, newlines, and other control characters from user-controlled fields.
  7. Apply a retention limit and provide a command that securely clears stored history.
  8. Never execute this script with elevated privileges when processing untrusted arguments or environment variables.
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (7)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill metadata and documentation advertise newsletter-specific capabilities such as audience segmentation, A/B testing, scheduling, and performance analysis, but the finding indicates those capabilities are absent while undeclared local data logging occurs instead. This creates a trust and transparency problem: users may provide campaign content, audience data, or business-sensitive material under false assumptions, and undisclosed filesystem logging increases privacy and data-handling risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The markdown explicitly says the tool is '专为中文用户设计,理解中国市场和文化', which imposes a specific user/language-market orientation in natural language. The file does not offer an opt-in choice or explain a justified region-specific compliance reason, so this appears to violate the locale-choice policy.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This shell skill exposes its user-facing description, usage guidance, and generated prompt templates in Chinese only. That creates a language/locale constraint without offering the user an explicit language choice or documenting a justified regional limitation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes a newsletter skill focused on newsletter content generation, subject optimization, audience segmentation, A/B testing copy, send-time suggestions, and performance analysis. However, the exposed commands are generic content-marketing actions such as outline, seo, hooks, cta, repurpose, and ideas, while key newsletter-specific capabilities like audience segmentation and A/B testing are absent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script persistently logs user-supplied arguments to a local history file without notice or consent, which can capture sensitive newsletter content, campaign plans, customer segments, or other proprietary text. In this skill context, users are likely to provide draft content and marketing details, so silent retention increases privacy and confidentiality risk, especially on shared systems or backups.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The markdown content is written entirely in Chinese, with no indication that the user can choose another language or that the skill is intentionally limited to a Chinese-speaking audience. This creates a natural-language policy concern because it implicitly enforces a specific language/locale without opt-in.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest claims '效果分析' / effectiveness analysis, which implies some newsletter-focused analytical behavior. The metrics command only echoes a fixed list of generic web/content metrics and does not analyze newsletter performance, campaign results, or recipient behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.