T09 · Insecure Skill Coding Practices
- Location
references/account.md:118- Finding
Non-expiring bearer credential stored in plaintext client configuration
- Content
View full analysis
Vulnerability Details
File Location:
references/account.md:118-138
Vulnerability Type: Plaintext storage of a long-lived bearer credential
Risk Level: HighVulnerable Code Segment
The relevant instructions, translated into English, are:
json { "blackstone": { "type": "http", "url": "https://blackstone.wansu.tech/mcp", "headers": { "Authorization": "Bearer bst_..." } } }text WorkBuddy: Write the WorkBuddy MCP server configuration. Determine its configuration file by checking, in order: ~/.workbuddy/mcp.json ~/.workbuddy/config.json ~/.workbuddy/settings.json Use the first file that exists. If none exists, create a file under ~/.workbuddy/ using the format of existing configuration files in that directory. Merge mcp_config into the mcpServers object. 1. Read and parse the original file before writing. 2. Replace the complete existing blackstone entry, including the old credential. 3. After writing, read the file again and confirm that the Authorization value matches the newly issued value.The related credential-lifetime instruction at
references/account.md:201states that the device credential does not expire and must be revoked manually.Technical Analysis
The Skill directs the Agent to place a bearer token directly inside a normal JSON configuration file. It does not require owner-only file permissions, encryption at rest, use of an operating-system keychain, or use of a client-managed secret store.
A bearer credential grants access based solely on possession. Because the credential is documented as non-expiring, disclosure creates a durable compromise until the author notices the issue and manually revokes the device. Re-reading and comparing the complete
Authorizationvalue also unnecessarily places the secret back into the Agent or file-tool processing context.Writing this credential is necessary for the ...[truncated 1478 chars]
- Remediation
View remediation
Remediation Suggestions
- Store the bearer token in the operating system's credential manager or a WorkBuddy-managed secret store rather than embedding it in ordinary JSON.
- If a configuration file must reference the credential, store only a secret identifier or environment-variable reference.
- If plaintext storage cannot be avoided, create the file with owner-only permissions and verify that existing files are not readable by groups or other users.
- Replace non-expiring credentials with short-lived, scoped access tokens backed by a separately protected refresh mechanism.
- Restrict the token to only the MCP operations required by this Skill and bind it to the intended service audience.
- Support automatic rotation and immediate revocation after suspected disclosure.
- Do not re-read or compare the complete token after writing. Verify the connection entry and compare a non-sensitive fingerprint supplied by the service.
- Ensure logs, tool traces, backups, diagnostics, and error messages redact the complete
Authorizationvalue.
