Back to skill

Security audit

ima.plus-skill-v1.0.12

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its IMA automation purpose, but it tells users to expose API keys in chat and includes irreversible account-changing scripts without script-level confirmation gates.

Review this skill carefully before installing. Use an official key-generation or secret-manager flow instead of asking any assistant to print API keys in chat, keep credentials scoped and rotated, and use dry-run or manual review before exports, permission changes, tag changes, joins, or note appends.

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

Warning
Location
knowledge-base/scripts/tag_delete.cjs:18
Finding

Destructive API operations lack code-enforced confirmation gates

Content
View full analysis

Vulnerability Details

File Locations:

  • knowledge-base/scripts/tag_delete.cjs:18-24
  • knowledge-base/scripts/tag_rename.cjs:18-25
  • knowledge-base/scripts/join_knowledge.cjs:18-33
  • knowledge-base/scripts/update_knowledge_base_permission.cjs:22-43
  • notes/scripts/notes_append.cjs:46-66
  • notes/scripts/note-images.cjs:271-275

Vulnerability Type: Destructive authenticated operations without executable confirmation enforcement
Risk Level: Medium

Technical Analysis

SKILL.md:67 requires explicit user confirmation before deleting or merging tags, joining a public knowledge base, changing knowledge-base permissions, or appending to an existing note. However, the executable scripts do not require a confirmation token, mandatory preview, or interactive confirmation before issuing the authenticated API requests.

For example, tag deletion proceeds directly from command-line arguments to the destructive API call:

js
const args = parseArgs(process.argv);
await __withRetry(args, async () => {
  if (!args['tag-name']) { console.error('[error] 缺少必需参数 --tag-name <标签名>'); process.exit(1); }
  const kbId = await resolveKbId(args);
  const body = { knowledge_base_id: kbId, tag_name: args['tag-name'] };
  log('⏳', `删除标签「${args['tag-name']}」(关联自动解除)…`);
  await call('openapi/wiki/v1/tag_delete', body);
  log('✅', `标签已删除:${args['tag-name']}`);
});

Tag renaming, which can merge an existing tag and remove the old association, also lacks enforcement:

js
const args = parseArgs(process.argv);
await __withRetry(args, async () => {
  if (!args['old-tag-name']) { console.error('[error] 缺少必需参数 --old-tag-name <旧标签名>'); process.exit(1); }
  if (!args['new-tag-name']) { console.error('[error] 缺少必需参数 --new-tag-name <新标签名>'); process.exit(1); }
  const kbId = await resolveKbId(args);
  const body = {
    knowledge_base_id: kbId,
    old_tag_name: args['old-tag-name'],
    new_tag_name: args['new-tag-name']
  };
  log('⏳', `重命名标签「${args['old-tag-name
...[truncated 5162 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require an explicit confirmation flag, such as --confirm, for every destructive or irreversible operation.
  2. Bind confirmation to the exact operation by generating a preview containing the resolved resource name, target identifier, requested changes, and a digest or one-time confirmation token.
  3. Reject execution if the supplied confirmation token does not match the previewed operation.
  4. Make dry-run or preview behavior the default for tag deletion, tag merging, permission changes, knowledge-base joining, and note appends.
  5. For note-images.cjs, obtain confirmation before the first append request and display the number and total size of batches. Avoid requesting confirmation between batches after writing has begun.
  6. Validate permission-setting values against their documented enumerations before sending the request.
  7. Preserve the documentation-level instruction as defense in depth, but do not rely on agent compliance as the only enforcement mechanism.
  8. Add automated tests proving that each affected script refuses to call the API unless valid operation-bound confirmation is supplied.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (53)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 73)May include surrounding context.

md
| 上传文件到知识库 | `node knowledge-base/scripts/upload_to_kb.cjs --path "库名/文件夹" --file <路径>` |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 74)May include surrounding context.

md
| 打包知识库/文件夹为 zip | `node knowledge-base/scripts/export_kb_zip.cjs --path "库名/文件夹" --out /path/out.zip` |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 205)May include surrounding context.

md
| 打包知识库/文件夹为 zip | `node knowledge-base/scripts/export_kb_zip.cjs --path "库名/文件夹" --out /path/out.zip` |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 221)May include surrounding context.

md
| 打包知识库/文件夹为 zip | `node knowledge-base/scripts/export_kb_zip.cjs --path "库名/文件夹" --out /path/out.zip` |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 75)May include surrounding context.

md
| 列出知识库内容 | `node knowledge-base/scripts/list_all_files.cjs --path "库名"` |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 77)May include surrounding context.

md
| 新建笔记 | `node notes/scripts/notes_create.cjs --content "内容" --path "笔记本名"` |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 78)May include surrounding context.

md
| 追加笔记 | `node notes/scripts/notes_append.cjs --note-id <id> --content "内容"` |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 79)May include surrounding context.

md
| 笔记插入图片 | `node notes/scripts/note-images.cjs --note-id <id> --file <md>` |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 138)May include surrounding context.

md
| 笔记插入图片 | `node notes/scripts/note-images.cjs --note-id <id> --file <md>` |

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill explicitly instructs the user to ask another Copilot/IMA session to reveal environment-stored API credentials in plaintext and then reuse them in a self-managed environment. That is a direct secret-disclosure workflow that bypasses normal secret-handling boundaries and creates a high risk of credential leakage, reuse, and account compromise.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This section operationalizes secret extraction from environment variables via natural-language prompting of another assistant session. That turns the assistant into a credential disclosure channel and undermines the security model of storing secrets in environment variables in the first place.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill instructs users to retrieve plaintext credentials from another session and expose them in chat, normalizing secret disclosure through natural language. Even with nearby warnings, the prescribed workflow explicitly causes secrets to appear in conversational logs and may lead to leakage to users, agents, transcripts, or screenshots.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The file performs outbound network requests with authentication headers containing API credentials. Even though it restricts the base URL to ima.qq.com, undeclared network capability is still security-relevant because it enables external data transmission and should be transparently permissioned and reviewed.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The file performs outbound network requests with authentication headers containing API credentials. Even though it restricts the base URL to ima.qq.com, undeclared network capability is still security-relevant because it enables external data transmission and should be transparently permissioned and reviewed.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'file_write' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest description says the skill can use "--path 自然语言定位知识库/文件夹/笔记本", which frames activation around general natural-language references to common objects like knowledge bases, folders, and notebooks. It does not define explicit trigger phrases, scope limits, or negative examples, so ordinary user requests about organizing or saving content could overlap with this skill unintentionally.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · SKILL.md (reported line 64)May include surrounding context.

md
1. **UTF-8 encoding (notes writes only):** Before calling `import_doc` or `append_doc`, ALL string fields (`content`, `title`) MUST be validated as legal UTF-8. Non-UTF-8 content causes irreversible garbled text. See `references/platform-notes.md` for platform-specific methods.
2. **File upload naming:** `title` MUST equal `file_name` (with extension). Never rename, shorten, translate, or modify the original filename.
3. **Unsupported file types:** Reject immediately with a clear message. Do NOT ask user "do you still want to try?" **视频文件(mp4/avi/mov/mkv…)不能作为文件直接上传**——必须走视频模块转成「内嵌单文件 HTML」再上传(见 § 📹 视频模块,细则读 `video/SKILL.md`);Bilibili / YouTube URL 与 `file://` URL 仍不支持,引导用户改用 IMA 客户端。
4. **File upload integrity:** Keep file content as-is during upload. No encoding conversion for binary files (PDF, images, Excel, etc.).
5. **PowerShell 5.1 (all modules):** If running in PowerShell, detect version before first API call. PS 5.1 silently converts request Body to GBK — must use UTF-8 byte array mode. See `references/platform-notes.md`.
6. **副作用操作必须显式确认(不得自行执行):** `join_knowledge`(真实加入公开库)、`tag_delete` / `tag_rename`(不可逆;新名已存在时自动合并)、`update_knowledge_base_permission`(影响全库成员)、`append_doc` 追加已有笔记(不可撤销修改)——调用前必须得到用户明确同意,不确定时先问。

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · SKILL.md (reported line 100)May include surrounding context.

md
## 模块决策表

| 用户意图                                                                                   | 模块           | 读取                      |
| ------------------------------------------------------------------------------------------ | -------------- | ------------------------- |
| 搜索笔记、浏览笔记本、获取笔记内容、创建笔记、追加内容                                     | notes          | `notes/SKILL.md`          |
| 上传文件、添加网页链接、搜索知识库、浏览知识库内容、获取知识库信息、获取可添加的知识库列表 | knowledge-base | `knowledge-base/SKILL.md` |

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document highlights phrases like "帮我记一下", "记录一下", and "添加到笔记里" as ambiguous, but it does not provide a bounded activation rule that distinguishes when this skill should engage versus when another generic note-taking workflow should handle the request. These phrases are common everyday speech and therefore create a risk of unintended invocation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This markdown file contains user-facing skill metadata and operational guidance primarily in Chinese, which effectively forces a specific language/locale for use of the skill. The policy allows locale constraints only when users are offered a choice or when the restriction is clearly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

L003 将该模块描述为负责上传文件、添加网页/微信文章、搜索与浏览内容、获取知识库信息,语义上偏向内容入库与查询。但后文明确包含创建知识库、修改库基本信息、修改权限、加入知识库、移动条目、标签管理、访问状态批量更新以及整库/文件夹 zip 导出等能力(如 L028-L041、L123-L149),明显超出该描述范围。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code fetches exported media from a remote URL and saves the resulting files locally, then later packages them into an archive. Although the file header comment describes the behavior, the runtime path performs file writes affecting user data/output without any confirmation prompt or prominent user-facing warning before execution.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file contains natural-language instructions and operational messaging exclusively in Chinese, starting in the top-level usage documentation. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s natural-language docstring, argument error text, progress logs, and result labels are all hardcoded in Chinese. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file's docstring, usage examples, and runtime messages are all written in Chinese, which imposes a specific language on users without any opt-in or indication that the skill is intended only for a Chinese-speaking context. This matches the language/locale policy concern for natural-language content present in code files.

Content

No source excerpt is available for this finding.