Back to skill

Security audit

待办清单

Security checks for vulnerabilities and agentic risk

Overview

This is a local to-do helper, but its documented Python implementation can unexpectedly change the saved task file when imported.

Review before installing or using directly. Keep it local-only, but move the example operations behind an explicit main guard or out of the module, use unique or monotonic task IDs, and be careful with delete/complete actions because they permanently modify quick_tasks.json.

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

Import-Time Example Code Mutates Persistent Task Data

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 107-119
Vulnerability Type: Import-time side effects and unauthorized local data modification
Risk Level: Medium

Vulnerable Code

python
todo = QuickTodo()
todo.add("学习Transformer架构", priority="high")
todo.add("写周报", priority="medium", due="2026-05-30")
todo.add("整理书签", priority="low")

# 查看待办
for t in todo.list(filter_done=False):
    pri = {"high": "🔴", "medium": "🟡", "low": "⚪"}[t["priority"]]
    print(f"[{t['id']}] {pri} {t['task']}")

# 标记完成
todo.done(1)

Technical Analysis

The example creates a QuickTodo instance and performs persistent write operations at module scope. No if __name__ == "__main__": guard separates demonstration behavior from the importable class implementation.

The documented command-line examples import the class with statements such as:

bash
python -c "from quick_todo import QuickTodo; QuickTodo().done(1)"

If the supplied implementation is copied into quick_todo.py, Python executes all module-scope statements during the import. Consequently, every import appends three demonstration tasks to quick_tasks.json and marks task ID 1 as completed before the caller's requested operation runs.

This is an insecure coding practice because a read-like module loading operation unexpectedly changes persistent user data. The behavior is deterministic rather than attacker-controlled, but it violates data-integrity expectations and can repeatedly corrupt the task list.

Attack Path

  1. A user copies the documented Python implementation into quick_todo.py.
  2. The user invokes one of the documented commands that imports QuickTodo.
  3. Python evaluates the module-level example code during import.
  4. Three sample tasks are appended to quick_tasks.json.
  5. Task ID 1 is marked complete.
  6. Only after those side effects does Python execute the operation explicitly requested by the us ...[truncated 630 chars]
Remediation
View remediation

Remediation Suggestions

Place all executable demonstration code behind a main-module guard:

python
if __name__ == "__main__":
    todo = QuickTodo()
    # Demonstration operations belong here.

Prefer moving examples entirely into documentation or a separate example script so that the importable module contains only class and function definitions.

Add an automated test that imports quick_todo in a temporary directory and verifies that importing it neither creates nor modifies quick_tasks.json. The command-line interface should also use an explicit entry point whose selected action is the only operation performed.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:48
Finding

Task Identifier Reuse Causes Ambiguous Updates and Unintended Deletion

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 48-76
Vulnerability Type: Non-unique identifier generation and data-integrity failure
Risk Level: Medium

Vulnerable Code

python
item = {
    "id": len(self.tasks) + 1,
    "task": task,
    "priority": priority,
    "done": False,
    "created": datetime.now().isoformat(),
    "due": due,
    "completed_at": None
}
self.tasks.append(item)
self._save()
return item

The identifier is subsequently trusted by the mutation methods:

python
def done(self, task_id: int) -> bool:
    for t in self.tasks:
        if t["id"] == task_id:
            t["done"] = True
            t["completed_at"] = datetime.now().isoformat()
            self._save()
            return True
    return False

def delete(self, task_id: int) -> bool:
    before = len(self.tasks)
    self.tasks = [t for t in self.tasks if t["id"] != task_id]
    if len(self.tasks) < before:
        self._save()
        return True
    return False

Technical Analysis

New task identifiers are calculated from the current number of records rather than from a monotonic counter or a uniqueness-preserving identifier generator. After a non-final task is deleted, the list length can produce an identifier already assigned to another task.

For example, if tasks have IDs 1, 2, and 3, deleting ID 2 leaves two records. The next task receives len(self.tasks) + 1, which is ID 3, even though ID 3 already exists.

The done() method updates the first matching record and returns immediately, making the selected record dependent on list order. The delete() method removes every record with the supplied identifier because its list comprehension excludes all matches. No uniqueness check is performed when records are created or loaded.

Attack Path

  1. Create three tasks, producing identifiers 1, 2, and 3.
  2. Delete task ID 2.
  3. Add another ...[truncated 1003 chars]
Remediation
View remediation

Remediation Suggestions

Replace list-length-based identifiers with identifiers that remain unique after deletion. Suitable approaches include:

  • Generate a UUID for every task with uuid.uuid4().
  • Use max((task["id"] for task in self.tasks), default=0) + 1 for a simple monotonic integer scheme.
  • Persist a separate monotonically increasing counter if identifiers must never be reused.

Validate the loaded JSON data before use and reject or repair duplicate identifiers. Mutation methods should also detect duplicate matches and fail safely rather than silently modifying an arbitrary record or deleting all matches.

Add regression tests covering deletion of a middle record, creation of a replacement record, reloading from disk, and subsequent completion and deletion operations.

Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The activation phrases include very generic terms like “待办”, “任务”, and “todo”, which are likely to appear in normal conversation and can trigger the skill unintentionally. In a skill that can persistently add, modify, or delete local task data, accidental invocation can lead to unintended state changes and user confusion.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill description advertises local JSON persistence and supports deletion/completion operations, but does not clearly warn users that actions will modify a persistent local file. Without explicit disclosure, users may assume the tool is ephemeral and unknowingly cause lasting changes or data loss, especially when combined with broad activation phrases.

Content

No source excerpt is available for this finding.