Back to skill

Security audit

aivideomaker-test-api

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent AIVideoMaker API helper, but it handles an API key and user media with under-scoped request construction that deserves manual review before use.

Install only if you trust AIVideoMaker with the prompts, images, generated outputs, and task history tied to your API key. Avoid using shared or high-privilege keys, do not pass task IDs from untrusted text, and consider patching taskId validation and URL encoding before production automation.

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

Warning
Location
scripts/aivideo-client.mjs:201
Finding

Unvalidated Task Identifier Enables Authenticated Same-Origin Path Manipulation

Content
View full analysis

Vulnerability Details

File Location: scripts/aivideo-client.mjs:201-222 and scripts/run-workflow.mjs:73-94
Vulnerability Type: Authenticated request path injection
Risk Level: Medium

User-controlled taskId values are inserted directly into API paths without validation or URL encoding.

Relevant client code:

javascript
async getTask(taskId) {
  return request({
    method: "GET",
    path: `/api/v1/tasks/${taskId}`,
    idempotent: true,
  });
},

async getStatus(taskId) {
  return request({
    method: "GET",
    path: `/api/v1/tasks/${taskId}/status`,
    idempotent: true,
  });
},

async cancelTask(taskId) {
  return request({
    method: "PUT",
    path: `/api/v1/tasks/${taskId}/cancel`,
    idempotent: false,
  });
},

The value originates directly from a command-line argument:

javascript
async function runAction(client, args) {
  const action = args.action;
  const taskId = args.taskId;

  if (action === "getStatus") {
    if (!taskId) throw new Error("--taskId is required for --action getStatus");
    const result = await client.getStatus(taskId);
    print(result);
    return;
  }

  if (action === "getTask") {
    if (!taskId) throw new Error("--taskId is required for --action getTask");
    const result = await client.getTask(taskId);
    print(result);
    return;
  }

  if (action === "cancelTask") {
    if (!taskId) throw new Error("--taskId is required for --action cancelTask");
    const result = await client.cancelTask(taskId);
    print(result);
    return;
  }
}

Technical Analysis

The client constructs the request URL by concatenating config.baseUrl and a path containing the raw taskId. It does not enforce the documented task-ID format and does not encode the identifier as an individual URL path segment.

Consequently, values containing path-navigation tokens such as ../, query delimite ...[truncated 2862 chars]

Remediation
View remediation

Remediation Suggestions

  1. Validate task identifiers before constructing any request. Use a strict allowlist matching the provider's actual identifier format, for example:

    javascript
    function validateTaskId(taskId) {
      if (typeof taskId !== "string" || !/^ck[a-zA-Z0-9_-]+$/.test(taskId)) {
        throw new Error("Invalid task ID");
      }
      return taskId;
    }
    
  2. Encode the validated identifier as one URL path segment:

    javascript
    const safeTaskId = encodeURIComponent(validateTaskId(taskId));
    path: `/api/v1/tasks/${safeTaskId}`
    
  3. Construct requests with the URL API and enforce destination invariants immediately before fetch:

    javascript
    const url = new URL(path, config.baseUrl);
    const expectedOrigin = new URL(config.baseUrl).origin;
    
    if (url.origin !== expectedOrigin) {
      throw new Error("Unexpected API origin");
    }
    
  4. Restrict each operation to its expected normalized pathname pattern. Reject paths containing traversal tokens, query strings, fragments, encoded separators, or unexpected prefixes.

  5. Apply validation inside the client methods rather than only in the CLI so that direct programmatic callers cannot bypass it.

  6. Add regression tests covering ../, %2e%2e, /, ?, #, backslashes, percent-encoded separators, empty values, oversized identifiers, and valid task IDs.

  7. If supported by the service, use an API credential scoped exclusively to video-generation task operations to reduce the impact of any future request-routing flaw.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
Findings (10)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill declares network-capable behavior but does not define any explicit tool scope such as permissions or allowed-tools. In an agent environment, this can let the skill be invoked with broader-than-intended capabilities, increasing the chance of unauthorized outbound requests using the configured API credential.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The description is broad enough to match generic requests about generating videos or automating API operations, which can cause the skill to activate outside narrowly intended scenarios. Over-broad activation increases the likelihood that network actions are taken with sensitive credentials in contexts the user did not clearly authorize.

Content

No source excerpt is available for this finding.

Unrestricted Tool Access

Medium
Category
Excessive Agency
Confidence
82% confidence
Finding

The security section claims requests go only to aivideomaker.ai, but also allows an optional custom base URL via client options. That exception weakens the boundary and can enable arbitrary outbound connections, credential misuse, or SSRF-like behavior if an attacker can influence configuration, especially since the API key would be sent for authentication.

Content

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

md
- Validates input payloads against a defined contract
- Reads only payload passed via `--payload`
- Does not read arbitrary host files, credentials, or sensitive system information
- Does not execute arbitrary code or shell commands

All network requests are made to `https://aivideomaker.ai` (or an optional custom base URL configured via client options) and include only the API key for authentication.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The note says base64 images are uploaded to backend storage and later represented by an R2 URL, but it omits any privacy or retention warning. Users may provide sensitive images assuming they remain transient, when in fact they are persisted server-side, creating confidentiality and data handling risks if retention, access controls, or sharing expectations are unclear.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation states that task listing returns all tasks for the current API key and that task details return full input/output data, but it does not warn that prompts, images, and generated outputs across all jobs become visible to any holder of that key. In this skill context, that can expose sensitive creative content, proprietary prompts, or user-supplied media if operators assume these endpoints are narrow or per-task only.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The examples document a task-listing endpoint (GET /api/v1/tasks) that is not described in the manifest, creating a capability/behavior mismatch. Undocumented capabilities are dangerous because they can expand data access beyond what reviewers and users expect, here potentially exposing historical task metadata, prompts, and outputs without explicit declaration or scrutiny.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest declares only "en" under the language field, which can constitute a language/locale policy restriction when no opt-in or justification is provided. The stated policy requires flagging cases where a skill forces a specific language without user choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

Naming the required API key header without any warning about secret handling increases the chance that users paste real credentials into examples, logs, traces, or shared automation configs. In an API-executor skill, credential leakage can grant full access to create, inspect, and cancel tasks associated with that account.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The manifest describes support for generating videos, monitoring progress, cancelling tasks, and automating those operations, but does not mention enumerating all tasks for the API key. This reference file explicitly documents a 'List tasks' endpoint that expands the skill's apparent operational scope beyond the manifest description.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The examples show external API submission and task cancellation flows without warning that user prompts, images, or related payload data are transmitted to a third-party service, and without clarifying cancellation effects. This can mislead users about privacy and operational consequences, increasing the chance of unintentional disclosure of sensitive content or accidental interruption of billable generation jobs.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/aivideo-client.mjs:5