Back to skill

Security audit

Manusilized

Security checks for vulnerabilities and agentic risk

Overview

This package is not a normal isolated skill: it patches OpenClaw core agent files and adds an unsafe Markdown-to-tool-call fallback that can turn model text into tool invocations.

Treat this as a core OpenClaw patch, not a regular skill. Review the TypeScript diff carefully, prefer the upstream PR if available, and do not install it in an environment with powerful tools or sensitive credentials unless you add tool allowlisting, argument validation, and explicit approval for consequential tool calls.

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
patches/ollama-stream.ts:337
Finding
Untrusted Markdown Content Is Promoted to an Executable Tool Call<![CDATA[ ## Vulnerability Details **File Location**: `patches/ollama-stream.ts:337-365` and `patches/ollama-stream.ts:558-577` **Vulnerability Type**: Unvalidated model-output conversion across a tool-execution trust boundary **Risk Level**: High ### Vulnerable Code ```ts const MARKDOWN_TOOL_CALL_RE = /```(?:json)?\s*\n?\s*\{[\s\S]*?"name"\s*:\s*"([^"]+)"[\s\S]*?\}\s*\n?```/g; export function extractMarkdownToolCalls(content: string): OllamaToolCall[] { const results: OllamaToolCall[] = []; let match: RegExpExecArray | null; MARKDOWN_TOOL_CALL_RE.lastIndex = 0; while ((match = MARKDOWN_TOOL_CALL_RE.exec(content)) !== null) { const raw = match[0] .replace(/^```(?:json)?\s*/i, "") .replace(/\s*```$/, "") .trim(); try { const parsed = parseJsonPreservingUnsafeIntegers(raw) as Record<string, unknown>; const name = typeof parsed.name === "string" ? parsed.name : undefined; if (!name) { continue; } const args = parsed.arguments != null && typeof parsed.arguments === "object" ? (parsed.arguments as Record<string, unknown>) : parsed.parameters != null && typeof parsed.parameters === "object" ? (parsed.parameters as Record<string, unknown>) : {}; results.push({ function: { name, arguments: args } }); } catch { log.warn(`[manusilized] Failed to parse Markdown tool call: ${raw.slice(0, 120)}`); } } return results; } ``` The resulting calls are subsequently attached to the assistant response as structured tool calls: ```ts if (accumulatedToolCalls.length === 0 && accumulatedContent) { const markdownCalls = extractMarkdownToolCalls(accumulatedContent); if (markdownCalls.length > 0) { log.debug( `[manusilized] Extracted ${markdownCalls.length} tool call(s) from Markdown fallback`, ); accumulatedToolCalls.push(...markdownCalls); // Strip the tool-call JSON blocks from the visible content so the ...[truncated 3252 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Restrict calls to offered tools** - Build an immutable map from `context.tools`. - Reject every fallback call whose name is not an exact match for a tool offered in the current request. - Do not rely solely on downstream dispatchers for this validation. 2. **Validate arguments** - Validate parsed arguments against the selected tool's declared JSON schema. - Reject unknown properties, invalid types, missing required values, excessive nesting, and oversized inputs. - Reject `null`, arrays, and other values where an argument object is required. 3. **Make fallback behavior opt-in** - Disable Markdown tool-call conversion by default. - Enable it only for explicitly trusted model configurations known not to support native structured calls. - Document that enabling it expands the model-output trust boundary. 4. **Use an unambiguous protocol** - Require a unique sentinel or envelope emitted under constrained generation rather than accepting arbitrary fenced JSON. - Ensure quoted examples and retrieved content cannot satisfy the protocol. - Prefer native structured tool calling whenever it is supported. 5. **Add authorization controls** - Require user confirmation or a policy-engine decision for shell, filesystem-write, credential, external-network, and other consequential tools. - Run tools with least privilege and sandbox command execution where possible. 6. **Preserve audit visibility** - Do not silently remove the source block before authorization. - Record the original model output, parsed tool name, validated arguments, and approval result in security audit logs without exposing secrets. 7. **Add adversarial tests** - Test fenced JSON embedded in quoted documentation, retrieved webpages, user messages, and tool results. - Test unknown tool names, schema-invalid arguments, duplicate calls, malformed JSON, oversized payloads, and tool names with Unicode or case variatio ...[truncated 7 chars]
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Ae1

High
Category
analysis-evasion
Content
3. Replace the corresponding files in `src/agents/` (`ollama-stream.ts` and `ollama-models.ts`).
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Self-Modification

High
Category
Rogue Agent
Content
## How to apply

1. Copy `ollama-stream.ts` and `ollama-models.ts` from this repository.
2. Replace the original files in your OpenClaw installation at `src/agents/`.
3. Rebuild your OpenClaw project using `pnpm build`.

Alternatively, please support our official PR to get these features merged into the main OpenClaw repository!
Confidence
96% confidence
Finding
The README instructs the user to manually replace core files in the host OpenClaw installation, which is a self-modifying/core-patching behavior rather than a normal isolated skill installation. This bypasses normal package boundaries, review controls, and update mechanisms, creating a high-risk supply-chain path where untrusted repository contents can alter privileged application logic.

Static analysis

Detected: suspicious.host_platform_source_patch

Install code patches host platform source and rebuilds without confirmation.

Critical
Code
suspicious.host_platform_source_patch
Location
install-patch.sh:25