Back to skill

Security audit

投标文件写作工具

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its bid-document purpose, but it under-discloses account onboarding, device fingerprinting, credential storage, and network scope in ways users should review before installing.

Install only if you are comfortable sending tender and bid documents to the 百炼标书 cloud service, storing an API key locally, and using a Chinese-language workflow. Before using the trial flow, ask for explicit confirmation of the exact device fields being sent; prefer entering API keys through a safer local secret mechanism rather than pasting them into chat; and avoid untrusted remote document URLs.

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

Warning
Location
scripts/zcm_lib/cli.py:199
Finding

Device fingerprint disclosure without an enforced consent gate

Content
View full analysis

Vulnerability Details

File Location: scripts/zcm_lib/cli.py:199-234; corroborating metadata at SKILL.md:11-14
Vulnerability Type: Undisclosed collection and remote transmission of host identity information
Risk Level: Medium

Vulnerable Code

python
def _collect_device():
    import getpass
    import platform as _platform
    import socket
    import uuid as _uuid

    def _try(fn):
        try:
            v = fn()
            return str(v).strip() if v else ""
        except Exception:
            return ""

    def _mac():
        node = _uuid.getnode()
        if (node >> 40) & 0x01:
            return ""
        return hashlib.sha256(str(node).encode("utf-8")).hexdigest()

    return {
        "hostname": _try(socket.gethostname),
        "platform": _try(_platform.system),
        "arch": _try(_platform.machine),
        "username": _try(getpass.getuser),
        "home_path": _try(lambda: os.path.expanduser("~")),
        "mac_hash": _try(_mac),
    }


def _trial_flow():
    body = {"device": _collect_device()}
    if CHANNEL:
        body["channel"] = CHANNEL
    resp = _anon_json("POST", "/trial-accounts", json_body=body)
    key = str(resp.get("app_key", "")).strip()
    if not key:
        die("Trial registration failed because the API returned no key.")
    save_creds_file(dict(load_creds_file(), app_key=key))

The direct command handler at scripts/zcm_lib/cli.py:851-853 invokes this flow without an enforced consent argument:

python
def cmd_trial(args):
    _trial_flow()

The Skill metadata states that device information is not collected, which conflicts with the executable behavior.

Technical Analysis

Invoking the exposed trial command collects the host name, operating-system name, architecture, local account name, home-directory path, and a hash derived from the machine MAC address. _trial_flow() place ...[truncated 1997 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require an explicit, machine-verifiable consent flag such as --consent-device-registration before _collect_device() can run.
  2. Reject non-interactive trial registration unless explicit consent was supplied through that dedicated parameter.
  3. Present the exact fields, destination, purpose, and retention implications before requesting consent.
  4. Minimize collection to fields strictly necessary for trial-abuse prevention. Remove the username and home-directory path, and avoid stable hardware-derived identifiers where possible.
  5. Update SKILL.md metadata so that it accurately declares every collected and transmitted device field.
  6. Separate trial enrollment from ordinary document-processing commands so missing credentials cannot silently initiate fingerprint collection.
  7. Add tests confirming that direct trial invocation fails before any network request when consent is absent.
  8. Consider a privacy-preserving server-issued challenge or short-lived random installation identifier instead of transmitting host identity attributes.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (45)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill documentation discloses additional behaviors not clearly reflected in the high-level description, including device fingerprint collection for trial-account creation, SMS-based registration/binding, experience/feedback upload, and local credential persistence. These expand the data-handling surface beyond simple document processing and could lead to unexpected collection, transmission, or retention of sensitive user and device data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill documentation discloses additional behaviors not clearly reflected in the high-level description, including device fingerprint collection for trial-account creation, SMS-based registration/binding, experience/feedback upload, and local credential persistence. These expand the data-handling surface beyond simple document processing and could lead to unexpected collection, transmission, or retention of sensitive user and device data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill documentation discloses additional behaviors not clearly reflected in the high-level description, including device fingerprint collection for trial-account creation, SMS-based registration/binding, experience/feedback upload, and local credential persistence. These expand the data-handling surface beyond simple document processing and could lead to unexpected collection, transmission, or retention of sensitive user and device data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill documentation discloses additional behaviors not clearly reflected in the high-level description, including device fingerprint collection for trial-account creation, SMS-based registration/binding, experience/feedback upload, and local credential persistence. These expand the data-handling surface beyond simple document processing and could lead to unexpected collection, transmission, or retention of sensitive user and device data.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 38)May include surrounding context.

md
**升级 skill 必须保留配置**:如果当前已安装目录存在 `config.json`,升级时不得删除、覆盖或替换该文件;只能更新 `SKILL.md`、`scripts/`、`references/` 等 skill 内容文件。本地生成目录 `biaoshu-writer-corp-files/` 也必须保留。

Lp1

High
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The code reads sensitive configuration from environment variables such as ZCM_APP_KEY and ZCM_BASE, but the finding indicates this capability is not declared in the manifest/permissions model. Undeclared environment access is dangerous because it can silently consume secrets or alter network destinations outside the user’s expected trust boundary, especially in an agent skill that handles paid document workflows and credentials.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The file performs outbound network access by downloading arbitrary URLs via urllib.request.urlopen, but the finding indicates this capability is not declared in the skill permissions. In a document-processing skill that handles bid/tender files, undeclared network access is dangerous because it can fetch user-supplied remote content, enable SSRF against internal services, and transfer sensitive document references to external locations without clear permission boundaries.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'shell' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill contradicts itself on credential storage location: metadata permits writing to ~/.zcm/config.json, while later instructions prohibit global storage and require storing config.json beside the skill. Conflicting credential-storage guidance increases the chance of insecure handling, accidental exposure to other tools/users, or credentials being written to unintended locations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation states that installation will automatically create a trial account by collecting device characteristics, while the manifest says device information is 'not collected.' This contradiction is dangerous because it undermines informed consent and may result in covert collection of identifying telemetry from users handling sensitive tender/bid documents.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The file requires that installation-success and capability descriptions '优先原文照抄' and mandates exact Chinese example wording, which effectively constrains user-facing output to Chinese. There is no opt-in or alternative language path, so this is a natural-language locale policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This file forces a specific language/locale for all instructions and user-facing guidance, and it does not indicate that the skill is region-specific or that users may opt into another language. Under the policy, language constraints should be optional or clearly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file presents all operational instructions and API behavior in Chinese only, which can amount to a language/locale policy violation when no user opt-in or alternative language is offered. The policy allows locale constraints only when explicitly documented and justified, which is not stated here.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The API documentation instructs callers to upload bid files or provide remote file URLs, but it does not warn that these documents may contain highly sensitive commercial, legal, and personal data or explain transmission, storage, and access implications. In this procurement context, omitting privacy and data-handling guidance can lead users to expose confidential bid content to the service or cause the backend to fetch attacker-controlled or unintended internal URLs.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The instruction mandates a specific Chinese response phrase: “必须如实说‘当前为部分结果/语义审查未完整完成’”. This imposes a fixed language/locale behavior without indicating user opt-in or that the skill is intentionally limited to Chinese-language usage.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The entire skill guidance is written exclusively in Chinese and instructs the assistant on behavior in that language context, with no indication that users may choose another language or that the skill is intentionally limited to a Chinese-only deployment. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/usage.md (reported line 70)May include surrounding context.

json
   {"app_key":"bk_live_xxxxx","base":"","output_dir":""}

建好后 chmod 600 config.json(含真实 Key)。通常不用手写——方式 2~5 任一命令都会自动生成到当前 skill 根目录。 2. 用户把 Key 发你后,先定位当前安装的 biaoshu-writer-corp/SKILL.md 所在目录,再由你代跑 login --app-key bk_live_xxx 保存(自动建/更新同级 config.json,权限 600)——别把这条命令丢给用户自己敲。 3. 临时用环境变量:export ZCM_APP_KEY=bk_live_xxx(首次会自动落盘到当前 skill 根目录的 config.json,不是全局目录)。 4. 没 Key 想直接注册:向用户要手机号,由你代跑 register --phone(skill 内手机号+短信验证码换取 Api Key,自动保存)——见本节末尾「绑定手机号 / 可用字数不足」流程,别让用户自己敲命令。

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill directs the assistant to save API credentials into a local config.json automatically, including via environment-variable fallback, without a strong user-facing warning or explicit consent at the time of storage. Persisting live API keys locally is sensitive because compromise of the skill directory, backups, logs, or multi-user host access could expose credentials and enable unauthorized API use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly instructs downloading user-supplied remote files to a local directory before processing, but does not require clear user-facing disclosure, consent, retention limits, or cleanup. This creates a real privacy and data-handling risk because bid/tender files may contain confidential commercial, legal, or personal information that is persisted locally beyond the user's expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The instructions state that output and reports are automatically converted to Chinese and should be presented directly in Chinese. This imposes a language choice without offering the user a locale or language option, which is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code hard-codes report titles and content in Chinese, beginning with the generated report name at L040 and continuing throughout the file. Because the file provides no natural-language indication that users can choose another language or that the skill is intentionally restricted to a Chinese-only regulatory context, it presents a language/locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The rendered document sets lang='zh' and surrounding visible branding and footer text are fixed in Chinese, indicating the skill forces a specific language/locale in its output. The file does not offer a user-selectable language option or document that the skill is intentionally region-specific, which matches the natural-language locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The function constructs all user-visible billing shortage messages in Chinese (预计/本次需要约, 当前可用) with no indication that language selection is configurable. Per the policy, forcing a specific language without user choice or a documented justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The guidance explicitly tells users to paste their API key directly into the conversation so the assistant can save it. Asking for secrets in chat is dangerous because conversational channels may be logged, retained, exposed to operators, or mishandled by downstream tooling, turning the assistant into a credential collection point.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The _collect_device function gathers multiple fingerprinting attributes—hostname, platform, architecture, username, home path, and a hashed MAC-derived identifier—and sends them for trial-account creation. This exceeds the core bidding-document processing purpose and creates a privacy/security risk because it enables device tracking and user correlation without strong necessity or minimization.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dynamic_code_execution

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
scripts/zcm_lib/reporting.py:59