T01 · Skill Instruction Hijacking
- Location
tools/skill_writer.py:224- Finding
Persistent User-Controlled Instructions Override Generated Skill Constraints
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This companion-building skill includes invasive local chat decryption, message extraction, and persistent skill/file changes that require careful review before use.
Install only if you are comfortable granting a companion skill access to local messaging databases and generated global skills. Prefer using manually exported, consented chat snippets instead of WeChat/iMessage database access; avoid running the decryptor with elevated privileges; keep decrypted outputs out of shared folders and version control; and review generated persona adjustments before reusing them as skills.
tools/skill_writer.py:224Persistent User-Controlled Instructions Override Generated Skill Constraints
tools/skill_writer.py:138Unvalidated Slugs Permit Path Traversal, Recursive Deletion, and Arbitrary File Placement
tools/version_manager.py:81Version and Skill Path Traversal Allows Out-of-Bound Rollback Reads and Writes
tools/wechat_decryptor.py:250WeChat Key Extraction Exposes Credentials Through Process Memory, Keychain, Temporary Files, and Logs
tools/chat_parser.py:602Decrypted Databases and Private Messages Are Persisted as Unprotected Plaintext
requirements.txt:1Security-Sensitive Dependencies Are Unpinned and Incompletely Declared
The skill includes a full decryption-and-extraction path for messaging databases, including key discovery and access to local message stores. This directly enables recovery of protected private communications, which is highly sensitive and can amount to unauthorized access if used on another person's device or account.
The skill provides operational guidance for extracting WeChat keys from process memory and decrypting message databases, which is a credential-access and protected-data circumvention capability unrelated to the claimed benign purpose. Even if framed as convenience, these instructions facilitate unauthorized access to sensitive communications and can be repurposed for account compromise or mass privacy invasion.
The code contains explicit capability to inspect another application's memory and recover secrets, plus fallback secret retrieval from Keychain. In the context of a consumer companion skill, this is context-inappropriate credential access behavior that can be used to bypass application protections and expose private messages at scale.
The README advertises importing WeChat/iMessage chat logs and specifically mentions WeChat database decryption as a core feature of a companion-building skill. That is a sensitive capability unrelated to the minimum needed for persona generation and normalizes access to private communications, which could expose third-party messages and credentials-derived data if misused.
These instructions tell users to extract a live WeChat key and decrypt message databases while WeChat is logged in, which directly operationalizes access to protected private message stores. In the context of a romance/companion skill, this is an unjustified sensitive capability and materially lowers the barrier to privacy-invasive behavior.
The skill claims a benign emotional-companion purpose but contains instructions to extract WeChat keys, access protected stores, decrypt message databases, and expose private chat contents. This is a severe capability mismatch that can facilitate covert surveillance or unauthorized access to highly sensitive personal communications.
The skill claims a benign emotional-companion purpose but contains instructions to extract WeChat keys, access protected stores, decrypt message databases, and expose private chat contents. This is a severe capability mismatch that can facilitate covert surveillance or unauthorized access to highly sensitive personal communications.
The skill claims a benign emotional-companion purpose but contains instructions to extract WeChat keys, access protected stores, decrypt message databases, and expose private chat contents. This is a severe capability mismatch that can facilitate covert surveillance or unauthorized access to highly sensitive personal communications.
Including WeChat decryption and local iMessage extraction in a companion-persona skill materially exceeds its stated purpose and introduces access to third-party private data. Because the data belongs not only to the user but also to chat counterparts, misuse can violate confidentiality at scale.
The instructions tell the agent to decrypt and analyze private chat histories without prominently warning about consent, data ownership, or the privacy rights of the other participants in those conversations. This omission can lead users to perform invasive collection they do not fully understand, exposing sensitive interpersonal data.
The workflow explicitly instructs extraction, analysis, and persistent storage of private chat histories, including categorization of intimate conversation content. This is dangerous because it operationalizes collection of sensitive communications and creates additional copies that expand exposure if the host system is compromised or shared.
The documented workflow acts as a local chat-forensics and import pipeline rather than just a persona builder, including contact enumeration, extraction, and classification of conversations. That broader surveillance-like behavior increases privacy and security risk because it normalizes deep access to messaging data under a benign label.
The generated directory structure is designed to archive chats and relationship memories derived from imported private conversations, creating durable local repositories of intimate data. Persistent archives multiply breach risk and make later unauthorized access more damaging.
The skill reads from the agent configuration directory to enumerate installed skills and parse metadata. While intended for listing created personas, access to .claude/skills exposes information about other installed skills and local agent configuration that may be outside the user's expectation for this feature.
ls -d .claude/skills/*/ 2>/dev/null | grep -v npy | xargs -I {} basename {} | while read slug; do
if [ -f ".claude/skills/$slug/meta.json" ]; then
name=$(cat ".claude/skills/$slug/meta.json" | grep -o '"name"[^,]*' | cut -d'"' -f4)
echo "[$slug] $name"
fi
done
Using rm -rf .claude/skills/{slug} with a templated parameter is dangerous because insufficient validation of slug can cause path traversal, wildcard expansion, or deletion of unintended directories. In agent-driven shells, a malformed or adversarial slug can turn a cleanup action into destructive filesystem loss.
用户确认后:
rm -rf .claude/skills/{slug}
# 同时删除全局链接
rm -f ~/.claude/skills/{slug}
rm -f ~/.openclaw/workspace/skills/{slug}
Deleting ~/.claude/skills/{slug} with a user-influenced parameter has the same path-manipulation risk and additionally targets a global configuration location. A crafted slug or symlink scenario could remove unrelated global skill data or configuration artifacts.
rm -rf .claude/skills/{slug}
# 同时删除全局链接
rm -f ~/.claude/skills/{slug}
rm -f ~/.openclaw/workspace/skills/{slug}
The command deletes ~/.openclaw/workspace/skills/{slug} based on a parameter without showing any path safety checks. This expands destructive impact into another workspace namespace and could erase unrelated workspace resources if the parameter is abused.
rm -rf .claude/skills/{slug}
rm -f ~/.claude/skills/{slug} rm -f ~/.openclaw/workspace/skills/{slug}
输出:
The skill encourages uploading and analyzing private conversations without any explicit notice that those messages also belong to other participants and may require their consent before processing. This omission normalizes non-consensual ingestion of third-party personal data, increasing the risk of privacy violations, harassment, and misuse of intimate communications.
The intake flow explicitly invites users to import and analyze private WeChat/iMessage conversations to recreate a real person, which creates substantial privacy and consent risks for the other participant(s). In the context of an AI companion skill, this goes beyond normal personalization and enables non-consensual profiling, impersonation, and emotional surveillance of a real individual.
The WeChat decryption section tells users how to obtain keys and decrypt databases without warning about the sensitivity of those keys, the exposure of entire message histories, or the legal and device-security consequences. This makes dangerous data-access behavior appear routine and lowers the barrier to mishandling credentials and highly sensitive private content.
The skill is presented as an AI companion, but this file implements forensic extraction and analysis of private chat histories from WeChat, iMessage, and text exports. That mismatch is dangerous because it can cause users or hosting platforms to grant trust and local data access under misleading expectations, enabling covert collection of highly sensitive relationship data.
This module directly accesses decrypted WeChat databases and macOS iMessage chat.db, then extracts message contents and metadata. In the context of a generic companion skill, that capability is overly invasive and creates substantial privacy risk because intimate communications can be harvested and processed without a narrowly justified, clearly disclosed need.
delete_npy_skill performs recursive deletion of the supplied skill directory with shutil.rmtree and then removes corresponding global links or copies. If the path is influenced by untrusted input or base_dir resolution is wrong, this can destroy arbitrary filesystem content under the resolved path with no containment beyond existence checks.
The code creates and removes symlinks or full copies inside global application skill directories under the user's home directory, affecting Claude/OpenClaw-wide behavior beyond this companion skill. Because the slug and target path are not tightly constrained and existing destinations may be deleted first, misuse can overwrite or replace unrelated skills and persist changes globally.
The rollback path overwrites SKILL.md, persona.md, relationship.md, and metadata immediately once invoked, with no interactive confirmation, dry-run mode, or integrity check on the target version. In a repository containing prompt and behavior definitions, an accidental or scripted invocation could silently restore stale or malicious content and alter metadata, making recovery and audit harder.