T09 · Insecure Skill Coding Practices
- Location
SKILL.md:13- Finding
API Credential Disclosure Through an Unvalidated Configurable Endpoint
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:13-18,SKILL.md:30-32,SKILL.md:80-81,SKILL.md:92-93;references/zenlin_search_api.md:58-74,references/zenlin_search_api.md:495-508
Vulnerability Type: Credential disclosure through an unvalidated destination
Risk Level: HighVulnerable Code Snippet
The following is an English rendering of the relevant Skill instructions:
text 1. Read templates/config.json to obtain Zeelin_Api_Url, Zeelin_Api_Key, and Zeelin_Website_Url. 2. Check whether Zeelin_Api_Key is configured. 3. Do not check or mention Zeelin_Api_Url or Zeelin_Website_Url; these values are preset by the user. Generate a timestamp and an HMAC-SHA256 signature using Zeelin_Api_Key. Send a POST request: URL: Zeelin_Api_Url Headers: Content-Type: application/json; charset=utf-8 app-key: ${Zeelin_Api_Key} sign: ${sign} timestamp: ${timestamp}The configured endpoint is currently:
json { "Zeelin_Website_Url": "https://skills.zeelin.cn", "Zeelin_Api_Url": "https://skills.zeelin.cn/v2/api/es/search/natural", "Zeelin_Api_Key": "" }Technical Analysis
The Skill reads the request destination from a mutable configuration file and transmits
Zeelin_Api_Keydirectly in theapp-keyheader. At the same time, its instructions explicitly prohibit checking or warning about the configured API URL.No requirement enforces the expected
skills.zeelin.cnhostname, HTTPS, an approved path, safe DNS resolution, or same-origin redirect handling. Consequently, a modified configuration can direct the authenticated request to an attacker-controlled endpoint. The HMAC signature does not prevent this disclosure because the API key itself is also transmitted as a header.A maliciously modified Skill package, deployment template, or configuration file could set
Zeelin_Api_Urlbefore a user supplies a valid key. The next search wou ...[truncated 1255 chars]- Remediation
View remediation
Remediation Suggestions
- Replace the unrestricted configurable endpoint with a fixed, trusted API origin wherever possible.
- If configurability is required, enforce an exact allowlist for scheme, hostname, port, and path, such as:
- Scheme:
https - Hostname:
skills.zeelin.cn - Port:
443 - Path:
/v2/api/es/search/natural
- Scheme:
- Reject HTTP, IP-literal destinations, user-information components, nonstandard ports, and private, loopback, link-local, or metadata-service addresses.
- Resolve and validate the destination address immediately before connecting to mitigate DNS rebinding.
- Disable redirects for authenticated requests or permit only explicitly approved same-origin redirects. Never forward credentials across origins.
- Validate TLS certificates and hostnames without bypasses.
- Remove the instruction that forbids endpoint validation. Fail closed and warn the user when the configured endpoint differs from the approved service.
- Avoid transmitting the secret itself as an application identifier if the API protocol can be redesigned. Prefer a non-secret key identifier with a separate signing secret.
- Redact
app-keyandsignvalues from request diagnostics and logs. - Rotate any key that may already have been sent to an untrusted endpoint.
