T09 · Insecure Skill Coding Practices
- Location
src/config.js:112- Finding
Sensitive credentials are stored in an insufficiently protected configuration file
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This TikTok Shop automation skill is purpose-aligned, but it handles store credentials, customer data, and business-changing actions with insufficient safeguards.
Review before installing. Use only test or least-privilege TikTok/Feishu credentials, avoid passing cookies or tokens on the command line, inspect and restrict permissions on ~/.clawhub/tiktok-shop/config.json, and do not enable live fulfillment, refunds, pricing changes, customer exports, or Feishu sync without your own approval process and data-handling controls.
src/config.js:112Sensitive credentials are stored in an insufficiently protected configuration file
bin/cli.js:51Reusable authentication credentials are accepted through command-line arguments
The exported getCurrentAccount function calls itself recursively instead of delegating to the imported initializer function, causing infinite recursion and eventual stack exhaustion whenever consumers invoke it. In an account-management skill, this can reliably break dependent workflows and create a denial-of-service condition for any feature that needs the current account.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
}
async getAccessToken(shopId) {
console.log('🔐 获取 TikTok Access Token...');
// TODO: 实现真实的 OAuth 2.0 流程
// 1. 构建授权 URL
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
}
async getAccessToken(shopId) {
console.log('🔐 获取 TikTok Access Token...');
// TODO: 实现真实的 OAuth 2.0 流程
// 1. 构建授权 URL
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
}
async getAccessToken(shopId) {
console.log('🔐 获取 TikTok Access Token...');
// TODO: 实现真实的 OAuth 2.0 流程
// 1. 构建授权 URL
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
'tiktok-shop'
);
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
const CREDENTIALS_FILE = path.join(CONFIG_DIR, 'credentials.json');
/**
* 配置 schema
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
}
/**
* 认证 - 模拟获取 access token
*/
async getAccessToken(shopId) {
console.log('🔐 [Mock] 获取 Access Token...');
The README advertises automation that can process orders and automatically adjust competitor-based pricing, both of which can directly affect store operations, revenue, and customer experience. Presenting these features without clear warnings, approval controls, rollback guidance, or operational safeguards increases the risk that users enable impactful actions without understanding the consequences.
The skill documents automatic order handling, refunds/returns processing, and customer notifications, which can trigger real-world business actions and affect user/customer data without explicit safeguards, confirmation requirements, or warning language. In an automation skill for commerce operations, these capabilities are legitimate, but presenting them without clear constraints increases the risk of accidental destructive actions or privacy-impacting misuse.
The documented ability to export customer data, including segmentation such as VIP customers, is privacy-impacting and may expose personal or commercially sensitive information if used improperly. The surrounding text lacks privacy, retention, access-control, or compliance guidance, making misuse or over-collection more likely.
The natural-language description and command help text in this file are written in Chinese, and the CLI does not offer any language selection or opt-in mechanism. That creates a locale/language policy concern because users are forced into a single language experience without documented justification or choice.
The CLI requires a session cookie as a command-line argument, which exposes sensitive credentials through shell history, process listings, logging, and screenshots or shared terminal transcripts. In this automation context, the cookie likely grants direct account access, so accidental disclosure could allow takeover of the linked TikTok Shop account.
This code persists options.cookie, which is a sensitive authentication credential, but the surrounding comments and logs do not disclose that credential material is being stored. For code files, access to or storage of credentials should have some visible warning, comment, or documentation unless clearly disclosed elsewhere in the skill materials.
The file’s natural-language descriptions and user-facing console messages are entirely in Chinese, starting with the module description and continuing throughout the skill. Under the policy, a fixed language without opt-in or a documented region-specific justification is a locale-policy violation.
The function is presented as competitor monitoring, but when options.alert is set it also transmits derived business intelligence to an external Feishu webhook. This hidden side effect can exfiltrate sensitive competitive-monitoring data or trigger outbound communications without the caller clearly consenting to data sharing, which is especially risky in automation contexts.
This code interactively collects sensitive values such as TikTok API keys, API secrets, and Feishu webhook/app tokens, then persists them to a local JSON config file. Storing secrets on disk without an explicit warning, permission hardening, or use of a secure secret store increases the risk of credential disclosure through local compromise, backups, shared accounts, or accidental file exposure.
The fulfillOrders flow performs live order-status changes and optional outbound notifications immediately based on provided options, with no confirmation gate, dry-run mode, or explicit acknowledgement for irreversible external actions. In an order-management skill, this increases the risk of accidental bulk shipment updates or unintended customer notifications if the command is misused, scripted incorrectly, or triggered with wrong parameters.
The processReturn function directly changes an order to refunded/returned status and sends an external Feishu notification without any explicit operator confirmation or safeguard. Because refund/return actions can have financial and customer-service consequences, a mistaken invocation or malformed automation could trigger real external state changes and messaging immediately.
The function logs and accepts notifyEmail as if alerts will be sent to an email recipient, but the implementation does not send email at all. When alerts are triggered, it instantiates the Feishu integration and calls sendStockAlert, creating a direct contradiction between the user-facing intent/documentation and the actual notification channel.
The file's comments and all user-facing console messages are written in Chinese, indicating the skill forces a specific language experience. The policy for this category requires flagging language or locale constraints when there is no user opt-in or documented justification.
This JavaScript file contains natural-language documentation and runtime messages entirely in Chinese, including the top-level description and later console output, but nowhere indicates that the skill is China-region-specific or that users may choose another language. Under the policy, forcing a specific language without opt-in is a natural-language policy violation.
This code includes natural-language comments and user-visible console output exclusively in Chinese, such as module descriptions and status/error messages. Under the language/locale policy, forcing a specific language without user opt-in or documented justification is a policy violation.
The method is documented as obtaining a tenant access token using app credentials, but it returns a fabricated token instead of performing real authentication. This can cause downstream code to operate under false security assumptions, leading to failed authorization checks, broken integrations, or accidental promotion of mock behavior into production.
The order sync sends customer identifiers and contact data, including name and email, to an external Feishu Bitable instance without any consent, minimization, or policy enforcement visible in the module. In a commerce context this creates a real data leakage and privacy/compliance risk if the destination workspace is misconfigured, overbroad, or not approved for customer PII.
The webhook sender posts arbitrary message content to an externally configured URL, and the surrounding helper methods use it for business and customer-related notifications. Because webhook URLs are effectively bearer secrets and messages may contain sensitive operational or customer data, misconfiguration or abuse can exfiltrate information outside the intended boundary.
The notification methods hardcode Chinese-language text and use the 'zh-CN' locale for date formatting, which imposes a specific language/locale choice. There is no indication that users can select another language or that the Chinese locale is a documented, justified constraint.