T09 · Insecure Skill Coding Practices
- Location
SKILL.md:141- Finding
Unencrypted Private Key Persistence and Caller Exposure
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is meant for cross-agent messaging, but its sample implementation handles keys, files, and identities too loosely for a security-sensitive communication system.
Install only for controlled experiments or after hardening. Treat messages and attachments as data leaving the current session, avoid sensitive files, restrict allowed paths, add explicit recipient confirmation, protect or redesign key storage, validate identifiers before filesystem use, and do not rely on the advertised impersonation resistance or forward secrecy until the implementation changes.
SKILL.md:141Unencrypted Private Key Persistence and Caller Exposure
SKILL.md:400Path Traversal Through Unvalidated Message and Agent Identifiers
SKILL.md:443Unauthenticated Agent Registry Overwrite Enables Identity Substitution
SKILL.md:672Unrestricted File Attachment Permits Sensitive Local File Collection
The skill promotes sharing data between Claude instances and persistent message queues, but it does not prominently warn that message contents may leave the current interaction boundary and remain stored on disk until read or deleted. In this context, missing privacy disclosure is dangerous because users may assume ordinary in-session collaboration rather than cross-agent transmission and retention.
The documentation promises identity verification and impersonation resistance, but register_agent simply accepts any supplied agent_id and public_key and writes them to the registry without proof of key ownership, trust establishment, or out-of-band verification. An attacker can register a spoofed identity or replace expected keys, enabling impersonation and message interception/misdirection.
The skill stores the agent private key in base64-encoded plaintext inside /home/claude/.clawhub/identity.json while simultaneously claiming private keys remain secure. Any local process, other skill, or user with filesystem access can recover the key and decrypt queued messages or forge signatures as that agent, breaking confidentiality and authenticity.
broadcast_to_channel sends the provided message content to all channel members, creating a built-in bulk exfiltration path. In a communication skill whose stated purpose is cross-agent data sharing, broadcast capabilities substantially amplify the blast radius of accidental or malicious disclosure, especially without consent checks, recipient validation, or content restrictions.
return channel_id
def broadcast_to_channel(channel_id, sender_id, message_content):
"""Send message to all channel members"""
with open(f"/home/claude/.clawhub/channels/{channel_id}.json", "r") as f:
channel = json.load(f)
The attachment helper reads arbitrary local files and embeds their full contents into outbound messages, yet the documentation provides no warning that this sends file data to other agents. That omission makes unintended exfiltration much more likely, especially because the function accepts a raw file path and automatically base64-encodes whatever is read.
The skill description is broad enough to trigger on ordinary collaboration or information-sharing requests, which increases the chance the agent will invoke a cross-agent messaging capability in contexts where the user did not explicitly consent to data sharing. In a skill designed for communication and persistence, overbroad activation materially raises the risk of unnecessary disclosure.
The 'When to Use This Skill' guidance lists many generic situations like sharing data and coordinating workflows, without boundaries or examples of when not to use it. Because this skill transmits data to other agents and stores messages persistently, ambiguous activation criteria increase the risk of accidental data propagation beyond the current conversation.
The skill claims perfect forward secrecy, but the code uses long-term RSA recipient keys to wrap per-message AES keys. If a recipient's RSA private key is later compromised, previously recorded messages can be decrypted, so the advertised protection is false.
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
3. **Rotate keys** - periodically generate new key pairs for long-running agents
4. **Sanitize inputs** - validate and sanitize all message content
5. **Rate limiting** - implement rate limits to prevent spam
6. **Message expiry** - automatically delete old unread messages
### Threat Model
- ✅ **Protected against**: eavesdropping, man-in-the-middle, message tampering, impersonation
No suspicious patterns detected.