Back to skill

Security audit

文件快速扫描 - 减少token消耗

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly behaves like a local project indexer, but it needs Review because it can automatically scan and write project indexes for future agent context and can include untrusted file text there.

Review before installing. Use this only on projects you are comfortable indexing locally, avoid startup auto-refresh on untrusted repositories, inspect generated `.anatomy.md` before letting an agent rely on it, and do not use `--scan-downloads` unless you want recent personal Downloads metadata included. I found no evidence of network exfiltration, credential harvesting, destructive actions, or OS-level persistence.

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
Findings (1)

T01 · Skill Instruction Hijacking

Warning
Location
scripts/anatomy_scan.py:45
Finding

Untrusted Project Content Is Injected into Agent Session Context

Content
View full analysis
str: """Extract a one-line description from file content.""" try: with open(filepath, 'r', encoding='utf-8', errors='ignore') as f: lines = [] for i, line in enumerate(f): if i >= 30: # only scan first 30 lines break lines.append(line) except (OSError, UnicodeDecodeError): return '' text = ''.join(lines) desc = '' # Python docstring if filepath.suffix == '.py': for marker in ('"""', "'''"): idx = text.find(marker) if idx != -1: end = text.find(marker, idx + 3) if end != -1: desc = text[idx+3:end].strip().split('\n')[0] break # JS/TS first comment or export elif filepath.suffix in ('.js', '.ts', '.jsx', '.tsx', '.mjs'): for line in lines: stripped = line.strip() if stripped.startswith('//'): desc = stripped.lstrip('/ ').strip() break elif stripped.startswith('/**'): desc = stripped.lstrip('/* ').rstrip('* /').strip() break elif stripped.startswith('export'): desc = stripped[:max_chars] break # Markdown heading elif filepath.suffix in ('.md', '.mdx'): for line in lines: if line.startswith('#'): desc = line.lstrip('# ').strip() break # Shell script comment elif filepath. ...[truncated 3985 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (12)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If the static finding is accurate, the documented purpose materially understates behavior by omitting unrelated scanning, structured data extraction, and report writing outside a simple project anatomy use case. Behavior-description mismatch is dangerous because users may authorize the skill for low-risk indexing while it actually processes unrelated files (including ~/Downloads) and extracts potentially sensitive business data.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill advertises shell, file-read, and file-write behavior but does not declare any explicit tool scope or permissions boundaries. In practice, this makes a startup-integrated skill more dangerous because it can read project files and write .anatomy.md automatically without clear least-privilege constraints or user visibility.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly describes automatic session-startup scanning and writing .anatomy.md, but does not prominently warn that this modifies the filesystem. Automatic writes at startup are risky because they can change repositories, create noisy diffs, overwrite expected state, or expose indexed file metadata without the user's informed consent.

Content

No source excerpt is available for this finding.

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/anatomy_inject.py (reported line 56)May include surrounding context.

python
'--format', args.format,
            '--incremental',
        ]
        result = subprocess.run(cmd, capture_output=True, text=True)
        if not args.quiet and result.stdout:
            print(result.stdout, file=sys.stderr)
        if result.returncode != 0:

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script's actual behavior is narrowly tailored to reimbursement artifacts and extracts sensitive expense metadata from filenames, which materially differs from the declared 'general file quick scan/project anatomy' purpose. This kind of scope mismatch is dangerous because users may grant or run it expecting a generic indexer while it instead performs domain-specific processing of financial records, increasing the chance of unanticipated access to private data.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The optional Downloads scan reaches outside the user-supplied expense directory into ~/Downloads, which is unrelated to the stated project/file-scan function and broadens data access to a common location for sensitive personal files. Even though it is gated by a flag, it can expose filenames, timestamps, and sizes for unrelated documents, creating an unnecessary privacy and scope-expansion risk.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The trigger phrase at line 23 uses common project-scanning terminology that is likely to overlap with normal user requests. Overly broad triggers can cause unintentional activation, pulling the agent into this skill in contexts where the user did not explicitly intend it, which can lead to unnecessary file enumeration or disclosure of project structure.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The trigger phrase at line 25 is ambiguous and not sufficiently specific to this skill's function. Ambiguous activation increases the chance the skill will run unexpectedly, which is especially risky here because the skill is designed to inspect project files and summarize their contents without opening them explicitly in the main flow.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The manifest emphasizes quickly scanning files so the AI can know contents without repeated reads, which suggests read-oriented indexing behavior. This implementation persists a new '.anatomy.md' report (or arbitrary output path), adding a file-creation side effect not conveyed in the manifest description.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script writes to either a user-specified path or a default .anatomy.md without checking for existing files or warning before overwrite. This can lead to accidental loss of local data or clobbering of prior reports, especially when run repeatedly or pointed at an existing output path.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
75% confidence
Finding

The summary and description are presented in Chinese, and the metadata includes a Chinese-specific display name, without indicating that language choice is optional or user-selectable. This can constitute a language/locale policy concern when the skill is exposed to users who may not have opted into Chinese-language content.

Content

No source excerpt is available for this finding.