T09 · Insecure Skill Coding Practices
- Location
SKILL.md:20- Finding
API Credentials Can Be Transmitted to an Untrusted Configurable Host
- Content
View full analysis
Header: X-API-Key: $LYNSE_API_KEY ``` ### Technical Analysis The skill directs the agent to send the API key to the host specified by `LYNSE_API_HOST`. It does not require HTTPS, validate the URL scheme, enforce an allowlist of trusted Lynse domains, or prohibit redirects to another host. Environment variables are configuration inputs rather than trust guarantees. If an attacker, compromised installer, or unsafe configuration file controls `LYNSE_API_HOST`, the API key will be placed in the `X-API-Key` header of a request to the attacker's server. Subsequent business requests may also disclose the temporary access token and API key. The declared homepage does not constrain the runtime API destination. The instruction to avoid constructing or guessing the address does not mitigate a malicious preconfigured value. ### Attack Path 1. The attacker modifies the environment, `.env` file, installation configuration, or process launch configuration. 2. The attacker sets `LYNSE_API_HOST` to an attacker-controlled HTTP or HTTPS endpoint. 3. A user asks the agent to perform any Lynse operation. 4. Following the documented authentication procedure, the agent sends a token-exchange request to the configured endpoint. 5. The request includes `LYNSE_API_KEY` in the `X-API-Key` header. 6. The attacker records the API key and can return a fabricated access token or response. 7. If the key remains valid, the attacker reuses it against the legitimate Lynse service within the permissions assigned to that key. ### Impact Assessment Successful exploitation discloses the long-lived API key and potentially temporary access tokens. T ...[truncated 573 chars]- Remediation
View remediation
