Back to skill

Security audit

OpenClaw Skill Scaffolder

Security checks for vulnerabilities and agentic risk

Overview

The skill broadly matches its scaffolding purpose, but it generates deployable code and shell commands from user-provided text without validation, creating serious downstream injection risk.

Review the generated project before running, deploying, or publishing it. Do not feed this scaffolder configuration from untrusted parties, only use simple allowlisted names and environment variable identifiers, pin Wrangler before use, and be aware that user_id, skill details, and billing data are sent to external services.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (5)

T01 · Skill Instruction Hijacking

Error
Location
src/templates.ts:1
Finding

Attacker-Controlled Content Is Embedded into Generated Skill Instructions Without Escaping

Content
View full analysis
` - ${e}`).join("\n")} --- # ${params.name} ${params.description} ## Pricing $${params.price} USDT per call via SkillPay.me `; } ``` The values originate directly from the request body: ```ts const body = await request.json() as { user_id: string; name: string; description: string; price_usdt: number; env_vars?: string[]; }; ``` ### Technical Analysis The generated `SKILL.md` places `name`, `description`, and environment-variable names directly into YAML frontmatter and Markdown without validation, YAML serialization, escaping, or content-boundary enforcement. A TypeScript type assertion does not validate runtime JSON. An attacker can therefore include newlines, YAML keys, Markdown sections, or agent-directed instructions in these fields. In particular, the `description` is emitted both inside frontmatter and in the skill body, where it can become operative instructions when an AI agent loads the generated skill. This is especially dangerous because the declared purpose of the project is to create artifacts that users subsequently deploy and publish. The untrusted input therefore crosses a trust boundary and becomes trusted skill content. ### Attack Path 1. An attacker submits a scaffold request containing a multiline `description`, for example one that starts with a benign description and then adds instructions telling an agent to disclose secrets ...[truncated 1140 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
src/templates.ts:33
Finding

Generated TypeScript Allows Arbitrary Source-Code Injection

Content
View full analysis
` ${e}: string;`) .join("\n"); return `import type { BillingResult } from "./billing"; interface Env { ${envInterface} } const SKILLPAY_API = "https://skillpay.me/api/billing/charge"; async function chargeUser(userId: string, env: Env): Promise { try { const response = await fetch(SKILLPAY_API, { method: "POST", headers: { "Content-Type": "application/json", Authorization: \`Bearer \${env.SKILLPAY_API_KEY}\`, }, body: JSON.stringify({ user_id: userId, amount: ${params.price}, skill: "${params.skillName}", }), }); return await response.json() as BillingResult; } catch (err) { return { success: false, error: err instanceof Error ? err.message : "Billing failed" }; } } ``` The request values are passed into the generator without runtime type or syntax validation: ```ts "src/index.ts": generateWorkerIndex({ skillName: body.name, price: body.price_usdt, envVars, }), ``` ### Technical Analysis `envVars`, `skillName`, and `price` are inserted into executable TypeScript source contexts without safe encoding: - Environment-variable names are inserted as raw interface members. - `skillName` is inserted into a double-quoted string literal without escaping. - `price` is inserted as a raw source expression. The declaration `request.json() as {...}` only informs the compiler; it does not guarantee that runtime values have the declared types. A JSON client can submit strings, arrays, objects, line breaks, quote characters, or source fragments. For example, ...[truncated 1638 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
src/index.ts:63
Finding

Generated Deployment Commands Permit Shell Command Injection

Content
View full analysis
`npx wrangler secret put ${v}` ); const result: ScaffoldResult = { files, deploy_commands: [...secretCommands, "npx wrangler deploy"], test_command: "npx wrangler dev", }; ``` `envVars` comes directly from the request: ```ts const envVars = body.env_vars ?? []; ``` ### Technical Analysis Environment-variable names are concatenated into shell command strings without validation or shell escaping. If a consumer copies these commands into a POSIX shell, shell metacharacters such as semicolons, command substitutions, pipes, redirections, or newlines are interpreted as syntax rather than as part of a variable name. Although the service does not execute the commands itself, the project explicitly returns them as deployment instructions and tells users to execute generated commands. This makes the output a practical command-execution delivery channel. ### Attack Path 1. An attacker requests a scaffold with an `env_vars` entry containing a shell metacharacter and a second command. 2. The server returns a `deploy_commands` item of the form: ```sh npx wrangler secret put SAFE_NAME; attacker-command ``` 3. The generated response presents this as an ordinary deployment command. 4. A user or automation pipeline executes the returned command. 5. The shell runs both the expected Wrangler command and the injected command. 6. The injected process executes with the local privileges and credentials of the deploying user or CI runner. ### Impact Assessment Exploitation can lead to arbitrary local command execution on a developer workstation or CI/CD runner. Depending on that environment, an attacker may obtain source code, local files, Cloudflare credentials, package-registry ...[truncated 240 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
src/templates.ts:26
Finding

Unescaped Skill Name Allows Injection into Generated Wrangler Configuration

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:67
Finding

Deployment Workflow Executes Unpinned Packages Through npx

Content
View full analysis
`npx wrangler secret put ${v}` ); const result: ScaffoldResult = { files, deploy_commands: [...secretCommands, "npx wrangler deploy"], test_command: "npx wrangler dev", }; ``` ### Technical Analysis No package manifest or lockfile is present in the audited project, and the documented workflow invokes `npx wrangler` without a pinned package version or integrity-locked dependency. Depending on the local environment and `npx` behavior, the command may download and execute a package version selected at execution time. This means the effective executable can change after the skill has been audited. A compromised upstream release, registry account, dependency chain, or package-resolution environment could result in arbitrary package lifecycle or CLI code running under the user's account. ### Attack Path 1. A user follows the documented deployment process in an environment without a trusted, locally locked Wrangler installation. 2. `npx` resolves and downloads the currently selected `wrangler` package and its transitive dependencies. 3. An upstream package or dependency has been compromised, or an unsafe package-resolution configuration selects an attacker-controlled artifact. 4. Package or CLI code executes during installation or invocation. 5. The malicious code accesses the developer or CI environment with the privileges of the invoking user. ### Impact Assessment A compromised executable can access local project files, environment variab ...[truncated 348 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 37)May include surrounding context.

md
- `SKILL.md` template

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill instructs users to make external network requests and relies on an external billing/scaffolding service, but it does not declare any explicit tool scope such as network permissions or allowed tools. That mismatch reduces transparency and weakens policy enforcement, making it easier for a skill to perform undeclared outbound actions or for users to miss that data is being sent off-platform.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly tells users to POST a user_id and other configuration data to an external HTTP endpoint, but provides no privacy notice, data handling explanation, retention policy, or warning that identifiers are being transmitted to a third party. In a billing context this is more concerning because users may assume the data exchange is required and trustworthy, increasing the chance of unintended disclosure of personal or tenant-linked information.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding

The generated deployment instructions invoke npx wrangler secret put without pinning a specific Wrangler version. npx may fetch the latest package at execution time, which creates a supply-chain risk: users could run an unexpected or compromised version with access to secrets they are entering. This is more dangerous in this skill because the command is explicitly used to handle sensitive values such as SKILLPAY_API_KEY and user-provided environment variable names.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding

The scaffolded deploy command includes npx wrangler deploy without a pinned version, so execution may download and run whatever version is current at that moment. That exposes users to supply-chain and reproducibility risks, especially since this skill generates deployable infrastructure code and asks users to immediately execute the returned commands. The skill context increases risk because it operationalizes the unsafe command directly rather than merely mentioning Wrangler conceptually.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding

The returned test command npx wrangler dev is also unpinned, meaning local development may execute an unreviewed package version fetched at runtime. While this is somewhat less sensitive than secret entry or deployment, it still creates a supply-chain execution path on the user's machine. In this scaffolding context, users are likely to copy-paste the command directly, which makes the unsafe pattern more likely to be exploited in practice.

Content

No source excerpt is available for this finding.