Back to skill

Security audit

WeryAI video tool — background remove

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent WeryAI background-removal tool, but its script can send undeclared JSON fields to the external API, so users should review payloads carefully before live runs.

Install only if you are comfortable sending the video URL and request body to WeryAI using your WERYAI_API_KEY. Before live submit or wait runs, inspect the JSON and do not include secrets, private metadata, or unrelated fields; the publisher should tighten the script to reject unknown fields.

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/video_background_remove.js:88
Finding

Unrestricted JSON Fields Are Transmitted to an External API

Content
View full analysis

Vulnerability Details

File Location: scripts/video_background_remove.js, lines 88–94, 183–202, and 467–468
Vulnerability Type: Missing input allowlisting leading to unintended external data transmission
Risk Level: Medium

Vulnerable Code

js
function buildPayload(spec, input) {
  const payload = { ...spec.defaults, ...(input || {}) };
  if (typeof spec.preparePayload === "function") spec.preparePayload(payload);
  if (payload.rect_vo_list != null) payload.rect_vo_list = normalizeRectList(payload.rect_vo_list);
  return payload;
}
js
async function httpJson(method, url, body, apiKey) {
  const headers = { "Content-Type": "application/json" };
  if (apiKey) headers.Authorization = `Bearer ${apiKey}`;

  const controller = new AbortController();
  const timer = setTimeout(() => controller.abort(), 30000);

  try {
    const res = await fetch(url, {
      method,
      headers,
      body: body != null ? JSON.stringify(body) : undefined,
      signal: controller.signal,
    });
js
const payload = buildPayload(spec, parseJsonInput(args.json));
const validationErrors = validatePayload(spec, payload);

Technical Analysis

The documented request schema allows only video_url and the optional background_color. However, buildPayload copies every property from the user-provided JSON object into the outbound payload.

validatePayload verifies required, URL, rectangle, and enumerated fields, but it does not reject undeclared properties. Consequently, arbitrary additional fields survive validation and are serialized into the POST request sent to the fixed external endpoint at https://api.weryai.com/v1/generation/video-background-remove.

The network request and transmission of the WeryAI API key and video URL are necessary for the declared remote background-removal functionality. The transmission of arbitrary undeclared fields is not necessary and exceeds the Skill's declared minimum data scope.

Attack Path

  1. A ...[truncated 1374 chars]
Remediation
View remediation

Remediation Suggestions

  1. Build the request body from an explicit allowlist rather than spreading all input properties:

    js
    function buildPayload(spec, input = {}) {
      return {
        video_url: input.video_url,
        background_color:
          input.background_color ?? spec.defaults.background_color,
      };
    }
    
  2. Reject unknown fields before making a network request:

    js
    const allowedFields = new Set(["video_url", "background_color"]);
    const unknownFields = Object.keys(input || {}).filter(
      (field) => !allowedFields.has(field)
    );
    
    if (unknownFields.length > 0) {
      throw new Error(`Unknown fields: ${unknownFields.join(", ")}`);
    }
    
  3. Apply the same schema validation to dry-run and live execution so their accepted inputs remain consistent.

  4. Add automated tests confirming that undeclared fields are rejected and never appear in requestPreview or outbound request bodies.

  5. Preserve the fixed HTTPS API origin and the existing restriction to WERYAI_API_KEY; do not add configurable network destinations or generic environment-variable forwarding.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (13)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Entry script:** `scripts/video_background_remove.js` (alongside this `SKILL.md`).

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Entry script:** `scripts/video_background_remove.js` (alongside this `SKILL.md`).

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Entry script:** `scripts/video_background_remove.js` (alongside this `SKILL.md`).

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Entry script:** `scripts/video_background_remove.js` (alongside this `SKILL.md`).

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Entry script:** `scripts/video_background_remove.js` (alongside this `SKILL.md`).

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Entry script:** `scripts/video_background_remove.js` (alongside this `SKILL.md`).

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Entry script:** `scripts/video_background_remove.js` (alongside this `SKILL.md`).

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Entry script:** `scripts/video_background_remove.js` (alongside this `SKILL.md`).

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Entry script:** `scripts/video_background_remove.js` (alongside this `SKILL.md`).

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Entry script:** `scripts/video_background_remove.js` (alongside this `SKILL.md`).

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Entry script:** `scripts/video_background_remove.js` (alongside this `SKILL.md`).

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill invokes a Node.js script that requires both network access and a sensitive environment variable, but the manifest does not declare an explicit tool scope such as permissions or allowed-tools. This creates a policy gap: an agent or reviewer cannot reliably constrain execution to the intended script/network behavior, increasing the risk of unintended tool use, overbroad execution, or secret exposure if the package contents drift or are maliciously modified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This script sends the request payload, including the user-provided video_url, to https://api.weryai.com via submitTool. While the help text notes that real calls require an API key and dry-run behavior, it does not explicitly disclose that user media references are transmitted to a third-party service.

Content

No source excerpt is available for this finding.