Back to skill

Security audit

Rule Extractor

Security checks for vulnerabilities and agentic risk

Overview

This skill is disclosed as a rule extractor, but it can turn local Markdown headings into future system-prompt instructions without review or containment.

Review carefully before installing. Only use this with learning files and traces you control, and do not automatically inject its generated prompt text into high-privilege agent sessions. Treat extracted rules as untrusted suggestions until a human or trusted policy approves them.

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/extractor.py:111
Finding

Untrusted Learning Content Can Poison Rules Injected into Future System Prompts

Content
View full analysis
str: """格式化为 System Prompt Args: rules: 规则列表 Returns: 格式化后的 prompt 字符串 """ if not rules: return "" lines = ["【历史经验规则(请遵循)】"] # 按类别分组 avoid_rules = [r for r in rules if r.category == "avoid"] prefer_rules = [r for r in rules if r.category == "prefer"] if avoid_rules: lines.append("\n## 避免操作") for r in sorted(avoid_rules, key=lambda x: -x.confidence): lines.append(f"- {r.description}(置信度: {r.confidence:.0%})") if prefer_rules: ...[truncated 3764 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The documented purpose and the described behavior do not cleanly align: the skill reads from .learnings/ and claims to influence future system prompts, but these effects are not fully and precisely disclosed. Behavior-description mismatches are dangerous because hidden persistence or hidden data ingestion can bypass user expectations and create prompt-poisoning or privacy risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The documented purpose and the described behavior do not cleanly align: the skill reads from .learnings/ and claims to influence future system prompts, but these effects are not fully and precisely disclosed. Behavior-description mismatches are dangerous because hidden persistence or hidden data ingestion can bypass user expectations and create prompt-poisoning or privacy risks.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/extractor.py (reported line 54)May include surrounding context.

python
# 从成功中提取 prefer 规则
        rules.extend(self._extract_from_successes(successes))

        return rules

    def _extract_from_failures(self, failures: List[dict]) -> List[Rule]:
        """从失败中提取 avoid 规则"""

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/extractor.py (reported line 79)May include surrounding context.

python
# 从成功中提取 prefer 规则
        rules.extend(self._extract_from_successes(successes))

        return rules

    def _extract_from_failures(self, failures: List[dict]) -> List[Rule]:
        """从失败中提取 avoid 规则"""

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/extractor.py (reported line 104)May include surrounding context.

python
# 从成功中提取 prefer 规则
        rules.extend(self._extract_from_successes(successes))

        return rules

    def _extract_from_failures(self, failures: List[dict]) -> List[Rule]:
        """从失败中提取 avoid 规则"""

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/extractor.py (reported line 118)May include surrounding context.

python
# 从成功中提取 prefer 规则
        rules.extend(self._extract_from_successes(successes))

        return rules

    def _extract_from_failures(self, failures: List[dict]) -> List[Rule]:
        """从失败中提取 avoid 规则"""

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/extractor.py (reported line 146)May include surrounding context.

python
# 从成功中提取 prefer 规则
        rules.extend(self._extract_from_successes(successes))

        return rules

    def _extract_from_failures(self, failures: List[dict]) -> List[Rule]:
        """从失败中提取 avoid 规则"""

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill documentation indicates file-reading behavior via extraction from the .learnings/ directory, but it declares no tool scope or permissions boundary. In an agent environment, undeclared file access increases the risk of overbroad data exposure and makes it harder for operators and users to understand what local content the skill may ingest.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Automatically deriving rules from prior activity and injecting them into later sessions creates a cross-session prompt-persistence channel without any visible warning or consent mechanism. This is dangerous because untrusted or poisoned historical content can silently alter future agent behavior, potentially overriding user intent, degrading safety, or causing persistent prompt injection.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The manifest description and usage sections are written in Chinese, and there is no indication that language is selectable or that the skill is intentionally limited to a Chinese-speaking context. This can violate language/locale policy when a skill implicitly enforces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This Python file consistently uses Chinese-only natural-language strings in the module docstring, class docstrings, and generated rule descriptions such as '避免在 {op} 中出现错误' and '优先使用 {op} 的成功模式'. 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
92% confidence
Finding

This code hardcodes Chinese natural-language headings such as '【历史经验规则(请遵循)】', '避免操作', and '推荐做法' in generated output. That imposes a specific language/locale on users with no visible opt-in or configuration path, which fits the language-policy violation category.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The entire document is written in Chinese and does not state that language selection is optional or user-configurable. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale constraint is documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This Python file contains user-facing natural-language content such as the module docstring and test docstrings/comments entirely in Chinese, with no indication that language selection is optional. Under the policy rule for language/locale constraints, this effectively imposes a specific language without user opt-in or a documented regional justification.

Content

No source excerpt is available for this finding.