T09 · Insecure Skill Coding Practices
Error
- Location
- templates/accounts.example.json:1
- Finding
- Plaintext aggregation and sharing of high-value credentials and Agent session identifiers<![CDATA[ ## Vulnerability Details **File Location**: `templates/accounts.example.json:1-18, 52-61`; related instructions in `SKILL.md:22-35` and `references/info-collection-template.md:3-15` **Vulnerability Type**: Plaintext sensitive credential storage **Risk Level**: High ### Vulnerable Code ```json { "feishuApps": [ { "label": "coordinator", "appId": "cli_your_app_id", "appSecret": "your_app_secret", "encryptKey": "your_encrypt_key", "verificationToken": "your_verification_token", "botName": "Coordinator Bot" }, { "label": "specialist-a", "appId": "cli_specialist_app_id", "appSecret": "specialist_app_secret", "encryptKey": "specialist_encrypt_key", "verificationToken": "specialist_verification_token", "botName": "Specialist Bot A" } ] } ``` ```json "agentSessions": [ { "agentId": "coordinator", "sessionKey": "agent:main:feishu:group:oc_primary_team" }, { "agentId": "specialist-a", "sessionKey": "agent:worker-a:feishu:group:oc_primary_team" } ] ``` The Skill directs operators to replace these placeholders with real values, save the result as an actual configuration file, and share the collected configuration with the team. The related Relay template also places bearer authentication material directly in JSON: ```json "invoke": { "type": "http", "url": "https://xiaogua.example.com/tools/invoke", "auth": "Bearer <token>", "timeout_ms": 20000 } ``` ### Technical Analysis The design aggregates Feishu application secrets, webhook verification tokens, encryption keys, Relay bearer tokens, and Agent session identifiers into ordinary plaintext JSON files. No secret-manager integration, encryption-at-rest requirement, restrictive file permissions, repository exclusion, redaction policy, or separation of credentials by bot is provided. This creates a high-value credential bundle. A single accidental commit, chat attachment, exposed backup, ...[truncated 1555 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Replace secret values in JSON with secret references such as environment-variable names or secret-manager resource identifiers. - Store application secrets, encryption keys, verification tokens, and bearer tokens in a managed secret service. - Prohibit sharing raw credentials through Feishu documents, chat, tickets, or source repositories. - Split credentials by bot and service so compromise of one configuration does not expose the entire mesh. - Apply restrictive filesystem permissions and run the Relay under a dedicated operating-system account. - Add explicit `.gitignore` rules for real configuration and environment files. - Add automated secret scanning to CI and pre-commit hooks. - Treat session identifiers as sensitive routing data and disclose them only to the Relay component that requires them. - Rotate any credential that has already been stored or shared using the documented plaintext workflow. ]]>
