T09 · Insecure Skill Coding Practices
- Location
open-link.py:11- Finding
Hardcoded Application Signing Credential
- Content
View full analysis
str: raw = f"{app_id}&{timestamp}&{app_key}" ``` `web-search.py:11-18`: ```python APP_ID = "100003" APP_KEY = "38d2391985e2369a5fb8227d8e6cd5e5" URL = "https://autoglm-api.zhipuai.cn/agentdr/v1/assistant/skills/web-search" TOKEN_URL = "http://127.0.0.1:53699/get_token" def generate_sign(app_id: str, timestamp: int, app_key: str) -> str: raw = f"{app_id}&{timestamp}&{app_key}" ``` The same signing key is also disclosed in `SKILL.md:43` as part of the documented MD5 signature formula. ### Technical Analysis The application signing key is embedded directly in two distributed source files and reproduced in the Skill documentation. Any party that can read or download the Skill can recover the value and generate the same `X-Auth-Sign` header as the legitimate scripts. The signature is calculated as an unkeyed MD5 digest over a predictable concatenation of the application ID, current timestamp, and exposed application key: ```python return hashlib.md5(raw.encode()).hexdigest() ``` Because every input to this calculation is known or predictable, possession of the Skill is sufficient to reproduce valid timestamped signatures. MD5 is also a deprecated cryptographic hash and this construction is not a standard message-authentication mechanism such as HMAC. The scripts additionally require a bearer token retrieved from the local token service. Consequently, the exposed application key alone may not provide complete API authentication. However, it removes o ...[truncated 1834 chars]- Remediation
View remediation
