T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:29
- Finding
- Credential File Is Not Protected Despite Documentation Assurance## Vulnerability Details **File Location**: `SKILL.md:29-34` **Vulnerability Type**: Missing credential-file protection and misleading security documentation **Risk Level**: Medium **Relevant excerpt translated into English:** ```markdown The project provides an `.env.example` template, which can be copied and modified: ```bash cp .env.example .env ``` The `.env` file is ignored by `.gitignore` and will not be committed, so real credentials can be safely entered. ``` Neither `.gitignore` nor `.env.example` exists in the audited project. Meanwhile, `scripts/generate.ts:20-31` automatically reads credentials from a root-level `.env` file. ### Technical Analysis The setup instructions explicitly encourage users to store a VolcEngine Access Key and Secret Key in `.env` and assure them that Git ignores this file. That assurance is false for the audited package because no `.gitignore` is present. Secret files must be excluded by an actual repository control rather than documentation alone. Without that control, commands such as `git add .`, automated repository synchronization, archive creation, or broad file-upload operations can include `.env`. This issue does not independently transmit credentials to an attacker. Exploitation requires the credential file to be committed, published, uploaded, or otherwise exposed after a user follows the documented setup process. ### Attack Path 1. A user follows the Skill instructions and creates `.env`. 2. The user places `VOLCENGINE_AK` and `VOLCENGINE_SK`, or an STS token, in that file. 3. Because the project contains no `.gitignore`, Git and other broad file-collection tools do not exclude `.env`. 4. The user runs a command such as `git add .`, publishes the repository, or uploads the complete project directory. 5. An attacker obtains the exposed credential file. 6. The attacker uses the credentials against VolcEngine APIs within the permissions assigned to the affected id ...[truncated 447 chars]
- Remediation
- ## Remediation Suggestions 1. Add a root-level `.gitignore` containing at least: ```gitignore .env .env.* !.env.example output/ dist/ node_modules/ ``` 2. Add the referenced `.env.example` with placeholders only: ```dotenv VOLCENGINE_AK= VOLCENGINE_SK= VOLCENGINE_TOKEN= ``` 3. Replace the absolute safety assurance with instructions to verify exclusion: ```bash git check-ignore .env ``` 4. Prefer short-lived STS credentials with minimum required permissions over permanent access keys. 5. Add secret scanning to CI and pre-commit workflows. 6. If credentials have already entered repository history, revoke or rotate them immediately; deleting the file from the latest commit is insufficient.
