Back to skill

Security audit

Project Context Manager

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent file-based project manager, but its initializer can write outside the intended project folders if given crafted paths, so it needs review before installation.

Install only if you are comfortable with a file-backed project manager that reads registered project paths and creates project records. Before using the initializer, provide explicit trusted paths, avoid path separators or '..' in project names, do not use overwrite unless you have reviewed the target files, and consider patching the script to enforce containment under the chosen project and workspace roots.

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 (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/init_project.py:43
Finding

Arbitrary Filesystem Write Through Unvalidated Path Components

Content
View full analysis
`', f'`{projects_root}`') if write_text(system_path, content, overwrite=overwrite): created.append(str(system_path)) else: skipped.append(str(system_path)) files = [ '00_恢复入口.md', '00_文档总索引与当前进度.md', '01_项目会话与恢复机制说明.md', '99_关键决策记录.md', 'checkpoints/README.md', 'session-backups/README.md', ] for rel in files: target = project_dir / rel content = read_template(base_dir, rel) content = content.replace('<项目名称>', project_ ...[truncated 3462 chars]
Remediation
View remediation
Path: candidate_component = Path(component) if ( candidate_component.is_absolute() or component in {"", ".", ".."} or len(candidate_component.parts) != 1 ): raise ValueError("Expected one safe path component") root = root.resolve() candidate = (root / candidate_component).resolve() if not candidate.is_relative_to(root): raise ValueError("Destination escapes the configured root") return candidate ``` 4. **Harden overwrite behavior** - Remove the undocumented `overwrite` parameter if it is unnecessary. - Otherwise, require explicit confirmation for every existing file. - Use exclusive creation mode for new files to reduce race conditions. - Create a backup before replacing an existing file. 5. **Defend against symbolic-link writes** - Reject destination files and parent directories that are symbolic links. - Revalidate paths immediately before writing. - Where supported, use operating-system primitives that prevent symlink following. 6. **Improve documentation and tests** - Document the exact accepted format for all path-related field ...[truncated 214 chars]
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (23)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The entire checklist is written in Chinese and provides no indication that users may choose another language or that the skill is specifically limited to a Chinese-speaking context. Under the policy, language constraints should either be optional for the user or clearly documented as justified by a region- or locale-specific purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

README从开头即强调将关键进展、决策、断点固化到文件,并在后文描述初始化结构、保存状态、维护注册表,但未在显著位置清楚提示这会创建或修改本地文件。用户若将其理解为纯对话辅助,可能在不知情下触发持久化写入,影响隐私、工作区整洁性或现有文件内容。

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

“帮我建一个长期项目”“把这个目录纳入项目管理”等接管/初始化触发语义较宽,且README未要求用户显式提供目标路径、作用范围或写入确认。结果是代理可能基于含糊请求在错误目录创建结构、修改现有项目或接管非预期路径,带来误写、污染工作区或覆盖用户文件的风险。

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

恢复项目/进入项目/回到项目等触发短语过于宽泛,容易与普通对话中的自然表达重叠,导致代理在未经明确确认的情况下进入项目恢复流程。该流程随后可能触发读取注册表、扫描路径、读取恢复文件等操作,造成意外的文件系统访问或上下文切换。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill instructs the agent to read and write workspace and project files, and even invokes an initialization script, but it does not declare any explicit tool scope such as permissions or allowed-tools. This creates an authorization ambiguity where the runtime may grant broader file access than users expect, increasing the risk of unintended modification of arbitrary filesystem locations such as the home directory or registered project paths.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file’s natural-language instructions and user-facing trigger examples are all presented in Chinese, which effectively forces a specific language for using or understanding the skill. The policy allows locale constraints only when the skill offers user choice or clearly documents a justified region-specific purpose, neither of which appears here.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documented trigger phrases are broad, generic conversation terms such as '恢复项目' and '进入项目', which can overlap with normal user dialogue and cause the skill to activate recovery logic unexpectedly. In this skill's context, unintended activation can lead to scanning the registry and local project paths, exposing project names, paths, and state without sufficiently explicit user intent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The takeover and new-project examples use very generic phrases that could overlap with ordinary requests about folders or tasks. Because these flows can initialize structures and register directories, overbroad triggers increase the chance of unintended project creation or management actions in the user's workspace.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation describes initializing project structure and registering the project, but it does not clearly warn that this will create or modify files in the user's workspace. In a filesystem-writing skill, lack of write-transparency can lead users to authorize actions without understanding that directories, markdown files, or registry entries will be added or changed.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The restore trigger phrases are broad natural-language expressions like '恢复项目' and '回到项目', which can plausibly appear in ordinary conversation. In an agent skill that performs stateful project switching and file-backed recovery, ambiguous activation can cause the assistant to enter the wrong workflow, reveal project options, or operate on unintended project context without sufficiently explicit user intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The 'solidify/save current breakpoint' functionality implies writing recovery files and snapshots, but the guide does not make the write operations, overwrite behavior, or storage locations explicit. This is risky because users may unintentionally persist sensitive interim content or overwrite prior checkpoints without realizing that durable artifacts are being created.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The recovery trigger phrases are broad enough that normal conversation like '回到项目' or '进入项目' could unintentionally invoke project-recovery behavior. In a context manager skill, this can cause unintended file reads, path validation, or context switching based on ambiguous user input, increasing the risk of accidental disclosure or confusing state transitions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code creates directories and writes template files under user-supplied paths, which can modify existing workspace state. Although overwrite protection exists for existing files, the script itself provides no explicit warning, confirmation prompt, or user-facing disclosure that it will create directories and files before doing so.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file title and all operational instructions are written as a Chinese-only recovery entry, and the required post-recovery outputs are implicitly constrained to this language context. Under the policy, forcing a specific language without user opt-in or a documented regional justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The entire skill file is written as a normative operating instruction in Chinese and does not indicate that language is optional or user-selectable. Under the policy, a skill that imposes a specific language or locale without opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document defines activation phrases and operational instructions entirely in Chinese, including required trigger examples such as “进入项目”“恢复项目”“回到项目”. This creates a language-specific behavior without any opt-in, alternative locale support, or justification that the skill is intended only for Chinese-speaking users.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language instructions and invocation examples are presented only in Chinese, which effectively forces a specific language for users reading or operating the skill. The file does not state that the skill is intentionally Chinese-only or provide an opt-in or alternative language.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The workflow instructs the assistant to read projects-registry.json, scan registered project paths, and inspect recovery files, but it does not explicitly require informing the user that local metadata will be accessed. Even if the data is limited to project metadata, this can still reveal sensitive local filesystem structure and project existence in a way the user may not expect.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

整份技能说明、口令示例和交互描述均默认使用中文,没有说明是否仅支持中文、是否允许用户选择其他语言,或为何需要固定中文。这可能构成语言/locale 层面的默认限制,尤其在面向更广泛用户发布时。

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

Exit and checkpoint phrases such as '退出项目' or '保存当前阶段进展' are broad and may be used conversationally without intending a state transition or persistence operation. In this skill, that ambiguity is less severe than restore or initialization, but it can still cause accidental context exit or unwanted snapshotting of the current workspace state.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

整份说明文档以中文编写,并多处直接规定用户与 assistant 的交互短语为中文,但未说明是否支持其他语言或允许用户选择语言。若该技能面向一般用户,这种默认单一语言约束可能构成语言/地区策略上的自然语言限制。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file is entirely structured with Chinese headings and instructions, which implicitly enforces a specific language/locale for use of the template. Under the policy, forcing a language without user opt-in or documented regional justification is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown template hard-codes Chinese for all headings and placeholders, which can impose a specific language on users without any documented opt-in or alternative. The policy for natural-language violations applies to all file types and flags forced language selection when no user choice is provided.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.