T09 · Insecure Skill Coding Practices
- Location
scripts/seedance-video.js:215- Finding
Ark bearer credential and submitted media can be exfiltrated through an unrestricted API base URL
- Content
View full analysis
Vulnerability Details
File Location:
scripts/seedance-video.js:215-233
Vulnerability Type: Unrestricted authenticated endpoint override
Risk Level: HighVulnerable Code
js function createClient(options) { const apiKey = options.apiKey || process.env.ARK_API_KEY; if (!apiKey) { throw new Error("Missing ARK_API_KEY. Set the environment variable or pass --api-key."); } const baseUrl = stripTrailingSlash(options.baseUrl || process.env.ARK_BASE_URL || DEFAULT_BASE_URL); const headers = { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json", }; return { async createTask(payload) { return requestJson(`${baseUrl}/api/v3/contents/generations/tasks`, { method: "POST", headers, body: JSON.stringify(payload), }); },The command-line interface explicitly exposes the override:
js --api-key <key> Override ARK_API_KEY --base-url <url> Override base URL (default: ${DEFAULT_BASE_URL})Technical Analysis
The runner obtains a sensitive bearer credential from
ARK_API_KEYand unconditionally places it in theAuthorizationheader used with the selectedbaseUrl. That URL can be controlled through either--base-urlor theARK_BASE_URLenvironment variable.No validation requires HTTPS, verifies that the destination is the documented Ark hostname, or otherwise establishes that the bearer credential is being sent to Volcengine. As a result, the credential can be transmitted to any attacker-controlled HTTP or HTTPS server.
During task creation, the same request also contains the generation payload. This can include prompts and Base64-encoded local image, video, or audio files. Although uploading selected media to Volcengine Ark is necessary and disclosed by the Skill, sending it to an arbitrary replacement origin is neither necessary nor dis ...[truncated 1553 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove support for
--base-urlandARK_BASE_URLfrom production Skill execution if endpoint replacement is not a documented functional requirement. - Hardcode the official origin:
js const baseUrl = "https://ark.cn-beijing.volces.com"; - If endpoint configurability is required for controlled testing, enforce all of the following:
- Require the
https:scheme. - Parse the value with
new URL(). - Require an exact hostname allowlist, preferably only
ark.cn-beijing.volces.com. - Reject embedded credentials, unexpected ports, fragments, and deceptive hostname suffixes.
- Never attach the Ark authorization header to a non-allowlisted origin.
- Require the
- Separate development endpoint overrides from the distributed production runner.
- Treat
ARK_BASE_URLas untrusted input rather than trusted configuration. - Add automated tests proving that HTTP URLs, lookalike domains, localhost, private addresses, and arbitrary public domains are rejected before any request is sent.
- Rotate any API key that may previously have been used with an untrusted base URL.
- Remove support for
