Back to skill

Security audit

Agent Architecture Patterns

Security checks for vulnerabilities and agentic risk

Overview

This is mostly a coherent agent-pattern library, but its runnable ReAct example and documentation teach an unsafe calculator implementation that can execute arbitrary JavaScript.

Review this skill before installing if you plan to copy or run the JavaScript examples. Do not use the documented eval() calculator pattern in a real agent; replace it with a strict arithmetic parser, validate all LLM-generated tool arguments, sandbox file/network tools, and avoid verbose logs on sensitive inputs.

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

Error
Location
examples/react-example.js:42
Finding

Arbitrary JavaScript Execution Through the ReAct Calculator Tool

Content
View full analysis
{ console.log(` [Tool: calculate] Expression: ${expression}`); try { // The implementation claims this is safe, but eval executes arbitrary JavaScript. const result = eval(expression); return result.toString(); } catch (error) { return `Calculation error: ${error.message}`; } } } ``` The documentation reproduces the vulnerable implementation: ```javascript calculate: { description: 'Execute mathematical calculations', execute: async ({ expression }) => { return eval(expression).toString(); } } ``` ### Technical Analysis The calculator passes the `expression` argument directly to JavaScript's `eval()` function. `eval()` does not restrict input to arithmetic syntax; it evaluates arbitrary JavaScript in the Node.js process. The ReAct execution flow makes this sink security-sensitive: 1. A task is included in an LLM prompt. 2. The LLM generates a JSON action containing a tool name and arguments. 3. `ReActAgent.observe()` resolves the selected tool and invokes `tool.execute(action.args)`. 4. If the selected tool is `calculate`, the LLM-generated `expression` reaches `eval()` without validation or isolation. Consequently, prompt injection, a malicious user task, or a compromised LLM response can transform a calculator action into arbitrary code execution. Catching exceptions does not mitigate the vulnerability because execution occurs before any error is handled. The source agent does not itself contain `eval()`, but it intentionally executes calle ...[truncated 2018 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • 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
Findings (53)

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

The supplied code is consistent with being an agent architecture patterns library: it serves as a main entry point exporting agent implementations for single- and multi-agent patterns. There is no evidence of undeclared permissions, triggers, or unrelated behavior. However, the description specifically claims 10 patterns, while this code chunk exposes only 7 exported agent modules. Based on the provided code alone, the declared description overstates the implemented/exported pattern count, so there is a description-to-behavior mismatch in scope/count.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · patterns/single-agent/plan-and-solve.md (reported line 399)May include surrounding context.

md
2. 创建后端项目结构
  3. 实现 API 路由(GET /todos)
  4. 实现 API 路由(POST /todos)
  5. 实现 API 路由(DELETE /todos/:id)
  6. 创建前端项目结构
  7. 实现前端 UI 和交互
  8. 测试和部署

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · patterns/single-agent/plan-and-solve.md (reported line 416)May include surrounding context.

md
2. 创建后端项目结构
  3. 实现 API 路由(GET /todos)
  4. 实现 API 路由(POST /todos)
  5. 实现 API 路由(DELETE /todos/:id)
  6. 创建前端项目结构
  7. 实现前端 UI 和交互
  8. 测试和部署

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · patterns/single-agent/plan-and-solve.md (reported line 399)May include surrounding context.

md
2. 创建后端项目结构
  3. 实现 API 路由(GET /todos)
  4. 实现 API 路由(POST /todos)
  5. 实现 API 路由(DELETE /todos/:id)
  6. 创建前端项目结构
  7. 实现前端 UI 和交互
  8. 测试和部署

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · patterns/single-agent/plan-and-solve.md (reported line 416)May include surrounding context.

md
2. 创建后端项目结构
  3. 实现 API 路由(GET /todos)
  4. 实现 API 路由(POST /todos)
  5. 实现 API 路由(DELETE /todos/:id)
  6. 创建前端项目结构
  7. 实现前端 UI 和交互
  8. 测试和部署

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · patterns/single-agent/plan-and-solve.md (reported line 438)May include surrounding context.

md
- API 端点:
  - GET /todos - 获取所有待办
  - POST /todos - 创建待办
  - DELETE /todos/:id - 删除待办

### 前端(HTML + CSS + JavaScript)
- 功能:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This markdown file documents clawhub delete agent-architecture-patterns, which is a destructive operation affecting published skill availability. The surrounding text provides no caution, confirmation note, or warning about impact, making it a missing user warning under the markdown-specific criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The document title and the entire usage guidance are presented in Chinese only, which imposes a specific language on users without any opt-in or alternative locale option. Under the policy, language constraints should either offer user choice or be clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This JavaScript example consistently hard-codes Chinese natural-language instructions and console output, starting with the title and run description, and continuing throughout the skill flow. Because the file does not provide any user opt-in, language selection, or justification for a Chinese-only locale, it violates the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This JavaScript file contains multiple natural-language string literals that assume Chinese input and produce Chinese output, such as trigger checks for '请分析这个任务' and user-facing text like '需求' and '待办事项'. Because the skill does not provide user opt-in or a configurable language/locale setting, it violates the policy against forcing a specific language without user choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This JavaScript file contains natural-language prompts, comments, and console output entirely in Chinese, and the mock LLM logic depends on matching Chinese trigger phrases such as '请生成初始答案' and '请修正所有错误'. Because the skill does not offer any user language choice or explain that it is intentionally China/Chinese-specific, it imposes a locale/language constraint that matches the policy violation criteria.

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 presents all user-facing documentation in a single language and does not indicate that Chinese is optional, selectable, or required for a region-specific purpose. That can violate language/locale policy guidance for skills that should not force a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The examples describe downloading project code and performing web searches without warning that they may trigger outbound network access or process untrusted external content. In agent environments, this can lead to unintended data disclosure, execution against attacker-controlled content, or policy violations if users assume the pattern is purely local/orchestration-focused.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

该 Markdown 文件整体以中文编写,标题、说明、示例输出与注释均默认要求中文,但没有提供语言切换、用户选择机制,或说明这是面向特定中文受众的区域化文档。根据规则,强制单一语言而无用户选择或明确正当说明,属于自然语言层面的语言/locale 策略违规。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The entire skill description, examples, prompts, and user-facing strings are written in Chinese, and there is no indication that the user can choose another language or that the skill is intentionally limited to a Chinese-speaking or region-specific context. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation and code claim a fallback to the majority opinion when consensus is not reached, but the implementation actually returns the first opinion. In a multi-agent decision system, this silently biases outcomes toward whichever agent is ordered first, undermining fairness, reliability, and any safety assumptions that depend on representative consensus.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The integration step is described as voting, but the vote function returns a random score, so final output selection is effectively nondeterministic. This can cause unsafe, low-quality, or adversarial results to be chosen unpredictably, especially if downstream users trust the system as performing reasoned consensus-based ranking.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The sample pipeline enables verbose logging that prints a substring of raw user input and each stage's output to the console. In agent pipelines, those values can contain secrets, personal data, proprietary prompts, or model-generated sensitive content, so logs can become an unintended disclosure channel if collected, shared, or retained.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The pattern describes an agent that takes arbitrary user tasks, decomposes them, and then 'executes' steps by sending them to an LLM, but it does not include any safety boundary, authorization check, or warning about acting on sensitive systems, code, or data. In an agent-skills library, this omission can normalize unsafe autonomous execution patterns and lead downstream implementers to build agents that perform impactful actions without adequate confirmation or scope controls.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill demonstrates powerful tools including network search and unrestricted local file reads without any safety guidance, access controls, or privacy warnings. In an agent setting, this normalizes patterns that can lead to sensitive local file disclosure or sending user/task data to external services when developers copy the example directly.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation states that actions include a completion declaration and elsewhere shows examples such as '行动:finish', implying completion is represented as an action. However, the implemented decideAction parser requires JSON with a tool name and observe() only executes entries from this.tools, while task completion is actually inferred from thought text in isComplete(). This is an active contradiction between the documented interaction model and the code behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The '观察处理' section says observations are returned as structured objects with success/data or success/error fields. In the actual main implementation, observe() directly returns the tool result and throws for unknown tools, with no structured wrapper or catch path. This is a substantive mismatch in documented behavior versus implemented 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 presents all instructions, examples, and usage guidance in Chinese, which effectively imposes a specific language on users. The policy allows locale constraints only when users are given a choice or when the restriction is explicitly justified, neither of which appears here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file presents the skill title, applicability, and the rest of the instructions in Chinese only, which effectively forces a specific language for users who invoke or read the skill. The policy allows locale constraints only when they are explicitly optional, user-selectable, or clearly justified as region-specific, 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
96% confidence
Finding

The document is written entirely in Chinese, including headings, instructions, prompts, and examples, with no indication that users may choose another language. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dynamic_code_execution

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
examples/react-example.js:42

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
tests/react-agent.test.js:55