Back to skill

Security audit

Reddit Assistant

Security checks for vulnerabilities and agentic risk

Overview

This Reddit assistant is purpose-aligned, but it tells the agent to run unresolved shell scripts and interpolate user content into Bash commands in a way that could execute unintended commands.

Review this skill before installing. Its Reddit workflows are coherent, and it does not show exfiltration, destructive behavior, or automatic Reddit posting, but it should not run as written unless the referenced scripts are included and audited, commands are invoked without shell interpolation, and users are warned before local product data and analytics logs are saved.

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

Error
Location
SKILL.md:138
Finding
Shell Command Injection Through Unsafe Placeholder Interpolation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:138-142`, `SKILL.md:182-188`, `SKILL.md:251-255`, and `SKILL.md:271-274` **Vulnerability Type**: Shell command injection through user-controlled or model-generated command arguments **Risk Level**: High ### Vulnerable Code `SKILL.md:138-142`: ```bash python3 scripts/save_draft.py \ --subreddit "{chosen_subreddit}" \ --angle "{A|B|C}" \ --title "{title}" \ --body "{body}" ``` `SKILL.md:182-188`: ```bash python3 scripts/update_subreddit_profile.py \ --subreddit "r/example" \ --subscribers 50000 \ --activity "high" \ --promo_rules "ok with transparency" \ --best_angle "story" \ --notes "Loves failure stories and specific numbers" ``` `SKILL.md:251-255`: ```bash python3 scripts/init_config.py \ --name "{product_name}" \ --description "{description}" \ --target_user "{target}" \ --stage "{stage}" ``` `SKILL.md:271-274`: ```bash python3 scripts/log_post.py \ --url "https://reddit.com/r/.../comments/..." \ --angle "{A|B|C}" \ --draft_file "memory/drafts/YYYY-MM-DD-subreddit.md" ``` ### Technical Analysis The Skill instructs an agent with Bash access to substitute product details, Reddit post content, subreddit information, and URLs directly into shell command templates. Double quotes do not make arbitrary input safe for shell execution. Shell constructs such as command substitutions using `$()` or backticks are evaluated even when they appear inside double-quoted arguments. An embedded double quote can also terminate the intended argument and introduce shell operators. For example, if a product description is supplied as: ```text $(malicious_command) ``` the resulting setup command would contain: ```bash --description "$(malicious_command)" ``` Bash would execute `malicious_command` before invoking the Python script. Input containing a closing quote and shell operators could similarly alter the command structure. The affected values can originate from us ...[truncated 2154 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Avoid shell-based interpolation entirely.** Invoke scripts through a structured process-execution API that accepts an argument array and does not invoke a shell. Each value should be passed as one literal argument. 2. **Use standard input or structured files for free-form content.** Post bodies, titles, descriptions, and notes should be serialized as JSON or written to a securely created temporary file and then supplied to the script through stdin or a file argument. 3. **Apply strict validation by field type.** - Restrict subreddit names to an allowlist pattern such as `^[A-Za-z0-9_]{2,21}$`. - Restrict angles and stages to documented enum values. - Validate Reddit URLs with a URL parser and allow only expected HTTPS Reddit hostnames. - Enforce reasonable length limits on titles, descriptions, notes, and post bodies. 4. **If shell execution cannot be avoided, use robust argument escaping.** Apply a proven shell-quoting routine to every dynamic value rather than relying on surrounding double quotes. Do not construct a command by string concatenation. 5. **Document safe execution explicitly.** Replace executable Bash templates containing placeholders with non-shell pseudocode or instructions that require argument-array invocation. 6. **Include and audit the referenced scripts.** The package currently contains only `SKILL.md`; the scripts named by the workflows are unavailable for review. Their source should be included and tested for input validation, path traversal, unsafe subprocess invocation, and insecure file handling. 7. **Add regression tests.** Test values containing double quotes, single quotes, spaces, newlines, semicolons, `$()`, backticks, redirection operators, and Unicode characters. Verify that these values are stored as literal data and never interpreted by a shell. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger phrases are broad enough to match common user requests such as 'reddit content' or 'reddit analytics', which can cause the skill to activate when the user did not intend to invoke it. In a skill that runs shell and Python scripts on startup, unintended invocation increases the chance of unnecessary command execution, file access, and network activity without clear user intent.

Missing User Warnings

Low
Confidence
92% confidence
Finding
The performance workflow fetches analytics from Reddit and saves updated metrics to local logs, but it does not explicitly warn the user about network access and local persistence. Even though the data is Reddit-related, silent external requests and storage can violate user expectations and organizational policies around outbound access and telemetry retention.

Missing User Warnings

Low
Confidence
90% confidence
Finding
The setup workflow collects product details and writes them to local configuration files, but the instructions do not require informing the user that this data will be persisted. That creates a privacy and consent issue, especially if users provide sensitive business details, URLs, or internal project information assuming the exchange is ephemeral.

Static analysis

No suspicious patterns detected.