Back to skill

Security audit

Auto Model Switch

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent, but it can automatically change model routing through a gateway token and may send that token over unencrypted HTTP if configured that way.

Review this skill before installing. Use it only with a local gateway or HTTPS gateway, protect and rotate OPENCLAW_GATEWAY_TOKEN, and understand that heartbeat mode can change the active model without asking at the moment of switching. Also consider updating dependencies and confirming that the fallback models meet your cost, data-handling, and compliance expectations.

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)

T09 · Insecure Skill Coding Practices

Warning
Location
auto_model_switch.js:149
Finding
Gateway bearer token may be transmitted over unencrypted HTTP<![CDATA[ ## Vulnerability Details **File Location**: `auto_model_switch.js:32-33, 149-159, 181-191` **Vulnerability Type**: Plaintext transmission of an authentication credential **Risk Level**: Medium ### Technical Analysis The gateway URL defaults to an unencrypted HTTP endpoint, and the implementation permits any caller-supplied `http://` gateway URL: ```javascript this.gatewayUrl = process.env.OPENCLAW_GATEWAY_URL || 'http://localhost:3000'; this.gatewayToken = process.env.OPENCLAW_GATEWAY_TOKEN || ''; ``` The token is placed directly into the HTTP `Authorization` header when retrieving status: ```javascript const url = new URL('/api/status', this.gatewayUrl); const client = url.protocol === 'https:' ? https : http; const req = client.get(url, { headers: { 'Authorization': `Bearer ${this.gatewayToken}`, 'Content-Type': 'application/json' } }, (res) => { ``` The same credential is transmitted when changing the configured model: ```javascript const options = { method: 'POST', headers: { 'Authorization': `Bearer ${this.gatewayToken}`, 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(data) } }; const req = client.request(url, options, (res) => { ``` The documentation explicitly demonstrates `OPENCLAW_GATEWAY_URL="http://localhost:3000"`. While loopback traffic has less exposure than traffic crossing a network, the code does not enforce loopback-only use for HTTP. An operator can configure a remote or shared-network HTTP endpoint, causing the bearer token and gateway responses to travel without transport encryption. Bearer tokens are replayable credentials. HTTP provides no confidentiality or server authentication, so an on-path party may observe the token or impersonate the gateway. The implementation also does not issue a warning when a non-loopback HTTP URL is used. ### Attack Path 1. An operator follows the documented configuration pattern but sets `OPENCLAW_GATEWAY_URL` to an `http://` addr ...[truncated 1431 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Require HTTPS whenever a gateway token is configured: - Reject `http:` URLs unless the hostname is strictly loopback (`localhost`, `127.0.0.1`, or `::1`). - Fail closed rather than silently sending credentials over an insecure remote connection. 2. Emit a prominent warning or require an explicit opt-in such as `ALLOW_INSECURE_LOOPBACK_HTTP=true` for local development. 3. Update `SKILL.md` and `QUICKSTART.md` to use an `https://` example for non-local gateways and explain the loopback-only exception. 4. Validate TLS certificates using Node.js defaults. Do not introduce options such as `rejectUnauthorized: false`. 5. Use a narrowly scoped gateway token that permits only status retrieval and model switching. 6. Support token rotation and document immediate revocation procedures for potentially exposed credentials. 7. Consider Unix-domain sockets or another authenticated local IPC mechanism when the gateway and skill run on the same host. 8. Add tests confirming that: - Remote `http://` gateway URLs are rejected when a token is present. - Loopback HTTP requires explicit authorization. - HTTPS remains accepted. ]]>

T08 · Insecure Dependencies

Note
Location
package-lock.json:14
Finding
Dependencies are resolved through a third-party npm registry mirror<![CDATA[ ## Vulnerability Details **File Location**: `package-lock.json:14-29` **Vulnerability Type**: Third-party dependency source and supply-chain trust risk **Risk Level**: Low ### Technical Analysis The lockfile resolves both installed packages through `registry.npmmirror.com` rather than the canonical npm registry: ```json "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmmirror.com/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "license": "Python-2.0" }, "node_modules/js-yaml": { "version": "4.1.1", "resolved": "https://registry.npmmirror.com/js-yaml/-/js-yaml-4.1.1.tgz", "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } } ``` This expands the project's supply-chain trust boundary to include a third-party mirror. A mirror compromise, synchronization error, account compromise, or policy change could affect package availability and future dependency resolution. The existing SHA-512 integrity fields materially mitigate direct substitution of the currently locked tarballs: npm should reject content that does not match the recorded digest. Consequently, compromise of the mirror alone is not sufficient to replace these exact pinned artifacts during an ordinary lockfile-respecting installation. The residual risk is concentrated in dependency updates, lockfile regeneration, workflows that ignore the lockfile, or a malicious change that alters both the resolved URL and integrity value. ### Attack Path A viable exploitation path requires a dependency-resolution or lockfile trust failure: 1. The third-party mirror or its distribution infrastructure is compromised, or it serves a malicious package during a future dependency update. 2. A devel ...[truncated 1415 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Regenerate the lockfile using the canonical npm registry: ```bash npm config set registry https://registry.npmjs.org/ rm -rf node_modules npm install --package-lock-only npm ci ``` 2. Review the resulting lockfile and confirm that all `resolved` entries use an organization-approved registry. 3. In CI, use `npm ci` rather than `npm install` so dependency versions and integrity values cannot drift. 4. Enforce the approved registry through repository-level `.npmrc` and CI policy. 5. Retain lockfile integrity hashes and fail the build on unexpected lockfile modifications. 6. Use dependency review, provenance verification where available, and automated vulnerability scanning before accepting updates. 7. If a mirror is operationally required, use an organization-controlled proxy with upstream verification, access controls, audit logging, and immutable caching. 8. Pin dependency versions deliberately and review package contents, maintainers, and release provenance when updating them. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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 (19)

Known Vulnerable Dependency: js-yaml==4.1.1 — 4 advisory(ies): CVE-2026-84375 (js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sources); CVE-2026-59869 (js-yaml: YAML merge-key chains can force quadratic CPU consumption); GHSA-5p4m-2wfm-xmqj (JS-YAML: Quadratic CPU consumption in !!omap resolution (3.x and 4.x) — CVE-2026) +1 more

High
Category
Supply Chain
Confidence
97% confidence
Finding
The lockfile pins js-yaml to version 4.1.1, and the reported advisories describe CPU-denial-of-service conditions during parsing of crafted YAML inputs. If this skill parses attacker-controlled or user-supplied YAML, an adversary could trigger excessive CPU consumption and degrade or stall the agent process. In the context of an agent skill, this is more dangerous when configuration or external content can be provided dynamically.

Known Vulnerable Dependency: js-yaml==4.1.1 — 4 advisory(ies): CVE-2026-84375 (js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sources); CVE-2026-59869 (js-yaml: YAML merge-key chains can force quadratic CPU consumption); GHSA-5p4m-2wfm-xmqj (JS-YAML: Quadratic CPU consumption in !!omap resolution (3.x and 4.x) — CVE-2026) +1 more

High
Category
Supply Chain
Confidence
96% confidence
Finding
The package depends on js-yaml in a version range associated with multiple published advisories involving CPU exhaustion during YAML parsing. If this skill parses attacker-controlled or even semi-trusted YAML, an attacker could trigger denial of service through resource-intensive payloads, which is especially relevant for an automation skill expected to remain available during failure conditions.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
This markdown file includes an example exporting `OPENCLAW_GATEWAY_TOKEN`, which is a sensitive credential, but provides no warning about keeping it secret, avoiding shell history exposure, or using safer secret-management practices. Under the markdown-specific warning criteria, credential-related behavior that can affect privacy or system integrity should be disclosed.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
The README content is written entirely in Chinese and does not provide an alternative language option or indicate that the skill is intentionally limited to a Chinese-speaking audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Lp3

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding
The skill documents executable commands and operational behaviors that imply access to environment variables, reading configuration, and writing state, but it does not declare any explicit tool scope or permissions boundary. This increases the chance of over-broad execution in hosts that rely on manifest-level scoping, making unintended file or secret access harder to audit and constrain.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill instructs users to export a gateway token in environment variables without any guidance on secret handling, storage, rotation, or avoiding disclosure in logs and shell history. Because this skill interacts with a gateway service, token exposure could allow unauthorized API access or abuse of the model-switching backend.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The file’s natural-language interface is consistently Chinese, including comments, status messages, errors, help text, and notifications. Under the policy, forcing a specific language without user opt-in is a locale/language policy violation because users are not given any mechanism to select another language.

Intent-Code Divergence

Medium
Confidence
92% confidence
Finding
The file header documents '自动检测API限流' as a provided feature. However, the code never inspects gateway HTTP responses for 429 or similar rate-limit indicators, and `recordRateLimit()` is defined but not invoked anywhere. This is an active contradiction between documented capability and implemented behavior.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The manifest says the skill automatically switches models when tokens are exhausted or when the model is rate-limited. In code, `shouldSwitch()` only checks token usage percentage against a critical threshold, while rate-limit state is only used to exclude backup candidates in `getNextModel()` and never triggers a switch from the current model. This means one of the core claimed behaviors is not actually implemented.

Missing User Warnings

Medium
Confidence
81% confidence
Finding
The skill can automatically issue a network request to reconfigure the model selection on the gateway without interactive confirmation at the moment of action. In a sensitive agent environment, automatic reconfiguration can unexpectedly alter routing, cost, policy boundaries, or data-handling characteristics, especially if backup models differ in trust, retention, or compliance posture.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The module title and description are written entirely in Chinese and provide no indication that language selection is optional or that the skill is intended only for a Chinese-language environment. Under the stated policy, forcing a specific language without user opt-in is a natural-language locale violation.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
This manifest contains user-facing natural language such as the title comment and notification message exclusively in Chinese. Under the policy, forcing a specific language without user opt-in or clear locale justification is a natural-language policy violation.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
This file contains natural-language comments and status strings in Chinese, which imposes a specific language on users and maintainers. Under the policy, forcing a language without user opt-in or a documented regional justification is a natural-language policy violation.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding
Suspicious Unicode normalization or mixed-script content

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
This Python file contains user-facing strings and docstrings entirely in Chinese, including status and completion messages printed during execution. Because the file provides no opt-in, language selection, or justification that it is intended only for a Chinese-speaking context, it appears to impose a specific language/locale in a way that violates the stated policy.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The skill documentation forces a specific language for all user-facing instructions, and there is no indication that the skill is region-specific or that users can opt into another language. This matches the policy category for language or locale constraints without user choice or justification.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
The file consistently forces a single language for the skill description and usage instructions, and does not provide an opt-in or alternative language. Per the policy, locale or language constraints should either offer user choice or be explicitly justified as region-specific.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
The package description is written only in Chinese, which can amount to a language/locale policy issue when the skill metadata is presented to users without offering an alternative language or documenting that the skill is intended for a Chinese-only audience. The file does not indicate any user opt-in or justified region-specific scope.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"author": "龙虾小队",
  "license": "MIT",
  "dependencies": {
    "js-yaml": "^4.1.0"
  }
}
Confidence
90% confidence
Finding
Using a caret range for dependencies allows newer compatible versions to be installed over time, which reduces build reproducibility and can unexpectedly introduce vulnerable or malicious transitive updates. In a skill package, this increases supply-chain risk because installs may not be deterministic across environments.

Static analysis

No suspicious patterns detected.