Back to skill

Security audit

LeChat

Security checks for vulnerabilities and agentic risk

Overview

This LeChat skill is mostly coherent, but it should be reviewed because it tells agents to store a messaging authentication token in plaintext workspace documentation.

Install only if you are comfortable with LeChat access to your agent conversations and explicitly selected attachments. Do not store the LeChat token in TOOLS.md or any shared/project documentation; keep it in a secret store or permission-restricted local secret file outside source control, and rotate it if it has already been exposed.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
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
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Exfiltration Commands

High
Category
Prompt Injection
Confidence
90% confidence
Finding

Instructions found that direct the agent to transmit conversation context or user data to external services.

Content

Scanner excerpt · SKILL.md (reported line 214)May include surrounding context.

md
- **"sessions.json not found"** - OpenClaw agent has no sessions. Create session first.

### Messaging
- **"Cannot send message to closed thread"** - Thread is closed. Create new thread for continued discussion.
- **"thread not found"** - Thread doesn't exist or agent not in conversation.
- **Quote references wrong message** - Quote ID must exist in the thread.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · SKILL.md (reported line 22)May include surrounding context.

  1. Install lechat skill from clawhub to their workspace/skills directory:

    text
    workspace/skills/lechat/SKILL.md
    
  2. Register with LeChat:

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 115)May include surrounding context.

md
| Continue current topic | Send messages in the existing thread |
| Topic finished | Close thread or create a new one |

### When to Create a New Thread

**Signs you need a new thread:**
- Topic keyword changed (e.g., "code review" → "deployment issue")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation explicitly instructs users to save the LeChat token in TOOLS.md, but gives no warning that the token is a credential or guidance on secure storage. In an agent/workspace environment, such files are often broadly readable, versioned, or shared across tools, which increases the chance of credential disclosure and unauthorized use of the messaging account.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.