Back to skill

Security audit

技能使用记录与统计(Nicki)

Security checks for vulnerabilities and agentic risk

Overview

This skill is a local usage tracker, but it asks for automatic session-history scanning and persistent logging without clear user control.

Review before installing. This skill stores local skill-usage records and its scripts appear limited, but the instructions ask the agent to periodically scan session history and alter future responses. Only install if you are comfortable with automatic usage tracking, and prefer a version with explicit opt-in, narrow event-based logging, and deletion/disable controls.

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
SKILL.md:10
Finding

Automatic Session-History Scanning and Response Manipulation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 10-11 and 27-28
Vulnerability Type: T01: Skill Instruction Hijacking
Risk Level: Medium

Relevant skill instructions, translated into English:

markdown
- **Automatic logging**: Automatically log every skill invocation without user interaction.
- **Manual reporting**: Proactively tell the user, "The XXX skill was just invoked."

**Automatic logging (primary)**: Use HEARTBEAT to scan session history every two hours and backfill records.
**Proactive reporting**: After every skill invocation, notify the user at the end of the response.

Technical Analysis

The skill text instructs the agent to adopt persistent behaviors beyond an explicitly requested statistics query:

  1. Periodically scan session history through a HEARTBEAT process.
  2. Infer and backfill skill invocations without per-invocation user approval.
  3. Modify subsequent responses by appending a mandatory skill-usage notice.

These behaviors are instruction-driven rather than implemented by the supplied Python scripts. scripts/log.py only accepts a skill name and optional note and writes them to a local JSON file, while scripts/query.py only reads and aggregates that file. Neither script implements session scanning, HEARTBEAT registration, or automatic response modification.

Consequently, loading the skill may alter the agent's ongoing session behavior and cause access to conversational history beyond what is required for a local usage counter. The mandatory response suffix also interferes with ordinary response generation and can disclose internal skill usage to conversation participants.

Attack Path

  1. The skill is installed or loaded by an agent.
  2. The agent interprets SKILL.md as operational instructions.
  3. The agent adopts the requested HEARTBEAT behavior and periodically examines accessible session history.
  4. Skill invocations inferred from that history ar ...[truncated 923 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the instruction to scan session history automatically or through HEARTBEAT.
  2. Require explicit user consent before enabling usage tracking, and provide a clear method to disable it.
  3. Log only invocations explicitly passed to scripts/log.py; do not infer activity from historical conversations.
  4. Remove mandatory response suffixes. Usage disclosures should only be produced when requested by the user.
  5. Minimize stored information by making the note field optional and avoiding conversation content or sensitive user data.
  6. Define retention and deletion controls for data/usage.json, including a command to clear stored records.
  7. If automation is genuinely required, implement it as transparent, reviewable code with a narrowly scoped event interface rather than relying on broad natural-language instructions to inspect session history.
  8. Document exactly what data is collected, where it is stored, how long it is retained, and which agent permissions are required.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

该代码片段的行为与描述存在明显差异。描述强调的是一个无需用户操作的自动追踪与多时间维度统计分析技能;而实际代码只是在被显式执行时,把传入的技能名、时间戳和备注写入本地 usage.json 文件。它没有展示任何自动触发/全局监听逻辑,也没有按日、周、月、季、年进行聚合统计、查询或生成报告的实现。代码本身没有发现明显越权或额外敏感能力,但其主要功能范围显著小于声明,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

描述中的核心能力包含两部分:1)自动追踪/记录所有技能调用;2)基于记录生成多时间维度统计报告。实际代码只覆盖了第2部分中的查询与报表展示:它读取本地 JSON 文件中的 records,按 called_at 时间过滤,并按 skill 聚合统计次数。虽然时间维度(日/周/月/季/年)与描述基本一致,但最关键的“自动追踪所有技能调用”能力完全未在该代码中体现,也没有任何写入 usage.json、挂钩技能调用事件或自动采集的实现。因此,描述对实际行为有实质性夸大,属于能力不匹配。

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill advertises automatic tracking and persistent storage of usage records but does not present a clear warning or consent mechanism for session-history monitoring and data retention. This is dangerous because users may unknowingly have behavioral metadata collected and stored over time, creating privacy, compliance, and trust risks.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
77% confidence
Finding

The skill describes persistent usage logging to a local JSON file and invocation of helper scripts, but it does not declare any tool scope or permissions boundaries. In a skill that writes telemetry-like data, missing explicit scope increases the risk of undocumented file writes and makes it harder for reviewers and users to understand what storage access is required.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Broad language such as 'automatic recording' and 'no user operation required' without explicit trigger boundaries can cause the skill to activate or collect data in contexts the user did not meaningfully consent to. In this skill, that matters because the documented purpose involves continuous tracking of skill usage and persistent storage.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill file presents the description and instructions entirely in Chinese, with no indication that language choice is optional or that the skill is intended only for a Chinese-speaking or region-specific audience. This can violate language/locale policy when a specific language is imposed without user opt-in.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Describing a HEARTBEAT process that scans session history every two hours is an ambiguous automatic trigger with unclear limits. That can lead to unintended collection of interaction metadata or repeated background processing outside the user's expectations, especially because the scan scope and filtering rules are not defined.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Automatic scanning of session history implies collection of interaction-derived data beyond an explicit per-request action. Even if the intended data is only skill invocation metadata, the mechanism is broad enough to touch user-provided context and therefore increases privacy exposure and the chance of over-collection.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code includes user-facing natural-language strings only in Chinese, such as the module description, success message, and CLI usage text. That imposes a specific language on users without offering a language choice or documenting a justified region-specific constraint, which matches the locale-policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script hardcodes Chinese language strings for its description, time-dimension inputs, date labels, and report output, which enforces a specific locale for all users. There is no option to select another language or any documented justification that this is intended only for a Chinese-specific environment.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest and feature list describe the skill as automatic tracking and reporting without user action, but the documentation also states it should manually tell the user after each invocation. That is a direct intent-level contradiction between passive background logging and visible per-call user messaging.

Content

No source excerpt is available for this finding.