Back to skill

Security audit

Clink Integration

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent ClinkBill payment-integration helper, but it needs Review because it handles payment secrets and includes under-scoped remote context, documentation loading, API destination, and shell restart mechanisms.

Install only in a trusted workspace and keep it sandbox-first. Prefer environment-variable references, a platform secret store, or an OS/managed secret store over plaintext profile or .env.local secrets; verify .env files are ignored and permission-restricted. Do not set CLINK_DOCS_URL or payment-skill URL/path overrides to untrusted sources, avoid --restart-command in agent-run flows, and use only approved Clink API hosts for authenticated commands, especially with production keys.

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 (5)

T09 · Insecure Skill Coding Practices

Error
Location
vendor/clink-integ-cli/clink-integ-cli.js:3565
Finding

Secret Key Disclosure Through Unrestricted API Base URLs

Content
View full analysis
") .description("Add or u ...[truncated 2463 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
scripts/load_payment_skill_contexts.mjs:13
Finding

Unverified Mutable Remote Skill Context Can Hijack Agent Instructions

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
lib/docs-runtime.mjs:76
Finding

Official Documentation Loader Allows SSRF, Local File Reads, and Context Poisoning

Content
View full analysis
{ const client = urlString.startsWith("https://") ? https : http; const request = client.get(urlString, (response) => { if ( response.statusCode && response.statusCode >= 300 && response.statusCode < 400 && response.headers.location ) { resolve(requestUrl(response.headers.location, timeoutMs)); return; } if (response.statusCode !== 200) { response.resume(); reject(new Error(`Failed to download docs: HTTP ${response.statusCode}`)); return; } response.setEncoding("utf8"); let body = ""; response.on("data", (chunk) => { body += chunk; }); response.on("end", () => resolve(body)); }); request.setTimeout(timeoutMs, () => { request.destroy(new Error(`Docs download timed out after ${timeoutMs}ms`)); }); request.on("error", reject); }); } ``` ```js export async function downloadText(source, { timeoutMs = DEFAULT_TIMEOUT_MS } = {}) { if (!source) throw new Error("Missing docs source"); const filePath = toFilePath(source); if (filePath) { return fs.readFileSync(filePath, "utf8"); } if (source.startsWith("http://") || source.startsWith("https://")) { return requestUrl(source, timeoutMs); } throw new Error(`Unsupported docs source: ${source}`); } ``` ```js export async function refreshOfficialDocs({ sourceUrl = proc ...[truncated 2681 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
vendor/clink-integ-cli/clink-integ-cli.js:3754
Finding

Payment Credentials Are Stored in Plaintext Without Enforced File Permissions

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
vendor/clink-integ-cli/clink-integ-cli.js:5905
Finding

Webhook Environment Synchronization Supports Unrestricted Shell Command Execution

Content
View full analysis
", `Write ${WEBHOOK_SIGNING_KEY_ENV} to an env file after resolving the plaintext signing secret` ) .option( "--restart-command ", "Run this shell command after --sync-env-file is updated" ); } ``` ```js async function syncEnvAndRestartIfRequested(options, result, dryRun) { if (!options.syncEnvFile) return void 0; if (dryRun) { return { envFile: options.syncEnvFile, key: WEBHOOK_SIGNING_KEY_ENV, dryRun: true, restartRequired: !options.restartCommand, restart: options.restartCommand ? { command: options.restartCommand, ok: true } : void 0 }; } const signingSecret = requireSigningSecret(result); await writeEnvFileValue(options.syncEnvFile, WEBHOOK_SIGNING_KEY_ENV, signingSecret); const envSync = { envFile: options.syncEnvFile, key: WEBHOOK_SIGNING_KEY_ENV, written: true, restartRequired: !options.restartCommand }; if (options.restartCommand) { envSync.restart = await runRestartCommand(options.restartCommand); envSync.restartRequired = false; } return envSync; } ``` ```js async function runRestartCommand(command) { const { stdout, stderr } = await execAsync(command, { windowsHide: true }); return { command, ok: true, stdout: truncateCommandOutput(stdout), stderr: truncateCommandOutput(stderr) }; } ``` ### Technical Analysis `--restart-command` accepts an arbitrary string and passes it to `execAsync`, which is created from Node.js `child_process.exec`. This invokes a shell and interprets shell metacharacters, substituti ...[truncated 2171 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
Findings (113)

Credential Access

High
Category
Privilege Escalation
Confidence
94% confidence
Finding

The webhook setup command uses --save-secret and --sync-env-file .env.local, which directs an agent to persist a sensitive signing secret into a local environment file. In agent-driven workflows, this is dangerous because such files may be accidentally committed, exposed to other tools, or included in logs and artifacts, leading to forged webhook events if the secret is disclosed.

Content

Scanner excerpt · README-zh.md (reported line 48)May include surrounding context.

--url https://example.com/api/clink/webhook
--events core
--save-secret
--sync-env-file .env.local
--json

text

Credential Access

High
Category
Privilege Escalation
Confidence
94% confidence
Finding

The command explicitly saves and synchronizes a webhook secret into .env.local, creating a concrete credential persistence path inside the project workspace. In agent-driven or shared development environments, secrets stored in local files are at elevated risk of accidental commit, workspace leakage, backup collection, or access by unrelated tools, making this more dangerous than a purely conceptual mention of secret handling.

Content

Scanner excerpt · README.md (reported line 55)May include surrounding context.

--url https://example.com/api/clink/webhook
--events core
--save-secret
--sync-env-file .env.local
--json

text

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is narrowly about Clink/ClinkBill payment integration workflows. The actual code shown is infrastructure code from Commander.js, a general-purpose command-line interface library. It provides parsing, help formatting, error handling, option/env processing, and subcommand execution, but no visible logic for Secret Key bootstrap, webhook setup, catalog import, checkout/subscription APIs, signature verification, sandbox validation, onboarding, or merchant integration review. While such a library could support a Clink integration CLI, this chunk itself does not implement the declared domain-specific capabilities, so the description does not accurately represent what this supplied code chunk actually does.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- run `node scripts/load_payment_skill_contexts.mjs --dependency openclaw-payment-skills --print-path`, then read the generated OpenClaw payment skill context

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- run `node scripts/load_payment_skill_contexts.mjs --dependency openclaw-payment-skills --print-path`, then read the generated OpenClaw payment skill context

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- run `node scripts/load_payment_skill_contexts.mjs --dependency openclaw-payment-skills --print-path`, then read the generated OpenClaw payment skill context

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- run `node scripts/load_payment_skill_contexts.mjs --dependency openclaw-payment-skills --print-path`, then read the generated OpenClaw payment skill context

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- run `node scripts/load_payment_skill_contexts.mjs --dependency openclaw-payment-skills --print-path`, then read the generated OpenClaw payment skill context

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- for clink-integ-cli work, use the offline bundled CLI at `vendor/clink-integ-cli/clink-integ-cli.js`; do not install `clink-integ-cli` from GitHub or npm duri

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- for clink-integ-cli work, use the offline bundled CLI at `vendor/clink-integ-cli/clink-integ-cli.js`; do not install `clink-integ-cli` from GitHub or npm duri

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- for validation tasks, prefer `node scripts/lint_contract.mjs`, `node scripts/lint_webhook_design.mjs`, and `node scripts/generate_guidance_artifacts.mjs`

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
98% confidence
Finding

This is a direct instruction to load and trust externally generated context as the authoritative source for tool names, integration metadata, notification routing, and especially tool return directives. In an agent setting, that enables prompt/context injection from a secondary file or dependency, potentially overriding local safeguards and altering how payment handoff, confirmation, or notifications are executed.

Content

Scanner excerpt · references/agent-integration.md (reported line 25)May include surrounding context.

md
## Main Responsibilities

Before generating code or reviewing an implementation for this path, load the latest available `openclaw-payment-skills` context through `node scripts/load_payment_skill_contexts.mjs --dependency openclaw-payment-skills --print-path` and read the generated context file. Treat this module as integration guidance, and treat the loaded payment skill context as the current source for exact OpenClaw tool names, merchant integration metadata, notification routing, tool return directives, and ownership boundaries.

### Merchant Skill / Agent

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

The prompt instructs the agent to sync secrets into .env.local, which is a plaintext file on disk. While the document also says .env-style files should be gitignored, directing an automated agent to write live API credentials and webhook signing keys into local env files increases the risk of accidental exposure through logs, editor plugins, backups, misconfigured VCS ignores, or later disclosure by the agent itself.

Content

Scanner excerpt · references/agent-prompt.zh-CN.md (reported line 205)May include surrounding context.

--url https://example.com/api/clink/webhook
--events core
--save-secret
--sync-env-file .env.local
--json

text

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

The guidance recommends syncing a webhook signing secret directly into .env.local, which creates a plaintext secret-handling path on disk. While .env.local may be ignored by version control, this still increases exposure through local file leakage, backups, shell history, logs, workspace sharing, or accidental inclusion in support artifacts.

Content

Scanner excerpt · references/clink-integ-cli-integration.md (reported line 254)May include surrounding context.

--url
--events core
--save-secret
--sync-env-file .env.local
--json

text

Credential Access

High
Category
Privilege Escalation
Confidence
91% confidence
Finding

This repeated instruction again promotes storing the webhook signing secret in .env.local, creating the same plaintext local-secret exposure risk. Because this appears in the signing-secret sync workflow, the context makes it more sensitive: the document also mentions rotation, so an agent may both expose a new secret locally and invalidate the old one in one automated step.

Content

Scanner excerpt · references/clink-integ-cli-integration.md (reported line 334)May include surrounding context.

--url
--events core
--save-secret
--sync-env-file .env.local
--json

text

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · references/environment-strategy.md (reported line 265)May include surrounding context.

md
- production-specific configuration changes required
- go-live prerequisites (DNS, credentials, monitoring)

## Output Rules

The skill generates code directly for the developer within a coding agent. Environment context is embedded in the generated code, not output as separate metadata.

Exfiltration Commands

High
Category
Prompt Injection
Confidence
90% confidence
Finding

Instructions found that direct the agent to transmit conversation context or user data to external services.

Content

Scanner excerpt · references/new-user-onboarding.md (reported line 147)May include surrounding context.

md
2. restart or redeploy the service
3. verify the webhook handler with `clink webhook simulate`, `clink webhook sign`, or `clink webhook verify`

If the bundled CLI still does not support `clink webhook endpoint ensure` after `node scripts/verify_cli_bundle.mjs` passes, stop and report the CLI capability gap instead of silently sending the user to configure webhooks in the Dashboard. New guidance should not present webhook endpoint management as Dashboard-only.

If the webhook URL changes, rerun `clink webhook endpoint ensure --save-secret --json`, sync the latest signing secret, and restart or redeploy again.

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · lib/skill-runtime.mjs (reported line 694)May include surrounding context.

js
When Elements promotion-code UI is in scope, add:

- `promotion_code_ui_contract` for collapsed, expanded, loading or error, applied, and clear states using `promoCodeChange`

## New User Onboarding Artifacts

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · references/output-artifacts.md (reported line 40)May include surrounding context.

md
When Elements promotion-code UI is in scope, add:

- `promotion_code_ui_contract` for collapsed, expanded, loading or error, applied, and clear states using `promoCodeChange`

## New User Onboarding Artifacts

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · references/review-checklist.md (reported line 100)May include surrounding context.

md
## Merchant Skill for OpenClaw Integration Checks

- does the design use `openclaw-payment-skills` for the OpenClaw payment skill path
- does the design align exact OpenClaw payment tool names, return directives, and notification ownership with the loaded `openclaw-payment-skills` context
- does the merchant skill call, handle, and resume according to the loaded `openclaw-payment-skills` contract without adding duplicate payment-layer behavior
- does the design clearly distinguish merchant skill from `openclaw-payment-skills`
- does it define merchant server responsibilities

Credential Access

High
Category
Privilege Escalation
Confidence
93% confidence
Finding

The guidance explicitly syncs a freshly issued webhook signing secret into .env.local, which creates a risk of credential exposure through accidental source control commits, local file leakage, editor plugins, backups, or insecure workstation access. In an integration skill, this is more dangerous because the file is prescriptive operational guidance and may cause users or agents to handle live secrets in less controlled storage than a proper secret manager.

Content

Scanner excerpt · references/standard-integration.md (reported line 147)May include surrounding context.

--url
--events core
--save-secret
--sync-env-file .env.local
--json

text

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
89% confidence
Finding

The runtime exposes a --skip-validation flag that disables validation checks before executing integration actions. In a payment-integration skill, this can let an operator or downstream automation bypass safety checks and proceed with misconfigured or risky production workflows, especially if environment/route detection is imperfect or if non-gated routes still have meaningful side effects.

Content

Scanner excerpt · scripts/run_skill_runtime.mjs (reported line 15)May include surrounding context.

js
validationFile: null,
    docsSource: process.env.CLINK_DOCS_URL || undefined,
    docsFallbackSource: process.env.CLINK_DOCS_FALLBACK_PATH || null,
    skipValidation: values.includes("--skip-validation"),
    confirmUnvalidatedProduction: values.includes("--confirm-unvalidated-production"),
    allowFixtureFallback: values.includes("--allow-fixture-fallback"),
    json: values.includes("--json"),

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
81% confidence
Finding

The code only blocks --skip-validation for production when a route is in GATED_PRODUCTION_ROUTES, meaning validation bypass remains possible for other routes. If route classification is incomplete or a supposedly non-gated route still performs sensitive payment setup actions, this creates a path to operate without required safeguards.

Content

Scanner excerpt · scripts/run_skill_runtime.mjs (reported line 59)May include surrounding context.

js
requiresExplicitUnvalidatedConfirmation &&
    !options.confirmUnvalidatedProduction
  ) {
    throw new Error("--skip-validation requires --confirm-unvalidated-production");
  }

  const validationInput = options.validationFile ? fs.readFileSync(options.validationFile, "utf8") : null;

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
70% 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 · tests/run_skill_runtime_tests.mjs (reported line 620)May include surrounding context.

js
runtimeScript,
    "--prompt",
    "Deploy to production our Clink checkout webhook integration.",
    "--skip-validation",
    "--allow-fixture-fallback",
    "--json",
  ];

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
70% 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 · tests/run_skill_runtime_tests.mjs (reported line 640)May include surrounding context.

js
runtimeScript,
    "--prompt",
    "Deploy to production our Clink checkout webhook integration.",
    "--skip-validation",
    "--allow-fixture-fallback",
    "--json",
  ];

Static analysis

Detected: suspicious.dangerous_exec, suspicious.env_credential_access, suspicious.exposed_secret_literal

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/load_payment_skill_contexts.mjs:75

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/verify_cli_bundle.mjs:151

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
tests/run_skill_runtime_tests.mjs:627

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
tests/run_skill_tests.mjs:20

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
vendor/clink-integ-cli/clink-integ-cli.js:5164

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
tests/run_llm_skill_tests.mjs:18

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
vendor/clink-integ-cli/clink-integ-cli.js:3715

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/clink-integ-cli-integration.md:234