Back to skill

Security audit

Model Alias Append

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its model-attribution purpose, but it can persistently change OpenClaw hook settings and append unsanitized config text into outgoing responses.

Review before installing. This skill should only be used if you are comfortable with it intercepting outgoing responses, reading OpenClaw model-alias configuration, and enabling a persistent OpenClaw hook. Prefer a pinned installer version, keep aliases to simple trusted text without Markdown or newlines, and verify how to disable or remove the hook from ~/.openclaw/openclaw.json.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:37
Finding
Unpinned Remote Package Execution in Installation Instructions<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:37-41` and `README.md:32-36` **Vulnerability Type**: Supply-chain exposure through mutable package execution **Risk Level**: Medium ### Vulnerable Code ```markdown ## Install ``` ```text npx clawhub@latest install model-alias-append ``` ### Technical Analysis The documented installation procedure instructs users to retrieve and execute the mutable `latest` release of the `clawhub` npm package. Neither a fixed package version nor an integrity hash is specified. Because `npx` can download and execute package code, the effective installer is not fully represented by the audited project. Its behavior can change after this audit whenever the package publisher updates the `latest` tag. A compromise of the publisher account, npm package, registry resolution path, or a future malicious release could therefore introduce arbitrary executable behavior. This finding concerns the documented external installation command. No malicious dependency or remote payload was found inside the reviewed project itself. ### Attack Path 1. An attacker compromises the `clawhub` package publication channel or otherwise causes a malicious release to become the package's `latest` version. 2. A user follows the installation instructions and runs: ```shell npx clawhub@latest install model-alias-append ``` 3. `npx` downloads the attacker-controlled package version. 4. Package entry points or lifecycle behavior execute with the permissions of the user running the command. 5. The malicious package can access or modify files and resources available to that user. ### Impact Assessment Successful exploitation could provide arbitrary code execution under the installing user's account. The accessible scope would depend on that user's privileges and could include project files, OpenClaw configuration, user-level credentials available to the process, and other files writable by the account. The reviewed command does not ...[truncated 202 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace `@latest` with a specifically reviewed version, for example: ```shell npx clawhub@<reviewed-version> install model-alias-append ``` 2. Publish and verify an integrity hash or signed release artifact where the package ecosystem supports it. 3. Document the expected registry and trusted package publisher. 4. Review the selected installer version, including its lifecycle scripts and transitive dependencies. 5. Update both `SKILL.md` and `README.md` so users are not directed to execute a mutable package release. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
hooks/response-alias-injector/handler.js:223
Finding
Unsanitized Model Alias Injection into Outgoing Responses<![CDATA[ ## Vulnerability Details **File Location**: `hooks/response-alias-injector/handler.js:120-123, 223-243`; duplicated behavior in `main.js:117-120, 209-219` **Vulnerability Type**: Persistent Markdown and response-content injection **Risk Level**: Medium ### Vulnerable Code The alias is copied directly from `openclaw.json` without validation: ```javascript for (const [fullModelId, modelConfig] of Object.entries(configModels)) { if (modelConfig.alias) { this.modelAliases[modelConfig.alias] = fullModelId; } } ``` The untrusted alias is then interpolated directly into outgoing Markdown: ```javascript if (replyTagMatch) { // Extract reply tag and put it at the end after model alias const replyTag = replyTagMatch[0]; processedResponse = processedResponse.replace(replyTag, '').trim(); // Add update notification if needed if (this.nextResponseNeedsUpdateNote) { response.content = `${processedResponse}\n\n*[Model alias configuration updated]*\n\n**${modelAlias}**${replyTag}`; this.nextResponseNeedsUpdateNote = false; } else { response.content = `${processedResponse}\n\n**${modelAlias}**${replyTag}`; } } else { // Add update notification if needed if (this.nextResponseNeedsUpdateNote) { response.content = `${processedResponse}\n\n*[Model alias configuration updated]*\n\n**${modelAlias}**`; this.nextResponseNeedsUpdateNote = false; } else { response.content = `${processedResponse}\n\n**${modelAlias}**`; } } ``` Equivalent direct interpolation occurs in `main.js`: ```javascript return `${processedResponse}\n\n**${modelAlias}**${replyTag}`; ``` ```javascript return `${processedResponse}\n\n**${modelAlias}**`; ``` ### Technical Analysis Values from `agents.defaults.models.*.alias` are treated as trusted display strings. The code neither constrains their length and character set nor escapes Markdown metacharacters before inserting them into `response.content`. An alias containing line breaks, Markdown ...[truncated 1927 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Validate aliases when loading configuration. Apply a conservative allowlist and length limit, such as: ```javascript const ALIAS_PATTERN = /^[A-Za-z0-9._:/-]{1,64}$/; if ( typeof modelConfig.alias === 'string' && ALIAS_PATTERN.test(modelConfig.alias) ) { this.modelAliases[modelConfig.alias] = fullModelId; } ``` 2. Explicitly reject carriage returns, line feeds, control characters, bidirectional text controls, and other invisible formatting characters. 3. Escape Markdown metacharacters before interpolation if aliases must support characters outside the allowlist. 4. Treat invalid aliases as configuration errors and omit them rather than silently appending unsafe values. 5. Apply identical validation and escaping in both `main.js` and `hooks/response-alias-injector/handler.js`, preferably through one shared implementation to prevent inconsistent fixes. 6. Add tests covering multiline aliases, Markdown links, mentions, oversized values, control characters, and valid aliases. 7. Restrict write access to `openclaw.json` and ensure any configuration-management interface authenticates and authorizes alias changes. ]]>
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (7)

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
The README instructs users to execute `npx clawhub@latest install model-alias-append`, which fetches and runs the latest published package version at install time. Because the version is not pinned, users may execute newly published code that has not been reviewed, increasing supply-chain risk if the package is compromised or a malicious version is published.

Lp3

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding
Without declared permissions the skill's intent is opaque and cannot be validated.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding
The install command uses 'npx clawhub@latest', which pulls whatever version is current at install time rather than a reviewed, fixed release. This creates a supply-chain risk: a malicious or compromised future version could execute arbitrary code during installation or install a materially different skill than the one reviewed here.

Description-Behavior Mismatch

Medium
Confidence
92% confidence
Finding
The documented purpose is appending model aliases and monitoring config changes, but the implementation also manages hooks that alter external runtime behavior. This hidden capability creates a trust-boundary violation: a seemingly low-risk formatting skill can change system behavior behind the scenes, making review and safe deployment harder and increasing the chance of unexpected persistence or policy bypass.

Context-Inappropriate Capability

Medium
Confidence
90% confidence
Finding
The skill launches an external script via child_process to enable or disable a hook, which goes beyond simple response post-processing and introduces code-execution and runtime-mutation behavior. Even though the command arguments are fixed and not obviously user-controlled here, invoking a separate script expands the attack surface and allows the skill to modify surrounding runtime behavior in ways not required for its stated purpose.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The script persistently edits the user's global OpenClaw configuration under ~/.openclaw/openclaw.json, affecting internal hook behavior outside the immediate scope of a single response. Even if intended to support transparency, modifying global config creates cross-session side effects and expands the skill's effective privileges beyond simply appending a model alias.

Context-Inappropriate Capability

Medium
Confidence
89% confidence
Finding
The code enables or disables an internal hook entry persistently without demonstrating that such privileged configuration changes are necessary for the stated attribution purpose. Because the change is written to internal hook configuration, it can silently alter future behavior of the environment and normalize a pattern that could be repurposed for more invasive hook-based persistence.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
main.js:253