T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:19
- Finding
- Plaintext Secret Storage Misrepresented as AES-256 Encryption<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 10 and 19-20 **Vulnerability Type**: Plaintext storage of sensitive credentials **Risk Level**: High ### Vulnerable Code ```markdown ## Features - Encrypted secret storage (AES-256) ``` ```bash # Set a secret (encrypted at rest) echo "sk-abc123" > ~/.agent-env/secrets/OPENAI_KEY chmod 600 ~/.agent-env/secrets/OPENAI_KEY ``` ### Technical Analysis The documented command writes the API key directly to a regular file without performing encryption. The subsequent `chmod 600` operation restricts ordinary filesystem access to the file owner, but it does not provide AES-256 encryption or any other form of encryption at rest. The project contains no encryption implementation, encryption-key management, operating-system keychain integration, or decryption workflow supporting the advertised security property. This discrepancy can cause users to treat plaintext credential files as encrypted secret storage. ### Attack Path 1. A user follows the documented command and writes a production API key to `~/.agent-env/secrets/OPENAI_KEY`. 2. The key remains present in plaintext on the filesystem. 3. An attacker compromises the user account, reads a backup, accesses the disk through a privileged process, or obtains the file through another local information-disclosure flaw. 4. The attacker reads and reuses the API key against the associated service. ### Impact Assessment An attacker who can access the file can obtain the complete credential with the same service privileges granted to that credential. Depending on the API key, this could permit unauthorized API use, access to confidential data, resource modification, or consumption of paid service quotas. The filesystem permission reduces exposure to other unprivileged local users but does not protect against compromise of the owning account, privileged processes, backup exposure, or offline disk access. ]]>
- Remediation
- <![CDATA[ ## Remediation Suggestions - Replace regular plaintext files with an organization-approved secret manager, operating-system keychain, or hardware-backed credential store. - If file-based encryption is unavoidable, use a vetted authenticated-encryption implementation and maintain encryption keys separately from encrypted data. - Remove the AES-256 and “encrypted at rest” claims unless the project actually implements and verifies those properties. - Set restrictive permissions on both secret files and their parent directories. - Avoid literal credential-shaped values in documentation and use clearly synthetic placeholders. - Document backup, rotation, revocation, and recovery procedures for stored credentials. ]]>
