Back to skill

Security audit

微信附件整理

Security checks for vulnerabilities and agentic risk

Overview

This attachment organizer needs review because unsafe rules or file lists can redirect writes outside your chosen folder and overwrite files.

Prefer a version with enforced destination containment and overwrite protection. Otherwise, restrict execution to a sandbox with only the intended files accessible, inspect rules and manifests, and back up existing output files. Select the intended accounts and explicitly approve any knowledge-base upload and destination space.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (8)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The reported unvalidated output paths undermine the explicit destination-only write guarantee: absolute paths or parent traversal in custom folders or manifest names can redirect writes outside the approved directory. Attachment XOR decoding is explicitly described in the workflow and is distinct from decrypting chat databases, so that portion of the finding is not independently evidence of malicious behavior.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/organize.py (reported line 99)May include surrounding context.

python
for rule in rules:
        pat = (rule.get("pattern") or "").lower()
        if pat in name or pat == (real_ext or "").lower() or pat in entry["src"].lower():
            return rule.get("folder")
    return None

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Tainted flow: 'dst' from open (line 240, file read) → open (file write)

Medium
Category
Data Flow
Confidence
99% confidence
Finding

The decode function opens its destination for truncating writes without checking containment. Its caller constructs that destination from unvalidated custom-rule folders and manifest-derived names, allowing crafted input to overwrite files outside the approved destination when --apply is used.

Content

Scanner excerpt · scripts/organize.py (reported line 49)May include surrounding context.

python
with open(src, "rb") as f:
        data = f.read()
    dec = bytes(b ^ key for b in data)
    with open(dst, "wb") as f:
        f.write(dec)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/organize.py (reported line 71)May include surrounding context.

python
return ""
        if ext == "pdf":
            try:
                r = subprocess.run(["pdftotext", src, "-"], capture_output=True,
                                   text=True, timeout=30)
                if r.returncode == 0:
                    return r.stdout

The documented destination-only write boundary is not enforced.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

Joining args.dest with rel_dir and out_name does not enforce containment: absolute components override earlier components, and parent traversal can escape the destination. Existing symlinks can also redirect writes, making the documented destination-only guarantee ineffective for malicious rules, manifests, or destination contents.

Content

No source excerpt is available for this finding.

Tainted flow: 'target' from open (line 237, file read) → shutil.copy2 (file write)

Medium
Category
Data Flow
Confidence
99% confidence
Finding

shutil.copy2 receives a target assembled from unvalidated manifest names and custom-rule folders. Absolute paths or traversal can escape the destination and overwrite files accessible to the agent; dry-run and confirmation reduce exposure but do not enforce the promised boundary.

Content

Scanner excerpt · scripts/organize.py (reported line 242)May include surrounding context.

python
if e.get("dat_key") is not None:
            decode_dat(e["src"], e["dat_key"], target)
        else:
            shutil.copy2(e["src"], target)
        if e.get("sha256"):
            done.add(e["sha256"])
        copied += 1

The workflow directs configuration writes outside the promised user-selected destination.

Low
Category
Excessive Agency
Confidence
96% confidence
Finding

The workflow instructs the agent to persist config.json inside the skill directory despite promising writes only to the user-selected destination. This is a limited write-boundary violation that can modify shared skill state or persist customer-specific paths outside the approved location; it does not itself establish code execution.

Content

No source excerpt is available for this finding.