T09 · Insecure Skill Coding Practices
- Location
scripts/transcribe.py:28- Finding
Audio and Authentication Metadata Transmitted over Plaintext HTTP
- Content
View full analysis
dict[str, str]: """构建带签名的请求参数""" params = { "appkey": self.config.appkey, "timestamp": str(get_timestamp()), **kwargs, } params["signature"] = self._generate_signature(params) return params ``` ```python def upload_file(self, task_id: str, filepath: str) -> str: """上传音频文件""" url = self.config.urls["upload"] file_md5 = calculate_file_md5(filepath) params = self._build_params( userid=self.config.userid, task_id=task_id, md5=file_md5, audiotype=self.config.audiotype, ) with open(filepath, "rb") as f: response_data = self._request("POST", url, params=params, data=f) ``` The same insecure HTTP endpoint is also documented in `SKILL.md:9`, `SKILL.md:166`, and `SKILL.md:181`. ### Technical Analysis The default UniSound API endpoint uses unencrypted HTTP. The script sends audio content directly in the request body and places authentication and task metadata in query parameters, including the application key, timestamp, signature, user ID, task ID, and file digest. HTTP provides neither transport confidentiality nor endpoint authentication. A network-positioned attacker can inspect traffic, alter uploaded audio, modify API responses, or impersonate the remote service. The request signature does not replace TLS because it does not encrypt the recording or transcript and does not authenticate the server to the client. The `UNISOUND_BASE_URL` environment variable can also select an arbitrary endpoint, and the implementation does not require the configured URL to use HTTPS. ### Attack Path 1. A user ...[truncated 1211 chars]- Remediation
View remediation
