T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:64
- Finding
- FortiCloud password-based authentication exposes reusable account credentials<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 64-72 **Vulnerability Type**: T09: Insecure Skill Coding Practices **Risk Level**: Medium ### Vulnerable Code ```text # Authenticate to FortiCloud and obtain bearer token POST https://customerapiauth.fortinet.com/api/v1/oauth/token/ Content-Type: application/json { "username": "<forticloud_user>", "password": "<forticloud_pass>", "client_id": "<api_client_id>", "grant_type": "password" } ``` ### Technical Analysis The skill declares `FORTISASE_API_TOKEN` as its required secret and describes read-only access as a prerequisite, but its main procedure instructs the operator or agent to handle a reusable FortiCloud username and password through the OAuth resource-owner password grant. Although the example contains placeholders rather than hardcoded credentials, following these instructions would place the real password in an agent-generated HTTP request body. Depending on the execution environment, sensitive request data could be retained in conversation records, tracing systems, debug logs, proxy logs, terminal history, or error reports. A reusable account password has a substantially larger security scope than a dedicated, revocable, read-only API token. It can also be usable outside the intended audit workflow and may grant access to other FortiCloud resources according to the account's IAM roles. ### Attack Path 1. An operator loads the skill and follows the documented authentication procedure. 2. The operator provides a FortiCloud username, password, and client identifier to the agent or an agent-controlled request tool. 3. The request body or surrounding execution context is retained in a prompt transcript, request trace, debug log, proxy log, or error report. 4. An attacker or unauthorized user obtains access to that retained record. 5. The attacker extracts the reusable FortiCloud credentials. 6. The attacker authenticates as the affected account and accesses FortiSASE or ...[truncated 861 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the username/password authentication procedure from the skill. 2. Require a dedicated FortiCloud service account with only the IAM read permissions needed by the audit. 3. Use a short-lived or explicitly revocable API token supplied through `FORTISASE_API_TOKEN`, as declared in the skill metadata. 4. Retrieve secrets only from protected environment variables or an approved secret manager; never ask users to paste passwords into prompts. 5. Prevent authorization headers, tokens, passwords, refresh tokens, and request bodies from appearing in logs or traces. 6. Document token expiration, revocation, and rotation procedures. 7. Add an explicit warning that personal FortiCloud accounts and reusable passwords must not be used. 8. Ensure the authentication endpoint is included in the declared egress policy if it remains necessary. ]]>
