T09 · Insecure Skill Coding Practices
- Location
scripts/openclaw.js:32- Finding
Merchant API Key Is Exposed Through Plaintext Storage, Process Arguments, and URL Query Parameters
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This looks like a real merchant operations skill, but it needs review because it stores a powerful merchant key insecurely and exposes broad data-query and write capabilities.
Install only if you trust the Koubei/OpenClaw service and are comfortable granting this skill a merchant key that can query business/user data and perform remote actions such as publishing, editing posts, sending bulk messages, changing labels, and increasing points. Use a least-privilege key if available, protect or rotate the key, and manually review every SQL query, file upload, message batch, points change, and post edit before allowing the agent to run it.
scripts/openclaw.js:32Merchant API Key Is Exposed Through Plaintext Storage, Process Arguments, and URL Query Parameters
scripts/openclaw.js:98Documented SQL Security Restrictions Are Not Enforced by the CLI
scripts/openclaw.js:374Sensitive Write and Bulk Operations Lack Programmatic Confirmation Controls
The skill advertises a relatively bounded merchant-operations purpose, but the instructions reveal materially broader capabilities including arbitrary SQL querying, access to table listings, bulk messaging, tag management, points adjustment, and management of "sockpuppet/马甲" accounts. This creates a trust-boundary problem: users or hosting platforms may authorize the skill based on a narrower description while unknowingly exposing sensitive data and high-impact write operations, enabling abuse, over-privileged use, and unintended data access.
Referenced artifact was not completely inspected
node scripts/openclaw.js init --key {{key}}
Referenced artifact was not completely inspected
node scripts/openclaw.js init --key {{key}}
Referenced artifact was not completely inspected
node scripts/openclaw.js init --key {{key}}
Referenced artifact was not completely inspected
node scripts/openclaw.js init --key {{key}}
Referenced artifact was not completely inspected
node scripts/openclaw.js init --key {{key}}
Referenced artifact was not completely inspected
node scripts/openclaw.js init --key {{key}}
The documented CLI exposes materially broader capabilities than the skill description suggests, including arbitrary data-table querying, identity/account management, points adjustments, internal messaging, and user labeling. In an agent setting, this increases the chance that a user or prompt can drive high-impact actions on users and business data beyond the expected posting/operations scope, undermining least privilege and informed consent.
The CLI exposes generic table enumeration and arbitrary SQL execution against the remote OpenClaw backend, which is substantially broader than the declared merchant-operations scope. If an agent or user can invoke this command, it can access or manipulate backend data outside intended workflows, creating a powerful data exfiltration and abuse primitive.
The skill can alter user state by assigning labels, granting points, and creating/editing alias accounts, which are high-impact administrative actions not clearly disclosed in the manifest. In an agent skill, these functions can be abused for covert account manipulation, reputation gaming, or unauthorized incentive changes.
The trigger phrases are broad and map to ordinary conversational language such as configuration/help requests, increasing the chance the skill is invoked unintentionally in unrelated chats. In a skill that can store merchant keys, query backend data, and perform write operations, accidental invocation can lead to credential collection prompts, unintended disclosure, or execution of sensitive workflows under ambiguous user intent.
Persistently binding a merchant key in a local config expands the trust boundary from per-operation authentication to ongoing credential storage on disk. That creates additional risk of credential leakage, reuse by unintended processes/users, and silent execution of privileged actions without fresh user awareness.
The SQL guidance claims a default restriction to approved posts, but the example instead queries administrator user attributes, signaling that direct access to sensitive user/account tables is possible. In practice this weakens operator assumptions and may encourage prompts or agents to retrieve privileged user data under the guise of ordinary analytics.
The direct upload commands can transmit arbitrary local files to a remote service, but the documentation provides no explicit warning that local file contents will leave the host. In an agent workflow, that omission raises the risk of accidental exfiltration of sensitive local data if a path is provided or inferred without clear user understanding.
This markdown file includes a data export feature that allows downloading Excel/CSV files containing post, user, and conversion data, but it does not mention any caution about sensitive information, access control, or safe handling of exported data. For markdown files, SQP-2 applies when descriptions omit warnings about behaviors that could affect user data or privacy.
The README introduces an OpenClaw SQL/table-query capability that appears outside the stated Koubei Circle merchant-operations scope. This scope drift is dangerous because it normalizes broader data-access functionality, potentially enabling operators to query unrelated datasets and expanding the blast radius if the skill or its credentials are misused.
The README instructs users to initialize and locally store an API key, but does not provide explicit credential-handling safeguards such as file-permission hardening, secret rotation, or prohibitions on sharing the config file. Because this skill requires merchant keys and performs operational actions, weak guidance around secret storage increases the risk of credential leakage and unauthorized use.
The README explicitly demonstrates querying user-related fields such as user_id and nickname without any warning about personal data handling, authorization, or minimization. In a merchant-operations skill, this makes unsafe data access seem routine and can lead to privacy violations, overcollection, or improper downstream use of identifiable user information.
The API key is stored in plaintext in a local config.json, increasing exposure through local file disclosure, accidental commits, backups, or multi-user system access. Because this key authorizes merchant operations, compromise could enable unauthorized posting, messaging, and administrative actions.
When a local file path is provided, the script reads the file and transmits its contents to the configured remote OpenClaw host. Although there is a log that an upload is happening, there is no warning about data leaving the local system or guidance to verify the target host before sending potentially sensitive media.
This path reads a local video file and uploads it over HTTPS to the configured host. The console output notes an upload is occurring, but it does not clearly warn that local data is being sent off-machine or identify the destination, which is important for privacy-sensitive operations.
The manifest lists posting, activity management, data monitoring, automatic reminders, and long-connection push, but does not mention direct outbound user messaging. sendStationMail performs batch站内信 delivery to arbitrary user IDs, which is a distinct engagement/moderation capability rather than an obvious implementation detail of posting automation.
Bulk messaging is a high-impact action affecting many users, yet the CLI executes immediately without confirmation, dry-run, or recipient validation safeguards. Mistakes or abuse can quickly result in spam, phishing, harassment, or reputational damage at scale.
This function updates an existing thread's title and/or message through a POST request, changing remote content. There is no user-facing confirmation, preview, or warning that the action will overwrite existing post content.
Bulk point increases change user entitlements or rewards and are applied immediately to multiple users without any confirmation or anti-mistake safeguards. In this context, erroneous or malicious use can distort incentives, create financial/reputational impact, and undermine platform trust.