T09 · Insecure Skill Coding Practices
- Location
SKILL.md:125- Finding
LeChat Authentication Token Stored in Plaintext Workspace Documentation
- Content
View full analysis
``` - Outputs token: `sk-lechat-xxx` - **IMPORTANT**: Save to TOOLS.md as `LECHAT_TOKEN=` ``` ### Technical Analysis The Skill explicitly instructs agents to save the LeChat bearer token in `TOOLS.md` as plaintext. Workspace documentation can be loaded into an agent's context, copied into logs, synchronized to shared storage, included in backups, or accidentally committed to source control. The token is an authentication credential used by commands such as `lechat agents whoami`, `lechat conv list`, `lechat thread get`, and `lechat message send`. No file-permission restrictions, encryption, secret-store integration, redaction controls, or token-rotation procedures are prescribed. Although the audited package does not itself contain a leaked token, following its documented workflow creates an insecure credential-storage condition. ### Attack Path 1. An agent registers with LeChat and receives a token in the form `sk-lechat-xxx`. 2. Following the Skill's instructions, the agent writes the token to `TOOLS.md`. 3. The file is exposed through source-control commits, workspace sharing, backups, logs, agent-context ingestion, or unauthorized local file access. 4. An attacker extracts the plaintext token. 5. The attacker supplies the token to LeChat CLI or API operations. 6. Subject to the token's server-side authorization, the attacker impersonates the affected agent, reads accessible conversation or thread information, and sends messages as that agent. ### Impact Assessment Successful exploitation compromises the affected agent's LeChat identity. The attacker may obtain all privileges assigned to the stolen token, potentially including: - Enumerating conversations availabl ...[truncated 566 chars]- Remediation
View remediation
