Back to skill

Security audit

Knowledge Router

Security checks for vulnerabilities and agentic risk

Overview

This skill is a knowledge search router, but it can automatically search conversation history and memory stores from broad prompts without clear consent or access limits.

Review before installing in any environment with private conversation history or shared memory stores. Use it only where the underlying tools enforce user, tenant, project, and session boundaries, and consider narrowing triggers plus requiring confirmation before raw conversation or persistent memory searches.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:53
Finding

Unscoped Access to Conversation History and Persistent Knowledge Stores

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 16–17, 53–55, and 68–72
Vulnerability Type: Unrestricted retrieval of potentially sensitive conversation and memory data
Risk Level: Medium

Vulnerable Code Snippets

markdown
| **memory-tencentdb** | `tdai_memory_search` / `tdai_conversation_search` | Conversation fragments | Automatically captured, real-time, fine-grained | High |
| **Ontology** | `memory/ontology/graph.jsonl` | Entities and relationships | Structured and suitable for inference | Medium |
markdown
1. `tdai_conversation_search` → Search raw conversations
2. `tdai_memory_search` → Search structured memory
3. (fallback) `memorySearch` → Enable only when TDAI returns no results
markdown
1. `Ontology` → Query entity relationships in `memory/ontology/graph.jsonl`
2. `domain-kit` → Query relationships in the domain ontology
3. `tdai_memory_search` → Search structured memory
4. `wiki-kb` → Check whether related articles mention the entities
5. (fallback) `memorySearch` → Enable only when TDAI returns no results

Technical Analysis

The Skill instructs the agent to search raw conversation history, structured memories, and a local ontology containing entity relationships. These sources may contain private discussions, personal relationships, historical decisions, project assignments, or other sensitive data.

The routing rules do not require an authorization check, authenticated-user or tenant scope, explicit consent, sensitive-field filtering, or result-level access control before these sources are searched. Broad trigger patterns and relationship queries can therefore cause the agent to retrieve data beyond what a requester should legitimately access.

Although the Skill does not itself grant operating-system permissions, it directs an agent with existing tool access to use potentially privileged data sources without defining least-privilege boundaries.

...[truncated 1245 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require explicit user intent before searching raw conversations or persistent memory.
  2. Enforce authenticated-user, tenant, project, and session boundaries in every retrieval tool.
  3. Perform authorization checks against each returned record rather than relying only on query-level controls.
  4. Disable raw-conversation search by default and enable it only for explicit conversation-recall requests.
  5. Add redaction for credentials, tokens, personal information, confidential project data, and other sensitive fields.
  6. Limit ontology relationship queries to entities the requester is authorized to inspect.
  7. Add audit logging for the requester identity, query, selected source, returned record identifiers, and redaction decisions.
  8. Modify the Skill workflow to include a mandatory authorization and data-minimization stage before results are presented.

T09 · Insecure Skill Coding Practices

Note
Location
SKILL.md:228
Finding

Contradictory Fallback Instructions Cause Unnecessary Memory Searches

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 19 and 228–229
Vulnerability Type: Inconsistent security-sensitive retrieval configuration
Risk Level: Low

Vulnerable Code Snippets

The declared fallback policy states:

markdown
> **Note**: `memorySearch` is the fallback for `tdai_memory_search`; they must not be used in parallel. Only downgrade to memorySearch when the TDAI search returns no results or poor results.

The comprehensive-query example later reverses that order:

markdown
5. Search memorySearch → Add semantic-search results
6. Search tdai_memory_search → Add structured-memory results

Technical Analysis

The comprehensive-query example conflicts with the Skill's mandatory fallback rule. It instructs the agent to invoke memorySearch before tdai_memory_search, even though vector memory is supposed to be used only when the TDAI search is empty or inadequate.

Examples in agent Skills can influence execution behavior as strongly as normative instructions. An agent following the example may query both memory systems unconditionally. This expands the number of sensitive data stores accessed, defeats the stated data-minimization behavior, and can produce duplicated or inconsistent results.

Attack Path

  1. A requester submits a broad request such as asking for all available information about a person or project.
  2. The router classifies it as a comprehensive query.
  3. The agent follows the comprehensive-query example.
  4. It invokes memorySearch before determining whether tdai_memory_search would be sufficient.
  5. It subsequently invokes tdai_memory_search as well.
  6. Information is retrieved from both stores despite the declared fallback-only policy, increasing the amount of memory data processed and potentially disclosed.

Impact Assessment

The inconsistency can cause unnecessary access to persistent vector memory, increase exposure of stored ...[truncated 199 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace lines 228–229 with an unambiguous ordered sequence:
    • Search tdai_memory_search.
    • Evaluate whether the result is empty or inadequate.
    • Invoke memorySearch only when that evaluation permits fallback.
  2. Ensure every example follows the same retrieval order as the normative fallback policy.
  3. Define measurable fallback criteria, such as no authorized results or a confidence score below an established threshold.
  4. Add an authorization and redaction check before either memory source is queried or its results are returned.
  5. State explicitly that querying both memory systems is prohibited unless the user requests a comprehensive cross-source search and is authorized for both sources.
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases include broad everyday expressions such as '帮我找' and 'XX是什么', which can cause the skill to activate on ordinary user input that did not clearly intend multi-source knowledge retrieval. Because this skill can search conversation memory and other stored knowledge, over-broad activation increases the chance of unintended access to sensitive historical or internal information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill advertises automatic routing into conversation memory and multiple knowledge stores without clearly warning users that prior conversations and stored data may be searched. This creates a transparency and consent problem that can lead to inadvertent disclosure of sensitive personal, internal, or contextual information when users issue seemingly simple knowledge queries.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The skill metadata and operating instructions are presented in Chinese without indicating that users may interact in other languages or that the locale is intentionally restricted. This can constitute a language-policy issue when a skill implicitly forces a single language without opt-in or justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

L160-L165 声称总体优先级为“编译过的 > 结构化的 > 语义搜索的 > 原始对话”,并将 tdai_conversation_search 置于最低;但类型 B 在 L052-L055 又把 tdai_conversation_search 放在首位,高于结构化记忆。这不是简单的省略,而是对“什么应优先查询”的明确矛盾描述。

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

文档在 L083-L088 明确规定类型 D 综合查询应按 wiki-kb → Ontology → domain-kit → tdai_memory_search → memorySearch(fallback) 的顺序执行,且 memorySearch 仅在 tdai 无结果时启用。但示例 4 却写成先查 memorySearch、后查 tdai_memory_search,直接违背了前述路由与 fallback 规则,属于文档内部的意图-执行描述冲突。

Content

No source excerpt is available for this finding.