Back to skill

Security audit

Poem Generator

Security checks for vulnerabilities and agentic risk

Overview

The skill presents itself as a poem generator, but it also ships a same-named marketing helper that saves user inputs locally without clear disclosure.

Review before installing. The poem-generation materials are coherent, but the package should either remove or clearly document the separate marketing script. Avoid entering sensitive campaign names, proprietary drafts, or personal data into the marketing commands unless local history logging is disclosed, optional, and permission-hardened.

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

Note
Location
scripts/script.sh:5
Finding

Undisclosed Persistent Storage of User-Supplied Content

Content
View full analysis

Vulnerability Details

File Location: scripts/script.sh, lines 5–8, 34, and 40–86
Vulnerability Type: Persistent plaintext storage with insufficient access-control hardening
Risk Level: Low

Vulnerable Code

bash
VERSION="2.0.0"
DATA_DIR="${POEM_GENERATOR_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/poem-generator}"
DB="$DATA_DIR/data.log"
mkdir -p "$DATA_DIR"
bash
_log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; }

User-controlled command arguments are passed to this logging function throughout the command handlers:

bash
_log "draft" "${1:-}"
_log "headline" "${1:-}"
_log "outline" "${1:-}"
_log "seo" "${1:-}"
_log "schedule" "${1:-}"
_log "hooks" "${1:-}"
_log "cta" "${1:-}"
_log "repurpose" "${1:-}"
_log "metrics" "${1:-}"
_log "ideas" "${1:-}"

Technical Analysis

The script persistently appends user-supplied topics to history.log under the configured data directory. This collection and retention are not disclosed by the poetry-oriented skill documentation and are not necessary to produce the command output.

The script creates the directory and log file without setting a restrictive umask or explicitly applying permissions such as 0700 to the directory and 0600 to the file. Consequently, effective access permissions depend on the invoking user's environment. With a permissive default umask and traversable parent directories, other local accounts or processes may be able to read retained topics.

The log has no retention limit, deletion mechanism, redaction, or consent control. Topics supplied to content-related commands may contain confidential project names, unpublished campaign details, personal information, or other sensitive text.

Attack Path

  1. A user invokes a command with sensitive text, for example:
    bash
    scripts/script.sh draft "Confidential acquisition strategy"
    
  2. The correspondi ...[truncated 1176 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove persistent logging if it is not required for the skill's documented functionality.
  2. If logging is required, clearly disclose what data is collected, where it is stored, and how long it is retained.
  3. Require explicit user consent before recording command arguments.
  4. Establish restrictive permissions before creating storage:
    bash
    umask 077
    mkdir -p -- "$DATA_DIR"
    chmod 700 -- "$DATA_DIR"
    touch -- "$DATA_DIR/history.log"
    chmod 600 -- "$DATA_DIR/history.log"
    
  5. Avoid recording raw arguments. Store only non-sensitive operational metadata, or redact and truncate user-provided values.
  6. Add configurable retention limits and a command that securely clears stored history.
  7. Validate that the configured data path is appropriate before writing and document the security implications of overriding it with POEM_GENERATOR_DIR.
  8. Update SKILL.md so the documented commands and data-handling behavior accurately match the executable script.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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
Findings (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says this skill is a poetry generator focused on specific poetic forms and poem translation. The code does not implement poetry-related features such as poem generation, haiku, couplets, acrostics, or translation. Instead, its primary purpose is a generic content creation and optimization assistant for marketing/editorial workflows. It exposes commands like headline, seo, schedule, hooks, cta, repurpose, metrics, and ideas, which are materially different from the declared purpose. It also logs command usage locally, which is not problematic by itself, but the main functional mismatch is substantial and clear.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script’s stated behavior and commands implement a content-marketing assistant, while the skill metadata claims it is a poem generator. This kind of capability mismatch is dangerous because it misrepresents what users and reviewers are installing, undermines informed consent, and can hide unrelated or unauthorized behavior behind an innocuous label.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
80% confidence
Finding

The natural-language description begins in Chinese and presents the skill as a Chinese-language assistant without stating that users may choose their preferred language. Organizational language/locale policy requires either user choice or a clearly justified locale constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The help text and all command instructions are written primarily in Chinese, which effectively forces a specific language for users of the skill. The file does not offer an opt-in language choice or explain that the skill is intentionally limited to a Chinese-speaking or region-specific audience.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The inline comments and help text repeatedly describe a different product intent than the manifest, indicating deliberate deception rather than a simple naming mistake. In a security review context, contradictory identity signals are a red flag because they can be used to smuggle unintended functionality past users, policy checks, or maintainers.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

User-supplied command inputs are logged to a local history file without any disclosure, which can capture sensitive prompts, topics, or proprietary text. Even though the data stays local, silent retention increases privacy risk, especially on shared systems or where the data directory is backed up, synced, or readable by other processes.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

In a markdown skill description, activation guidance should be specific enough to avoid unintended invocation. The phrase suggesting users start with help is generic and commonly used across many contexts, and the file does not provide exclusion conditions or tighter trigger scope.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file is largely written in Chinese and provides no indication that the user can choose another language or that the skill is intended only for a Chinese-language audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.