Back to skill

Security audit

Short Drama Writer

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a short-drama writing helper, but one bundled command script silently keeps user-supplied topics in a persistent local plaintext history file without clear controls.

Install only if you are comfortable with a bundled command script retaining entered topics or prompts locally in plaintext. Avoid entering confidential campaign names, unpublished scripts, personal data, or proprietary ideas unless the logging behavior is removed, disabled, or clearly controlled.

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 Persistent Plaintext Logging of User-Supplied Content

Content
View full analysis

Vulnerability Details

File Location: scripts/script.sh, lines 5–7 and 35–83
Vulnerability Type: Persistent plaintext storage of potentially sensitive user input
Risk Level: Medium

Vulnerable Code

bash
DATA_DIR="${SHORT_DRAMA_WRITER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/short-drama-writer}"
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 by the content commands:

bash
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

The script automatically creates a persistent data directory and appends raw command arguments to history.log. Users may reasonably supply con ...[truncated 1984 chars]

Remediation
View remediation

Remediation Suggestions

  1. Disable input logging by default and only enable it through explicit user consent.
  2. Do not store raw command arguments. If telemetry is required, record only non-sensitive event metadata, such as the command name and execution time.
  3. Clearly document what is stored, where it is stored, why it is needed, and how long it is retained.
  4. Establish restrictive permissions before creating storage:
    bash
    umask 077
    mkdir -p -- "$DATA_DIR"
    chmod 700 -- "$DATA_DIR"
    
  5. Create the history file with user-only permissions:
    bash
    touch -- "$DATA_DIR/history.log"
    chmod 600 -- "$DATA_DIR/history.log"
    
  6. Add configurable retention limits and a command that securely clears stored history.
  7. If logging must remain available, provide a redaction mechanism and avoid recording free-form content.
  8. Remove the unused DB variable if no database file is required, reducing ambiguity about the tool's storage behavior.
Vulnerability Patterns
  • 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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (4)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The phrase "专为中文用户设计,理解中国市场和文化" indicates a locale/language-specific constraint as a selling point, but the document does not provide any user opt-in or alternative language/locale option. Under the policy, forcing or privileging a specific language/locale without user choice is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This shell script emits Chinese-language content and labels throughout its generated output, while the help text does not disclose a language option or obtain user opt-in. That creates a natural-language policy concern because the skill effectively forces a specific locale rather than allowing user choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script records user-supplied content to a persistent history file via _log without any notice, consent, retention policy, or redaction. Even though this is not code execution, prompts and content ideas may contain sensitive or proprietary text, and silent logging increases privacy and data exposure risk if the local account or data directory is accessed by others.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code file contains user-facing natural-language output and documentation in Chinese, starting with the module docstring, and does not provide any user opt-in or alternative locale. Under the policy, forcing a specific language without user choice is a natural-language policy concern unless the locale limitation is clearly justified.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.