T09 · Insecure Skill Coding Practices
- Location
SKILL.md:28- Finding
Unrestricted API Base URL Override Can Expose the Bearer Token
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 28-35
Vulnerability Type: Arbitrary credentialed endpoint configuration
Risk Level: MediumVulnerable Code
markdown - **API Key**: stored in env `ALPHAGBM_API_KEY` (format `agbm_xxxx…`). - **Base URL**: default `https://alphagbm.zeabur.app`. Override with env `ALPHAGBM_BASE_URL`. - If the user has no key, direct them to register at <https://alphagbm.com> and create one at `/api-keys`. - **Tier requirement**: Free tier = 1 profile, Plus = 10, Pro = 50. Create endpoint returns 403 with `upgrade_required: true` when the cap is hit. ## API Endpoints All endpoints require `Authorization: Bearer $ALPHAGBM_API_KEY`.Technical Analysis
The skill permits
ALPHAGBM_BASE_URLto override the service endpoint without defining validation requirements, while instructing the agent to attachALPHAGBM_API_KEYas a bearer token to all API requests.If an attacker can influence the environment variable, authenticated requests may be redirected to an attacker-controlled host. The skill does not require HTTPS, restrict the destination to trusted hostnames, prohibit IP-literal destinations, or specify safe handling of cross-origin redirects. Consequently, the authorization header could be disclosed to an untrusted endpoint.
This is an insecure configuration pattern rather than embedded malicious behavior. The package contains no scripts or executable payloads, but agents implementing these instructions literally may transmit a secret to an arbitrary destination.
Attack Path
- An attacker or compromised deployment component sets
ALPHAGBM_BASE_URLto an attacker-controlled HTTP or HTTPS endpoint. - The user asks the agent to list, create, retrieve, refresh, or archive a company profile.
- The agent constructs the request using the overridden base URL.
- Following the skill instructions, the agent includes `Authorization: Bearer $ALPH ...[truncated 976 chars]
- An attacker or compromised deployment component sets
- Remediation
View remediation
Remediation Suggestions
- Restrict API destinations to an explicit allowlist, with
https://alphagbm.zeabur.appas the approved default. - If custom endpoints are operationally necessary, require explicit user or administrator approval before sending credentials to a new origin.
- Require HTTPS and reject plaintext HTTP URLs, embedded credentials, malformed URLs, and unsupported schemes.
- Reject loopback, link-local, private-network, and IP-literal destinations unless they are explicitly approved for a controlled development environment.
- Do not forward the
Authorizationheader across cross-origin redirects. Prefer disabling redirects for authenticated requests or revalidate every redirect destination against the allowlist. - Validate the final resolved request origin immediately before attaching the bearer token.
- Separate development and production credentials, and ensure development overrides cannot access production tokens.
- Use narrowly scoped, revocable, and expiring API tokens where supported.
- Document secure override behavior directly in the skill, including hostname validation and a prohibition on transmitting credentials to untrusted endpoints.
- Rotate the API key immediately if requests may already have been sent to an untrusted base URL.
- Restrict API destinations to an explicit allowlist, with
