Back to skill

Security audit

Smart Memory

Security checks for vulnerabilities and agentic risk

Overview

This is a mostly local memory skill, but it has a real path-scoping flaw that can expose local files during recall after migration and its documentation overstates or under-explains several sensitive behaviors.

Review before installing. Use it only with trusted memory data, avoid migrating untrusted v2 directories or manually edited databases, and do not enable scheduled maintenance until path containment, dependency pinning, and clear privacy/retention controls 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

Error
Location
scripts/migrate.py:253
Finding

Arbitrary Local File Read Through Unvalidated Migrated Manifest Paths

Content
View full analysis
bool: """Register a document.""" if not checksum: checksum = "" now = utcnow_str() self._conn.execute( """INSERT OR REPLACE INTO manifest (doc_id, rel_path, checksum, created_at, updated_at) VALUES (?, ?, ?, ?, ?)""", (doc_id, file_path, checksum, now, now), ) self._conn.commit() return True ``` Recall later constructs a path directly from the stored value, validates only that the same value exists in the manifest, and then reads the resulting file: ```python for doc_rel in docs: doc_path = os.path.join(base_dir, doc_rel) entry = manifest_store.get_by_path(doc_rel) if entry is None: checksum_statuses.append({ "doc": doc_rel, "status": "not_registered", }) continue if not os.path.isfile(doc_path): checksum_statuses.append({ "doc": doc_rel, ...[truncated 3776 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/requirements.txt:1
Finding

Unpinned Third-Party Dependencies Create a Non-Reproducible Supply-Chain Boundary

Content
View full analysis
=0.42.1 pyyaml>=6.0 ``` The installation documentation directs users to install these requirements: ```text pip install -r requirements.txt ``` The main README also contradictorily describes the project as having zero external dependencies. This can prevent users from recognizing the actual supply-chain trust boundary. ### Technical Analysis Lower-bound-only version constraints do not provide reproducible dependency resolution. An installation performed later can retrieve package versions that were not part of the audited project and may have different behavior. No evidence was found that `jieba` or `pyyaml` is currently malicious, misspelled, or retrieved from an explicitly unsafe repository. The issue is that the Skill delegates trust to unrestricted future releases without: - Exact version pins - A reviewed lock file - Package hashes - A documented package index policy Python packages may execute code during installation and are imported into the Skill process at runtime. A compromised future release satisfying the lower bound could therefore execute with the privileges of the user installing or invoking the Skill. ### Attack Path 1. A future dependency release satisfying `jieba>=0.42.1` or `pyyaml>=6.0` becomes compromised, malicious, or otherwise unsafe. 2. A user follows the documented installation command. 3. The package resolver selects the newer release because no upper bound, exact pin, lock file, or hash prevents it. 4. Malicious code executes during package installation or when the dependency is imported. 5. That code receives the filesys ...[truncated 675 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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (80)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a comprehensive long-term memory management system with advanced retrieval, extraction, deduplication, decay, analytics, and synthesis features. The supplied code chunk only provides a persistence/CRUD layer for cue cards in SQLite, plus simple status management and tag search. While cue storage is plausibly a supporting component of such a system, this chunk does not actually implement most of the headline capabilities in the description. The status flow does partially align with a GC/state-machine concept, but only at a basic card-status level. Therefore the description materially overstates what this code chunk does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

该代码片段的核心职责是管理 manifest 表中的文档元数据,并对文件进行 SHA256 完整性校验。这更像是文档索引/清单基础设施,而不是声明中描述的长期记忆管理、语义召回和知识卡片系统。虽然它可能是更大系统中的底层组件,但就所给代码本身而言,其实际行为与声明的主要功能存在明显差异。未发现额外敏感或越权行为,但主目的明显不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

描述强调的是完整的长期记忆管理与语义处理系统能力,但给出的代码块仅实现离线数据迁移与维护操作。它读取 v2 目录中的 cues.jsonl、manifest.yaml、docs/,写入 v3 SQLite 表,复制文档,做数量与抽样校验,并支持回滚删除数据。这与描述中的核心能力(语义召回、LLM 收割、去重、衰减、聚类、报告等)不一致,且代码的主要目的明显是版本迁移而非记忆管理本身。因此应判定为描述与实际行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a comprehensive long-term memory system with retrieval, knowledge extraction, deduplication, decay modeling, GC workflow, reporting, and relationship/clustering features. The supplied code chunk is much narrower: it only manages cue records in SQLite. It supports storing fields like importance/retention and includes a limited status workflow for stale/deleted handling, which partially aligns with a GC/state-machine concept. However, the major advertised behaviors—TF-IDF recall, LLM harvesting, semantic deduplication, signal/maturity analysis, and cross-card association/clustering—are absent from this code. Therefore the description materially overstates what this code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

该代码块的核心用途是维护文档清单(manifest)及文件校验信息,而不是描述中的“分层长期记忆管理系统”。从函数上看,仅有 SQLite 表的 CRUD、SHA256 计算、全量校验和扫描目录重建,属于底层文档注册/完整性管理能力。声明中的主要能力——语义记忆召回、知识抽取、去重、衰减、GC、分析报告、关联聚类——在此代码中完全不存在。因此描述与实际行为存在明显且实质性的偏差。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

声明描述的是完整的长期记忆管理/检索/分析系统,而代码片段实际仅实现了一个迁移脚本。它确实处理“记忆”相关数据结构(cues、signals、manifest、docs),但功能集中在格式转换、状态映射、文档复制、校验和回滚,不包含描述中的核心智能能力,如语义召回、LLM 抽取、去重、聚类、报告生成等。虽然迁移工具可能属于该系统的一部分,但就该代码块本身而言,其主要目的与声明的主要功能明显不一致,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The rollback method issues DELETE statements against multiple tables and commits them, clearing migrated data. While the docstring mentions that tables are emptied, there is no confirmation prompt, safeguard, or visible runtime warning before performing this irreversible database operation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README presents automatic recall and post-task persistence up front without an equally prominent warning that conversations, summaries, and derived knowledge may be durably written to local storage. Users may unknowingly expose sensitive prompts, internal project details, or personal data to long-lived retention.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The 'conversation harvesting' feature implies extracting reusable knowledge from dialogue text, but the documentation does not warn that harvested content may include secrets, credentials, proprietary code, or personal information. Because the feature is designed to transform free-form dialogue into stored artifacts, the privacy risk is elevated in this skill's context.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The README asserts the skill is fully offline and limited to Python standard library use, but later documents shell-based maintenance and AI-driven autonomous maintenance workflows. This creates a trust and deployment mismatch: users may grant the skill broader autonomy or schedule unattended execution under false assumptions about scope and behavior.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

The documented harvest --auto-confirm mode removes a human review step from converting dialogue-derived content into persisted knowledge. In a memory skill, that increases the risk of automatically storing inaccurate, sensitive, or adversarially injected content, especially when used in unattended or scripted contexts.

Content

Scanner excerpt · README.md (reported line 54)May include surrounding context.

md
| `build-index` | 全量重建 TF-IDF 索引 |
| `migrate` | 从 self-learning-skills 迁移历史数据 |
| `signal --kind card_recalled --card-id xxx --context "上下文"` | 记录记忆使用信号 |
| `harvest --text "对话摘要" --auto-confirm` | 对话启发式收割 |
| `session --summary "任务摘要"` | 创建会话快照 |
| `session-list --days 7` | 列出历史会话快照 |
| `dedup --threshold 0.45` | 语义去重检测 |

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The documentation expands a memory skill into autonomous anomaly detection, root-cause diagnosis, graded repair, and experience deposition, which materially exceeds the stated purpose of long-term memory management. In an agent environment, such broad self-directed maintenance can authorize unexpected actions on local code or data, increasing the risk of unintended modification or abuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The scheduled maintenance section encourages unattended overnight processing and writing, but does not clearly warn that this can continuously read prior dialogue-derived data and create or modify stored artifacts without active user review. Unattended processing increases the chance that sensitive or low-quality content is persisted and propagated over time.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises commands that can read environment state, write to files, access a SQLite database, and invoke shell/Python commands, but the manifest declares no explicit tool scope or permission boundaries. In an agent setting, undocumented capability breadth increases the chance that the skill is invoked with more authority than users expect, especially because it persists data and exposes an env-snapshot operation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger keywords are broad everyday terms like 'memory', 'remember', and 'knowledge base', which can cause accidental invocation in unrelated contexts. For a skill that persists information and may capture environment or sensitive task details, over-broad triggering increases the chance of unintended data storage or execution of state-changing commands.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill description advertises persistent storage and includes an env-snapshot command, yet provides no warning that sensitive user data or environment secrets may be stored locally in SQLite. In a memory-oriented skill, lack of disclosure materially increases privacy risk because users may provide credentials, personal notes, or proprietary content under the assumption that the interaction is ephemeral.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

An env-snapshot command is high-risk because environment data often contains secrets such as API keys, tokens, hostnames, and internal configuration. In a long-term memory skill, capturing and potentially persisting such data is more dangerous because it can store sensitive material beyond the immediate task context and broaden later exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README lists gc and delete operations without clearly warning that they can remove or irreversibly purge stored memory records. Because this skill is a long-term memory system, users may execute destructive lifecycle commands assuming they are routine maintenance, leading to accidental data loss or loss of auditability.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README advertises an env-snapshot command to collect a system environment fingerprint but provides no warning about what data is collected, where it is stored, or whether it may include sensitive host metadata. In a memory-management skill that persists and correlates information over time, undocumented environment collection increases privacy and security risk because users may run it without informed consent or retention controls.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file is written as a review/report template entirely in Chinese, including headings and status fields, with no indication that the user may choose another language. Under the policy rule, natural-language constraints that effectively force a specific language without opt-in should be flagged unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The schema persistently stores host environment metadata such as OS, Python version, shell, and git information in env_snapshots, which is broader than a typical memory-management function and is not clearly disclosed by the skill description. Collecting and retaining environment fingerprints can expose sensitive host details, aid later targeting, and create unnecessary privacy and reconnaissance risk if the database is accessed or exfiltrated.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Provisioning persistent storage for environment metadata unrelated to the core long-term memory capability expands the skill's data collection scope and creates a durable inventory of host characteristics. Even without immediate exfiltration code in this file, such stored metadata can later be queried by other components, increasing the blast radius of compromise and violating least-privilege data handling.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The gc() method performs irreversible deletion of cue records and cleanup of orphan env_snapshots, and cleanup_signals() permanently deletes old signal records. Although the docstrings describe the behavior, there is no confirmation prompt, print/log disclosure, or other user-facing warning in this code path itself before destructive actions occur.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

The script invokes harvesting with --auto-confirm, causing recent conversations to be processed into long-term memory without an interactive approval step. In a memory-management skill, that increases the risk of silently storing sensitive, irrelevant, or prompt-injected content, especially when run from cron and combined with later automated write stages.

Content

Scanner excerpt · scripts/maintenance.sh (reported line 18)May include surrounding context.

sh
# 1. 对话收割:从最近对话提取知识卡片
echo "[1/6] 对话收割..."
if [ "$DRY_RUN" = true ]; then
    python "$MEMORY_PY" harvest --days 1 --auto-confirm --dry-run
else
    python "$MEMORY_PY" harvest --days 1 --auto-confirm
fi

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

This branch also runs harvesting with --auto-confirm, so both execution paths bypass human review for memory creation. Because the skill is specifically designed to retain and synthesize conversational data, the context makes autonomous acceptance more sensitive than in ordinary batch processing: it can amplify retention of sensitive or adversarial content into persistent knowledge artifacts.

Content

Scanner excerpt · scripts/maintenance.sh (reported line 20)May include surrounding context.

sh
if [ "$DRY_RUN" = true ]; then
    python "$MEMORY_PY" harvest --days 1 --auto-confirm --dry-run
else
    python "$MEMORY_PY" harvest --days 1 --auto-confirm
fi

# 2. 语义去重:检测高度相似的记忆对

Static analysis

No suspicious patterns detected.