Back to skill

Security audit

moa-engine

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent multi-agent analysis framework, but it asks agents to retain raw run logs and automatically mutate persistent expert-routing state without enough controls.

Install only if you are comfortable with a prompt-based, heuristic orchestration framework. Use it on a scoped copy of the profile registry, review signal files before updates, avoid feeding secrets or regulated data into raw execution logs, and do not send generated system prompts to a model without separating untrusted task content from trusted instructions.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • 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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/red_team_cli.py:191
Finding

Untrusted Task Content Is Embedded Directly into a System Prompt

Content
View full analysis
str: if team not in RED_TEAM_PROMPTS: raise ValueError(f"Unknown team: {team}") return RED_TEAM_PROMPTS[team]["prompt"].format( task=task.strip(), decomposition=decomposition.strip(), ) ``` The resulting prompt is exposed as a system prompt intended to be sent to the host model: ```python prompt = cls.get_prompt(team, task, decomposition) results[team] = { "name": RED_TEAM_PROMPTS[team]["name"], "system_prompt": prompt, "expected_output_format": "XML ", } ``` ### Technical Analysis The `task` and `decomposition` arguments are attacker-influenced CLI inputs. They are inserted directly into a prompt that the surrounding workflow explicitly designates as a system prompt. No trust boundary, structural separation, escaping, or instruction-content validation is applied. Consequently, an attacker can place prompt instructions inside either input. Once interpolated, those instructions appear within the same system-level message as the fixed red-team policy and may compete with or override the intended review instructions. This is an insecure prompt-construction practice rather than evidence that the packaged Skill intentionally hijacks the agent. The project does not itself call a model API or execute tools based on the generated output, so exploitation depends on a downstream caller following the documented instruction to send the generated prompt to a host model. ### Attack Path 1. An attacker supplies a crafted value through `--task` or `--decomposition`. 2. The value includes instructions such as directing the model to ignore the red-team rules, suppress findings, change the output format, or reveal un ...[truncated 982 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Warning
Location
scripts/registry_cli.py:318
Finding

Unvalidated Signals Can Poison Persistent Expert-Routing State

Content
View full analysis
dict: updates = {} for sig in signals: expert = self.get(sig.expert_id) if not expert: updates[sig.expert_id] = {"status": "skipped", "reason": "expert not found"} continue metric = sig.metric if not hasattr(expert.performance_vector, metric): updates[sig.expert_id] = { "status": "skipped", "reason": f"unknown metric: {metric}", } continue old_val = getattr(expert.performance_vector, metric) new_val = round(alpha * sig.score + (1 - alpha) * old_val, 4) setattr(expert.performance_vector, metric, new_val) expert.version += 1 expert.meta.run_count += 1 expert.meta.updated_at = datetime.now(timezone.utc).isoformat() if sig.source: expert.meta.source = sig.source ``` The CLI loads attacker-influenced JSON and persists the resulting state: ```python with open(args.signals, "r", encoding="utf-8") as f: raw = json.load(f) signals = [SignalTag(**s) for s in raw] registry = CapabilityRegistry(args.profiles) results = registry.update_from_signals(signals, alpha=args.alpha) registry.persist() ``` ### Technical Analysis The data model documents `score` and `alpha` as values between zero and one, but the implementation does not enforce these constraints. It also does not reject non-finite numeric values, authenticate signal provenance, or require approval before updating the persistent capability registr ...[truncated 1914 chars]
Remediation
View remediation
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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (31)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The registry and matching features are framed as intelligent routing and recursive improvement for complex-problem solving, yet the finding indicates they are primarily simple profile CRUD, BM25 matching, and offline score updates. In a high-risk decision-support skill, overstating these capabilities can mislead users into believing expert selection, review quality, and adaptation are stronger than they really are.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The registry and matching features are framed as intelligent routing and recursive improvement for complex-problem solving, yet the finding indicates they are primarily simple profile CRUD, BM25 matching, and offline score updates. In a high-risk decision-support skill, overstating these capabilities can mislead users into believing expert selection, review quality, and adaptation are stronger than they really are.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The registry and matching features are framed as intelligent routing and recursive improvement for complex-problem solving, yet the finding indicates they are primarily simple profile CRUD, BM25 matching, and offline score updates. In a high-risk decision-support skill, overstating these capabilities can mislead users into believing expert selection, review quality, and adaptation are stronger than they really are.

Content

No source excerpt is available for this finding.

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/moa-case-study.md (reported line 173)May include surrounding context.

md
</critic>

<!-- 专家修正 v2 -->

<expert role="缓存算法专家C" subtask="C" version="v2" status="已修正">
  <response to_attack="C-finding-1">

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/moa-case-study.md (reported line 173)May include surrounding context.

md
</critic>

<!-- 专家修正 v2 -->

<expert role="缓存算法专家C" subtask="C" version="v2" status="已修正">
  <response to_attack="C-finding-1">

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/moa-case-study.md (reported line 528)May include surrounding context.

<task_type>工具执行型</task_type> <decision_protocol>调度执行</decision_protocol> <high_risk flag="否" />

就是写个登录注册,没什么复杂的 </task_judgment>

text

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/moa-case-study.md (reported line 528)May include surrounding context.

<task_type>工具执行型</task_type> <decision_protocol>调度执行</decision_protocol> <high_risk flag="否" />

就是写个登录注册,没什么复杂的 </task_judgment>

text

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/moa-case-study.md (reported line 596)May include surrounding context.

md
<attack target="程序员" severity="">
    <!-- 失败模式: 批判空泛 — severity 为空,无具体等级 -->
    <issue>这里不够好</issue>
    <!-- 失败模式: 无 <impact>、无 <boundary_condition> — 无法定位具体问题 -->
    <demand>需要改进</demand>
  </attack>

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill documentation advertises and instructs use of local CLI scripts that read and update repository files, but it does not declare any explicit tool scope or allowed-tools boundary. In an agent environment, this can lead to over-broad file access assumptions, making it easier for the skill to be invoked with unintended read/write capability and reducing auditability of what the skill is permitted to touch.

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 natural-language instructions exclusively in Chinese, including the manifest description and all operational guidance. Because the skill does not provide an opt-in language choice or justify that it is intended only for a Chinese-language context, it can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file defines activation conditions using broad phrases such as '高质量方案输出'、'多角度分析' and '深度架构评审', which overlap with many ordinary user requests and do not clearly distinguish when the skill should or should not activate. The document also does not provide negative examples or tighter scope constraints to prevent unintended invocation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The documented final output format requires answers to start with the Chinese prefix '[最终答案]:', which implies a fixed language convention. The file does not state that users may choose another language or locale, so this can violate language/locale policy expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

This JSON manifest contains profile titles and skill labels in Chinese, while the file provides no indication that users can choose a language or that the dataset is intentionally limited to a Chinese-language context. Because SQP-3 applies to all file types and covers locale policy concerns, this constitutes a natural-language policy issue rather than a code-security issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file’s instructional content is written entirely in Chinese, with only limited inline English glosses, and does not state that language selection is optional or region-specific. Under the policy, forcing a specific language without user opt-in is a natural-language locale 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 file content is entirely Chinese and does not document any locale scope or user-consent requirement, so it effectively constrains downstream agent behavior to a single language. In a reusable skill, this can override user preference, reduce transparency for non-Chinese users, and create prompt-routing or review blind spots when operators assume language-neutral behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file is written as a direct-use prompt template whose headings, instructions, field labels, and example output language are all fixed in Chinese. Because the skill does not state that language is configurable or limited to a justified Chinese-only context, it imposes a locale/language choice on downstream use, which matches the policy-violation criterion for forced 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
92% confidence
Finding

The title and entire document are written in Chinese, and the file does not provide any language-selection option or note explaining that the content is intentionally limited to Chinese readers. Under the policy, forcing a specific language without opt-in or clear justification is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document explicitly instructs operators to retain complete raw MoA execution logs as training data. In a system designed for deep multi-role analysis and high-risk decision review, those logs may include user prompts, sensitive business data, credentials, personal data, or regulated content, creating avoidable privacy, compliance, and data-retention risk if stored indefinitely or reused for training.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The title and entire guide are written as a Chinese-only operating document, and there is no indication that users may choose another language or that the locale restriction is required for a region-specific purpose. Under the policy rules, forcing a specific language without opt-in is a natural-language locale violation.

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 presents the skill design entirely in Chinese and gives no indication that language choice is optional or limited to a justified region-specific context. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The entire specification, including headings, rules, examples, and operational guidance, is written exclusively in Chinese with no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking context. Under the stated policy, a skill that effectively enforces a specific language without opt-in or documented 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
96% confidence
Finding

This code file contains natural-language instructions, help text, and examples exclusively in Chinese, which effectively forces a specific language for users. The file does not provide any opt-in, locale selection, or justification for restricting the interface to a single language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The parser description, epilog, subcommand help, and argument help strings are all fixed to Chinese, which creates a language-policy issue for users who are not given a choice. Because these are the primary user-facing interface strings, the lack of language selection is a clear natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code file contains user-facing natural-language content such as the module docstring and CLI help text exclusively in Chinese. Per the policy, forcing a specific language without offering a language or locale choice is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The CLI writes JSON data directly to the user-specified registry path in persist(), and this path is used by register/add-profile/update commands to modify or overwrite profile data. Although the code comments mention persistence, there is no user-facing warning or confirmation before altering the target file.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.