Back to skill

Security audit

Unipile Instagram Sdk

Security checks for vulnerabilities and agentic risk

Overview

This Instagram/Unipile skill largely matches its stated purpose, but it needs review because it enables write actions by default despite a read-only safety claim.

Review this skill before installing. Use it only with a dedicated Instagram account or a tightly scoped Unipile setup, set UNIPILE_PERMISSIONS=read before first use unless you truly need posting or messaging, verify the UNIPILE_DSN is the intended Unipile HTTPS endpoint, and rotate the token if it may have been used with an untrusted endpoint.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/instagram.mjs:18
Finding

Write Operations Are Enabled by Default Despite a Read-Only Safety Claim

Content
View full analysis
p.trim().toLowerCase()); ``` Permission derivation and write-command enforcement: ```javascript const hasRead = PERMISSIONS.includes('read'); const hasWrite = PERMISSIONS.includes('write'); // Commands that require write permission const WRITE_COMMANDS = [ 'send', 'start-chat', 'create-post', 'comment', 'react' ]; // Commands that are read-only const READ_COMMANDS = [ 'accounts', 'account', 'chats', 'chat', 'messages', 'profile', 'my-profile', 'relations', 'followers', 'posts', 'post', 'attendees', 'comments' ]; ``` ```javascript function checkPermission(cmd) { if (WRITE_COMMANDS.includes(cmd) && !hasWrite) { console.error(`Error: Command '${cmd}' requires write permission.`); console.error(`Current permissions: ${PERMISSIONS.join(', ')}`); console.error(`Set UNIPILE_PERMISSIONS=write or UNIPILE_PERMISSIONS=read,write to enable.`); process.exit(3); } if (READ_COMMANDS.includes(cmd) && !hasRead) { console.error(`Error: Command '${cmd}' requires read permission.`); console.error(`Current permissions: ${PERMISSIONS.join(', ')}`); console.error(`Set UNIPILE_PERMISSIONS=read to enable.`); process.exit(3); } } ``` Contradictory documentation: ```markdown ## 🛡️ Permission Modes By default, the skill operates in read-only mode for safety. **Read-only** (`UNIPILE_PERMISSIONS=read`): ``` ### Technical Analysis The implementation assigns `read,write` whenever `UNIPILE_PERMISSIONS` is absent. Consequently, `hasWrite` evaluates to `true`, and the local permission check permits all write commands, including sending direct messages, starting conversations, ...[truncated 1808 chars]
Remediation
View remediation
permission.trim().toLowerCase()); ``` 2. Reject unknown or empty permission values rather than silently accepting malformed configuration. 3. Require an explicit `write` setting before enabling any mutating command. 4. Add an interactive confirmation or a separate non-interactive confirmation flag for consequential operations such as sending DMs and creating posts. 5. Where supported by Unipile, use separately scoped or server-enforced read-only credentials rather than relying solely on a local environment variable. 6. Make the behavior consistent across `SKILL.md`, source comments, and CLI help. 7. Add automated tests asserting that every write command is rejected when `UNIPILE_PERMISSIONS` is absent or set to `read`. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/instagram.mjs:16
Finding

Unrestricted API Endpoint Can Expose the Access Token to a Malicious DSN

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (10)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 57)May include surrounding context.

md
2. **Review Unipile's security** — Read their [privacy policy](https://unipile.com) and [terms of service](https://unipile.com)
3. **Audit the SDK** — The [unipile-node-sdk](https://github.com/unipile/unipile-node-sdk) is open source and auditable
4. **Use least privilege** — Set `UNIPILE_PERMISSIONS=read` unless you need write access
5. **Rotate tokens** — Regularly regenerate your access token from the Unipile dashboard
6. **Monitor activity** — Check your Unipile dashboard for unexpected API usage

### If You're Unsure

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 97)May include surrounding context.

md
2. **Review Unipile's security** — Read their [privacy policy](https://unipile.com) and [terms of service](https://unipile.com)
3. **Audit the SDK** — The [unipile-node-sdk](https://github.com/unipile/unipile-node-sdk) is open source and auditable
4. **Use least privilege** — Set `UNIPILE_PERMISSIONS=read` unless you need write access
5. **Rotate tokens** — Regularly regenerate your access token from the Unipile dashboard
6. **Monitor activity** — Check your Unipile dashboard for unexpected API usage

### If You're Unsure

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/instagram.mjs (reported line 8)May include surrounding context.

js
* 
 * Environment:
 *   UNIPILE_DSN           - API endpoint (required)
 *   UNIPILE_ACCESS_TOKEN  - Access token (required)
 *   UNIPILE_PERMISSIONS   - Comma-separated: "read" and/or "write" (default: "read,write")
 * 
 * Examples:

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/instagram.mjs (reported line 83)May include surrounding context.

js
* 
 * Environment:
 *   UNIPILE_DSN           - API endpoint (required)
 *   UNIPILE_ACCESS_TOKEN  - Access token (required)
 *   UNIPILE_PERMISSIONS   - Comma-separated: "read" and/or "write" (default: "read,write")
 * 
 * Examples:

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 40)May include surrounding context.

md
### What This Means

- **Unipile gets your data** — Your Instagram messages, posts, and profile data flow through Unipile's servers
- **API-level control** — Anyone with these credentials can send DMs, create posts, and interact as you
- **Connected accounts** — If you connect Instagram via Unipile's dashboard, your Instagram session is stored on their servers

### Higher-Risk: Connecting Instagram Accounts

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill claims it is read-only by default, but elsewhere documents the default UNIPILE_PERMISSIONS as read,write. That mismatch can cause users to believe they are granting passive access while the skill may actually be able to send messages, create posts, comment, and react, leading to unauthorized or unexpected account actions.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The description advertises triggers such as "instagram message", "send instagram", and "instagram api" without clarifying boundaries or exclusion conditions. These phrases are somewhat broad and may match ordinary user requests about Instagram generally, increasing the chance of unintended invocation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
66% confidence
Finding

The file presents natural-language use examples and conversational operation but does not state whether users may choose their preferred language or locale. If organizational policy requires language choice rather than implicit default behavior, this omission can be a natural-language policy concern.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
91% confidence
Finding

The dependency is version-ranged with a caret (^1.9.3), which allows installation of newer compatible releases that were not explicitly reviewed by the skill author. This creates a supply-chain integrity risk: a compromised or breaking upstream release could be pulled into future installs automatically.

Content

Scanner excerpt · package.json (reported line 14)May include surrounding context.

json
"author": "",
  "license": "ISC",
  "dependencies": {
    "unipile-node-sdk": "^1.9.3"
  }
}

Static analysis

No suspicious patterns detected.