T09 · Insecure Skill Coding Practices
- Location
SKILL.md:24- Finding
Client-Side Exposure of the AutoHeal API Key
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:24-30andSKILL.md:43-49
Vulnerability Type: Client-side credential exposure
Risk Level: HighThe browser integration instructs users to include
AUTOHEAL_API_KEYin 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_KEYas 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
- A project follows the documented browser integration and supplies its AutoHeal API key.
- The key is embedded in a client-side bundle or exposed in ...[truncated 1097 chars]
- Remediation
View remediation
Remediation Suggestions
- Never include a privileged AutoHeal API key in browser code, build-time frontend environment variables, or browser request bodies.
- Route browser telemetry through an application-controlled backend. The backend should hold the API key and forward only validated, sanitized fields.
- 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.
- Separate ingestion credentials from management and status-query credentials.
- Add abuse controls, including payload limits, replay protection, anomaly detection, and revocation.
- Update the Skill instructions to explain explicitly that server API keys must never be exposed to frontend applications.
