Back to skill

Security audit

tokenrouter-video-usaging

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent Tokenrouter video purpose, but it can modify routing config, restart services, and send discovered API credentials and prompts to a fixed external endpoint without clear user confirmation.

Review this skill before installing. It is not clearly malicious, but only use it where the agent may inspect Tokenrouter config, change routing files, restart the service, and send prompts or image URLs to Tokenrouter. Require a shown diff and approval before config edits or restarts, and ensure API keys are only sent to the origin they were issued for.

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:30
Finding
Cross-Origin Disclosure of Configured API Credentials## Vulnerability Details **File Location**: `SKILL.md:30`, `SKILL.md:42-46`, and `SKILL.md:68-75`; duplicated in `references/api_reference.md:312-316` **Vulnerability Type**: Cross-origin credential reuse **Risk Level**: High ### Vulnerable Code Snippets `SKILL.md:30`: ```markdown 4. **API Call**: Use the detected channel's key and the fixed base URL `https://api.tokenrouter.com` to call the video generation endpoints. ``` `SKILL.md:42-46`: ```markdown Authentication discovery rule: - Search current channel/provider configs for a `baseurl` or `baseURL` containing `https://api.tokenrouter.com` or `https://open.palebluedot.ai`. - If found, treat that entry as the tokenrouter channel and reuse its configured key for `Authorization`. - If not found, stop and instruct the user to register at `https://www.tokenrouter.com` to obtain tokenrouter access and the required channel configuration. ``` `SKILL.md:68-75`: ```markdown ## API Calls Use the fixed tokenrouter base URL `https://api.tokenrouter.com` for all API calls. Auth rule: - Base URL is always `https://api.tokenrouter.com`. - If a matching channel exists, use that channel's configured key directly. - If no matching channel exists, do not fabricate placeholders like `TOKENROUTER_API_KEY`; instead tell the user to register at `https://www.tokenrouter.com` and add tokenrouter config first. ``` `references/api_reference.md:312-316`: ```markdown ## Auth And Base URL - Detect whether the current workspace already has a channel whose `baseurl` or `baseURL` contains `https://api.tokenrouter.com` or `https://open.palebluedot.ai`. - If found, reuse that channel's key directly. The request base URL is always `https://api.tokenrouter.com`. - Reuse the workspace's current auth style, usually `Authorization: Bearer <token>`. ``` ### Technical Analysis The Skill recognizes credentials from channels configured for either `https://api.tokenro ...[truncated 2251 chars]
Remediation
## Remediation Suggestions 1. Bind each discovered credential to the exact configured origin, including scheme, hostname, and port. 2. Send requests to the channel's configured and validated base URL rather than replacing it with a fixed hostname. 3. If the API must always use `https://api.tokenrouter.com`, accept only credentials from a channel configured for that exact origin. 4. Do not reuse a credential from `https://open.palebluedot.ai` unless the provider explicitly documents that the token is interchangeable and the user gives informed confirmation. 5. Add an origin-validation check immediately before constructing the Authorization header. Abort if the credential's source origin differs from the request destination. 6. Maintain an explicit allowlist using exact parsed host comparisons rather than substring matching. Reject user-info components, unexpected ports, subdomains, and lookalike hostnames. 7. Avoid logging or returning Authorization headers and redact secrets from command output and error messages. 8. Update both `SKILL.md` and `references/api_reference.md` so their authentication requirements are consistent. 9. Add tests proving that a credential configured for `open.palebluedot.ai` is never sent to `api.tokenrouter.com`, and vice versa.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
There is a clear description-behavior mismatch. The declared skill promises a workflow that inspects actual tokenrouter channel configuration, conditionally instructs the user, ensures specific video models are present, potentially edits configuration to add routes, and then uses those routes for video task operations. The supplied code only searches the workspace for files that might contain tokenrouter-related configuration based on names and keyword matches. This file-discovery step could support the declared workflow, but by itself it does not implement the core promised checks or actions. Therefore the code's actual functionality is materially narrower and different from the declared purpose.

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
The manifest describes an end-to-end workflow: detect an existing tokenrouter channel, verify whether a requested video model is configured, auto-configure missing model routes, and then create/query video generation tasks. This file only walks the workspace and heuristically lists likely configuration files based on filenames and text snippets, with no logic to validate channel contents, modify configs, or interact with video task APIs.

Lp3

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding
The skill clearly instructs the agent to read workspace files to discover tokenrouter configuration, but it does not declare an explicit tool scope such as allowed file-read permissions. This weakens least-privilege boundaries and can cause an agent runtime to grant broader access than users expect when the skill is invoked.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill instructs the agent to auto-modify configuration and possibly reload or restart a service with no explicit requirement for prior user confirmation. That creates a real integrity and availability risk: the agent could alter production routing or interrupt service based on heuristic schema inference alone.

External Transmission

Medium
Category
Data Exfiltration
Content
**Hailuo:**

```bash
curl -X POST "https://api.tokenrouter.com/v1/video/generations" \
  -H "Authorization: Bearer $DETECTED_CHANNEL_KEY" \
  -H "Content-Type: application/json" \
  -d '{
Confidence
82% confidence
Finding
The hardcoded external base URL itself is not inherently malicious, but it codifies outbound communication to a third-party service and encourages automatic use once a matching key is found. In the context of a skill that inspects local configuration, this increases the chance of unreviewed credential reuse and external data transfer.

External Transmission

Medium
Category
Data Exfiltration
Content
**Hailuo:**

```bash
curl -X POST "https://api.tokenrouter.com/v1/video/generations" \
  -H "Authorization: Bearer $DETECTED_CHANNEL_KEY" \
  -H "Content-Type: application/json" \
  -d '{
Confidence
82% confidence
Finding
The hardcoded external base URL itself is not inherently malicious, but it codifies outbound communication to a third-party service and encourages automatic use once a matching key is found. In the context of a skill that inspects local configuration, this increases the chance of unreviewed credential reuse and external data transfer.

External Transmission

Medium
Category
Data Exfiltration
Content
**Kling text-to-video:**

```bash
curl -X POST "https://api.tokenrouter.com/v1/video/generations" \
  -H "Authorization: Bearer $DETECTED_CHANNEL_KEY" \
  -H "Content-Type: application/json" \
  -d '{
Confidence
82% confidence
Finding
This example instructs transmission of prompts and authorization data to an external API endpoint. The risk is contextual rather than inherently malicious, but it remains a true egress concern because the skill couples local config discovery with outbound authenticated requests.

External Transmission

Medium
Category
Data Exfiltration
Content
**Kling image-to-video:**

```bash
curl -X POST "https://api.tokenrouter.com/v1/video/generations" \
  -H "Authorization: Bearer $DETECTED_CHANNEL_KEY" \
  -H "Content-Type: application/json" \
  -d '{
Confidence
82% confidence
Finding
This image-to-video example adds another category of potentially sensitive outbound data: image URLs and prompts are sent to an external service using discovered credentials. If users point to private assets or internal URLs, the agent may disclose them without sufficient warning.

External Transmission

Medium
Category
Data Exfiltration
Content
**Seedance text-to-video:**

```bash
curl -X POST "https://api.tokenrouter.com/v1/video/generations" \
  -H "Authorization: Bearer $DETECTED_CHANNEL_KEY" \
  -H "Content-Type: application/json" \
  -d '{
Confidence
82% confidence
Finding
This example similarly enables authenticated outbound transfer of user-supplied generation content to a third-party API. The danger is amplified by the skill's instruction to automatically discover and reuse existing channel keys from workspace configuration.

External Transmission

Medium
Category
Data Exfiltration
Content
**Seedance image-to-video:**

```bash
curl -X POST "https://api.tokenrouter.com/v1/video/generations" \
  -H "Authorization: Bearer $DETECTED_CHANNEL_KEY" \
  -H "Content-Type: application/json" \
  -d '{
Confidence
83% confidence
Finding
This example can transmit prompts plus image URLs to an external provider and may expose sensitive content or internal references. In a skill that also edits configuration, the combination of auto-configuration and immediate outbound use raises the blast radius of mistakes.

External Transmission

Medium
Category
Data Exfiltration
Content
Then:

```bash
curl "https://api.tokenrouter.com/video/generations/$TASK_ID" \
  -H "Authorization: Bearer $DETECTED_CHANNEL_KEY"
```
Confidence
80% confidence
Finding
Polling a task-status endpoint is lower risk than the create call, but it still performs authenticated outbound communication and may disclose task identifiers and response contents to an external service. It is therefore a real but lower-severity egress issue in context.

Static analysis

No suspicious patterns detected.