Back to skill

Security audit

Context Manager

Security checks for vulnerabilities and agentic risk

Overview

This context manager fits its stated purpose, but it persists sensitive personal context and ships a cleanup script that can permanently delete notes without per-file confirmation or recovery.

Install only if you are comfortable with a local skill storing personal notes, external content, and derived summaries of your beliefs and decision patterns. Avoid running the bundled entropy_reduce.py script with --force unless you have reviewed every listed file and made backups; prefer dry-run/report-only use until deletion safeguards are added.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/entropy_reduce.py:249
Finding

Permanent Note Deletion Without Per-File Confirmation or Recovery

Content
View full analysis

Vulnerability Details

File Location: scripts/entropy_reduce.py:249-258
Vulnerability Type: Unsafe destructive file operation
Risk Level: Medium

python
# 删除文件
if not dry_run and force:
    print("🗑️  执行删除...")
    for item in self.stats["to_delete"]:
        try:
            Path(item["path"]).unlink()
            print(f"  删除:{item['path']}")
        except Exception as e:
            print(f"  删除失败 {item['path']}: {e}")
elif not dry_run:
    print("💡 提示:使用 --force 参数执行删除")

Technical Analysis

When the script is invoked with --force, it permanently unlinks every file automatically placed in self.stats["to_delete"]. It does not request per-file approval, validate an approved deletion manifest, create a backup, or move files into a recoverable trash directory.

The deletion candidates are selected through heuristic checks in scripts/entropy_reduce.py:91-123 and scripts/entropy_reduce.py:130-162. A journal can be selected when at least two conditions are met, including a failure to recognize an internal judgment, no connection in connections.json, or a modification time older than 90 days. External notes can be selected merely because the keyword scanner does not recognize an internal judgment and no connection is recorded.

These heuristics can misclassify valuable notes due to unrecognized wording, incomplete connection metadata, stale timestamps, or malformed connection data. This behavior also conflicts with SKILL.md:210 and SKILL.md:362, which state that deletion candidates should be presented to the user for confirmation.

Attack Path

  1. A valuable note is stored under data/journal or data/external.
  2. The note does not contain one of the hardcoded judgment keywords, or its corresponding connection is absent from connections.json.
  3. For a journal note, another condition such as an age greater than 90 days is satisfied.
  4. The user or an agent invokes `p ...[truncated 983 chars]
Remediation
View remediation

Remediation Suggestions

  1. Keep report-only behavior as the default and require explicit approval of each candidate before any destructive operation.
  2. Accept an approved-file manifest generated from the dry-run report and delete only exact entries included in that manifest.
  3. Move candidates to a dedicated quarantine or trash directory rather than calling unlink() immediately.
  4. Record a deletion log containing the original path, quarantine path, reason, timestamp, and approval source.
  5. Resolve and validate every candidate path before acting:
    • Resolve the data root and candidate with Path.resolve().
    • Verify that the candidate remains inside the intended data root.
    • Reject symbolic links and non-regular files.
  6. Add a final interactive confirmation showing the exact number and paths of files to be affected.
  7. Improve classification by parsing structured note metadata rather than relying solely on substring keywords and modification times.
  8. Update the documentation so it precisely matches the implemented confirmation and recovery behavior.

T08 · Insecure Dependencies

Note
Location
clawhub.json:12
Finding

Package Manifest References an Unrelated Source Repository

Content
View full analysis

Vulnerability Details

File Location: clawhub.json:12
Vulnerability Type: Package provenance and supply-chain metadata mismatch
Risk Level: Low

json
"repository": {"type": "git", "url": "https://github.com/lj22503/women-awakening-museum.git"}

Technical Analysis

The package manifest identifies the project as context-manager, but its repository field points to a repository named women-awakening-museum. In contrast, README.md:118 identifies https://github.com/lj22503/context-manager as the project repository.

Repository metadata is commonly used to inspect source code, report security defects, verify release history, and assess updates. The conflicting identifiers prevent reliable provenance verification and may cause reviewers to inspect code unrelated to the distributed artifact.

No malicious dependency or remote payload was identified in the supplied files. The risk arises from inaccurate supply-chain metadata rather than confirmed execution of code from the referenced repository.

Attack Path

  1. A user, package index, or security reviewer treats clawhub.json as the authoritative package metadata.
  2. The repository URL directs them to women-awakening-museum instead of the Context Manager source.
  3. The reviewer audits or trusts the unrelated repository and does not verify the files actually included in the distributed artifact.
  4. Security fixes, release tags, issue reports, or future update decisions may consequently be associated with the wrong source project.

Impact Assessment

This issue does not directly grant filesystem, network, or execution privileges. Its impact is reduced package traceability and unreliable source verification. It can undermine security review and release integrity by causing users and automated systems to associate the package with the wrong upstream source.

Remediation
View remediation

Remediation Suggestions

  1. Replace the manifest repository URL with the exact canonical repository for the distributed Context Manager package.
  2. Keep the repository identifier synchronized across clawhub.json, README.md, release metadata, and the package registry.
  3. Add immutable source provenance, such as a release tag or commit identifier, to published releases.
  4. Ensure that the manifest version matches SKILL.md; the reviewed files currently declare versions 1.1.0 and 1.0.0, respectively.
  5. Review the manifest file list. It currently lists only SKILL.md and evolve-test, while the audited artifact also contains scripts/entropy_reduce.py. Explicitly include all shipped executable files so consumers can verify the complete package contents.
  6. Add a release validation check that rejects publication when repository URLs, versions, or declared package files are inconsistent.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (19)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is presented as a personal context-management tool, but it also instructs the agent to scan broad local data directories, create and modify persistent files, and identify low-value content for cleanup. Even though deletion is described as user-confirmed, this is still a capability expansion beyond simple note-taking and increases the risk of unintended file operations or over-collection of personal data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README explicitly promotes saving external content from platforms like WeChat, Feishu, Xiaohongshu, Yuanbao, and local sources, but it does not warn users about privacy, consent, retention, or the risk of storing sensitive third-party data. In a context-management skill, users are likely to process highly personal notes and copied external material, so the absence of clear data-handling guidance can lead to accidental exposure or inappropriate collection of confidential information.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest describes broad keyword-based activation conditions like journaling, knowledge integration, and cognitive mapping without clear limits. This increases the chance that unrelated user requests containing common phrases will route into a skill that persists personal information and scans stored notes.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill encourages collecting and storing external conversations and personal judgments from sources like WeChat, Feishu, Xiaohongshu, and exported chats. This creates a significant privacy risk because highly sensitive third-party and user data may be centralized, retained, and later processed without clear minimization, consent boundaries, or source-specific safeguards.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The "minimal kernel" flow directs the agent to scan all notes and distill the user's principles, beliefs, decision mechanisms, and priorities into a compact profile. That is effectively the creation of a sensitive psychological and behavioral dossier, which becomes especially dangerous if exposed, reused out of context, or accessed by other tools or agents.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger phrase "帮我保存这个" is so generic that it can easily match ordinary conversation and activate the skill unintentionally. In a skill with Write/Exec permissions and broad data-retention behavior, accidental activation could cause sensitive content to be stored without clear, contemporaneous consent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The phrase "帮我清理低价值内容" is ambiguous and can overlap with normal discussion about organizing information. Because the skill's cleanup flow involves scanning notes and proposing deletions, accidental invocation could expose large amounts of personal data for analysis and lead to destructive follow-on actions.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The observation documents that the skill can trigger on a vague request like '帮我管理一下知识' based largely on a keyword match. In a context-management skill that can store, scan, and organize user data, overly broad triggering can cause the agent to activate without clear user intent, leading to unintended handling of personal information or execution of the wrong workflow.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The document explicitly instructs the agent to create local directories under data/ and to persist user-related content without any warning, consent, or data-handling boundary. In a context-management skill, this can lead to silent creation of persistent storage for personal notes or reflections, increasing privacy and data-retention risk even if the functionality is intended.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The bridge-record design tells the system to write structured records containing external information summaries and the user's internal judgments to disk. Because this skill manages highly personal context, storing these sensitive associations persistently without warning or consent materially raises privacy risk and may expose intimate user data if the filesystem is shared, synced, or later accessed by other tools.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The prompt explicitly encourages accepting an external URL, storing its content under external/, and building connections from it, but provides no warning, consent checkpoint, or constraints on what will be fetched and retained. In a context-management skill that may process personal knowledge bases, this can lead to unintended ingestion of untrusted external content and surprise persistence of third-party or sensitive data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The prompt directs the skill to scan all notes, identify valuable judgments, and generate a new minimal-kernel.md file without warning that broad user data will be processed and a derived artifact will be created. For a personal context manager, this expands access across the user's full note corpus and may expose or repackage sensitive information in a new file without clear user awareness.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document instructs the agent to create local directories and persist user context data without any mention of notifying the user, obtaining consent, or constraining where writes occur. In a context-management skill, this can lead to silent storage of sensitive personal reflections or external content on the filesystem, increasing privacy and data-handling risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The usage examples show saving user-provided text and URLs into local files, but they do not document any warning that content will be stored persistently. Because this skill manages personal context and knowledge, the stored material may include sensitive thoughts, preferences, or browsing interests, making undisclosed persistence more dangerous than in a less personal domain.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The docstring describes the script as identifying and cleaning low-value content, but the implementation can irreversibly unlink files when run without --dry-run and with --force. That mismatch is security-relevant because it can mislead users or integrators into treating the tool as non-destructive, increasing the chance of accidental data loss in a skill that handles personal notes and journals.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This script can permanently delete user journal and external note files based on weak heuristic criteria such as missing subjective keywords, having zero graph connections, or being older than 90 days. In a personal context-management skill, this is dangerous because the behavior exceeds simple organization and can destroy user-authored data that may still be valuable, with only a CLI flag separating review from irreversible deletion.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The natural-language instructions and invocation examples are presented only in Chinese, which effectively forces a specific language for use and onboarding. There is no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking context for a documented reason.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest description is written entirely in Chinese and presents the skill identity in that language, with no indication that language is configurable or intentionally limited to a Chinese-speaking audience. Under the language/locale policy, this can be a natural-language policy issue when a specific language is imposed without user opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

All prompts and expectations in the file are presented in Chinese, which effectively imposes a specific language on users without any opt-in or explanation. Under SQP-3, language or locale constraints should either be optional or clearly documented as justified.

Content

No source excerpt is available for this finding.