Back to skill

Security audit

WeryAI video tool — face change

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for WeryAI video face-changing, but it can send unexpected extra JSON fields to the external API and does not enforce its paid-run confirmation gate in code.

Review before installing. Use this only with media URLs you intend to send to WeryAI, keep only WERYAI_API_KEY in the runtime environment, and do not pass any extra JSON fields because the current script may forward them to the API. Also confirm paid submit or wait runs explicitly before execution.

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_face_change.js:77
Finding

Undeclared JSON Properties Are Transmitted to the WeryAI API

Content
View full analysis

Vulnerability Details

File Location: scripts/video_face_change.js:77-78, with the transmission sink at scripts/video_face_change.js:156-164 and invocation at scripts/video_face_change.js:451-501
Vulnerability Type: Unrestricted outbound payload construction
Risk Level: Medium

Complete Code Snippet

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;
}

The resulting object is serialized in full and sent to the remote service:

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,
    });

Submission is performed after validation without rejecting unknown properties:

js
const payload = buildPayload(spec, parseJsonInput(args.json));
const validationErrors = validatePayload(spec, payload);

// ...

const submitResult = await submitTool(spec, payload, apiKey);

Technical Analysis

The documented input surface consists of video_url and image_url. However, buildPayload uses object spread on the complete parsed JSON input. This retains every caller-supplied property rather than constructing the outbound request from an explicit allowlist.

validatePayload verifies required fields and known URL fields, but it does not reject unknown keys. httpJson then serializes the entire object with JSON.stringify(body). As a ...[truncated 1658 chars]

Remediation
View remediation

Remediation Suggestions

Construct the outbound payload using an explicit allowlist:

js
function buildPayload(spec, input = {}) {
  return {
    video_url: input.video_url,
    image_url: input.image_url,
  };
}

Alternatively, define a complete allowedFields list in the tool specification and reject unknown properties before submission:

js
const allowedFields = new Set(["video_url", "image_url"]);
const unknownFields = Object.keys(input || {}).filter(
  (key) => !allowedFields.has(key)
);

if (unknownFields.length > 0) {
  throw new Error(`Unsupported fields: ${unknownFields.join(", ")}`);
}

Additional hardening should include:

  • Validate URLs with the standard URL parser and require the https: protocol instead of relying only on a string prefix.
  • Keep dry-run previews limited to allowlisted fields.
  • Add tests proving that unknown keys, especially secret-like fields, are rejected and never reach fetch.
  • Add a required confirmation mechanism, such as --confirmed, before paid submit or wait operations so the implementation enforces the mandatory confirmation gate documented in SKILL.md.
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (12)

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_face_change.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_face_change.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_face_change.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 33)May include surrounding context.

md
**Entry script:** `scripts/video_face_change.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 48)May include surrounding context.

md
**Entry script:** `scripts/video_face_change.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 51)May include surrounding context.

md
**Entry script:** `scripts/video_face_change.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 54)May include surrounding context.

md
**Entry script:** `scripts/video_face_change.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 60)May include surrounding context.

md
**Entry script:** `scripts/video_face_change.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 67)May include surrounding context.

md
**Entry script:** `scripts/video_face_change.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_face_change.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_face_change.js` (alongside this `SKILL.md`).

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill invokes code with access to environment variables and outbound network access, but the manifest does not declare an explicit tool scope such as permissions or allowed-tools. That creates a governance gap: a reviewer or runtime may not have a precise, enforceable boundary for what the skill is allowed to access, increasing the chance of unintended data exposure or misuse if the script changes or if adjacent files are executed.

Content

No source excerpt is available for this finding.