Back to skill

Security audit

Publish Answer Baidu Know

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly implements Baidu Zhidao answer posting, but important behavior is under-disclosed and under-scoped enough that users should review it before installing.

Before installing, verify that the runtime sets OPENCLAW_TEST_TARGET=real_rpa when you intend real posting; otherwise the skill may report mock success without publishing. Only use trusted HTTPS values for JIANGCHANG_AUTH_BASE_URL and OPENAI_BASE_URL, use limited-scope API keys, and assume selected drafts, question context, browser profile state, logs, and local publish records may be used by the skill during operation.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/service/entitlement_service.py:10
Finding

Unrestricted entitlement endpoint can receive identity metadata and bearer credentials

Content
View full analysis
Tuple[bool, str]: auth_base = (os.getenv("JIANGCHANG_AUTH_BASE_URL") or "").strip().rstrip("/") if not auth_base: return True, "" user_id = (os.getenv("JIANGCHANG_USER_ID") or "").strip() if not user_id: return False, "鉴权失败:缺少用户身份(JIANGCHANG_USER_ID)" auth_api_key = (os.getenv("JIANGCHANG_AUTH_API_KEY") or "").strip() timeout = int((os.getenv("JIANGCHANG_AUTH_TIMEOUT_SECONDS") or "5").strip()) headers = {"Content-Type": "application/json"} if auth_api_key: headers["Authorization"] = f"Bearer {auth_api_key}" payload = { "user_id": user_id, "skill_slug": skill_slug, "trace_id": (os.getenv("JIANGCHANG_TRACE_ID") or "").strip(), "context": {"entry": "main.py"}, } try: res = requests.post(f"{auth_base}/api/entitlements/check", json=payload, headers=headers, timeout=timeout) ``` ### Technical Analysis The destination for the entitlement request is taken directly from `JIANGCHANG_AUTH_BASE_URL`. The code does not parse the URL, require HTTPS, restrict the hostname to an approved entitlement service, reject embedded URL credentials, or explicitly control redirects. When `JIANGCHANG_AUTH_API_KEY` is configured, it is attached as a bearer credential to the request. The request also contains the user ID, trace ID, Skill identifier, and execution context. Consequently, any party that can influence the process environment or generated configuration can redirect this information to an arbitrary HTTP or HTTPS server. The entitlement check is invoked near the beginning of the normal `run` workflow, before business-parameter validation. Therefore, even a subsequen ...[truncated 1320 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/service/answer_optimizer.py:124
Finding

Optional answer optimizer can transmit local drafts and API credentials to an unrestricted endpoint

Content
View full analysis
OptimizedAnswer: """根据问题上下文,优化已有草稿回答。""" client, model = _get_openai_client() user_prompt = ( f"问题上下文:\n{ctx.to_summary()}\n\n" f"基础草稿:\n{draft}\n\n" f"请优化上述草稿,使其成为更高质量的百度知道回答。" ) content, tokens = _call_llm(client, model, _OPTIMIZE_PROMPT, user_prompt) # 审核优化后的回答 review_result = _review_answer(client, model, ctx, content) return OptimizedAnswer( content=content, review_result=review_result, model=model, tokens_used=tokens, ) ``` ### Technical Analysis `OPENAI_BASE_URL` is passed directly to the OpenAI SDK without scheme or hostname validation. The SDK uses `OPENAI_API_KEY` to authenticate to the configured origin. During optimization, the outbound prompt includes the complete local draft, the scraped Baidu question title and description, and excerpts from existing answers. The generated response and contextual material are then transmitted again for review. There is no destination allowlist or transmission-time warning identifying the receiving provider. The primary production CLI in `scripts/cli/app.py` does not currently expose th ...[truncated 1444 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
pyproject.toml:1
Finding

Shared-runtime dependencies are resolved from broad, non-reproducible version ranges

Content
View full analysis
=3.11,<3.13" dependencies = [ "playwright>=1.49.0,<2", "openai>=1.55.0", "requests>=2.31.0", "jiangchang-platform-kit>=1.2.0", ] [[tool.uv.index]] name = "jiangchang-pypi" url = "https://git.jc2009.com/api/packages/client-jiangchang/pypi/simple/" ``` ### Technical Analysis The dependency declaration uses lower-bound-only constraints for `openai`, `requests`, and `jiangchang-platform-kit`. Although Playwright has a major-version upper bound, its allowed range is still broad. No lockfile or artifact hashes were identified in the supplied project structure. A future environment rebuild can therefore resolve versions different from those reviewed during this audit. The particularly privileged `jiangchang-platform-kit` package is obtained from a private package index and supplies runtime, configuration, logging, browser automation, video, and path-management functions used throughout the Skill. This is a supply-chain hardening deficiency rather than evidence that the current dependencies are malicious. The risk arises because package behavior may change after review without a corresponding source change in this repository. ### Attack Path 1. The shared Python runtime is created or rebuilt from `pyproject.toml` without a hash-verified lockfile. 2. The resolver queries the configured package sources. 3. It selects newer releases satisfying the broad version constraints. 4. A compromised registry account, compromised package index, or malicious future release s ...[truncated 850 chars]
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
Findings (224)

Context-Inappropriate Capability

Critical
Category
Not specified by scanner
Confidence
100% confidence
Finding

This section contains explicit financial operation capabilities, including account selection, multi-row payment-like form entry, and PIN-authorized final submission. In the context of a skill advertised for answer publishing, this is highly dangerous because it enables covert execution of sensitive financial transactions using stored credentials and authorization factors.

Content

No source excerpt is available for this finding.

Tainted flow: 'payload' from os.getenv (line 24, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/service/entitlement_service.py (reported line 31)May include surrounding context.

python
"context": {"entry": "main.py"},
    }
    try:
        res = requests.post(f"{auth_base}/api/entitlements/check", json=payload, headers=headers, timeout=timeout)
    except requests.RequestException as exc:
        return False, f"鉴权请求失败:{exc}"
    if res.status_code != 200:

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
98% confidence
Finding

声明描述的是一个面向百度知道的业务自动化能力:在指定问题下发布本地答案文稿。而实际代码并未实现登录百度知道、定位指定问题、读取本地回答文稿、填写表单或提交回答等核心行为。它只是一个通用浏览器会话管理模块,用于启动系统 Chrome/Edge 的 Playwright persistent context、打开由环境变量或默认值指定的起始页面,并提供关闭能力。虽然这可能是更大自动化流程的支撑组件,但就该代码块本身而言,其实际行为与声明的主要用途存在明显差异。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的核心能力是向百度知道问题自动发布回答,而该代码片段的实际功能完全不同:它专注于浏览器页面中的人工验证检测与等待逻辑,包括识别滑块验证码、短信验证码、安全/频控验证以及保存登录信息弹窗,并在超时时返回错误结果。代码中没有体现定位百度知道问题、读取本地回答文稿、填写回答内容或提交发布等行为。因此这不是简单的辅助实现细节,而是与声明的主要用途明显不一致的独立能力模块,应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的核心能力是“在百度知道指定问题下自动发布本地准备好的回答文稿”。但代码的主流程是:启动浏览器、确保登录、定位搜索框、输入关键词、提交搜索、等待搜索结果、滚动页面并收集结果项。返回值也是采集得到的 items 列表,没有任何进入指定问题页、定位回答输入框、填充本地文稿、点击发布/提交回答等操作。因此这不是描述与实现细节的小偏差,而是主要用途完全不同:声明是内容发布,实际是关键词搜索采集。应判定为明显不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个面向百度知道的自动发帖/回答发布技能,核心行为应包括定位指定问题、读取本地回答文稿并提交发布。实际代码却是一个“关键词搜索采集”任务服务:调用 run_keyword_search_async,使用 keyword/max_items/max_scrolls 控制抓取,成功后返回采集条目和 stop_reason,失败时返回搜索阶段错误。代码中没有任何与百度知道问题定位、回答内容加载、提交发布、发布确认相关的逻辑。因此主用途与实际行为存在明显且实质性的偏差,应判定为描述与代码不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

该代码片段是一个示例常量配置文件,不包含发布回答流程所需的任何关键逻辑或页面元素,反而定义了通用搜索与结果滚动场景的选择器和参数。其实际行为指向“在示例站点上进行搜索结果浏览/抓取类 RPA 配置”,与“在百度知道指定问题下自动发布回答”的声明存在明显且实质性的目的与平台不一致,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared purpose is a Baidu Zhidao automation skill that publishes prepared answers to a target question. The supplied code chunk does not perform any posting, browser automation, page interaction, local document submission, trigger handling, or Baidu-specific logic. Instead, it provides generic logging helpers and masking of potentially sensitive values for safe logging. This is not a supporting detail clearly tied to answer publication in the given chunk; it is an unrelated utility module, so the description does not accurately represent this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个面向百度知道的自动化发帖/回答能力,但提供的代码片段只是 pytest 的 conftest 配置,用于修改 sys.path 以便导入脚本目录。它没有浏览器自动化、网络交互、页面定位、登录、内容发布或文稿读取等行为。其主要目的与声明功能明显不一致,因此应判定为描述与实际行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个面向百度知道的问题回答自动发布能力;而实际代码并没有执行浏览器自动发布、定位百度知道问题、填写回答文稿或提交回答。相反,代码是针对 human_verification 模块的测试,核心行为是检测 DOM/文本中的滑块验证码和短信验证,并测试等待超时逻辑。这属于 materially different primary purpose,且体现了未声明但明显不同的能力,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个面向百度知道的自动发帖/回答发布技能,但代码实际只是单元测试,验证采集任务停止原因的用户提示文本,例如 max_items、end_marker、max_scrolls 等情形。代码没有体现任何百度知道页面交互、问题定位、本地文稿读取、回答提交等行为。其主要目的与声明严重不符,属于明显的描述-行为不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是“向百度知道问题自动发布回答”的内容发布自动化能力;但提供的代码片段并未执行任何浏览器操作、页面导航、问题定位、文本填写或提交回答。相反,它专注于账号管理基础设施:解析 account-manager 入口、调用子进程执行 pick-web/account get/lease release、返回 profile_dir 和 lease_token,并处理无账号、租约冲突等情况。这属于支撑性账号准备逻辑,但与声明的核心功能相比差异显著;尤其声明未体现任何账号管理、租约控制或外部 CLI 调用能力。因此该代码片段与声明用途不准确匹配,存在明显描述-行为不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description is about performing a concrete end-user action on Baidu Zhidao: posting a prepared answer to a specified question. The supplied code does not implement answer composition, navigation to Baidu Zhidao, question targeting, or submission of content. Instead, it is infrastructure code for selecting an adapter implementation based on configuration, including mock and simulator variants. That is a materially different primary purpose from the declared skill behavior, so this chunk does not accurately represent the stated description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is about automatically posting a prepared answer to a specific Baidu Zhidao question. The supplied code instead contains only generic dataclasses for batch submission results/items and an abstract adapter base class with a submit_batch method. There is no logic for interacting with Baidu Zhidao, locating questions, publishing answers, or browser/RPA actions. This is a materially different purpose, so the description does not accurately represent the code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared purpose is a browser/RPA-style automation task for publishing prepared answers to specific Baidu Zhidao questions. The supplied code instead implements a mock testing adapter for batch submission. It explicitly states that it does not start a browser, does not interact with Baidu Zhidao, does not publish content, and does not use the target parameter meaningfully. Its primary behavior is to simulate successful batch submission by counting items, summing monetary-like amounts, and returning a fabricated batch ID. This is a materially different purpose and capability from the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

声明描述的是一个面向百度知道的具体自动化发布能力:在指定问题下发布预先准备的回答文稿。但实际代码片段并没有实现或直接体现该平台特定行为,也没有出现百度知道、问题定位、回答内容填写或发布动作。它主要是一个通用的适配层/编排层:检测运行依赖、挑选账号、获取 lease_token、解析 base_url、调用 submit_batch_rpa 执行下层自动化,并最终释放租约。这说明代码的主要职责与声明的终端业务目标并不一致,且包含了未在声明中体现的账号租赁和环境检查等能力。虽然这些可能是支撑自动发布所需的基础设施,但就该代码片段本身而言,无法证明其准确对应“在百度知道指定问题下发布回答”这一描述,因此应判定为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个面向百度知道回答发布的具体业务技能,而给出的代码片段只是底层浏览器会话管理模块。它没有执行与“指定问题”“本地回答文稿”“自动发布为回答”直接对应的核心行为,也没有任何百度知道相关站点访问、页面导航、表单填写、提交发布等逻辑。相反,代码的实际用途是提供通用浏览器启动/关闭能力,并带有浏览器探测、无头配置和简单 stealth 设置。这属于与声明主目的 materially different 的代码片段,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是“在百度知道指定问题下自动发布回答”,应表现为访问百度知道页面、定位问题、填入回答文稿并提交。实际代码完全没有出现百度知道、问题页面、回答文本发布等行为;相反,它实现的是一个通用/仿真的业务系统 RPA 批量提交流程,包括登录两步表单、等待门户放行、选择账户、批量填写交易样式明细行、提交并确认 PIN、获取 batch_id。其目标系统、数据类型、操作流程和主要用途都与声明严重不符,因此属于明显的描述与行为不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个面向百度知道的自动答题发布技能,但代码并未体现任何与百度知道、问题定位、回答文本读取或发布回答相关的逻辑。相反,代码核心是对 items 列表做校验,要求 name、account、amount 等字段,随后选择 adapter 执行 submit_batch,这更像是批量交易、付款或通用批处理提交的编排层。其主要目的与声明明显不同,且涉及的资源和数据字段也不一致,因此属于明显描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description says the skill should automatically post prepared answers to specified Baidu Zhidao questions. However, this code chunk does not implement or support that specific purpose in any visible way. It is a constants/configuration module for a simulator-browser RPA example, with simulator base URL handling, local demo app path resolution, login wait timing, and demo authentication values. These behaviors point to a generic/demo simulator environment, not Baidu Zhidao answer publishing. This is a material purpose mismatch, not merely a supporting implementation detail.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个面向百度知道的自动发帖/回答发布技能,应包含与网页操作、定位指定问题、提交回答内容等相关行为。但给出的代码片段仅实现日志辅助功能:创建/获取 logger、设置日志级别与格式、以及对字符串中的手机号、长数字、邮箱局部进行掩码处理后用于日志输出。它没有任何与百度知道、浏览器自动化、回答发布、本地文稿读取或页面交互相关的行为。因此,这段代码的实际用途与声明的核心目的 materially 不一致,应判定为描述与代码行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个面向百度知道的自动发布回答技能,需要进行页面自动化、读取本地文稿并提交回答。而实际代码只是测试配置文件 conftest.py,在 pytest 运行时把脚本目录加入 sys.path,方便导入模块。它既不涉及浏览器操作,也不涉及百度知道、问题定位、文稿读取或内容发布。因此该代码块的实际行为与声明用途存在明显且实质性的不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个面向百度知道的自动回答发布技能,预期应包含浏览器/RPA 发帖、定位指定问题、读取本地回答文稿并提交回答等行为。但实际代码只是测试代码:它检查 select_adapter() 在不同 OPENCLAW_TEST_TARGET 环境变量下返回哪种适配器,并验证 MockBatchAdapter 的 submit_batch 对一组 BatchItem 的成功/失败结果与金额统计。代码没有任何百度知道相关逻辑,没有回答发布、网页交互、本地文稿读取,也没有与声明用途相关的触发或权限使用。因此代码实际用途与声明用途明显不符,属于实质性不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is about browser/RPA-style automation for posting an answer to Baidu Zhidao. The supplied code does not automate browser actions, interact with Baidu Zhidao, publish content, or use local answer drafts. Instead, it is a repository test that walks the scripts tree, reads Python files, searches for forbidden regex patterns, and asserts that none are present. This is a materially different primary purpose and behavior from the declared skill description.

Content

No source excerpt is available for this finding.