T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:394
- Finding
- Sensitive Configuration Values May Be Propagated into Generated Documentation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:394-403`, `SKILL.md:451-461`, `templates/l2-template.md:89-93`, `README.md:57-65` **Vulnerability Type**: Sensitive information exposure through generated artifacts **Risk Level**: Medium ### Vulnerable Code Snippet The relevant instructions, translated into English while preserving their meaning, are: ```markdown 2. Generate an L2 module document containing: - Module responsibility overview - File index - Public APIs - MyBatis mapping relationships - Dependency relationships - Core business processes - Configuration items (summary of application.properties/yml content) ``` The L2 template explicitly includes configuration default values: ```markdown ## Configuration Items | Configuration Item | Source | Default Value | Description | |--------------------|--------|---------------|-------------| | `{configKey}` | {ConfigClass} | {defaultValue} | {description} | ``` The documented workflow also permits generated documentation to be committed: ```markdown 7. Commit documentation to Git (optional) ``` ### Technical Analysis The Skill instructs agents to inspect Spring Boot configuration files and reproduce configuration summaries and default values in L2 and L1 documentation. It does not define any secret-detection, redaction, allowlisting, or output-review requirement. Files such as `application.properties`, `application.yml`, and `application.yaml` frequently contain sensitive material, including: - Database usernames and passwords - API keys and access tokens - Cloud service credentials - Internal service URLs - Message-broker credentials - Encryption keys or keystore passwords Because generated documents are ordinary Markdown files under `.ai-doc`, sensitive values copied into them may be distributed, uploaded, indexed, or committed to repository history. The optional Git workflow increases the persistence and disclosure risk. ### Attack Path 1. A target project ...[truncated 1178 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Prohibit inclusion of configuration values by default. Document only configuration key names and non-sensitive descriptions. 2. Add mandatory redaction for keys matching patterns such as: - `password` - `passwd` - `secret` - `token` - `apiKey` - `accessKey` - `privateKey` - `credential` - `connectionString` 3. Redact credential-like values regardless of key name, including private-key blocks, bearer tokens, JWTs, and high-entropy strings. 4. Replace sensitive values with a fixed marker such as `[REDACTED]`; do not preserve prefixes or suffixes unless explicitly required. 5. Use an allowlist for safe values that may be documented, such as feature flags, timeouts, and non-sensitive port numbers. 6. Add a generated-artifact secret scan before displaying, exporting, or committing `.ai-doc`. 7. Require explicit user confirmation before including any configuration value rather than only its key and description. 8. Add `.ai-doc` to `.gitignore` by default or require a review step before committing it. 9. If exposure has already occurred, rotate affected credentials and remove them from repository history. ]]>
