Back to skill

Security audit

context-management

Security checks for vulnerabilities and agentic risk

Overview

This context-management skill is coherent, but it promotes prior conversation text into system-level instructions, so it needs review before installation.

Install only if you are comfortable with the skill rewriting conversation history for the agent. Avoid using it in sessions containing secrets, sensitive customer data, or untrusted user-supplied instructions unless it is changed to keep summaries at non-system priority and add redaction, provenance, and user controls. Non-Chinese users should also note that the documentation and generated strings are primarily Chinese.

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

T01 · Skill Instruction Hijacking

Error
Location
scripts/strategies.py:227
Finding

Untrusted Conversation Content Is Promoted to System-Level Instructions

Content
View full analysis
100: topic += "..." user_topics.append(topic) elif role == "assistant": # 提取助手执行的动作 action = content[:100].strip() if len(content) > 100: action += "..." assistant_actions.append(action) elif role == "tool": # 简要记录工具结果 tool_name = msg.get("name", "unknown_tool") tool_results.append(f"{tool_name}") # 构建摘要文本 if user_topics: summary_parts.append(f"用户请求({len(user_topics)}条): " + "; ".join(user_topics[:5])) if len(user_topics) > 5: summary_parts[-1] += f" ...等{len(user_topics)}条" if assistant_actions: summary_parts.append(f"助手操作({len(assistant_actions)}条): " + "; ".join(assistant_actions[:5])) if len(assistant_actions) > 5: summary_parts[-1] += f" ...等{len(assistant_actions)}条" if tool_results: unique_tools = list(set(tool_results)) summary_parts.append(f"使用工具({len(tool_results)}次): " + ", ".join(unique_tools[:10])) summary_text = "[历史对话摘要] " + " | ".join(summary_parts) if summary_parts else "[历史对话摘要] 无重要内容" # 构建新的消息列表 summary_msg = { "role": "system", "content": summary_text, "_is_summary": True, "_summarized_count": len(old_messages), } # 检查是否已有摘要,如果有则合并 result = [summary_msg] + recent_messages return result, True ``` The structured-note strategy likewise extracts user or assistant text and appends it to a system messag ...[truncated 4876 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (7)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file’s user-facing natural-language content, including the module docstring and API documentation, is exclusively in Chinese. That imposes a specific language on users without indicating that language selection is optional or region-specific, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This file’s natural-language docstrings and injected message content are exclusively in Chinese, including system-level summary and note text that would be surfaced to the model. The skill does not provide any opt-in or language-selection mechanism, which can violate a language/locale policy requiring user choice.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The conversation summarizer copies portions of prior user and assistant content into a new system message, which elevates old data into persistent high-priority context. This can retain and re-expose sensitive inputs that users expected to age out, and because the summary is injected as a system message, later model behavior may over-trust or continue surfacing that information.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The structured note extractor scans user and assistant messages for salient content and injects extracted snippets into system context, increasing persistence and prominence of potentially sensitive information. Since the regexes target key conclusions, issues, and plans, they may preferentially capture exactly the most confidential parts of a conversation and make them available to later turns or downstream agents.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

该 markdown 文件全文仅以中文提供阈值配置说明,未见任何提示表明用户可选择其他语言或该文档仅适用于特定中文区域场景。根据规则,强制单一语言且无用户 opt-in 的自然语言内容可构成语言/locale 政策违规。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file's docstrings, comments, and printed test output are consistently in Chinese, including user-facing runtime messages such as test headings and results. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation unless the constraint is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.