T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- SKILL.md:145
- Finding
- Implicit Import of Environment Credentials into a Configurable Identity Backend## Vulnerability Details **File Location**: `SKILL.md`, lines 145-156 **Vulnerability Type**: Implicit secret ingestion and least-privilege violation **Risk Level**: Medium ### Vulnerable Code ```markdown Credential must exist first (`identity_fetch`). Common env vars: `GOOGLE_ACCESS_TOKEN`, `OPENAI_API_KEY`, `GITHUB_TOKEN`, etc. | Param | Type | Required | Description | | ---------- | ------ | -------- | ---------------------------------------------------------------------------------------- | | `provider` | string | Yes | Provider name (e.g. `google`) | | `envVar` | string | Yes | Env var for injection (e.g. `GOOGLE_ACCESS_TOKEN`). Must match `[A-Za-z_][A-Za-z0-9_]*`. | ```json { "provider": "google", "envVar": "GOOGLE_ACCESS_TOKEN" } ``` If credential exists: binds it. Else: imports from `process.env[envVar]` as api_key (gateway must have that env set). ``` ### Technical Analysis The documented binding operation has two materially different behaviors: 1. If a hosted credential exists, it binds that credential to an environment-variable name. 2. If no hosted credential exists, it reads the value of the specified gateway process environment variable and imports it as an API key. The second behavior is an implicit credential-ingestion path. A request to establish a binding can therefore cause a gateway secret to be read and transferred to the configured identity backend without a separate import operation or explicit confirmation. This exceeds the minimum privilege needed to bind an existing hosted credential. The accepted `envVar` pattern validates syntax but does not restrict which gateway environment variables may be accessed. The identity API endpoint is configurable elsewhere in the Skill, so a configuration error or compromised backend could expose the ...[truncated 1340 chars]
- Remediation
- ## Remediation Suggestions - Remove the automatic environment import fallback from `identity_set_binding`. - Fail closed when the requested provider has no stored credential and direct the user to a separate credential-import workflow. - Require explicit, informed confirmation before reading an environment variable, identifying the variable name, provider, destination service, and intended scope. - Implement a strict allowlist of environment-variable names and providers rather than relying only on identifier-format validation. - Prevent identity-service endpoints from being changed by untrusted users or Skill instructions. - Require authenticated TLS and validate the expected destination identity for every credential transfer. - Record security audit events without recording credential values. - Prefer opaque references or secret-manager handles so raw values do not need to leave the gateway. - Apply provider-side least privilege, short expiration periods, rotation, and revocation procedures to imported credentials.
