Back to skill

Security audit

1688-shop-health-check

Security checks for vulnerabilities and agentic risk

Overview

The skill largely matches its shop health-check purpose, but it needs review because it can automatically install unpinned packages and stores or forwards merchant access keys with weak safeguards.

Install only in a trusted environment. Preinstall reviewed dependencies instead of allowing automatic pip installs, protect or avoid plaintext AK storage, verify OPENCLAW_GATEWAY_URL points to the intended local OpenClaw gateway, and rotate the merchant access key if it may have been stored with permissive file permissions.

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

T08 · Insecure Dependencies

Error
Location
workflow/health-check.js:690
Finding

Runtime Installation of Unpinned Packages Based on Subprocess Error Output

Content
View full analysis
📦 检测到缺失依赖 ${modName},正在自动安装...`) const installCmd = `python3 -m pip install ${shellEscape(modName)} 2>&1` const _installRaw = await callTool('Bash', buildBashCommand('sh', ['-c', installCmd], `安装 ${modName}`, 180000)) const installResult = parseBashOutput(_installRaw) if (installResult.exitCode === 0) { emit(`✅ ${modName} 安装完成,重新执行脚本...`) const _retryRaw = await callTool('Bash', buildBashCommand('python3', bashArgs, description || `重试 ${scriptName}`, 120000, { dataCapture: true })) const retryResult = parseBashOutput(_retryRaw) return parseCliOutput(retryResult, scriptName) } } } ``` The same behavior is repeated for batch execution: ```javascript const modName = detectMissingModule(parsed) if (modName) { emit(`📦 检测到缺失依赖 ${modName},正在自动安装...`) const installCmd = `python3 -m pip install ${shellEscape(modName)} 2>&1` const _installRaw = await callTool('Bash', buildBashCommand('sh', ['-c', installCmd], `安装 ${modName}`, 180000)) if (parseBashOutput(_installRaw).exitCode === 0) { emit(`✅ ${modName} 安装完成,重新取数...`) const _retryRaw = await callTool('Bash', buildBatchCommand(tasks, description)) parsed = parseBatchEnvelope(_retryRaw, keys, description) } } ``` ### Technical Analysis The workflow extracts a Python module name from subprocess error output and passes that name to `pip install` at runtime. Although `shellEscape()` reduces direct shell-command ...[truncated 2168 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/capabilities/configure/service.py:57
Finding

1688 Access Key Stored in Plaintext Without Enforced File Permissions

Content
View full analysis
bool: """Directly write openclaw.json (fallback).""" try: config: dict = {} if CONFIG_PATH.exists(): try: with open(CONFIG_PATH, "r", encoding="utf-8") as f: content = f.read().strip() if content: config = json.loads(content) except json.JSONDecodeError: return False config.setdefault("skills", {}) config["skills"].setdefault("entries", {}) config["skills"]["entries"].setdefault(SKILL_NAME, {}) skill_entry = config["skills"]["entries"][SKILL_NAME] skill_entry["apiKey"] = api_key if "env" in skill_entry and isinstance(skill_entry["env"], dict): skill_entry["env"].pop("ALI_1688_AK", None) if not skill_entry["env"]: del skill_entry["env"] CONFIG_PATH.parent.mkdir(parents=True, exist_ok=True) with open(CONFIG_PATH, "w", encoding="utf-8") as f: json.dump(config, f, ensure_ascii=False, indent=2) return True except Exception: return False ``` ### Technical Analysis When Gateway-based configuration is unavailable, the fallback writes the complete 1688 access key into `openclaw.json` as plaintext. The implementation neither sets a restrictive mode such as `0600` on the file nor verifies that an existing configuration file is private. It also creates the parent directory without explicitly restricting its permissions. The resulting protection depends on the process umask and any preexisting directory or file modes. On a permissively configured multi-user host, another local account or process may be able to read the credential. The fi ...[truncated 1746 chars]
Remediation
View remediation
Vulnerability Patterns
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (133)

Tainted flow: 'gateway_url' from os.environ.get (line 32, credential/environment) → requests.patch (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

The service takes OPENCLAW_GATEWAY_URL directly from the environment and sends the API key payload and optional bearer token to that URL without validation. If an attacker can influence the environment, they can redirect credential-bearing requests to an attacker-controlled endpoint, causing secret exfiltration or SSRF-like behavior against internal services.

Content

Scanner excerpt · scripts/capabilities/configure/service.py (reported line 49)May include surrounding context.

python
headers = {}
        if token:
            headers["Authorization"] = f"Bearer {token}"
        resp = requests.patch(f"{gateway_url}/api/config",
                              headers=headers, json=payload, timeout=5)
        return resp.ok
    except Exception:

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description is for a complete shop health-check and reporting skill, but the provided code does not perform any diagnostic, analysis, reporting, or workflow orchestration. It is a low-level auth helper module for signing 1688 API requests and reading credentials from env/config. While authentication could be a supporting component of such a skill, this code chunk by itself does not match the declared end-user functionality and instead has a materially different immediate purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Yes, this code chunk does not implement the declared shop health-check functionality. Instead, it performs usage tracking: it reads configuration from a local .env file and sends a usage event to an external endpoint every time the CLI runs. This is an undeclared capability and materially different from the stated purpose of seven-dimension business diagnosis and report generation. While telemetry can sometimes be a supporting detail, here the supplied code chunk is exclusively analytics/reporting logic and not behavior related to the declared business-diagnostic workflow, so it should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is for a business health-check skill focused on 1688 shop diagnostics and report generation. The actual code chunk does something entirely different: it implements a command-line configure entrypoint that checks whether an Access Key is already configured, validates a provided AK, writes it through a gateway or config file, and prints status messages. This is a materially different primary purpose and capability set. There is no evidence of any shop data access, seven-dimension analysis, report creation, optimization-action selection, or scheduled health-check setup. Therefore the description does not accurately represent the code behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个面向 1688 店铺经营分析的业务技能,而提供的代码片段仅处理该技能的 AK/API Key 配置:校验密钥格式、读取环境变量、查询已有配置、通过 REST API 或直接写入 openclaw.json 保存密钥。这属于配置/凭证管理功能,与七大维度体检、报告生成、诊断输出等核心声明能力没有直接对应关系。虽然配置能力可能是技能运行的支撑实现,但就该代码片段本身而言,其行为与声明的主要用途明显不一致,因此应判定为描述与代码行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个完整的店铺经营体检/诊断流程,覆盖多个业务维度并产生综合报告与后续行动引导。而给出的代码片段仅是单一能力的命令行封装,用于按日期和店铺查询广告渠道深度数据。虽然“广告”属于声明中的七大维度之一,但该代码既不体现综合诊断流程,也不生成报告或结论,主功能与声明的整体用途存在明显偏差,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

声明描述的是一个高层、完整的店铺健康诊断 Skill/Workflow,核心能力是七维度分析、报告生成与后续行动编排。而实际代码片段只是一个单点广告数据接口封装,用于获取某日广告渠道详情。这可以作为“广告维度”中的底层支持能力之一,但单独看与声明的主要用途差距很大,缺少绝大多数承诺功能,因此属于明显的描述-行为不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is for an end-to-end 1688 shop business health-check skill/workflow, including diagnostic analysis across seven dimensions, reporting, optimization actions, and scheduling. The supplied code does none of that. It is narrowly focused on one operational function: obtaining the current user's multi-shop binding list via get_bindlist(). While multi-shop support is mentioned in the description, simply fetching binding relationships is at most a supporting utility and not representative of the declared primary purpose. Therefore the code chunk's actual behavior materially differs from the declared skill description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个完整的店铺经营健康诊断能力,核心是分析流量、询盘、成交、商品、客户、广告、风险等维度并输出报告;而给出的代码片段只是在查询当前用户绑定的店铺列表。该行为更像是体检流程的辅助前置步骤,但就该代码片段本身而言,其实际能力与声明的主要用途并不一致,且未体现任何诊断、分析、报告或行动建议逻辑。因此应判定为描述与代码行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a broad, end-to-end 1688 shop health inspection skill/workflow with diagnosis across traffic, inquiries, transactions, products, customers, ads, and risk, plus conclusions, HTML reports, action recommendations, and scheduling guidance. The actual code provided does not implement that overall behavior. It is a narrow command-line wrapper that accepts a date and optional shop loginId, checks AK configuration, calls get_channel_traffic(...), and outputs channel traffic data. While traffic is one of the declared dimensions, this chunk alone materially under-implements the described skill and reflects a different immediate purpose: retrieving channel traffic data. Therefore the description does not accurately represent what this supplied code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description presents a full end-to-end 1688 shop health-check skill orchestrated by a workflow, including seven diagnostic dimensions, conclusions, HTML reporting, follow-up actions, and scheduling. The actual code chunk instead exposes a narrow CLI command (alibaba.1688.get.core.metrics) for fetching core metrics trend/peer comparison data for recent 7/30 days. This is materially different in primary purpose and much narrower in scope. While core metrics could be one supporting component of a health check, the provided code does not demonstrate the claimed workflow behavior or the major user-facing outputs and interactions described. Therefore, the description does not accurately represent what this code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared purpose describes an end-to-end shop health diagnosis workflow with broad analytical coverage and downstream interaction/reporting features. The supplied code chunk does not implement that overall behavior; it only queries one API endpoint for core metrics and trend data and parses the returned payload. While this could be a supporting subcomponent of the larger workflow, viewed against the declared description it is materially narrower and does not itself match the represented functionality.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个面向店铺经营健康诊断的综合能力,重点是七维度分析、总结结论、HTML 报告、多店铺体检以及后续行动建议。而代码实际只实现了一个“行业大盘对比数据查询”命令行入口:解析日期和可选店铺 loginId,检查 AK,调用 get_industry_benchmark 服务并输出结果。该行为更像是某个底层数据查询能力,且其名称、参数和调用目标都指向行业 benchmark 数据,而非完整店铺体检流程。即使行业对比可能是体检流程中的一个辅助数据点,这段代码本身并不能体现声明中的主要能力,因此属于明显的描述与实际行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个完整的店铺体检/诊断型技能或 workflow,核心是围绕店铺经营七大维度进行综合分析并输出报告与行动建议。而提供的代码片段只是一个底层查询服务,作用是获取某日期的行业大盘对比数据。该能力最多只能作为“店铺体检”中某一分析维度的辅助数据源,但从当前代码本身看,其主目的、输出形式和功能范围都与声明明显不一致。根据评估标准,这属于主目的和能力范围的实质性不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个高层次、完整的“1688 店铺生意体检”流程与结果产出,重点在七维度综合分析、结论、HTML 报告、多店铺批量执行以及后续行动编排。而代码片段实际只是一个“商品状态检查”命令行入口:解析 query_date 和可选店铺 loginId,检查 AK,调用 get_product_status 服务并输出结果。虽然“商品”可被视为七维度中的一个子维度,但该代码并未显示任何综合诊断、跨维度分析、报告生成、交互卡片或定时任务能力,因此与声明的主要目的和范围存在明显不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

声明描述的是一个高层、端到端的店铺经营健康诊断能力,包含多维分析、报告生成和后续交互流程;而实际代码只是一个非常具体的商品状态查询服务封装。虽然“商品”维度可能属于七维度中的一部分,但当前代码不足以支撑声明中的主要用途,且缺少体检流程中的关键产出与交互能力。因此就“描述是否准确代表该代码实际行为”而言,存在明显不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description describes an orchestrated end-to-end store health-check product with seven diagnostic dimensions and downstream reporting/action flows. The supplied code chunk instead exposes a narrow command named 'alibaba.1688.get.recommend.channel.detail' for querying recommendation-channel detail by date, optionally per shop. This is not a supporting implementation detail clearly tied to the described seven-dimension health-check flow; its primary purpose is materially different and much narrower. Therefore the description does not accurately represent what this code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared purpose is a comprehensive 1688 shop health-check skill covering seven business dimensions and a multi-step workflow that produces conclusions, HTML reports, and follow-up actions. The supplied code chunk only wraps a backend API for recommendation channel detail drill-down on a given date, optionally scoped by shop login ID. This is a materially different and much narrower capability. While recommendation-channel data could theoretically support one sub-aspect of analysis, the code shown neither performs health diagnosis nor aligns with the declared end-to-end workflow, so this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a high-level, end-to-end shop health examination workflow spanning traffic, inquiries, transactions, products, customers, ads, and compliance risk, with reporting and post-diagnosis action flows. In contrast, the actual code only defines a command named '搜索渠道深度下钻' that parses a date and optional shop loginId, validates AK presence, and calls get_search_channel_detail. This is a narrow analytics retrieval function for search channel details, not a full seven-dimension diagnostic workflow. While search-channel data could theoretically support part of a traffic analysis dimension, the code chunk itself does not implement or orchestrate the declared workflow, reporting, or interactive follow-up behaviors. Therefore the code's actual behavior is materially different from the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个覆盖流量、询盘、成交、商品、客户、广告、风险七个维度的店铺体检能力,包含诊断、总结、HTML 报告、行动建议和定时任务引导。而实际代码只是一个单一的数据访问能力:获取某日的搜索渠道详情。它既没有体现七维度诊断逻辑,也没有报告生成、结论汇总、交互行动项或定时任务相关行为。虽然“流量”可能与搜索渠道有关,但该代码片段的功能范围明显更窄,且主要目的与声明的完整店铺体检流程不一致,因此属于描述与实际行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description describes a broad, orchestrated shop health-check product with seven diagnostic dimensions and downstream reporting/interaction features. The actual code chunk is much narrower: it parses a date and optional shop login ID, validates credentials, and invokes get_traffic_overview to retrieve traffic overview data. This is only one potential sub-capability under the broader 'traffic' dimension and does not itself implement the end-to-end health check, reporting, or action flow described. Because the supplied code chunk’s primary behavior is materially narrower than the declared purpose, this should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个高层、完整的店铺健康诊断能力,重点在七维度分析、总结结论、HTML 报告、多店批量处理以及后续行动编排。而实际代码只是一个底层数据获取脚本,功能局限于查询近 7/30 天的逐日流量趋势。它没有实现或体现其余六个维度、综合诊断逻辑、报告生成、交互式行动建议、定时任务设置等核心能力。虽然“流量”是声明中的一个子维度,但该代码块的实际主功能与声明的整体能力范围相比明显过窄,属于与声明不符的代码行为。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个高层、完整的店铺健康体检能力集合;而提供的代码片段只是其中非常基础的一个底层数据获取能力,且局限于“流量”维度中的逐日趋势查询。按照评估标准,这属于主要目的和能力范围的明显不一致:代码没有实现描述中的核心输出物(诊断结论、HTML 报告)、也没有覆盖其宣称的多维诊断和后续交互流程。虽然该函数理论上可作为整体体检流程的支撑组件之一,但就“该 supplied code chunk 实际做什么”而言,它远不足以准确代表所声明的完整 Skill 能力,因此应判定为描述与代码不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个高层次、综合性的店铺经营健康检查能力,核心是七大维度分析与诊断报告输出;而实际代码仅实现了“商家活动参与信息查询”CLI,主要查询近 30 天活动参与及效果数据。两者在 primary purpose 上明显不同:一个是全面经营体检,另一个是单一活动数据查询。代码中也未见体检流程、七维分析、报告生成、行动项推荐或定时任务相关实现,因此应判定为明显不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description describes an end-to-end, multi-step shop health assessment workflow with seven analytical dimensions and multiple output/interaction features. The supplied code does not implement or evidence that behavior. Instead, it performs a narrow data retrieval for recent seller activity participation/effectiveness only. This is not merely a supporting detail of the declared workflow because the chunk's primary purpose is materially narrower and unrelated to most of the promised diagnosis/reporting capabilities. No HTML reporting, health scoring, conclusions, action cards, scheduling, or seven-dimension analysis are present in the code.

Content

No source excerpt is available for this finding.