T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:41
- Finding
- Plaintext Storage of Gmail App Password<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 41-49 **Vulnerability Type**: Plaintext credential storage **Risk Level**: High ### Vulnerable Code ```markdown Store in TOOLS.md: ```markdown ## Kindle - Address: user@kindle.com ## Email (Gmail SMTP) - From: your@gmail.com - App Password: xxxx xxxx xxxx xxxx - Host: smtp.gmail.com - Port: 587 ``` ``` ### Technical Analysis The skill explicitly instructs users to store a Gmail App Password in `TOOLS.md`, a plaintext Markdown file in the working environment. This provides no encryption, access isolation, or secret lifecycle controls. The file could be exposed through source-control commits, workspace synchronization, backups, diagnostic bundles, agent context collection, logs, or access by other local users and processes. The configuration also exposes the sender email address and private Kindle delivery address. An App Password is a reusable authentication credential. Depending on the Gmail account configuration and enabled protocols, disclosure may permit SMTP authentication and potentially access to other mail protocols that accept the same credential. ### Attack Path 1. A user follows the skill instructions and writes a valid Gmail App Password into `TOOLS.md`. 2. The file is accidentally committed, synchronized, backed up, included in an agent context, or read by another local process or user. 3. An attacker extracts the sender address and App Password. 4. The attacker authenticates to the applicable Gmail service using the stolen credential. 5. The attacker sends unauthorized email or accesses other enabled mail services within the credential's effective scope. 6. The exposed Kindle address may also be targeted with unsolicited document deliveries if the attacker's sender is authorized by the Kindle account. ### Impact Assessment Successful exploitation may provide unauthorized authenticated use of the configured email account. At minimum, the attacker may be able to send m ...[truncated 422 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Do not store passwords, tokens, or App Passwords in `TOOLS.md` or any other project documentation. - Retrieve the SMTP credential at runtime from an operating-system keychain, managed secret store, or equivalent protected credential provider. - If environment variables are unavoidable, load them from a file excluded from source control and restrict that file to the owning user, such as mode `0600` on Unix-like systems. - Add secret-bearing files and local configuration files to `.gitignore`. - Ensure credentials are redacted from logs, exceptions, tool output, generated reports, and agent context. - Use a dedicated email account with the minimum capabilities needed for Kindle delivery rather than a primary personal account. - Document credential revocation and rotation procedures. - Immediately revoke any App Password that has already been committed, logged, synchronized, or otherwise exposed. ]]>
