T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/setup-auto-memory.sh:43
- Finding
- API Key Is Echoed During Interactive Setup<![CDATA[ ## Vulnerability Details **File Location**: `scripts/setup-auto-memory.sh:43-44` **Vulnerability Type**: Interactive secret disclosure **Risk Level**: Medium ### Vulnerable Code ```bash read -rp "Paste your API key here: " API_KEY API_KEY="${API_KEY//[[:space:]]/}" ``` ### Technical Analysis The `read` command does not use silent mode (`-s`). Consequently, the API key is displayed as the user types or pastes it. Although transmitting the key to the Auto Drive API is necessary for authentication, exposing it in terminal output is not necessary for the Skill’s declared functionality. The key may be captured by shoulder surfing, terminal session recording, screen sharing, support logs, or automation that records terminal output. ### Attack Path 1. A user runs `scripts/setup-auto-memory.sh`. 2. The script prompts the user to paste an Auto Drive API key. 3. The terminal displays the complete key. 4. A local observer, screen-sharing participant, or terminal-recording system captures it. 5. The attacker uses the stolen key against Auto Drive API endpoints. ### Impact Assessment A captured key can provide access to the victim’s Auto Drive account capabilities, including authenticated uploads and consumption of the victim’s storage quota. The exact scope depends on the permissions assigned to the API key. This issue does not itself provide operating-system privilege escalation. ]]>
- Remediation
- <![CDATA[ ## Remediation Suggestions Use silent input for secrets and explicitly print a newline afterward: ```bash read -rsp "Paste your API key here: " API_KEY printf '\n' API_KEY="${API_KEY//[[:space:]]/}" ``` Additionally: - Avoid logging the variable or commands containing it. - Clear the variable with `unset API_KEY` after verification and persistence. - Warn users not to paste the key while screen sharing or recording a terminal. - Prefer integration with an operating-system credential store where supported. ]]>
