Back to skill

Security audit

Weryai Image Toolkits

Security checks for vulnerabilities and agentic risk

Overview

This skill is a legitimate WeryAI image-processing integration, but its file upload and API-host handling are too broad for safe default installation.

Install only if you trust WeryAI and can keep use tightly controlled. Prefer public HTTPS image URLs, avoid passing local paths unless you intentionally want that exact file uploaded, do not set WERYAI_BASE_URL unless you fully trust the host, and use dry-run before paid processing.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/image_toolkits.js:19
Finding

Unrestricted API base URL can disclose the API key and image data to an attacker-controlled host

Content
View full analysis
controller.abort(), 30000); try { const res = await fetch(url, { method, headers, body: body != null ? JSON.stringify(body) : undefined, signal: controller.signal, }); ``` ### Technical Analysis The `WERYAI_BASE_URL` environment variable is accepted without validating its protocol or hostname. The resulting value controls the destination of upload, submission, and status requests. These requests include the production `WERYAI_API_KEY` in an `Authorization: Bearer` header. Consequently, a configuration error or environment-variable injection can redirect credentials, request parameters, prompts, and uploaded image contents to an arbitrary server. An `http://` URL is also accepted, allowing sensitive information to be transmitted without transport encryption. The documentation in `SKILL.md:76` advises users to select a trusted host, but documentation is not an effective security boundary. The executable must enforce destination restrictions before transmitting credentials. Remote processing is necessary for the declared Skill functionality, but transmitting the credenti ...[truncated 1352 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/image_toolkits.js:518
Finding

Image source handling permits arbitrary local-file upload without image or size validation

Content
View full analysis
controller.abort(), 60000); let res; try { res = await fetch(`${BASE_URL}${UPLOAD_API_PATH}`, { method: "POST", headers: { Authorization: `Bearer ${apiKey}` }, body: form, signal: controller.signal, }); ``` ```js async function resolvePayloadMediaSources(toolId, payload, apiKey) { const spec = TOOLS[toolId]; const out = { ...payload }; for (const field of spec.urlFields) { const value = out[field]; if (typeof value !== "string" || value.trim().length === 0) conti ...[truncated 2967 chars]
Remediation
View remediation
MAX_IMAGE_BYTES) { throw new Error("Image exceeds the 20 MB upload limit."); } ``` 4. Restrict local paths to approved attachment or workspace directories. Resolve both the requested path and allowed root with `fs.realpath()` to prevent traversal and symlink escapes. 5. Reject sensitive path classes, hidden credential files, device files, and pseudo-filesystems as defense in depth. 6. Require explicit informed confirmation before local upload. The confirmation should identify: - The resolved local path. - The file size and detected image type. - The exact remote hostname. - That file contents will leave the local environment. 7. Stream allowed files into the multipart request where runtime support permits, rather than buffering the complete file in memory. 8. Apply the same controls to both `img_url` and `face_img_url`. 9. Add tests demonstrating rejection of: - `.env`, private-key, text, executable, and extensionless files. - Images with mismatched magic bytes. - Files exceeding the configured limit. - Paths outside approved directories. - Symlinks resolving outside approved directories. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (22)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill explicitly allows local file paths and says they are uploaded to a remote server, while the analysis indicates support may extend beyond images to video, audio, and text-like files. If true, that materially broadens exfiltration risk because a user or upstream agent could cause sensitive local content to be uploaded under the guise of an image-processing workflow.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill explicitly allows local file paths and says they are uploaded to a remote server, while the analysis indicates support may extend beyond images to video, audio, and text-like files. If true, that materially broadens exfiltration risk because a user or upstream agent could cause sensitive local content to be uploaded under the guise of an image-processing workflow.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill explicitly allows local file paths and says they are uploaded to a remote server, while the analysis indicates support may extend beyond images to video, audio, and text-like files. If true, that materially broadens exfiltration risk because a user or upstream agent could cause sensitive local content to be uploaded under the guise of an image-processing workflow.

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

md
**Dependencies:** `scripts/image_toolkits.js` in this directory, `WERYAI_API_KEY`, and Node.js 18+. No other skills are required.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Dependencies:** `scripts/image_toolkits.js` in this directory, `WERYAI_API_KEY`, and Node.js 18+. No other skills are required.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Dependencies:** `scripts/image_toolkits.js` in this directory, `WERYAI_API_KEY`, and Node.js 18+. No other skills are required.

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
**Dependencies:** `scripts/image_toolkits.js` in this directory, `WERYAI_API_KEY`, and Node.js 18+. No other skills are required.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Dependencies:** `scripts/image_toolkits.js` in this directory, `WERYAI_API_KEY`, and Node.js 18+. No other skills are required.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Dependencies:** `scripts/image_toolkits.js` in this directory, `WERYAI_API_KEY`, and Node.js 18+. No other skills are required.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Dependencies:** `scripts/image_toolkits.js` in this directory, `WERYAI_API_KEY`, and Node.js 18+. No other skills are required.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Dependencies:** `scripts/image_toolkits.js` in this directory, `WERYAI_API_KEY`, and Node.js 18+. No other skills are required.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The upload helper infers and accepts many non-image MIME types, including video and audio, even though this is an image toolkit. Combined with the local-file upload behavior, this broadens the exfiltration surface and allows unrelated local media to be transmitted to the remote API under an image-processing tool. The mismatch between advertised purpose and accepted content increases the chance of accidental or abusive leakage.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill declares network and environment-variable use but does not define an explicit tool scope such as permissions or allowed-tools. In an agent setting, missing scope boundaries increases the chance the runtime grants broader-than-necessary capabilities, especially since the skill can access secrets and make remote requests.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
## Constraints

- Do not treat this skill as a text-to-image or image-to-image generator.
- Do not ask the user to choose raw API fields when a safe default already fits the request.
- Do not use unsupported file types for `img_url` or `face_img_url`; local sources are uploaded before the toolkit request.
- Do not re-run paid processing casually because each `submit` or `wait` call can create a new paid task.
- Do not broaden this skill beyond the documented WeryAI image-tools API surface.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/image-tools-matrix.md (reported line 47)May include surrounding context.

md
### `background-remove`

- Endpoint: `/v1/generation/image-bg-remove`
- Use for: automatically remove the background
- Required:
  - `img_url`

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · scripts/image_toolkits.js (reported line 267)May include surrounding context.

js
},
  "background-remove": {
    endpoint: "/v1/generation/image-bg-remove",
    summary: "Automatically remove the background from an image.",
    required: ["img_url"],
    defaults: {},
    enums: {},

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill treats any non-http(s) string in image URL fields as a local path and will upload that file to the WeryAI API. That creates a data-exfiltration path for arbitrary local files, not just intended image assets, and the behavior is broader than the skill description suggests. In an agent setting, a prompt or tool invocation could cause sensitive local files to be sent off-host without the user realizing it.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

At runtime, the tool automatically resolves local media sources and uploads them before submission, but there is no explicit warning or confirmation at the point of execution in the real run path. Users may think they are passing a local path for local processing when in fact the file is being sent to a third-party API. That lack of clear consent materially raises the privacy and data-handling risk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The helper explicitly allows uploading video, audio, and general text/structured-text files even though the skill is described as an image toolkit. That mismatch broadens the data exfiltration surface: any caller that can influence a path can cause local non-image files to be read and uploaded to a remote service, including potentially sensitive documents if they carry an allowed extension.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The source resolver accepts any HTTP/HTTPS URL and returns it without checking that it is an image resource or from a trusted domain. In an image-processing skill, this permits arbitrary remote content to flow into downstream components, increasing the risk of SSRF-like fetches by later stages, unsafe processing of unexpected media, and policy bypass around intended image-only handling.

Content

No source excerpt is available for this finding.

Scope Creep

Low
Category
Excessive Agency
Confidence
70% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

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

md
- Do not ask the user to choose raw API fields when a safe default already fits the request.
- Do not use unsupported file types for `img_url` or `face_img_url`; local sources are uploaded before the toolkit request.
- Do not re-run paid processing casually because each `submit` or `wait` call can create a new paid task.
- Do not broaden this skill beyond the documented WeryAI image-tools API surface.

## Re-run behavior

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

This markdown file instructs users to supply public https:// asset URLs and documents tools that upload images for analysis, translation, face swapping, and editing. For a markdown file, SQP-2 applies when the description omits warnings about behaviors that could affect user data or privacy, and there is no disclosure here that submitted images may contain sensitive content or become accessible via public URLs.

Content

No source excerpt is available for this finding.