Back to skill

Security audit

Privacy Check

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a local privacy scanner, not malware, but it needs review because its reports can mishandle sensitive scan results.

Use this only on paths you intentionally choose, keep generated reports private, avoid --context unless needed, and prefer JSON or CSV over HTML when scanning untrusted files. Before relying on it for privacy review, the publisher should fix HTML escaping and context masking so reports cannot expose or execute sensitive scanned content.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/scanner.py:307
Finding

Stored HTML and Script Injection in Generated Reports

Content
View full analysis
{f['file']}" f"---" f"Error: {f['error']}\n" ) else: ctx = " | ".join(f.get("context", [])) detail_rows += ( f"{f['file']}{f['line']}" f"{f['description']}{f['severity']}" f"{f['match']}{ctx[:60]}\n" ) ``` ### Technical Analysis The HTML report generator directly interpolates dynamic data into HTML markup without applying HTML escaping. The affected values include: - Scanned file paths and filenames - File-reading error messages - Finding descriptions and masked matches - Context extracted from scanned file contents These values may contain attacker-controlled characters such as `<`, `>`, `"`, `'`, and `&`. Consequently, an attacker can inject arbitrary HTML elements or JavaScript event handlers into the generated report. A malicious filename is sufficient to reach the vulnerable output path without enabling context collection. Malicious content inside a scanned file can also reach the HTML report when the user enables the `--context` option. ### Attack Path 1. An attacker provides a file whose filename contains an HTML payload, or whose contents contain a payload such as an element with a JavaScript event handler. 2. The victim scans the attacker-controlled file or directory and selects HTML output: ```bash python3 scripts/scanner.py --dir ./untrusted-data --format html --output report.html ``` 3. For content-based injection, the victim additionally enables `--co ...[truncated 1019 chars]
Remediation
View remediation
alert(1) "> ``` 6. Consider adding a restrictive Content Security Policy to generated reports as defense in depth. Escaping remains mandatory because a policy alone is not a substitute for safe output encoding. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/scanner.py:144
Finding

Context Masking Can Expose Sensitive Data Due to Invalidated Match Offsets

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

整体上,代码与声明的主要用途高度一致:它是一个纯本地的文件/目录敏感信息扫描器,使用Python标准库,无网络访问,支持JSON/CSV/HTML输出、忽略模式、扩展名过滤、脱敏、默认关闭上下文、上下文脱敏和ASCII摘要,这些核心能力都已实现。

但仍存在实质性描述偏差,因此应判定为 mismatch:

  1. 声明称“检测15+种敏感个人信息”,代码中的 PATTERNS 实际为 15 项,包含部分并非严格“个人信息”的类型(如 IP 地址、API 密钥、邮政编码)。数量上不是“15+”而是恰好15项。
  2. 声明中把若干类别表述为较泛化、较可靠的“检测”,但实际实现存在明显过宽或歧义:
    • wechat_id 正则非常宽泛,几乎任何 6-20 位以字母开头的单词样式标识都可能命中,误报风险高;
    • china_passport / hk_passport / tw_passport 的实现较粗糙,未体现强校验,且“港澳台护照”与实际分拆的 hk_passport/tw_passport 并不严格等价;
    • driver_license 使用近似身份证样式的 18位规则,是否准确代表“中国大陆驾驶证号”存疑;
    • bank_card 与 credit_card 存在模式重叠,且依赖Luhn减少误报,但声明未体现这类限制与近似性。
  3. 声明强调“15+种敏感个人信息”,但实际还扫描 API 密钥与 IP 地址,这些更像敏感凭证/技术标识,不完全等同“个人信息”。这虽不构成恶意越界,但说明描述不够准确。

因此,虽然主功能方向一致,描述与代码行为并非完全准确对应,尤其在检测范围和类别定义上存在可观偏差。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill declares capabilities consistent with file read/write behavior but does not explicitly scope or document those permissions. In agent environments, missing tool-scope declarations can cause users or orchestrators to underestimate what the skill may access or modify, increasing the risk of overbroad file exposure or unintended writes.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

Broad trigger phrases can cause the skill to activate in contexts the user did not intend, leading to unnecessary scanning of local files or generation of sensitive reports. In an agent system, ambiguous invocation increases the chance of surprise access to data and accidental privacy exposure, even if the skill itself is local-only.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The package description is written entirely in Chinese, which imposes a specific language on users without indicating any language choice or opt-in. Under the policy for natural-language violations, this is a locale/language constraint that is not documented as optional or region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code's user-facing natural language, CLI help, warnings, and generated reports are written in Chinese, and the HTML report explicitly sets lang="zh-CN". Under the policy, forcing a specific language or locale without user opt-in is a natural-language policy violation unless the locale constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file presents the changelog heading in Chinese ("更新日志") with no indication that the skill is region-specific or that users can choose another language. This can conflict with language/locale policy expectations when a skill appears to impose a specific language by default.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill description and all user-facing documentation are written entirely in Chinese, with no indication that other languages are supported or that the language is a deliberate region-specific constraint. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
75% confidence
Finding

The user-facing description and usage context are presented entirely in Chinese for operational guidance, with no indication that another language is supported or that the user may choose their preferred language. This can violate language/locale policy when a skill implicitly enforces one language without opt-in.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

L388-L389 的提示称“如需关闭请上传时不带 --context 参数”,但该工具是本地命令行脚本,并不存在“上传”这一使用方式。代码实际通过 L437-L454 的 CLI 参数在本地启用上下文,这段提示文案会误导用户对工具运行方式和安全操作的理解。

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.