Back to skill

Security audit

店铺视觉统一 Brand Kit

Security checks for vulnerabilities and agentic risk

Overview

This brand-consistency skill is mostly coherent, but it needs Review because one provider setting can redirect API keys and private image inputs to an arbitrary endpoint.

Install only if you trust the runtime environment and the image providers you configure. Do not set ARK_BASE_URL unless it is a controlled HTTPS endpoint, prefer dedicated low-scope provider keys, avoid placing sensitive local files in --images or model.reference, and use the remove-watermark task only for images you own or are authorized to edit.

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/lib/providers.mjs:294
Finding
Unrestricted Ark Base URL Can Exfiltrate API Credentials and Private Generation Inputs<![CDATA[ ## Vulnerability Details **File Location**: `scripts/lib/providers.mjs:294-301` **Vulnerability Type**: Unvalidated credential-bearing outbound request **Risk Level**: Medium ### Vulnerable Code ```js const base = env.ARK_BASE_URL || 'https://ark.cn-beijing.volces.com/api/v3' const body = { model: ark.model(), prompt: req.prompt, size: req.size || '2K', response_format: 'url', watermark: false, } if (req.images?.length) body.image = await Promise.all(req.images.map(asDataUri)) const j = await postJson(`${base}/images/generations`, body, { authorization: `Bearer ${env.ARK_API_KEY}` }, req.timeoutMs) ``` ### Technical Analysis The Ark provider accepts `ARK_BASE_URL` directly from the process environment without validating its protocol, hostname, port, or network destination. The resulting URL receives an authorization header containing `ARK_API_KEY`, as well as the generation prompt and any supplied reference images. Local images are converted into data URIs before transmission. Consequently, a malicious or mistakenly configured base URL can receive: - The Ark bearer credential. - User generation prompts. - Product or business imagery. - Model face-reference images or other potentially personal data. - Generation parameters and model identifiers. A custom endpoint can be legitimate when an organization deliberately uses a compatible gateway. However, forwarding an official provider credential and private input to any environment-controlled destination violates least-privilege principles. The implementation also permits an `http:` endpoint, which could expose the request to network interception. This issue requires an attacker to influence the process environment, deployment configuration, wrapper script, or command execution context. The code does not independently modify `ARK_BASE_URL`. ### Attack Path 1. An attacker compromises or influences a launcher, CI configuration, shell profile, deployment manifest, or wrapper that starts the ...[truncated 1472 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Require encrypted transport** - Parse the configured value with `new URL()`. - Reject every protocol except `https:`. - Reject URLs containing embedded usernames or passwords. 2. **Allowlist trusted destinations** - Use the official Ark hostname by default. - Restrict `ARK_BASE_URL` to an explicit allowlist of approved gateway hostnames. - Compare normalized hostnames rather than using substring or suffix checks that can be bypassed. 3. **Separate gateway credentials** - Never forward the official `ARK_API_KEY` to an arbitrary compatible gateway. - If custom gateways are required, introduce a separate gateway-specific credential variable. - Associate each credential with an approved destination. 4. **Protect internal network destinations** - Reject loopback, link-local, multicast, and private-network destinations unless an administrator explicitly approves them. - Resolve DNS and validate resulting addresses to reduce server-side request forgery and DNS-rebinding risks. 5. **Require explicit user awareness** - Display the normalized destination before sending private prompts or images to a non-default endpoint. - Require an explicit opt-in flag for custom providers or gateways. - Document that prompts and reference images leave the local system. 6. **Reduce credential exposure** - Use narrowly scoped keys with spending limits and rotation policies. - Revoke and rotate any key suspected of having been sent to an untrusted endpoint. - Avoid logging authorization headers or full provider error responses that could contain sensitive information. A hardened implementation should validate the endpoint before constructing the request, for example: ```js const officialBase = 'https://ark.cn-beijing.volces.com/api/v3' const parsed = new URL(env.ARK_BASE_URL || officialBase) if (parsed.protocol !== 'https:') { throw new Error('ARK_BASE_URL must use HTTPS') } const allowedH ...[truncated 373 chars]
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Context-Inappropriate Capability

Medium
Confidence
94% confidence
Finding
The helper fetches arbitrary user-supplied URLs and also reads arbitrary local paths, creating an SSRF and local-file access primitive through the image reference mechanism. In a skill whose apparent purpose is style coordination, this extra retrieval capability materially increases risk because prompts or configuration could cause access to internal services or sensitive local files.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The activation guidance includes broad phrases such as '统一风格', '店铺调性', and '品牌规范', which are common across many image- and marketing-related tasks. This can cause the skill to trigger in situations where the user did not specifically intend to apply a persistent brand policy, leading to unintended prompt injection into downstream generation workflows and incorrect task routing.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The brand spec hard-codes a specific demographic identity for the model ('East Asian woman') and body characteristics, and the skill description indicates this reference will be propagated across all image-generation workflows. That creates a systematic bias risk: users may unknowingly generate outputs constrained to a protected or sensitive appearance profile without explicit opt-in, business justification, or safeguards for inclusive alternatives.

Missing User Warnings

Medium
Confidence
87% confidence
Finding
The code fetches arbitrary URLs from provider output via fetch(f.url) and writes the response to disk without validating the destination host, scheme, size, or content type. If a provider response is malicious or compromised, this can trigger server-side request forgery-like outbound requests, leak network metadata/IP, or cause unsafe downloads and resource exhaustion.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The task registry explicitly exposes a `remove-watermark` capability, which is commonly associated with bypassing ownership, attribution, or platform protections on third-party images. In this brand/e-commerce image workflow, there is no nearby policy gating, proof-of-rights requirement, or documented user opt-in, so the feature could be misused to strip marks from copyrighted or marketplace-protected assets.

Static analysis

Detected: suspicious.dangerous_exec, suspicious.env_credential_access

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/lib/providers.mjs:104

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/gen.mjs:118

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/lib/providers.mjs:21