Back to skill

Security audit

AICFO OpenClaw Agent

Security checks for vulnerabilities and agentic risk

Overview

This AICFO integration is mostly purpose-aligned, but it needs review because it can use a sensitive bearer key for broad company-data actions and can send that key to a caller-configured URL.

Install only if you trust the configured AICFO endpoint and can provide a narrowly scoped API key. Avoid passing the key with --api-key, prefer a protected environment source, set AICFO_APP_URL explicitly to the intended HTTPS origin, and review connector/document actions before allowing writes, imports, deletes, reprocessing, or raw file retrieval.

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
bin/openclaw-aicfo-adapter.mjs:315
Finding
Bearer API Key Disclosure Through an Unvalidated Request Destination## Vulnerability Details **File Location**: `bin/openclaw-aicfo-adapter.mjs`, lines 20–21, 315–365, and 456–457 **Vulnerability Type**: Arbitrary credential transmission and insecure transport configuration **Risk Level**: High ### Vulnerable Code ```javascript Named options: --url <baseUrl> --api-key <token> ``` ```javascript function buildHeaders({ apiKey, companyId, contentType } = {}) { const headers = { Authorization: `Bearer ${apiKey}`, Accept: "application/json", }; if (companyId) { headers["x-company-id"] = companyId; } if (contentType) { headers["Content-Type"] = contentType; } return headers; } async function parseResponseBody(response) { const contentType = response.headers.get("content-type") ?? "application/octet-stream"; const contentDisposition = response.headers.get("content-disposition"); const text = await response.text(); let parsed = text; if (contentType.includes("application/json")) { try { parsed = text ? JSON.parse(text) : null; } catch { parsed = text; } } return { ok: response.ok, status: response.status, contentType, contentDisposition, body: parsed, }; } async function request({ appUrl, apiKey, companyId, path, method = "GET", query, jsonBody }) { const url = `${appUrl}${path}${toQueryString(query ?? {})}`; const response = await fetch(url, { method, headers: buildHeaders({ apiKey, companyId, contentType: jsonBody ? "application/json" : undefined, }), body: jsonBody ? JSON.stringify(jsonBody) : undefined, }); ``` ```javascript const appUrl = (named.url || process.env.AICFO_APP_URL || "http://localhost:3000").replace(/\/$/, ""); const apiKey = named["api-key"] || process.env.AICFO_API_KEY; ``` ### Technical Analysis The adapter accepts its destination from ei ...[truncated 3251 chars]
Remediation
## Remediation Suggestions 1. **Restrict credentials to approved origins** - Parse the destination with `new URL()`. - Maintain an explicit allowlist of production API origins, such as `https://aiceo.city`. - Compare the normalized URL origin rather than using string prefix or suffix checks. - Reject embedded usernames or passwords, unexpected ports, malformed URLs, and unapproved hosts. 2. **Enforce encrypted transport** - Require `https:` for all non-loopback destinations. - If local development is required, allow plaintext HTTP only for exact loopback hosts such as `localhost`, `127.0.0.1`, or `[::1]`. - Place development exceptions behind an explicit opt-in flag rather than enabling arbitrary HTTP destinations. 3. **Use a safe default** - Use the documented production HTTPS endpoint as the production default. - Clearly separate production and local-development modes to prevent accidental credential transmission to unintended services. 4. **Constrain redirect handling** - Set `redirect: "manual"` for authenticated requests. - If redirects must be supported, validate the destination origin before issuing a new request containing credentials. - Never forward authorization headers to an origin that has not independently passed the allowlist checks. 5. **Avoid command-line secret exposure** - Remove or deprecate `--api-key`. - Obtain the key from a protected environment variable, restricted credential store, or standard input. - Ensure errors and diagnostic logs never print the key or complete authenticated request headers. 6. **Apply least privilege and credential lifecycle controls** - Issue narrowly scoped keys for only the required company and operations. - Separate read-only connector access from state-changing document or connector permissions. - Rotate the affected key if it may have been used with an untrusted destination. - Add expiry, revocation, ...[truncated 435 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (16)

Ae1

High
Category
analysis-evasion
Content
evel MCP usage, connector actions, Company-DB entity/file reads, and the local `bin/openclaw-aicfo-adapter.mjs` bridge.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
evel MCP usage, connector actions, Company-DB entity/file reads, and the local `bin/openclaw-aicfo-adapter.mjs` bridge.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
evel MCP usage, connector actions, Company-DB entity/file reads, and the local `bin/openclaw-aicfo-adapter.mjs` bridge.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
evel MCP usage, connector actions, Company-DB entity/file reads, and the local `bin/openclaw-aicfo-adapter.mjs` bridge.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
evel MCP usage, connector actions, Company-DB entity/file reads, and the local `bin/openclaw-aicfo-adapter.mjs` bridge.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
evel MCP usage, connector actions, Company-DB entity/file reads, and the local `bin/openclaw-aicfo-adapter.mjs` bridge.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
The adapter exposes a write-capable operation, `answer-document-questions`, that can modify document workflow state by submitting clarifications and optionally reprocessing or applying answers to similar documents. In a skill described primarily as access/introspection/reads, this creates a scope mismatch that can mislead users or calling agents into invoking state-changing actions they did not expect.

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill advertises and operationalizes access to sensitive capabilities via environment secrets, local Node execution, and outbound API/network access, but it does not declare an explicit permission or allowed-tools scope. That makes the effective trust boundary unclear to the host and user, increasing the chance that the skill is invoked with broader capabilities than intended and that sensitive bearer-key-backed actions occur without clear authorization visibility.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The skill includes write-capable operations such as imports, deletions, connector actions, and answering document clarification requests, but it lacks a clear warning that these actions can modify or submit data to external systems. In a bearer-token integration spanning company data and third-party connectors, missing user warnings increases the risk of unintended destructive changes, data submission, or compliance-impacting actions.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
This code performs HTTP requests using a bearer API key and may send company-scoped query data or document-answer payloads to a remote service, but there is no confirmation prompt or user-facing notice before transmission. For a code file, these network operations qualify for review because they transmit user or system data and the file itself provides no explicit disclosure beyond functional usage text.

Description-Behavior Mismatch

Medium
Confidence
90% confidence
Finding
The code supports document workflow operations beyond simple inspection, including listing pending document questions and mutating them via answer submission. Even if listing alone is read-only, bundling it with mutation paths that are not clearly declared increases the chance of unauthorized or accidental workflow changes in a sensitive finance/document-processing context.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The documentation instructs users to export a bearer API key but provides no guidance on secret handling, storage, redaction, or rotation. In an agent-oriented environment, this increases the risk that credentials are exposed in shell history, logs, transcripts, or copied examples, enabling unauthorized API access.

Missing User Warnings

Medium
Confidence
86% confidence
Finding
The raw file retrieval example enables direct reading of company document contents and does not warn that paths may expose confidential internal data. Because this skill is designed to bridge an agent into Company-DB resources, omission of sensitivity guidance makes accidental exfiltration or overly broad retrieval more likely.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The connector examples demonstrate access to Telegram and Google Drive data, which may contain sensitive messages, contacts, and files, without any privacy, authorization, or data-minimization warnings. In this skill context, broad third-party connector access materially increases the risk of over-collection or disclosure of external data through an agent workflow.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The operations document includes a state-changing capability to answer document-processing questions and trigger reprocessing, which goes beyond the described read/introspection-oriented scope. This expands the skill from data access into workflow mutation, increasing the chance of unauthorized business-process changes or misleading document routing if an agent uses the command inappropriately.

Missing User Warnings

Low
Confidence
84% confidence
Finding
The script reads AICFO_API_KEY from process environment and uses it for authenticated requests, which is a sensitive credential access path. Although the usage text says the variable is required, it does not clearly warn users that the skill will read and use this credential for outbound authenticated API calls.

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
bin/openclaw-aicfo-adapter.mjs:82