Back to skill

Security audit

scarcest-not-money-video-gen

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed WeryAI video generator, but its helper script can read and upload any local file passed as an image path without code-level safeguards.

Review before installing. Use public HTTPS image URLs when possible. If you use local image paths, only provide files you intentionally want uploaded to WeryAI, ideally from a temporary folder with non-sensitive images, and use a scoped or short-lived WERYAI_API_KEY.

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_gen.js:142
Finding

Unrestricted Local File Read and Upload to WeryAI

Content
View full analysis

Vulnerability Details

File Location: scripts/video_gen.js, lines 142–263
Vulnerability Type: Arbitrary local file disclosure through an unrestricted upload path
Risk Level: Medium

Vulnerable Code

js
function normalizeLocalFilePath(value) {
  if (typeof value !== 'string' || !value.trim()) return null;
  if (value.startsWith('file://')) {
    return new URL(value);
  }
  return path.resolve(value);
}

function inferMimeType(filePath) {
  return IMAGE_MIME_TYPES[path.extname(filePath).toLowerCase()] || 'application/octet-stream';
}

async function uploadFileToPublicUrl(inputPath, apiKey) {
  const resolvedPath = normalizeLocalFilePath(inputPath);
  if (!resolvedPath) {
    throw new Error(`Invalid local image path: ${inputPath}`);
  }

  const filePath = resolvedPath instanceof URL ? fileURLToPath(resolvedPath) : path.resolve(resolvedPath);
  let stat;
  try {
    stat = await fs.stat(filePath);
  } catch {
    throw new Error(`Local image file not found: ${inputPath}`);
  }
  if (!stat.isFile()) {
    throw new Error(`Local image path is not a file: ${inputPath}`);
  }

  const fileBuffer = await fs.readFile(filePath);
  const fileName = path.basename(filePath);
  const mimeType = inferMimeType(filePath);
  const form = new FormData();
  form.append('batch_no', makeUploadBatchNo());
  form.append('fixed', 'false');
  form.append('file', new Blob([fileBuffer], { type: mimeType }), fileName);

  const controller = new AbortController();
  const timer = setTimeout(() => controller.abort(), 60_000);
  let res;
  try {
    res = await fetch(MODELS_BASE_URL + UPLOAD_API_PATH, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${apiKey}`,
      },
      body: form,
      signal: controller.signal,
    });
  } catch (err) {
    clearTimeout(timer);
    if (err.name === 'AbortError') {
      throw new Error(`Upload timeo
...[truncated 4270 chars]
Remediation
View remediation

Remediation Suggestions

  1. Disable local-file handling by default. Require an explicit option such as --allow-local-upload before accepting any local path.
  2. Require confirmation immediately before reading and uploading the file, displaying the canonical path, destination host, file size, and privacy implications.
  3. Restrict local inputs to a dedicated, user-approved directory. Resolve the canonical path with fs.realpath() and verify it remains inside that directory.
  4. Reject symlinks or validate their canonical target before access to prevent escaping the approved directory.
  5. Allowlist supported image extensions and verify file signatures or magic bytes instead of relying solely on filename extensions.
  6. Reject unknown formats rather than falling back to application/octet-stream.
  7. Enforce a conservative maximum file size before reading it. Prefer streaming uploads to buffering the complete file in memory.
  8. Separate public URL inputs from local paths through explicit fields, such as image_url and local_image, so malformed URLs are not silently reinterpreted as filesystem paths.
  9. Consider removing local upload support entirely because public HTTPS image URLs are already the documented normal path and satisfy the Skill's core functionality.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill description presents a narrow, themed video generator, but the content reveals broader capabilities including generic video generation, image/multi-image workflows, polling, and possible local file upload to public storage. This mismatch undermines informed consent and security review because users may invoke a seemingly narrow skill that can access local files and transmit data externally in ways not clearly disclosed by the top-level description.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Dependencies:** `WERYAI_API_KEY` + Node.js 18+. **`scripts/video_gen.js`** + **[`WERYAI_VIDEO_API.md`](resources/WERYAI_VIDEO_API.md)**. **No other Cursor ski

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Dependencies:** `WERYAI_API_KEY` + Node.js 18+. **`scripts/video_gen.js`** + **[`WERYAI_VIDEO_API.md`](resources/WERYAI_VIDEO_API.md)**. **No other Cursor ski

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Dependencies:** `WERYAI_API_KEY` + Node.js 18+. **`scripts/video_gen.js`** + **[`WERYAI_VIDEO_API.md`](resources/WERYAI_VIDEO_API.md)**. **No other Cursor ski

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Dependencies:** `WERYAI_API_KEY` + Node.js 18+. **`scripts/video_gen.js`** + **[`WERYAI_VIDEO_API.md`](resources/WERYAI_VIDEO_API.md)**. **No other Cursor ski

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Dependencies:** `WERYAI_API_KEY` + Node.js 18+. **`scripts/video_gen.js`** + **[`WERYAI_VIDEO_API.md`](resources/WERYAI_VIDEO_API.md)**. **No other Cursor ski

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
**Dependencies:** `WERYAI_API_KEY` + Node.js 18+. **`scripts/video_gen.js`** + **[`WERYAI_VIDEO_API.md`](resources/WERYAI_VIDEO_API.md)**. **No other Cursor ski

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Dependencies:** `WERYAI_API_KEY` + Node.js 18+. **`scripts/video_gen.js`** + **[`WERYAI_VIDEO_API.md`](resources/WERYAI_VIDEO_API.md)**. **No other Cursor ski

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares access to environment secrets and network use in metadata, but does not define an explicit tool/permission scope. That weakens least-privilege boundaries and makes it harder for reviewers and runtime policy to verify exactly what operations are intended, especially given the documented use of an API key and external uploads.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill specification mandates 'English subtitles' as a default requirement, which imposes a language choice without asking the user. The policy allows locale or language constraints only when the user is given a choice or the restriction is clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This line directs the skill to translate Chinese input into English on-screen text by default, requiring the user to opt out rather than opt in. That is a language-policy issue because it forces a specific output language unless the user actively declines.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The evaluation content hard-codes English subtitles/captions as a requirement without indicating that language should follow user preference or context. This can cause the skill to override user locale needs, reduce accessibility for non-English users, and make the agent less aligned with user intent, though it is primarily a policy and UX security issue rather than a direct exploit vector.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The implicit trigger tests are phrased broadly enough that the skill may activate on generic prompts about scarcity, mystery shorts, or reveal-style captions even when the user did not intend to invoke this specific skill. In an agent system, overbroad trigger criteria can cause unintended prompt expansion, incorrect tool selection, and execution of skill-specific behaviors outside their proper scope.

Content

No source excerpt is available for this finding.