T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:183
- Finding
- Potential Disclosure of Credentials and Proprietary Context to External AI Services<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:29-30, 136, 183, 216-222` **Vulnerability Type**: Sensitive data exposure through external AI CLI context transfer **Risk Level**: High ### Complete Code Snippets ```markdown 2. **Availability Check:** Run `tool --version` or simple echo tests to verify API key validity. 3. **Environment Sync:** Read `.ai-config.yaml` or `.env` from project root for permission config. ``` ```markdown | **Auth Failed** | `401 Unauthorized` | Try local backup `.env`; if failed, skip and notify user. | ``` ```markdown - **Shared Context:** When switching tools, always pass `git diff` or latest `summary.md` to the接管 tool. ``` ```markdown - Read project-specific AI configs (`.ai-config.yaml`, `.env`) ### Credential Protection - **Local Processing Only**: All credential checks happen locally on your machine - **No Data Exfiltration**: Credentials are never sent to external servers - **Minimal Access**: Only reads necessary config files, never writes or modifies them ``` ### Technical Analysis The documented workflow reads files that commonly contain API keys and other credentials, including `.env`, and directs the orchestrator to pass `git diff` or `summary.md` content between AI CLI tools. These tools may communicate with third-party, network-hosted AI services. No controls are specified for secret detection, context redaction, file allowlisting, provider-specific consent, or preventing environment-file contents from entering prompts. The instruction to “always pass” a diff or summary creates an especially broad transfer boundary: diffs can include newly added secrets, private source code, credentials removed from files, internal endpoints, or confidential business data. This behavior conflicts with the claims that processing is local and that credentials are never sent to external servers. Although the repository does not contain a direct network-exfiltration implementation, the documented operational workflo ...[truncated 1288 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Do not read `.env` contents for tool discovery or availability testing. 2. Treat `.env`, credential stores, private keys, and authentication files as prohibited prompt sources. 3. Replace automatic context transfer with explicit, per-transfer user approval that identifies the destination provider. 4. Apply secret scanning and redaction before sending diffs, summaries, logs, or source files to any AI CLI. 5. Use a default-deny file policy with explicit project-relative allowlists. 6. Limit diffs to the files and lines strictly required for the active task. 7. Prevent fallback tools from receiving primary-tool transcripts unless the user approves the transfer. 8. Document that network-backed AI CLIs may send supplied context to third-party services. 9. Add automated tests using synthetic secrets to verify that credentials cannot enter generated prompts. 10. If credential validity must be checked, invoke a provider-specific authentication-status operation without reading or forwarding the credential value. ]]>
