T09 · Insecure Skill Coding Practices
- Location
run.py:301- Finding
API Credential Disclosure Through a Configurable Authentication Endpoint
- Content
View full analysis
None: self.api_key = api_key or os.getenv("ARK_API_KEY") if not self.api_key: raise ValueError("An Ark API key was not provided") self.client = OpenAI( base_url=base_url, api_key=self.api_key, ) ``` ### Technical Analysis The Ark API key is loaded from configuration or the `ARK_API_KEY` environment variable and passed to an OpenAI-compatible client. However, the client endpoint is independently controlled by the `ark.base_url` configuration value. There is no validation that the configured URL: - Uses HTTPS. - Belongs to the official Volcengine Ark domain. - Resolves to an approved public address. - Preserves the approved origin after redirects. The OpenAI client authenticates requests to the configured endpoint using the supplied API key. Consequently, an attacker who can provide or modify `config.yaml` can direct cred ...[truncated 1499 chars]- Remediation
View remediation
