T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:24
- Finding
- Client-Side Exposure of the AutoHeal API Key## Vulnerability Details **File Location**: `SKILL.md:24-30` and `SKILL.md:43-49` **Vulnerability Type**: Client-side credential exposure **Risk Level**: High The browser integration instructs users to include `AUTOHEAL_API_KEY` in requests made directly from client-side JavaScript. ```javascript headers: { "Content-Type": "application/json" }, body: JSON.stringify({ key: process.env.AUTOHEAL_API_KEY || "YOUR_API_KEY", message: msg, stack: err?.stack || "", source_url: source, browser: navigator.userAgent }) ``` The same credential handling is repeated for unhandled promise rejections: ```javascript headers: { "Content-Type": "application/json" }, body: JSON.stringify({ key: process.env.AUTOHEAL_API_KEY || "YOUR_API_KEY", message: err?.message || String(err), stack: err?.stack || "", source_url: window.location.href, browser: navigator.userAgent }) ``` ### Technical Analysis Secrets cannot be securely retained in browser-side code. JavaScript build systems commonly replace environment-variable expressions during compilation, causing the resulting API key to be included in downloadable application bundles. Even if substitution does not occur, users are instructed to replace the placeholder with a usable key. The API key is also included directly in the JSON request body. Site visitors, browser extensions, injected scripts, browser developer tools, and systems with access to captured network requests can inspect and recover it. The project uses the same `AUTOHEAL_API_KEY` as a bearer token when querying error status. The documentation does not establish that browser-facing keys are short-lived, origin-restricted, ingestion-only, or otherwise separated from credentials used for authenticated API operations. ### Attack Path 1. A project follows the documented browser integration and supplies its AutoHeal API key. 2. The key is embedded in a client-side bundle or exposed in ...[truncated 1097 chars]
- Remediation
- ## Remediation Suggestions 1. Never include a privileged AutoHeal API key in browser code, build-time frontend environment variables, or browser request bodies. 2. Route browser telemetry through an application-controlled backend. The backend should hold the API key and forward only validated, sanitized fields. 3. If direct browser ingestion is required, introduce a separate public ingestion token that is: - Restricted to ingestion only. - Bound to explicitly configured origins. - Short-lived and easily rotated. - Protected by per-origin and per-client rate limits. - Unable to query errors, account information, or other authenticated resources. 4. Separate ingestion credentials from management and status-query credentials. 5. Add abuse controls, including payload limits, replay protection, anomaly detection, and revocation. 6. Update the Skill instructions to explain explicitly that server API keys must never be exposed to frontend applications.
