Back to skill

Security audit

Dola Seedream

Security checks for vulnerabilities and agentic risk

Overview

This image-generation skill mostly matches its purpose, but an undocumented endpoint override could send the user's API key and prompts to an untrusted server.

Install only if you are comfortable sending prompts and reference-image URLs to BytePlus Seedream. Before use, keep ARK_DOLA_API_BASE unset or verify it points to a trusted BytePlus HTTPS endpoint, protect and quota-limit ARK_DOLA_API_KEY, and rotate the key if it may have been run in an untrusted environment.

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

Error
Location
scripts/seedream_image_generate.py:43
Finding
Unvalidated API Endpoint Override Can Expose Bearer Credentials and User Data## Vulnerability Details **File Location**: `scripts/seedream_image_generate.py`, lines 43-47, 77-83, and 103-107 **Vulnerability Type**: Unvalidated API endpoint configuration and credential disclosure **Risk Level**: High ### Vulnerable Code ```python API_KEY = os.getenv("ARK_DOLA_API_KEY") API_BASE = os.getenv( "ARK_DOLA_API_BASE", "https://ark.ap-southeast.bytepluses.com/api/v3" ).rstrip("/") ``` ```python def _get_headers() -> dict: if not API_KEY: raise ValueError("Missing ARK_DOLA_API_KEY environment variable.") return { "Content-Type": "application/json", "Authorization": f"Bearer {API_KEY}", } ``` ```python async def _call_image_api(client: httpx.AsyncClient, item: dict, model_name: str, version: str) -> dict: url = f"{API_BASE}/images/generations" body = _build_request_body(item, model_name, version) response = await client.post(url, headers=_get_headers(), json=body) ``` ### Technical Analysis The destination API base URL is read directly from the `ARK_DOLA_API_BASE` environment variable without validating its scheme, hostname, port, or trust boundary. The same request unconditionally includes the secret from `ARK_DOLA_API_KEY` in the `Authorization` header. Consequently, a malicious or incorrectly configured environment can redirect requests to an attacker-controlled origin. The resulting request contains the bearer credential and generation payload, including user prompts and any supplied reference-image URLs. A non-HTTPS endpoint could also expose this information to network interception. The HTTP client's ordinary TLS verification protects connections only when HTTPS is used; it does not establish that the selected destination is an authorized BytePlus endpoint. The endpoint override is also not documented in `SKILL.md`, reducing the likelihood that users will recognize an unsafe inherited configura ...[truncated 1691 chars]
Remediation
## Remediation Suggestions 1. Remove the `ARK_DOLA_API_BASE` override if custom API endpoints are not an explicit requirement, and use a fixed trusted BytePlus HTTPS endpoint. 2. If endpoint customization is required, parse the configured value with a URL parser and enforce: - The `https` scheme. - An explicit allowlist of trusted BytePlus hostnames. - Expected ports only. - Rejection of embedded credentials, fragments, malformed URLs, and unexpected IP literals. 3. Generate and attach the `Authorization` header only after confirming that the final request origin is trusted. 4. Disable or tightly validate redirects so credentials cannot be forwarded to another origin. Prefer rejecting redirects for authenticated API requests. 5. Fail closed with a clear error when endpoint validation fails. 6. Document the endpoint configuration, its security constraints, and the sensitivity of inherited environment variables. 7. Use narrowly scoped API credentials with appropriate quotas, rotation procedures, monitoring, and revocation support to limit the impact of credential disclosure. A hardened validation pattern should resemble: ```python from urllib.parse import urlparse TRUSTED_API_HOSTS = {"ark.ap-southeast.bytepluses.com"} def validate_api_base(value: str) -> str: parsed = urlparse(value) if ( parsed.scheme != "https" or parsed.hostname not in TRUSTED_API_HOSTS or parsed.username is not None or parsed.password is not None or parsed.fragment ): raise ValueError("ARK_DOLA_API_BASE is not an approved HTTPS endpoint.") return value.rstrip("/") ``` The HTTP client should additionally reject redirects or ensure that authorization information is never sent across origins.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
Findings (7)

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill documentation indicates capabilities that require environment access and network access, including reading an API key from an environment variable and calling an external image-generation service, but it declares no explicit tool scope such as permissions or allowed-tools. This creates a trust-boundary problem: an orchestrator or reviewer cannot easily determine what the skill is allowed to access, increasing the risk of unintended credential use or network activity.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The top-level description says to use this skill for broad classes of user requests like creating artwork or visual content, without narrow activation criteria. Overly broad invocation guidance can cause an agent to route many generic creative requests to a skill that performs external network calls and uses credentials, increasing unnecessary exposure of prompts and potential misuse of paid or sensitive resources.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The 'When to Use This Skill' section lists many common creative scenarios but does not state when the skill should not be used. In an agentic environment, missing boundaries can result in over-invocation of a networked, credentialed skill, sending user content externally when a simpler local response would suffice.

Intent-Code Divergence

Medium
Confidence
85% confidence
Finding
The documentation claims a 'tools parameter (like web search)' capability for version 5.0 even though the skill is presented as an image-generation skill and no such behavior is otherwise scoped or described. Unjustified mention of tool use broadens the implied authority of the skill and can lead operators or agents to permit unexpected external actions, especially network-based retrieval beyond image generation.

Missing User Warnings

Low
Confidence
82% confidence
Finding
The setup instructions tell users to export an API key but do not warn that it is sensitive or provide safe-handling guidance. This increases the chance of accidental credential exposure through shell history, screenshots, logs, or copied transcripts, especially in collaborative or automated environments.

Intent-Code Divergence

Low
Confidence
95% confidence
Finding
The documentation consistently presents the available model version as '5.0-lite' (for example in the model table and CLI option descriptions), but the Python example calls the API with version='5.0'. This is an active contradiction in the skill's own documentation about what version identifier users should supply.

Scope Creep

Low
Category
Excessive Agency
Content
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
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.

Static analysis

No suspicious patterns detected.