T09 · Insecure Skill Coding Practices
- Location
src/api/routes.ts:617- Finding
Plugin Configuration Endpoint Exposes the Gemini API Key
- Content
View full analysis
{ const cfg = getCfg ? getCfg() : ({} as OrchardConfig); const allowModelOverride = cfg.allowModelOverride === true; return jsonOk(res, { ...cfg, allowModelOverride }); }, }); ``` ### Technical Analysis The `/orchard/config` endpoint returns the entire plugin configuration using object spread. The `OrchardConfig` structure includes `contextInjection.apiKey`, so a Gemini API key configured directly in the plugin configuration is serialized and returned verbatim. Gateway authentication limits access to clients possessing a gateway bearer token, but it does not make disclosure of unrelated third-party credentials necessary. Dashboard clients only require non-sensitive operational settings and should never receive provider API keys. ### Attack Path 1. An attacker obtains or is granted a valid OpenClaw gateway bearer token. 2. The attacker sends `GET /orchard/config`. 3. The route serializes the complete configuration object. 4. If `contextInjection.apiKey` is configured, the response exposes it in plaintext. 5. The attacker uses the key to submit requests to the Gemini API or consume the associated quota. ### Impact Assessment A gateway-authenticated user can obtain a third-party API credential that is not required for normal dashboard operation. This may permit unauthorized API requests, quota exhaustion, billing impact, and access to any additional services or projects authorized by the exposed key. ]]>- Remediation
View remediation
