T09 · Insecure Skill Coding Practices
- Location
scripts/qwen-omni-chat.js:1674- Finding
Unrestricted API endpoint can receive the API credential and private multimodal content
- Content
View full analysis
Vulnerability Details
File Location:
scripts/qwen-omni-chat.js:1483-1489andscripts/qwen-omni-chat.js:1674-1677
Vulnerability Type: Unvalidated credential-bearing network destination
Risk Level: HighVulnerable Code
js const response = await fetch(`${baseUrl}/chat/completions`, { method: 'POST', headers: { Authorization: `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, body: JSON.stringify(payload) });js const baseUrl = String( firstNonEmpty(process.env.DASHSCOPE_BASE_URL, config.baseUrl, DEFAULT_BASE_URL) ).replace(/\/$/, ''); const apiKey = firstNonEmpty(process.env.DASHSCOPE_API_KEY, config.apiKey);Technical Analysis
The request destination is obtained from either
DASHSCOPE_BASE_URLor the local configuration without validating its scheme or hostname. The same destination is then sent anAuthorization: Bearerheader containing the DashScope API key.The request body can contain:
- User prompts and optional system prompts
- Local images, audio, video, or video frames encoded as Data URLs
- Active conversation history
- Earlier conversation summaries
- Model and output configuration
Consequently, a malicious or accidentally modified environment or
config.jsoncan redirect credentials and private content to an arbitrary server. The implementation also does not require HTTPS, so a configured HTTP endpoint could expose the credential and request content to network interception.Network access is necessary for the Skill's declared cloud-model functionality. However, sending the DashScope credential to an unrestricted destination exceeds the minimum privilege required to communicate with the documented Alibaba Cloud service.
Attack Path
- An attacker with influence over the process environment, deployment configuration, or project-local
config.jsonsetsDASHSCOPE_BASE_URLorbaseUrlto an attacker-controll ...[truncated 1085 chars]
- Remediation
View remediation
Remediation Suggestions
- Parse the endpoint with
new URL()before making a request. - Require the
https:scheme and reject plaintext HTTP. - Allowlist the documented DashScope hosts, such as:
dashscope.aliyuncs.comdashscope-intl.aliyuncs.com
- Reject URLs containing embedded credentials, unexpected ports, or unapproved hostnames.
- If custom compatible endpoints must be supported, require an explicit command-line opt-in and interactive confirmation before transmitting credentials or user content.
- Use separate credentials for custom endpoints rather than automatically forwarding
DASHSCOPE_API_KEY. - Clearly display the validated destination hostname before sending sensitive content.
- Add automated tests covering HTTP URLs, deceptive subdomains, user-information prefixes, malformed URLs, and attacker-controlled hosts.
- Parse the endpoint with
