T09 · Insecure Skill Coding Practices
- Location
scripts/ark_web_search.py:44- Finding
ARK API Credential Can Be Sent to an Arbitrary Configurable Endpoint
- Content
View full analysis
urllib.request.Request: headers = { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json", } if stream: headers["Accept"] = "text/event-stream" return urllib.request.Request( url=url, data=json.dumps(payload).encode("utf-8"), headers=headers, method="POST", ) ``` ```python def execute_request(args: argparse.Namespace, payload: dict[str, Any]) -> tuple[dict[str, Any], bool]: endpoint = args.base_url.rstrip("/") + "/responses" request = create_request(endpoint, args.api_key, payload, args.stream) if args.stream: return stream_response(request, args.timeout, args.format) return non_stream_response(request, args.timeout), False ``` ### Technical Analysis The Skill legitimately needs network access and must send the user’s search query to the Volcengine ARK Responses API. Sending the API key to the documented default endpoint, `https://ark.cn-beijing.volces.com/api/v3/responses`, is therefore necessary for its declared functionality. However, the destination is fully configurable through the `--base-url` argument or the `ARK_BASE_URL` environment variable. The supplied value is used without validating its scheme or hostname. The same request unconditionally includes th ...[truncated 1890 chars]- Remediation
View remediation
