T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:45
- Finding
- API Credentials Can Be Transmitted to an Unrestricted Environment-Controlled Endpoint<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:45-50` **Vulnerability Type**: Unvalidated destination for credential-bearing network requests **Risk Level**: High ```markdown ## Authentication All API requests require the user's API key: \`\`\` -H "x-api-key: $NEONOUS_API_KEY" \`\`\` Base URL: `$NEONOUS_URL` (e.g., `https://app.neonous-ai.com`). ``` Authenticated requests subsequently combine these variables, for example at `SKILL.md:68-69`: ```bash curl -s "$NEONOUS_URL/custom/builder/agents" \ -H "x-api-key: $NEONOUS_API_KEY" | jq '.[]| {id, name, model, enabled}' ``` ### Technical Analysis The Skill requires `NEONOUS_URL` from the environment and uses it directly as the destination for requests containing `NEONOUS_API_KEY`. It does not instruct the Agent to validate the URL scheme, hostname, port, or origin before transmitting the credential. Authentication over the network is necessary for the declared Neonous platform-management functionality. However, sending a privileged API key to an unrestricted environment-controlled destination exceeds minimum-safe behavior. If `NEONOUS_URL` is accidentally or maliciously set to an HTTP URL or an attacker-controlled HTTPS origin, the API key will be disclosed to that endpoint. The key is used across endpoints that manage agents, conversations, artifacts, workflows, integrations, working memory, and account information, making compromise materially more severe than disclosure of a narrowly scoped read-only token. ### Attack Path 1. An attacker, compromised deployment configuration, or malicious wrapper modifies `NEONOUS_URL`. 2. The value is set to an attacker-controlled endpoint, such as `https://attacker.example`. 3. A user asks the Agent to perform any authenticated Neonous operation. 4. The Agent follows the documented command and sends `x-api-key: $NEONOUS_API_KEY` to the configured endpoint. 5. The attacker records the header and reuses the API key against the legitimate Neonous ser ...[truncated 932 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the unrestricted base URL with the canonical Neonous HTTPS origin where possible. 2. If configurable deployments are required, validate `NEONOUS_URL` before every credential-bearing request: - Require the `https` scheme. - Allowlist approved hostnames and ports. - Reject embedded user information, fragments, and unexpected URL forms. - Reject loopback, link-local, private-network, and metadata-service destinations unless explicitly required and trusted. 3. Do not follow redirects for authenticated requests unless every redirect target is independently allowlisted. 4. Add `curl --fail --show-error --proto '=https'` and appropriate connection and request timeouts. 5. Document that operators must verify the destination before setting `NEONOUS_API_KEY`. 6. Use a narrowly scoped and revocable API key if the Neonous platform supports token scopes. 7. Rotate the API key immediately if it may have been sent to an untrusted destination. ]]>
