T09 · Insecure Skill Coding Practices
- Location
scripts/xiangongyun_api.py:41- Finding
Unvalidated API Endpoint Can Receive Bearer Tokens and Deployment Credentials
- Content
View full analysis
Dict[str, Any]: """发送 HTTP 请求""" url = f"{BASE_URL}{endpoint}" try: if method.upper() == "GET": response = requests.get( url, headers=self.headers, params=params, timeout=30 ) elif method.upper() == "POST": response = requests.post( url, headers=self.headers, json=data, timeout=30 ) ``` ```python # scripts/xiangongyun_api.py:138-141 if password: data["password"] = password return self._request("POST", "/open/instance/deploy", data=data) ``` ```yaml # config/config.yaml:4-7 api: base_url: "https://api.xiangongyun.com" # Replace the access_token below with the Xiangongyun API access token. access_token: "YOUR_ACCESS_TOKEN_HERE" ``` ### Technical Analysis The API destination is read directly from a mutable configuration file without validating its scheme, hostname, port, or origin. The same request logic attaches the bearer token to every request. Deployment requests can also carry a p ...[truncated 2239 chars]- Remediation
View remediation
