Back to skill

Security audit

Hk Ipo Research Assistant

Security checks for vulnerabilities and agentic risk

Overview

This looks like a Hong Kong IPO research tool, but it stores and prints a user's financial profile, so it needs review before installation.

Review the profile feature before installing. Only create scripts/config/user-profile.yaml if you are comfortable storing your capital, risk preference, margin preference, and broker in a local file that the skill may print into chat or logs. Use an isolated Python environment, avoid sudo, and consider pinning dependencies before installation.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
scripts/requirements.txt:1
Finding
Unpinned Third-Party Dependencies Permit Unreviewed Package Releases<![CDATA[ ## Vulnerability Details **File Location**: `scripts/requirements.txt:1-5`; installation instruction at `SKILL.md:18-21` **Vulnerability Type**: Software supply-chain risk caused by unrestricted dependency resolution **Risk Level**: Medium ### Vulnerable Code `scripts/requirements.txt:1-5`: ```text httpx>=0.24.0 requests>=2.28.0 opencc-python-reimplemented>=0.1.7 beautifulsoup4>=4.12.0 lxml>=5.0.0 ``` `SKILL.md:18-21`: ```bash cd <skill_dir> pip install -r scripts/requirements.txt ``` ### Technical Analysis Every dependency is specified using only a minimum version constraint. There is no upper bound, exact version pin, lock file, or package hash verification. Consequently, package resolution can install releases that did not exist when the Skill was reviewed. The installation instructions also invoke `pip` directly without requiring an isolated virtual environment or hash verification. Python packages may execute build backend logic during installation, while installed packages execute code when imported by the Skill. If an allowed package or one of its transitive dependencies is compromised, a malicious release may therefore run code with the privileges of the user installing or invoking the Skill. This finding does not establish that the currently named packages are malicious. It identifies an unsafe dependency-resolution policy that permits future, compromised, or otherwise unreviewed releases to enter the execution environment. ### Attack Path 1. An attacker compromises the distribution account, source repository, build pipeline, or transitive dependency of a package permitted by `scripts/requirements.txt`. 2. The attacker publishes a malicious release with a version satisfying the applicable `>=` constraint. 3. A user follows the documented command: ```bash pip install -r scripts/requirements.txt ``` 4. The package resolver selects the malicious release because no exact version or trusted hash is specified. 5. Malicious code e ...[truncated 858 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace lower-bound constraints with exact, reviewed versions: ```text httpx==<reviewed-version> requests==<reviewed-version> opencc-python-reimplemented==<reviewed-version> beautifulsoup4==<reviewed-version> lxml==<reviewed-version> ``` 2. Generate a lock file that includes all transitive dependencies and cryptographic hashes. Install it with hash enforcement: ```bash python3 -m pip install --require-hashes -r requirements.lock ``` 3. Perform installation in a dedicated virtual environment: ```bash python3 -m venv .venv . .venv/bin/activate python3 -m pip install --require-hashes -r requirements.lock ``` 4. Configure pip to use an approved package index and disable unintended extra indexes to reduce dependency-confusion exposure. 5. Add automated dependency review, vulnerability scanning, and controlled lock-file update procedures. Review release notes and package provenance before changing pinned versions. 6. Explicitly warn users not to install the dependencies with `sudo` or into a privileged system Python environment. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (48)

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding
Most of the code is aligned with the declared Hong Kong IPO research purpose: it dispatches to modules for margin, ratings, grey market, allotment, A+H discount, HKEX disclosure, and sentiment-related data. That matches the stated IPO打新 assistant concept. However, the implementation materially extends beyond a pure data-fetching research helper. The `profile` command accesses a local YAML configuration file containing user capital, risk preference, margin preference, and broker, then combines that with IPO data to produce personalized outputs. This is a meaningful undeclared capability involving local file access and user profiling. The `analyze` command also synthesizes multiple sources into a structured single-IPO analysis, which goes beyond the description's narrower framing of simply fetching data for AI to analyze. Additionally, the `etnet` sponsor-statistics functionality is not clearly disclosed in the description. These are substantial enough to count as a description-behavior mismatch, though the overall domain remains Hong Kong IPO analysis.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding
整体领域基本一致,都是围绕港股 IPO 数据采集与分析支持;代码确实覆盖了孖展、暗盘相关信息、中签率、保荐人等核心 IPO 数据,因此不属于完全不同目的。但声明中若干关键能力与实际实现不符:代码没有看到评级来源或评级抓取逻辑,也没有 A+H 折价相关计算/抓取;注释提到暗盘可通过 WebSocket,但实际代码仅实现暗盘时间表抓取,没有实时行情连接;“基石投资者”也未被明确实现,当前仅解析名为 institutional_investors 的机构投资者表,不能等同于基石投资者。故描述对能力范围有明显夸大,存在描述与行为不匹配。

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The description presents a broader data-ingestion/research assistant focused on collecting multiple real-time Hong Kong IPO indicators. The supplied code does not perform network access, scraping, API calls, or data retrieval of any kind. Instead, it implements a mathematical estimation model for one specific metric: allotment/winning probability based on oversubscription, price, mechanism, and lot count. While '中签率' is one item listed in the description, the primary behavior here is a calculator rather than a real-time data fetching assistant, so the description materially overstates and mischaracterizes the implemented capability.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
描述声称该技能是“港股 IPO 打新研究助手”,并明确列出会抓取多类核心打新指标:孖展、基石、评级、暗盘、A+H 折价、中签率。实际代码只访问富途 IPO 页面,解析其中已上市新股列表,提取发行价、当前价、首日涨跌幅、暗盘涨跌幅、累计涨跌幅、上市日期、市值和行业,并按近期上市时间做简单筛选统计。也就是说,代码只覆盖了声明中的“暗盘”以及部分上市后表现数据,缺少大部分声明中的关键研究维度,且重点偏向“已上市新股表现回顾”而不是“打新决策所需的实时多维数据抓取”。未发现额外的敏感或越权能力,但描述与实际功能范围存在明显不一致。

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
描述强调的是面向港股打新的多维实时研究数据聚合能力,核心指标包括孖展、基石、评级、暗盘、A+H 折价、中签率等。给定代码却仅访问 HKEX News 的披露易接口,获取处理中和已上市 IPO 列表,并提取状态、日期、板块及文档链接,尤其是招股书/聆讯后资料集。这与“港股 IPO”领域有关,但未覆盖描述中最关键的打新研究数据来源和指标,因此属于描述与实际行为的实质性不一致。代码也没有出现与声明无关的危险或额外越权能力;问题主要在于声明明显高估了实现范围。

Lp3

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding
The skill documentation advertises commands that read local files, write a user profile to disk, and fetch remote data, but it does not declare any explicit tool scope or allowed-tools/permissions boundaries. This is dangerous because consumers and hosting platforms cannot easily constrain filesystem and network access, increasing the chance of over-privileged execution or unintended data access.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill instructs users to collect personal financial preference data such as capital, risk appetite, margin usage, and broker, then store it in a local YAML file without a clear privacy notice, retention policy, or access limitations. This is dangerous because sensitive financial profiling data may be persisted insecurely, exposed to other local processes/users, or handled without informed consent.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The entire guide is written in Chinese and presents its instructions exclusively in that language, with no indication that users may choose another language or that the skill is intentionally restricted to a Chinese-speaking audience. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
This markdown file documents cache management commands including `--clear`, which performs deletion of cached data, but it provides no warning that the action removes stored data or may be irreversible. For markdown files, destructive behaviors that can affect user data or system state should be accompanied by an explicit warning.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
This section discusses leveraged IPO subscription, financing fees, and the tradeoff between higher application size and potential gains, which can influence real trading behavior. Although it mentions some costs, it does not clearly warn that this is not financial advice, that leveraged participation can amplify losses or opportunity costs, or that users may make unsuitable decisions based on incomplete risk framing.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
This section outlines sell-timing options such as grey market trading, first-day sale, or longer holding, which can be interpreted as actionable trading guidance. It lacks explicit warnings that IPO prices can be highly volatile, liquidity may be poor, and users may incur substantial losses if they rely on these timing descriptions without adequate risk disclosure.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The CLI adds a `profile` command that reads and outputs a user’s capital, risk tolerance, margin preference, and broker from a local YAML file, which goes beyond the declared IPO market-data research scope in the skill metadata. This creates a scope-expansion and privacy risk because an agent invoking the skill may access or surface sensitive personal financial preference data that users did not expect this skill to process.

Context-Inappropriate Capability

Medium
Confidence
94% confidence
Finding
This code processes personal investor profile information such as available capital, risk preference, margin usage, and broker choice, none of which is necessary for merely fetching IPO research data. Even though the data is local, collecting and using it for analysis broadens the data handling surface and can expose sensitive financial attributes to downstream consumers or logs.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The `profile` path silently reads `user-profile.yaml` and later emits its contents in JSON without any warning, confirmation, or masking. In an agent setting, that can leak sensitive financial preferences and capital information into chat responses, tool traces, or logs, especially because the skill description does not signal personal-data handling.

Description-Behavior Mismatch

Medium
Confidence
91% confidence
Finding
The documented '主要功能' includes retrieving '暗盘行情', which implies quote/market data, and the manifest also emphasizes real-time data collection. In practice, the only grey-market function fetches a greymarket HTML page and returns listing/schedule fields such as date and offer price, not live行情 or streaming quote data. This makes the implemented behavior materially narrower than the stated capability.

Intent-Code Divergence

Medium
Confidence
95% confidence
Finding
The documentation states '获取暗盘行情(通过 WebSocket)' and notes that real-time grey-market quotes require a WebSocket connection. However, the implementation only defines `get_grey_market_schedule()` using `httpx` to fetch a regular HTML page and does not establish any WebSocket connection or retrieve real-time quotes. This is an active contradiction between stated behavior and implemented behavior.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The manifest explicitly scopes the skill to 港股 IPO 打新 and says A 股打新、美股 IPO are not applicable. However, the yearly summary and performance functions return cross-market data with market codes HK, N, and A, and the CLI even labels them as 港股/美股/A股, expanding the skill beyond its declared domain.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
This code file contains natural-language strings and documentation entirely in Chinese, including the module docstring and user-facing CLI help/output messages. Under the policy rule, forcing a specific language without user opt-in is a locale-policy violation unless the regional restriction is explicitly justified, which is not stated in this file.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The request header explicitly sets `Accept-Language` to prefer `zh-CN` and Chinese content. This imposes a language/locale choice in code without any user opt-in or explanation that the skill is region-specific, which matches the language/locale policy concern.

Session Persistence

Medium
Category
Rogue Agent
Content
API 端点:
- 主板处理中: https://www.hkexnews.hk/ncms/json/eds/appactive_appphip_sehk_c.json
- 主板已上市: https://www.hkexnews.hk/ncms/json/eds/applisted_sehk_c.json
- 创业板处理中: https://www.hkexnews.hk/ncms/json/eds/appactive_appphip_gem_c.json
"""
Confidence
75% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Session Persistence

Medium
Category
Rogue Agent
Content
API 端点:
- 主板处理中: https://www.hkexnews.hk/ncms/json/eds/appactive_appphip_sehk_c.json
- 主板已上市: https://www.hkexnews.hk/ncms/json/eds/applisted_sehk_c.json
- 创业板处理中: https://www.hkexnews.hk/ncms/json/eds/appactive_appphip_gem_c.json
"""
Confidence
75% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The function returns market interpretations only in Chinese, and later CLI output is also presented in Chinese. This creates a language/locale policy concern because the skill does not provide user opt-in or an alternative language path, and the file itself does not clearly justify a Chinese-only interface as a documented regional requirement.

Intent-Code Divergence

Medium
Confidence
97% confidence
Finding
The CLI catches requests.RequestException even though the code performs network access with httpx, so real network failures from httpx will go uncaught and can terminate the process with a traceback. In this skill's context, which depends on external live IPO data, malformed or unavailable upstream responses can reliably trigger denial of service for the command-line workflow and may leak stack traces or internal details to users/logs.

Natural-Language Policy Violations

Low
Confidence
87% confidence
Finding
This markdown file presents all user-facing instructions, examples, and warnings exclusively in Chinese. The policy requires flagging language or locale constraints when a skill forces a specific language without user opt-in, and no alternative language option or justification is provided here.

Natural-Language Policy Violations

Low
Confidence
92% confidence
Finding
The guide content is presented entirely in Chinese and begins with a Chinese-only description, with no indication that users may choose another language or that the locale restriction is intentional and justified. The policy requires flagging language or locale constraints when a specific language is imposed without opt-in or documented justification.

Static analysis

No suspicious patterns detected.