Back to skill

Security audit

instagram-saver

Security checks for vulnerabilities and agentic risk

Overview

This Instagram downloader is transparent about using Cobalt, but it tells the agent to run an unsafe shell command on user-provided links and can trigger broad third-party requests automatically.

Install only if you are comfortable with Instagram links being sent to Cobalt and review or rewrite the request step first. The safer design is to require explicit confirmation, validate Instagram URLs, and use a structured HTTP client or argument-array invocation instead of constructing a shell command from the pasted link.

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:23
Finding
Shell Command Injection Through Unsanitized User-Supplied URL## Vulnerability Details **File Location**: `SKILL.md`, lines 23–29 **Vulnerability Type**: Shell command injection **Risk Level**: High The skill directs the agent to replace `{url}` with an untrusted URL and execute the resulting shell command: ```bash ### Step 2 — 發送請求與解析 (Fetch & Parse) 執行以下 `curl` 指令(請將 `{url}` 替換為實際連結): ```bash curl -X POST [https://api.cobalt.tools/api/json](https://api.cobalt.tools/api/json) \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{"url": "{url}"}' ``` ### Technical Analysis The `{url}` placeholder represents user-controlled input and is embedded directly inside a single-quoted shell argument. Shell quoting does not safely contain an input that can itself include a single quote. A malicious value can terminate the JSON argument and introduce shell separators and additional commands. This vulnerability arises before the request reaches Cobalt: the local shell interprets the constructed command. JSON formatting and `Content-Type` headers therefore provide no protection against shell metacharacters. The endpoint is additionally represented using Markdown-link syntax: ```bash [https://api.cobalt.tools/api/json](https://api.cobalt.tools/api/json) ``` This is not a valid literal URL argument for `curl` and may cause the documented command to fail. Although this is primarily a correctness issue, it reinforces the need to avoid generating executable shell commands from prose through textual substitution. ### Attack Path 1. An attacker supplies an apparent Instagram URL containing a single quote followed by shell control operators and an additional command. 2. The agent follows the skill instruction and replaces `{url}` verbatim with the attacker-controlled value. 3. The single quote in the value closes the `-d` argument prematurely. 4. The shell interprets the remaining input as shell syntax rather than URL data. 5. The inject ...[truncated 1300 chars]
Remediation
## Remediation Suggestions 1. **Do not construct shell commands through placeholder substitution.** Use an HTTP client API that accepts the endpoint, headers, and JSON body as distinct structured values without invoking a shell. 2. **Parse and validate the submitted URL.** Require: - The `https` scheme. - An explicitly allowlisted Instagram hostname, such as `instagram.com` or `www.instagram.com`. - Rejection of embedded credentials, control characters, and malformed URLs. - A path matching the supported Instagram content types. 3. **Serialize the request body with a JSON library.** Do not manually concatenate the URL into JSON, because characters such as quotes, backslashes, and control characters require JSON escaping. 4. **If command-line `curl` is unavoidable, pass arguments without a shell.** Invoke it through an argument-array API and provide each argument separately. Generate the body using a JSON serializer. Do not use `sh -c`, `bash -c`, `eval`, or an equivalent command interpreter. 5. **Correct the endpoint representation.** Use the literal endpoint rather than Markdown-link syntax: ```text https://api.cobalt.tools/api/json ``` 6. **Apply least privilege and execution controls.** Run the downloader in a restricted environment with limited filesystem access, no unnecessary credentials, constrained outbound networking, and a dedicated download directory. 7. **Add negative security tests.** Test URLs containing single quotes, double quotes, backslashes, newlines, shell separators, command substitutions, and malformed hostnames, and verify that none are interpreted as executable syntax.
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 (6)

Vague Triggers

Medium
Confidence
95% confidence
Finding
The skill is designed to auto-trigger on any detected Instagram link and proceed toward downloading content, which is an overly broad activation condition for an action that causes network activity and content retrieval. This increases the chance of unintended execution, surprise downloads, and processing of links the user did not explicitly intend to send to a third-party resolver.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The skill sends user-provided Instagram URLs to the external Cobalt API without an explicit warning or consent flow about third-party data transmission. Even if only a URL is sent, links can contain personal, private, or tracking-related information, and silently forwarding them to an external service creates a privacy and trust risk.

External Transmission

Medium
Category
Data Exfiltration
Content
當使用者提供 Instagram 網址(`url`)時,請準備執行 `curl` 指令。我們將使用 Cobalt API 來獲取真實的媒體下載連結。

**API Endpoint:** `https://api.cobalt.tools/api/json`
**Header:** `Content-Type: application/json`
**Header:** `Accept: application/json`
**Body:** `{"url": "{url}"}`
Confidence
94% confidence
Finding
The documented API endpoint establishes that the skill relies on a third-party service to process user-supplied content links. In context, this is dangerous because the skill's purpose is to send those links off-platform, and no warning, consent, retention, or trust boundary explanation is provided.

External Transmission

Medium
Category
Data Exfiltration
Content
執行以下 `curl` 指令(請將 `{url}` 替換為實際連結):

```bash
curl -X POST [https://api.cobalt.tools/api/json](https://api.cobalt.tools/api/json) \
     -H "Content-Type: application/json" \
     -H "Accept: application/json" \
     -d '{"url": "{url}"}'
Confidence
90% confidence
Finding
This finding reflects the same underlying issue as the curl example: direct instruction to send user input to api.cobalt.tools. In this skill context, automatic media-resolution behavior makes the external transmission more dangerous because the user may perceive the action as local link handling rather than disclosure to a third party.

External Transmission

Medium
Category
Data Exfiltration
Content
執行以下 `curl` 指令(請將 `{url}` 替換為實際連結):

```bash
curl -X POST [https://api.cobalt.tools/api/json](https://api.cobalt.tools/api/json) \
     -H "Content-Type: application/json" \
     -H "Accept: application/json" \
     -d '{"url": "{url}"}'
Confidence
90% confidence
Finding
This finding reflects the same underlying issue as the curl example: direct instruction to send user input to api.cobalt.tools. In this skill context, automatic media-resolution behavior makes the external transmission more dangerous because the user may perceive the action as local link handling rather than disclosure to a third party.

Natural-Language Policy Violations

Low
Confidence
86% confidence
Finding
The skill description and instructions are presented in Traditional Chinese, which may impose a language choice on users without documenting that constraint or offering alternatives. Under the language/locale policy, a forced language should be justified or optional.

Static analysis

No suspicious patterns detected.