Back to skill

Security audit

Npy

Security checks for vulnerabilities and agentic risk

Overview

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.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
Findings (6)

T01 · Skill Instruction Hijacking

Error
Location
tools/skill_writer.py:224
Finding

Persistent User-Controlled Instructions Override Generated Skill Constraints

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
tools/skill_writer.py:138
Finding

Unvalidated Slugs Permit Path Traversal, Recursive Deletion, and Arbitrary File Placement

Content
View full analysis
bool: if not skill_dir.exists(): return False meta_path = skill_dir / "meta.json" slug = skill_dir.name if meta_path.exists(): try: meta = json.loads(meta_path.read_text(encoding="utf-8")) slug = meta.get("slug", slug) except Exception: pass shutil.rmtree(skill_dir) if cleanup_global_links: removed = remove_global_skill_link(slug) return True ``` Global link creation also deletes any existing non-symlink destination: ```python global_link = global_dir / slug if global_link.exists() or global_link.is_symlink(): try: if global_link.is_symlink(): global_link.unlink() else: shutil.rmtree(global_link) except OSError as e: errors.append(f"无法删除已存在的 {global_link}: {e}") continue global_link.symlink_to(skill_dir) ``` The CLI passes the unvalidated value directly into these operations: ```python slug = args.slug or slugify(meta.get("name", "npy")) skill_dir = create_npy_ ...[truncated 2118 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
tools/version_manager.py:81
Finding

Version and Skill Path Traversal Allows Out-of-Bound Rollback Reads and Writes

Content
View full analysis
bool: versions_dir = skill_dir / "versions" target_dir = versions_dir / target_version if not target_dir.exists(): return False meta_path = skill_dir / "meta.json" meta = json.loads(meta_path.read_text(encoding="utf-8")) current_version = meta.get("version", "v1") backup_dir = versions_dir / f"{current_version}_before_rollback" backup_dir.mkdir(parents=True, exist_ok=True) for fname in ("SKILL.md", "persona.md", "relationship.md", "meta.json"): src = skill_dir / fname if src.exists(): shutil.copy2(src, backup_dir / fname) for fname in ("SKILL.md", "persona.md", "relationship.md"): src = target_dir / fname dst = skill_dir / fname if src.exists(): shutil.copy2(src, dst) ``` The CLI also accepts an unrestricted slug: ```python if not args.slug: print("错误:需要 --slug 参数", file=sys.stderr) sys.exit(1) skill_dir = base_dir / args.slug if not skill_dir.exists(): print(f"错误:找不到 Skill 目录 {skill_dir}", file=sys.stderr) sys.exit(1) ``` Rollback receives the version without validation: ```python if not args.version: print("错误:rollback 需要 --version 参数", file=sys.stderr) sys.exit(1) success = rollback_version(skill_dir, args.version) ``` ### Technical Analysis Both `args.slug` and `target_version` are interpreted as path components without validation or containment checks. A traversing slug can select an arbitrary directory as `skill_dir`. A traversing version can cause `target_dir` to resolve outside the selected Skill's `versions` directory. The rollback routine copies files named `SKILL.md`, `persona.md`, and `relationship.md` from the out-of-b ...[truncated 1252 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
tools/wechat_decryptor.py:250
Finding

WeChat Key Extraction Exposes Credentials Through Process Memory, Keychain, Temporary Files, and Logs

Content
View full analysis
str | None: try: import pymem import pymem.process except ImportError: print("请先安装依赖:pip install pymem", file=sys.stderr) sys.exit(1) pm = pymem.Pymem(pid) key_candidates = [] try: wechat_module = pymem.process.module_from_name(pm.process_handle, "WeChatWin.dll") module_base = wechat_module.lpBaseOfDll module_size = wechat_module.SizeOfImage chunk_size = 0x100000 phone_pattern = b"iphone\x00" offset = 0 while offset < module_size: to_read = min(chunk_size, module_size - offset) try: chunk = pm.read_bytes(module_base + offset, to_read) except Exception: offset += chunk_size continue ``` The macOS implementation writes a broad process-memory range to a predictable file: ```python result = subprocess.run( ["lldb", "-p", str(pid), "-o", "memory read --force --outfile /tmp/wechat_mem.bin 0x0 0x100000000", "-o", "quit"], capture_output=True, text=True, timeout=30, ) ``` It also queries the macOS Keychain: ```python result = subprocess.run( ["security", "find-generic-password", "-s", "com.tencent.xinWeChat", "-w"], capture_output=True, text=True, timeout=5, ) if result.returncode == 0 and result.stdout.strip(): return result.stdout.strip() ``` The recovered key is printed in full: ```python print(f"密钥提取成功:{key_hex}") if args.find_key_only: print(f"\n密钥(hex):{key_hex}") print("使用方法:python wechat_decryptor.py --key <上面的密钥> --db-dir <目录> --output ./decrypted/") return ``` ### Technical Analysis The too ...[truncated 1909 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
tools/chat_parser.py:602
Finding

Decrypted Databases and Private Messages Are Persisted as Unprotected Plaintext

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Security-Sensitive Dependencies Are Unpinned and Incompletely Declared

Content
View full analysis
=0.49.0 ``` Additional packages are installed through unpinned documentation commands: ```bash pip3 install -r requirements.txt pip install pycryptodome psutil pymem pypinyin ``` The decryptor repeats the unpinned installation guidance: ```text pip install pycryptodome psutil Windows extra: pip install pymem ``` ### Technical Analysis The project does not lock exact dependency versions or package hashes. Security-sensitive packages used for cryptography, process enumeration, and process-memory access are omitted from `requirements.txt` and installed ad hoc from the package index. As a result, two users installing the same project at different times may execute different dependency code. The build cannot be reproduced or reliably reviewed, and a compromised future release could execute with the same privileges granted to the decryptor. No evidence of a currently malicious dependency was identified; the finding concerns unsafe dependency acquisition and integrity controls. ### Attack Path 1. A user follows the documented installation command. 2. The package manager resolves the latest versions satisfying the open-ended constraints. 3. Package source distributions or installation hooks execute during installation. 4. A compromised or unexpectedly changed dependency runs under the user's account. 5. If the user later runs the memory extractor with elevated privileges, dependency code receives that elevated execution context. ### Impact Assessment The potential scope includes arbitrary code execution under the account performing installation or running the tool. Because `pymem` and `psutil` participate in process ...[truncated 233 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (90)

Ssd 3

Critical
Category
Not specified by scanner
Confidence
100% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Critical
Category
Not specified by scanner
Confidence
99% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Critical
Category
Not specified by scanner
Confidence
99% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
85% confidence
Finding

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.

Content

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

bash
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

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

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.

Content

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

用户确认后:

bash
rm -rf .claude/skills/{slug}
# 同时删除全局链接
rm -f ~/.claude/skills/{slug}
rm -f ~/.openclaw/workspace/skills/{slug}

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
93% confidence
Finding

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.

Content

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

bash
rm -rf .claude/skills/{slug}
# 同时删除全局链接
rm -f ~/.claude/skills/{slug}
rm -f ~/.openclaw/workspace/skills/{slug}

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
92% confidence
Finding

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.

Content

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

rm -rf .claude/skills/{slug}

同时删除全局链接

rm -f ~/.claude/skills/{slug} rm -f ~/.openclaw/workspace/skills/{slug}

text

输出:

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

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.

Content

No source excerpt is available for this finding.