Back to skill

Security audit

Insta Content Engine

Security checks for vulnerabilities and agentic risk

Overview

This skill’s social posting purpose is mostly disclosed, but it handles live account credentials and sessions while shipping exploitable command-generation patterns that should be reviewed before installation.

Review this skill carefully before installing. Use it only in an isolated environment with dedicated low-privilege social accounts, rotate any credentials used, avoid passing untrusted queries or action values, and require a manual preview/confirmation before any post is published.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/viral-search.js:75
Finding
Shell Command Injection Through the X Search Query<![CDATA[ ## Vulnerability Details **File Location**: `scripts/viral-search.js`, lines 75-79 **Vulnerability Type**: OS command injection through shell interpolation **Risk Level**: High ### Vulnerable Code ```javascript const raw = execSync(`bird search "${searchQuery.replace(/"/g, '\\"')}" -n ${fetchCount} --json`, { encoding: 'utf8', timeout: 30000, stdio: ['pipe', 'pipe', 'pipe'], }); ``` ### Technical Analysis The user-controlled search query is interpolated into a command string executed by `execSync`. Escaping double quotes alone does not prevent shell interpretation inside a double-quoted argument. For example, shell command substitution constructs such as `$(command)` and backticks remain active inside double quotes. Consequently, an attacker who can influence the query can cause the shell to run an additional local command before invoking `bird`. The vulnerability is present in the normal query search path. The fixed trending queries do not introduce the same direct user-controlled input. ### Attack Path 1. An attacker supplies a malicious query containing a shell command-substitution expression. 2. Argument parsing stores that value in `query`. 3. `searchX` appends search operators to the value and stores the result in `searchQuery`. 4. The code escapes only double-quote characters. 5. The resulting value is inserted into a command string passed to `execSync`. 6. The operating-system shell evaluates command substitution within the double-quoted search argument. 7. The injected command executes with the privileges and environment of the user running the Skill. ### Impact Assessment Successful exploitation provides arbitrary command execution under the Agent user's operating-system account. An attacker could read or modify files accessible to that user, access environment variables and local configuration, steal API credentials or social-media sessions, invoke installed tools, or perform network requests. The vulnerability does not in ...[truncated 136 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Replace shell-based `execSync` with `execFileSync` or `spawnSync`. - Pass every command-line argument in an argument array so no shell parses the query. - Explicitly disable shell execution. - Validate numeric options such as `fetchCount` before passing them to the child process. - Apply reasonable query length limits and reject control characters. A safer implementation would follow this pattern: ```javascript const { execFileSync } = require('child_process'); const raw = execFileSync( 'bird', ['search', searchQuery, '-n', String(fetchCount), '--json'], { encoding: 'utf8', timeout: 30000, stdio: ['pipe', 'pipe', 'pipe'], shell: false, } ); ``` Escaping input is not an adequate substitute for avoiding the shell. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/instagram-post.js:68
Finding
Python Code Injection Through the Instagram Action Argument<![CDATA[ ## Vulnerability Details **File Location**: `scripts/instagram-post.js`, lines 68-94 **Vulnerability Type**: Generated-code injection leading to arbitrary code execution **Risk Level**: High ### Vulnerable Code ```javascript const pyScript = ` import json, os, sys from pathlib import Path from instagrapi import Client cl = Client() session_file = '${escapePy(sessionFile)}' # Try loading session if os.path.exists(session_file): try: cl.load_settings(session_file) cl.login('${escapePy(username)}', '${escapePy(password)}') cl.get_timeline_feed() # test session print("✅ Logged in via saved session") except Exception as e: print(f"⚠️ Session expired, re-logging: {e}") cl = Client() cl.login('${escapePy(username)}', '${escapePy(password)}') cl.dump_settings(session_file) else: cl.login('${escapePy(username)}', '${escapePy(password)}') cl.dump_settings(session_file) print("✅ Logged in fresh, session saved") caption = '''${escapePy(caption)}''' media_files = [${mediaListPy}] action = '${action}' ``` ### Technical Analysis The `--action` argument is inserted directly into dynamically generated Python source code: ```javascript action = '${action}' ``` Unlike the username, password, session path, caption, and media paths, `action` is not passed through `escapePy` and is not restricted to the documented action names. A value containing a single quote can terminate the Python string literal and inject additional Python statements. The completed source is subsequently passed to `python3 -c`, causing injected statements to execute as Python code. Shell quoting applied later does not address this flaw because the attack alters the Python source before the shell command is constructed. ### Attack Path 1. An attacker invokes the script or influences its arguments and supplies a crafted `--action` value. 2. The argument parser accepts the value without allowlist validation ...[truncated 1103 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Do not build executable Python source from user-controlled strings. - Move the Python implementation into a fixed `.py` file. - Pass captions, paths, credentials, and action names through command-line arguments or JSON over standard input. - Invoke Python with `execFileSync` or `spawnSync` using an argument array and `shell: false`. - Strictly allowlist the action before invoking Python: ```javascript const allowedActions = new Set(['photo', 'reel', 'story', 'carousel']); if (!allowedActions.has(action)) { console.error('Invalid action'); process.exit(1); } ``` - Avoid passing Instagram passwords in generated source or process command lines. Prefer standard input, a protected credential provider, or another channel that does not expose secrets through process listings. - Restrict the session file to the current user and ensure its parent directory is created with restrictive permissions. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:15
Finding
Unpinned Third-Party Python Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 15 **Vulnerability Type**: Insecure and non-reproducible dependency installation **Risk Level**: Medium ### Vulnerable Code ```bash pip3 install instagrapi pillow ``` ### Technical Analysis The installation instruction retrieves the latest versions of `instagrapi` and `pillow` without version constraints, a lockfile, or package hashes. The effective code installed by users can therefore change over time without any corresponding change to the audited Skill package. These dependencies execute in a sensitive context. In particular, `instagrapi` receives Instagram credentials and session data. Dependency installation can also execute package build logic under the installing user's privileges. This is a supply-chain weakness rather than evidence that the named packages are currently malicious. ### Attack Path 1. A user follows the documented prerequisite command. 2. `pip` resolves mutable package versions from the configured package index. 3. A compromised upstream release, compromised package-index account, unsafe alternate index, or unexpectedly incompatible future release is selected. 4. Package installation or subsequent import executes the retrieved code. 5. That code runs with the installing or Skill-running user's privileges and may access credentials, files, sessions, and network resources. Exploitation depends on a malicious or compromised dependency source or release; the repository itself does not include such a payload. ### Impact Assessment A compromised dependency could execute arbitrary code with the user's privileges. It could access Instagram credentials, saved session settings, API keys, local files, and social-media posting capabilities. The precise scope depends on the installation environment and the permissions granted to the Python process. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions - Pin reviewed dependency versions rather than installing unconstrained latest releases. - Maintain a lockfile or requirements file containing exact versions. - Use package hashes and install with `--require-hashes` where practical. - Review and update dependencies through a controlled process with vulnerability scanning. - Install dependencies in an isolated virtual environment instead of the user's global Python environment. - Document the expected package index and avoid untrusted extra indexes. - Prefer prebuilt wheels from trusted sources and restrict unexpected source builds. For example: ```text instagrapi==<reviewed-version> --hash=sha256:<verified-hash> Pillow==<reviewed-version> --hash=sha256:<verified-hash> ``` ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (15)

Tainted flow: 'req' from os.environ.get (line 42, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Content
print(f"Generating image ({size})...")
try:
    resp = urllib.request.urlopen(req, timeout=120)
    result = json.loads(resp.read())
    b64 = result["data"][0]["b64_json"]
    with open(output, "wb") as f:
Confidence
90% confidence
Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Undisclosed reliance on external APIs and incomplete description of actual behavior can mislead users about data flows, costs, and account exposure. In security terms, hidden dependencies and omitted external-service interactions reduce informed consent and make risky operations easier to trigger unexpectedly.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Undisclosed reliance on external APIs and incomplete description of actual behavior can mislead users about data flows, costs, and account exposure. In security terms, hidden dependencies and omitted external-service interactions reduce informed consent and make risky operations easier to trigger unexpectedly.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Undisclosed reliance on external APIs and incomplete description of actual behavior can mislead users about data flows, costs, and account exposure. In security terms, hidden dependencies and omitted external-service interactions reduce informed consent and make risky operations easier to trigger unexpectedly.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Undisclosed reliance on external APIs and incomplete description of actual behavior can mislead users about data flows, costs, and account exposure. In security terms, hidden dependencies and omitted external-service interactions reduce informed consent and make risky operations easier to trigger unexpectedly.

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill documents use of networked tools and environment-based credentials, but it declares no explicit tool scope or allowed-tools policy. That omission can cause overbroad execution in agent environments, making it easier for the skill to access network resources or secrets without clear user visibility or platform enforcement.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill instructs users to place sensitive API keys and account credentials in environment variables but gives no guidance on secure handling, storage, rotation, or least privilege. This raises the risk of credential leakage through logs, process inspection, shell history, or overly broad agent access to env vars.

Behavior Manipulation

Medium
Category
Prompt Injection
Content
1. **NEVER just put text on a solid dark background** — it looks flat and amateur
2. **ALWAYS use a photographic/cinematic background** — real scenes, real subjects
3. **ALWAYS use dark gradient overlay** on the lower 40% for text readability
4. **Keep subject visible** in the top 60% — face, setting, context
5. **Text lives in the bottom 40% only** — never cover the subject
6. **Use bold condensed typography** (Anton-style) — not regular weight fonts
Confidence
70% confidence
Finding
Subtle instructions detected that may alter agent decision-making or introduce hidden biases.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill provides direct commands for publishing to live X/Twitter and Instagram accounts without an explicit safety warning or confirmation requirement. In an agent setting, that increases the chance of accidental posting, reputational harm, disclosure of sensitive information, or unwanted actions on behalf of the user.

External Transmission

Medium
Category
Data Exfiltration
Content
}).encode()

req = urllib.request.Request(
    "https://api.openai.com/v1/images/generations",
    data=data,
    headers={
        "Content-Type": "application/json",
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Context-Inappropriate Capability

Medium
Confidence
84% confidence
Finding
The manifest describes a skill for finding trends, generating social graphics, and posting to Instagram/X without paid APIs, but it does not indicate that the implementation will collect account credentials from environment variables or command-line flags. Handling raw credentials is a more sensitive capability than the stated purpose alone implies, especially since the script also persists authenticated session state.

Context-Inappropriate Capability

Medium
Confidence
90% confidence
Finding
The script stores an authenticated Instagram session to a local file under the user's home directory, creating durable account-state material that can be reused if the file is read by another local process or user. In a skill marketed mainly as social posting automation, silently persisting reusable session state increases the blast radius of compromise beyond a one-time login and can enable unauthorized posting or account access.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
The script accesses both environment credentials and a local OpenClaw config file to obtain a Brave API key, which expands its access beyond a narrowly scoped Instagram search helper. In an agent-skill context, reading unrelated local configuration can expose secrets from the host environment and creates unnecessary secret-discovery behavior that could be abused or repurposed if the skill is modified or combined with other components.

Description-Behavior Mismatch

Medium
Confidence
89% confidence
Finding
The manifest describes a skill that can 'find trending topics' in general, but this file's trending implementation only searches three fixed topic areas: crypto, DeFi, and AI trading. That materially narrows and biases the behavior relative to the broader claim in the description.

Natural-Language Policy Violations

Low
Confidence
96% confidence
Finding
The code explicitly uses `toLocaleDateString('en-GB', ...)`, which hard-codes a specific locale in user-visible output. This is a natural-language/locale policy concern because users are not offered a choice or informed that output formatting will be forced to British English conventions.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/instagram-post.js:120

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/viral-search.js:68