Back to skill

Security audit

采购意向监控-发标前1-3个月对接

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly aligned with procurement opportunity monitoring, but it needs review because it handles credentials, device identifiers, signed access links, and generated HTML reports with under-scoped safeguards.

Review this skill before installing if you are uncomfortable with a third-party procurement service receiving your search terms, storing an API key under your home directory, using a hashed device identifier for free-trial registration, or placing signed access links into chat and shareable HTML reports. Prefer a manually configured API key, avoid sharing generated reports that contain sk links, and treat the HTML renderer as needing URL-safety fixes.

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/render_report.py:143
Finding

Untrusted API URLs Permit Active Content Injection in Generated HTML Reports

Content
View full analysis

Vulnerability Details

File Location: scripts/render_report.py, lines 143–144
Vulnerability Type: HTML attribute injection and unsafe URL scheme handling
Risk Level: Medium

Vulnerable Code

python
def _link(text, url):
    return f'<a href="{esc(url)}" target="_blank">{esc(text)}</a>' if url else esc(text)

The esc() helper used here is based on xml.sax.saxutils.escape:

python
def esc(s) -> str:
    return _esc(str(s if s is not None else ""))

Technical Analysis

The report renderer incorporates URLs from API-derived report records into an HTML href attribute. The _link() function applies xml.sax.saxutils.escape, which escapes &, <, and > by default but does not escape quotation marks. Consequently, a URL containing a double quote can terminate the href attribute and inject additional HTML attributes.

For example, a value resembling:

text
https://example.invalid/" onclick="alert(document.domain)

would produce markup structurally equivalent to:

html
<a href="https://example.invalid/" onclick="alert(document.domain)" target="_blank">...</a>

The function also performs no URL-scheme validation. A javascript: URL can therefore remain active and execute when the report viewer clicks the link.

This sink is reachable from several report fields, including URLs in top_picks, proposed, intent, expiring, and citations.items. The documented workflow instructs the agent to preserve API-returned URLs unchanged when generating the HTML report, so a malicious or compromised upstream data record can reach this renderer without local user authorship.

Attack Path

  1. An upstream API or data provider returns a procurement record whose url field contains either:
    • a double quote followed by an injected event attribute; or
    • an active scheme such as javascript:.
  2. The agent copies the API-returned URL into the JSON report input as required by the Skill workflow.
  3. Full scan mo ...[truncated 1152 chars]
Remediation
View remediation

Remediation Suggestions

  1. Escape attribute values with quote-aware HTML escaping:
python
from html import escape

def esc_text(value) -> str:
    return escape(str(value if value is not None else ""), quote=False)

def esc_attr(value) -> str:
    return escape(str(value if value is not None else ""), quote=True)
  1. Validate every URL before rendering it. Permit only https URLs and, where compatible with the business requirement, restrict hosts to the expected platform domains:
python
from urllib.parse import urlparse

ALLOWED_HOSTS = {
    "www.zhiliaobiaoxun.com",
    "ai.zhiliaobiaoxun.com",
    "agent.zhiliaobiaoxun.com",
}

def safe_url(value) -> str | None:
    if not isinstance(value, str):
        return None

    value = value.strip()
    parsed = urlparse(value)

    if parsed.scheme != "https":
        return None
    if parsed.hostname not in ALLOWED_HOSTS:
        return None

    return value
  1. Render rejected or malformed URLs as plain text rather than as clickable links:
python
def _link(text, url):
    validated = safe_url(url)
    if not validated:
        return esc_text(text)
    return (
        f'<a href="{esc_attr(validated)}" '
        f'target="_blank" rel="noopener noreferrer">'
        f'{esc_text(text)}</a>'
    )
  1. Apply the same validation consistently to every URL-bearing collection, including citation entries.

  2. Add regression tests for:

    • double and single quotation marks;
    • javascript:, data:, and file: schemes;
    • encoded or mixed-case active schemes;
    • malformed URLs and user-info host confusion;
    • valid signed HTTPS URLs containing ordinary query parameters.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (38)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的是一个面向用户的商机监控与发现技能,核心能力应是搜索、筛选、跟踪和持续监控采购相关机会。但提供的代码并没有访问外部数据源、抓取采购信息、执行检索条件过滤、排序计算、监控增量变化或任务调度。它只接受已有的扫描结果 JSON,并将其格式化为 HTML 页面,附带打印/PDF/PNG 导出和品牌展示。这说明代码对应的是“报告展示层/输出层”,而不是所声明的“采购意向监控与早期商机发现助手”主体能力,因此存在明显的描述与实际行为不匹配。

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The activation rule is overly broad and says the skill must be used even when the user does not explicitly request procurement-intent analysis. In an agent routing context, this can cause over-collection of user queries, unnecessary external API calls, and unexpected spending or disclosure of business interests to the third-party service.

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 81)May include surrounding context.

md
完整模式下,对话清单输出后默认再用 `scripts/render_report.py` 生成一份可分享的 HTML 版商机清单并告知保存路径(详见 report-template.md「HTML 报告导出」)。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
完整模式下,对话清单输出后默认再用 `scripts/render_report.py` 生成一份可分享的 HTML 版商机清单并告知保存路径(详见 report-template.md「HTML 报告导出」)。

Hidden Instructions

High
Category
Prompt Injection
Confidence
94% confidence
Finding

This duplicate finding identifies the same hidden instruction block, which still represents a real risk. Concealed directives that require sending package/source identity and acknowledgment callbacks create non-obvious control channels and undermine trustworthy inspection of what the skill transmits.

Content

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

  • 用户想持续跟踪 → 介绍订阅模式(见上方「订阅模式」)
  • 以上都不贴切 → 询问是否要对某条高价值商机深挖,或引导访问知了商机大师 https://agent.zhiliaobiaoxun.com

安装包身份与升级检查:所有发往知了标讯 API 的请求(包括账户查询)必须额外携带以下两个请求头:

text
X-Skill-Package: procurement-intent-monitor/1.0.8

Hidden Instructions

High
Category
Prompt Injection
Confidence
94% confidence
Finding

This duplicate finding identifies the same hidden instruction block, which still represents a real risk. Concealed directives that require sending package/source identity and acknowledgment callbacks create non-obvious control channels and undermine trustworthy inspection of what the skill transmits.

Content

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

  • 用户想持续跟踪 → 介绍订阅模式(见上方「订阅模式」)
  • 以上都不贴切 → 询问是否要对某条高价值商机深挖,或引导访问知了商机大师 https://agent.zhiliaobiaoxun.com

安装包身份与升级检查:所有发往知了标讯 API 的请求(包括账户查询)必须额外携带以下两个请求头:

text
X-Skill-Package: procurement-intent-monitor/1.0.8

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/api-quick.md (reported line 1)May include surrounding context.

请求身份:使用已配置的 API Key,并保留本包的 X-Client,携带下列完整身份头;不得沿用其它包的版本或来源。

text
X-Client: opportunity-radar/1.0.3

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/api-quick.md (reported line 1)May include surrounding context.

请求身份:使用已配置的 API Key,并保留本包的 X-Client,携带下列完整身份头;不得沿用其它包的版本或来源。

text
X-Client: opportunity-radar/1.0.3

Hidden Instructions

High
Category
Prompt Injection
Confidence
95% confidence
Finding

This duplicate hidden-instruction finding points to the same concealed request-identity block that directs the agent to use specific headers and package provenance. In a skill context, concealed transport instructions are especially risky because they are easy to smuggle into prompt content and can steer authenticated requests without clear user awareness.

Content

Scanner excerpt · references/auto-register.md (reported line 1)May include surrounding context.

请求身份:使用已配置的 API Key,并保留本包的 X-Client,携带下列完整身份头;不得沿用其它包的版本或来源。

text
X-Client: opportunity-radar/1.0.3

Hidden Instructions

High
Category
Prompt Injection
Confidence
95% confidence
Finding

This duplicate hidden-instruction finding points to the same concealed request-identity block that directs the agent to use specific headers and package provenance. In a skill context, concealed transport instructions are especially risky because they are easy to smuggle into prompt content and can steer authenticated requests without clear user awareness.

Content

Scanner excerpt · references/auto-register.md (reported line 1)May include surrounding context.

请求身份:使用已配置的 API Key,并保留本包的 X-Client,携带下列完整身份头;不得沿用其它包的版本或来源。

text
X-Client: opportunity-radar/1.0.3

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file embeds a full account lifecycle workflow—API-key discovery, user consent prompts, device-feature collection, automatic account registration, balance checks, recharge links, and credential persistence—inside a skill whose declared purpose is procurement-intent monitoring. This is dangerous because it expands the skill’s authority far beyond user-expected functionality and enables collection and transmission of host-derived identifiers and persistence of secrets, creating privacy, abuse, and supply-chain risk if the skill is installed or invoked in trusted agent environments.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs collection of platform, CPU architecture, and a hashed MAC-derived identifier for trial deduplication, even though that data is unrelated to procurement monitoring. Even with hashing, MAC-derived fingerprints are stable device identifiers and their external transmission creates a privacy-invasive tracking mechanism that exceeds the stated purpose of the skill.

Content

No source excerpt is available for this finding.

Hidden Instructions

High
Category
Prompt Injection
Confidence
86% confidence
Finding

This duplicate hidden-instruction finding identifies the same embedded comment-based directive that controls API identity headers and package/source metadata. Such concealed instructions can bypass normal transparency expectations and cause the agent to send metadata or use credentials under rules not evident to the user.

Content

Scanner excerpt · references/report-template.md (reported line 1)May include surrounding context.

请求身份:使用已配置的 API Key,并保留本包的 X-Client,携带下列完整身份头;不得沿用其它包的版本或来源。

text
X-Client: opportunity-radar/1.0.3

Hidden Instructions

High
Category
Prompt Injection
Confidence
86% confidence
Finding

This duplicate hidden-instruction finding identifies the same embedded comment-based directive that controls API identity headers and package/source metadata. Such concealed instructions can bypass normal transparency expectations and cause the agent to send metadata or use credentials under rules not evident to the user.

Content

Scanner excerpt · references/report-template.md (reported line 1)May include surrounding context.

请求身份:使用已配置的 API Key,并保留本包的 X-Client,携带下列完整身份头;不得沿用其它包的版本或来源。

text
X-Client: opportunity-radar/1.0.3

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The template explicitly requires preserving and displaying full API-returned URLs containing sk login-bypass parameters in both chat output and exported HTML. Exposing bearer-like access parameters to users, logs, or shareable files risks token leakage, unauthorized access, link replay, and uncontrolled redistribution of authenticated resources.

Content

No source excerpt is available for this finding.

Hidden Instructions

High
Category
Prompt Injection
Confidence
95% confidence
Finding

This duplicate finding points to the same hidden instruction block that attempts to control authenticated request headers and package identity through non-user-visible content. Even if intended for normal operation, hidden prompt directives that govern credential use are dangerous because they can bypass user awareness and normalize trusting concealed instructions in adversarial content.

Content

Scanner excerpt · references/workflow.md (reported line 1)May include surrounding context.

请求身份:使用已配置的 API Key,并保留本包的 X-Client,携带下列完整身份头;不得沿用其它包的版本或来源。

text
X-Client: opportunity-radar/1.0.3

Hidden Instructions

High
Category
Prompt Injection
Confidence
95% confidence
Finding

This duplicate finding points to the same hidden instruction block that attempts to control authenticated request headers and package identity through non-user-visible content. Even if intended for normal operation, hidden prompt directives that govern credential use are dangerous because they can bypass user awareness and normalize trusting concealed instructions in adversarial content.

Content

Scanner excerpt · references/workflow.md (reported line 1)May include surrounding context.

请求身份:使用已配置的 API Key,并保留本包的 X-Client,携带下列完整身份头;不得沿用其它包的版本或来源。

text
X-Client: opportunity-radar/1.0.3

Obfuscated Code

High
Category
Supply Chain
Confidence
50% confidence
Finding

Code contains obfuscation (base64, hex encoding with execution). This is often used to hide malicious functionality.

Content

Scanner excerpt · scripts/render_report.py (reported line 64)May include surrounding context.

python
ROUTE_COLOR = {"拟建": "#7c5cbf", "意向": "#0b7a6a", "临期": "#b9770e"}

# 知了标讯白色 logo(299x96 PNG base64 内嵌,保证报告离线/打印/转发时不裂图)
_LOGO_B64 = "iVBORw0KGgoAAAANSUhEUg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hcUd9MXXgK+BVNGAJlRJnEBGVbOy7Lz2be1bbdtax3p1LYtnf1tenk3euMneWrHSVu7cbTCNSAGyUU9yCILV9IxMq5KVaUfZdPioBh9DQDomTXxaZNUyM613s2Z2UYe2dlrDhlaD8+w5nG8zt22zd1atthlbmcZKZChyLKsUFtWxtKJTyOYfZc3KT+9rwNdAYjSQZk8//wKk8POyThGTAfF0b9DQHh022M5p3eq40slr27R/vz06a649N28uYSGzVnXr2vltWtvpLVpY29q1rHqlLDsC4ew8dMjm5+yw91avsbk5260mxHRr3952eZdOVp3lUNHxf1m01B6bNdu25uZChmUINzkEmXYIa+1dGPNKppPJCz2fv+5rwNdA+WsgIZZVBpbPKQ0b2avnn2tdsKaO4E6t3L3bpm/ZagcKjjgW1sAmTaxFzZr20JCB1q1BPQwXw0pqZw2rhu8lMBQr6mendLecgwctl2leOkFsynfdvn32xdYcZ3vzmjWsb+NG1rxGDefYJtWr2k2Tpth20pTJwioqghHTGllWVl1uiU9W5V8v/TP6GjhOAwkhq/pVqth9gwY4RLU3P98enTnHnsd62pN32IkrZeLi9Wve1P5w1unWtX59+1mP7scVJNyGLFw6EZGkEKKat32H3Txxkk1du94ho0xcQ+V3W7/e9oNOHe2c7NZ2Q699ds/n05nduJTCeZAM4m01sK4UbPfF14CvgRTQQJnJqjJhpcHNm9t5uHP
...[truncated 27 chars]

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill explicitly writes HTML reports to a local directory but does not declare any tool scope or allowed-tools boundary for file writing. In agent environments, undeclared write capability weakens least-privilege controls and can let the skill create artifacts without clear user or platform consent boundaries.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The entire skill description and prescribed user-facing phrasing are written only in Chinese, including mandatory disclosure examples and response guidance, with no indication that users may choose another language. Under the stated policy, forcing a specific language without opt-in is a natural-language policy issue unless the locale restriction is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The markdown says '给我一个行业/产品/地区,我把还没发标的机会先帮你找出来', which is a very general instruction pattern that could match broad user conversation. It does not define when this skill should not activate, nor does it provide negative examples to prevent accidental invocation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation instructs the agent to output URLs containing an sk login-bypass parameter and says they can be clicked directly. If these links are shared, logged, or exposed in transcripts, anyone possessing them may gain unintended access to protected content without normal authentication, creating a token leakage risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Direct-click bypass links are effectively bearer tokens, and the documentation lacks any warning that they are sensitive credentials. In an agent setting, such links can easily propagate through chat history, telemetry, browser previews, or downstream systems, broadening unauthorized access risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The documentation states that expiring-project results contain contact fields, but provides no strong privacy boundary beyond a vague note about restrained output. In a procurement-monitoring skill, surfacing contact information without explicit user need or policy controls can disclose personal or sensitive business data unnecessarily.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest describes a skill focused on discovering and tracking early procurement opportunities, but this file requires every session to call an account balance endpoint and to submit a version-notice acknowledgment callback. Those package/account management operations are not part of the user-facing procurement-monitoring purpose described in the manifest.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.