Back to skill

Security audit

MediaGo

Security checks for vulnerabilities and agentic risk

Overview

This MediaGo downloader skill is purpose-aligned, but it asks the agent to store an optional API key in plaintext and build curl commands from user-controlled values without clear safety controls.

Install only if you trust the MediaGo endpoint you configure. Prefer localhost, avoid storing an API key unless needed, protect or remove ~/.mediago-skill.json when done, and do not use crafted URLs, names, or API keys unless the agent implementation safely constructs HTTP requests without shell interpolation.

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:60
Finding

Shell Command Injection Through Unvalidated MediaGo Configuration and Download Parameters

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 60–109
Vulnerability Type: Shell command injection through unsafe interpolation of user-controlled values
Risk Level: High

The Skill instructs the Agent to store user-provided configuration and subsequently interpolate configuration values, video URLs, and filenames into shell-based curl commands.

markdown
When the user provides the URL (and optionally an API key), write it to `~/.mediago-skill.json`.

### Updating Config / 更新配置

Trigger on phrases like:

- EN: "set mediago url to ...", "mediago api key is ...", "my mediago is at ..."
- CN: "设置 mediago 地址为 ...", "mediago api key 是 ...", "我的 mediago 跑在 ..."

Read the existing config, update the relevant field, and write it back.

## API Reference

All API calls use `curl`. Read `url` and `apiKey` from `~/.mediago-skill.json` before each call.

If `apiKey` is set, add header: `-H "X-API-Key: API_KEY"`

### Health Check

curl -s BASE_URL/healthy

text

Returns `{"success":true,...}` if service is running.

### Create & Start Download

curl -s -X POST BASE_URL/api/downloads
-H "Content-Type: application/json"
-d '{"tasks":[{"type":"TYPE","url":"VIDEO_URL","name":"NAME"}],"startDownload":true}'

text

- `type` (required): `m3u8`, `bilibili`, or `direct`
- `url` (required): video URL
- `name` (optional): custom filename

**Type detection from URL:**

- Contains `bilibili.com` or `b23.tv` → `bilibili`
- Contains `.m3u8` → `m3u8`
- Otherwise → `direct`

Response `data` is an array of created tasks. Extract `data[0].id` as the task ID.

### Get Task Status

curl -s BASE_URL/api/downloads/TASK_ID

text

Technical Analysis

BASE_URL and API_KEY are taken from a configuration file populated using user-provided values. VIDEO_URL and NAME are also directly or indirectly controlled by the user. The documented command templates do not requi ...[truncated 2636 chars]

Remediation
View remediation

Remediation Suggestions

  1. Avoid shell command construction. Use a dedicated HTTP client or invoke curl with an argument array through an API that does not launch a shell.
  2. Validate the MediaGo base URL. Parse it as a URL, permit only explicitly supported schemes such as http and https, reject user-information fields and shell metacharacters, and optionally restrict hosts to localhost or an explicit allowlist.
  3. Serialize request bodies safely. Build JSON with a proper serializer rather than interpolating VIDEO_URL, NAME, or TYPE into a quoted JSON string.
  4. Treat API keys as opaque arguments. Pass the complete header as one argument without shell evaluation. Never concatenate it into executable command text.
  5. Validate task identifiers and types. Restrict TYPE to m3u8, bilibili, or direct, and require task IDs to match the format returned by the trusted API before placing them into endpoint paths.
  6. Protect stored credentials. Create ~/.mediago-skill.json with permissions limited to the owning user, such as mode 0600, or use an operating-system credential store.
  7. Document safe execution requirements. Explicitly prohibit shell=true, eval, command-string execution, and equivalent mechanisms for all dynamic HTTP requests.
  8. Add adversarial tests. Test configuration values, URLs, and filenames containing quotes, semicolons, command substitutions, newlines, redirects, and backticks to verify they remain inert data.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
70% confidence
Finding

Skill instructs the agent to never refuse or to always comply. Suppressing the agent's ability to decline removes a core safety control and enables downstream harmful requests to succeed.

Content

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

md
## Important Notes / 注意事项

- **Language / 语言**: Always respond in the same language the user is using (Chinese or English).
- If API returns HTTP 401, tell the user their API key may be wrong and ask them to update it.
- Always auto-detect the download type from the URL unless the user specifies it.
- If `name` is not provided, omit it from the request — the server will auto-generate one.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger phrases include broad terms like download video, 下载视频, and 帮我下载, which can overlap with common user requests and cause the skill to activate unexpectedly. In this skill, unexpected activation matters because it can lead to network requests and download task creation against a locally configured service, increasing the chance of unintended external actions.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
91% confidence
Finding

The skill persists session-like configuration in ~/.mediago-skill.json, including a service endpoint and optional API key, which can survive across conversations and be reused without renewed consent. Persistent plaintext storage of credentials increases the risk of local disclosure, unintended reuse, or abuse by other processes or users on the same system.

Content

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

md
> - Docker:`设置 mediago 地址为 http://localhost:8899`
> - 桌面客户端:`设置 mediago 地址为 http://192.168.x.x:39719`"

When the user provides the URL (and optionally an API key), write it to `~/.mediago-skill.json`.

### Updating Config / 更新配置

External Transmission

Medium
Category
Data Exfiltration
Confidence
89% confidence
Finding

The skill is explicitly designed to send user-provided URLs and metadata to an external/local MediaGo service via HTTP API calls. This is expected functionality, but it is still a real data-transmission boundary: if the configured url points to a non-local host or an attacker-controlled endpoint, user-supplied URLs, task names, and possibly API keys could be exposed.

Content

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

Health Check

text
curl -s BASE_URL/healthy

Returns {"success":true,...} if service is running.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill writes persistent configuration, including the MediaGo URL and optionally an API key, to ~/.mediago-skill.json without clearly warning the user beforehand. This creates a privacy and credential-handling risk because users may not realize secrets are being stored locally in plaintext.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.