T09 · Insecure Skill Coding Practices
- Location
scripts/vod_client.py:45- Finding
Configurable API Host Can Redirect Signed Requests and Media Uploads
- Content
View full analysis
dict: body_str = json.dumps(body, ensure_ascii=False) url, headers = self._sign("POST", action, version, {}, body_str) r = requests.post(url, headers=headers, data=body_str.encode(), timeout=_HTTP_TIMEOUT) self._check(r) return r.json() def get(self, action: str, version: str, params: dict) -> dict: url, headers = self._sign("GET", action, version, params or {}, "") r = requests.get(url, headers=headers, timeout=_HTTP_TIMEOUT) ``` ```python # scripts/vod_client.py:108-111, 144-150 canonical_query = urlencode(sorted(qp.items()), quote_via=quote, safe="-_.~") url = f"https://{_VOD_HOST}/?{canonical_query}" # ... headers["Authorization"] = ( f"HMAC-SHA256 Credential={self._ak}/{credential_scope}, " f"SignedHeaders={signed_headers_str}, Signature={signature}" ) return url, headers ``` ```python # scripts/tos_upload.py:308-338 ua = data.get("UploadAddress") or {} stores = ua.get("StoreInfos") or [] hosts = ua.get("UploadHosts") or [] if not stores or not hosts: raise RuntimeError("ApplyUploadInfo: UploadAddress missing StoreInfos or UploadHosts") ...[truncated 3359 chars]- Remediation
View remediation
