Back to skill

Security audit

Ashare Fast Watcher

Security checks for vulnerabilities and agentic risk

Overview

This skill is a financial market tool with unclear scope and unsafe local notification code, so users should review it carefully before installing.

Install only if you are comfortable with a China-market trading-signal tool rather than a simple market watcher. Do not run the daemon with elevated privileges, avoid relying on its alerts for real trades without independent verification, and prefer a version that removes shell execution, uses authenticated market-data transport, documents all modes and data sources, and restores user-controlled trading-hours behavior.

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

T09 · Insecure Skill Coding Practices

Error
Location
daemon.py:22
Finding
Arbitrary Command Injection Through Market-Controlled Notification Content<![CDATA[ ## Vulnerability Details **File Location**: `daemon.py`, lines 22-23 **Vulnerability Type**: OS command injection **Risk Level**: High ### Vulnerable Code ```python safe_msg = msg.replace('"', '\\"') cmd = f'''osascript -e 'display notification "{safe_msg}" with title "{title}" sound name "Glass"'''' os.system(cmd) ``` The notification content originates from market data retrieved without transport authentication: ```python url = f"http://qt.gtimg.cn/q={codes}" resp = requests.get(url, timeout=1.0) lines = resp.text.strip().split(';') ``` ### Technical Analysis The application constructs a shell command by interpolating `safe_msg` and `title` into a string and then executes it through `os.system()`. Because `os.system()` invokes a command shell, shell metacharacters in interpolated values are interpreted rather than treated strictly as notification data. The attempted sanitization only escapes double quotation marks: ```python safe_msg = msg.replace('"', '\\"') ``` This does not protect the command's outer single-quoted AppleScript expression. An instrument name containing a single quote can terminate that shell-quoted expression. Subsequent shell syntax can then introduce an additional command. The message includes remotely supplied instrument names parsed from a plaintext HTTP response. Consequently, an attacker capable of modifying that response can potentially control part of `msg`. Exploitation also requires the forged response to satisfy one of the alert conditions so that `notify_mac()` is called. ### Attack Path 1. The daemon requests market data from `http://qt.gtimg.cn` over plaintext HTTP. 2. A network-positioned attacker intercepts or modifies the response. 3. The attacker supplies a syntactically valid response containing: - An instrument name with a single quote followed by shell command syntax. - Numeric values that satisfy a bond-linkage or ETF-premium alert condition. 4. The manipulated instrument name is incorporated ...[truncated 837 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the shell from the execution path. Invoke AppleScript with an argument list: ```python import subprocess subprocess.run( ["osascript", "-e", script], shell=False, check=True, ) ``` 2. Do not assume that `shell=False` alone makes dynamically generated AppleScript safe. Encode or escape all values according to AppleScript string-literal rules, including backslashes, quotation marks, and control characters. A safer design is to pass data as separate `osascript` arguments and read it from `argv` in an AppleScript handler. 3. Strictly validate market-data fields before using them: - Allow only expected stock-code syntax. - Reject malformed numeric fields. - Apply a conservative allowlist to instrument names or remove control characters and shell-relevant punctuation. - Enforce maximum field lengths. 4. Use HTTPS with certificate verification if the provider offers an authenticated HTTPS endpoint. If not, use a trusted market-data source that provides transport authentication. 5. Treat all external market data as untrusted, even after transport security is added. 6. Run the monitor as a dedicated, unprivileged user with minimal filesystem and credential access. 7. Add tests containing single quotes, semicolons, command substitutions, newlines, and malformed AppleScript input to verify that none can cause additional process execution. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
index.py:5
Finding
Market Data and Trading Signals Can Be Manipulated Through Plaintext HTTP<![CDATA[ ## Vulnerability Details **File Location**: `index.py`, lines 5-14 **Vulnerability Type**: Unauthenticated transport of security-relevant market data **Risk Level**: Medium ### Vulnerable Code ```python def fetch_raw_data(code_str): url = f"http://qt.gtimg.cn/q={code_str}" try: resp = requests.get(url, timeout=0.5) if resp.status_code == 200: return resp.text.strip().split(';') return [] except: return [] ``` The same transport weakness also appears in `daemon.py` at lines 27-30: ```python url = f"http://qt.gtimg.cn/q={codes}" resp = requests.get(url, timeout=1.0) lines = resp.text.strip().split(';') ``` ### Technical Analysis Both market-data clients use plaintext HTTP. HTTP does not authenticate the remote endpoint and does not protect response integrity. A network-positioned attacker, compromised gateway, malicious proxy, or DNS/network redirection can observe and modify the returned quote data. The parsed values directly influence outputs such as `TRIGGER_BOND_BUY`, `QUEUE_ETF_LIMIT_UP`, spread calculations, and desktop alerts. Although the code shown does not execute trades directly, its outputs explicitly recommend or signal trading actions. A forged response can therefore manufacture apparent limit-up conditions, bond spreads, ETF premiums, names, prices, and percentage changes. The client checks only the HTTP status in `index.py`; it does not authenticate the source or establish cryptographic integrity. Basic field-count checks do not establish data authenticity. ### Attack Path 1. A user invokes a linkage or ETF-premium analysis, or runs the monitoring daemon. 2. The application sends a plaintext HTTP request for quote data. 3. A network-positioned attacker intercepts or redirects the request. 4. The attacker returns a response with the expected delimiter structure but forged prices and percentage changes. 5. `parse_line()` or `fetch_data()` accepts the forged fields as legitima ...[truncated 848 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace the endpoint with an HTTPS endpoint that provides valid certificate authentication. Keep certificate verification enabled. 2. If this provider cannot offer authenticated HTTPS, migrate to a trusted data provider that can. Do not disable TLS verification as a workaround. 3. Validate response structure and semantics before analysis: - Confirm requested codes match returned codes. - Enforce exact field types and reasonable numeric ranges. - Reject non-finite numbers, unexpected delimiters, oversized values, and invalid names. - Verify timestamps or freshness indicators when available. 4. Where the provider supports it, use signed responses or another application-level integrity mechanism. 5. Fail closed when authenticity or parsing checks fail. Clearly distinguish unavailable data from a valid `WAIT` recommendation. 6. Avoid using unauthenticated quote data for automated financial actions. Require an independently authenticated data source or human verification before order placement. 7. Replace the broad `except:` block with specific exception handling and security-conscious logging so transport and parsing failures are visible rather than silently converted into empty data. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The skill claims Tencent direct API and millisecond-level continuous monitoring, but the analyzed behavior reportedly uses different data interfaces, scans unrelated instruments, and performs one-off ranking output. Such misrepresentation is a security and trust issue because reviewers cannot accurately assess data flows, dependencies, or operational behavior from the manifest.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The skill claims Tencent direct API and millisecond-level continuous monitoring, but the analyzed behavior reportedly uses different data interfaces, scans unrelated instruments, and performs one-off ranking output. Such misrepresentation is a security and trust issue because reviewers cannot accurately assess data flows, dependencies, or operational behavior from the manifest.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill claims Tencent direct API and millisecond-level continuous monitoring, but the analyzed behavior reportedly uses different data interfaces, scans unrelated instruments, and performs one-off ranking output. Such misrepresentation is a security and trust issue because reviewers cannot accurately assess data flows, dependencies, or operational behavior from the manifest.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The implementation materially diverges from the declared skill purpose: instead of a millisecond-level A-share watcher using Tencent direct API, it performs ad hoc screening of convertible bonds and cross-border ETFs using AkShare/Eastmoney-style data sources. This kind of spec/behavior mismatch is dangerous because users and orchestrators may grant the skill trust, permissions, or workflow placement based on the manifest, while the code actually performs different market analysis and may produce misleading outputs in a trading context.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill metadata declares no explicit tool scope, yet the analyzed implementation reportedly uses both network and shell capabilities. That creates an authorization and transparency gap: operators may approve a seemingly simple market-data skill without realizing it can execute shell commands or make arbitrary outbound requests.

Context-Inappropriate Capability

Medium
Confidence
92% confidence
Finding
The skill constructs a shell command and invokes it with os.system to display notifications. Although the current message content is internally generated from market data and only escapes double quotes, shell execution is still an unnecessarily powerful primitive for this use case and can become dangerous if any upstream data contains unexpected characters or if future changes introduce less-controlled input.

Natural-Language Policy Violations

Medium
Confidence
98% confidence
Finding
The docstring, notification text, and console output are written in Chinese, and the rest of the file continues this pattern for all user-facing messages. This imposes a specific language on users without any opt-in, selection mechanism, or justification that the skill is intended only for a Chinese-speaking or region-specific audience.

Intent-Code Divergence

Medium
Confidence
98% confidence
Finding
Lines L43-L44 describe automatic silence outside trading hours to save resources, and L52 says the restriction is being forcibly opened for testing. But L53 uses 'if True', meaning the monitor ignores the computed trading-time gate entirely and always runs, directly contradicting the stated behavior in the comments.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
User-supplied security identifiers are sent to a third-party endpoint over plain HTTP without any disclosure, allowing those inputs to be exposed to the remote service and potentially intercepted in transit. In this skill context, ticker queries may reveal user trading interests or strategy targets, making the privacy leak more meaningful than a generic quote lookup.

Unbounded Resource Access

Medium
Category
Excessive Agency
Content
def fetch_raw_data(code_str):
    url = f"http://qt.gtimg.cn/q={code_str}"
    try:
        resp = requests.get(url, timeout=0.5)
        if resp.status_code == 200:
            return resp.text.strip().split(';')
        return []
Confidence
75% confidence
Finding
Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.

Description-Behavior Mismatch

Medium
Confidence
97% confidence
Finding
The manifest says this skill is a millisecond-level market data watcher using Tencent's API, which implies monitoring and retrieval of market quotes. However, the code goes further by implementing decision logic that emits actionable trading-style outputs such as "TRIGGER_BOND_BUY" and "QUEUE_ETF_LIMIT_UP", effectively acting as a signal generator rather than a passive watcher.

Intent-Code Divergence

Medium
Confidence
84% confidence
Finding
The docstring at L43 describes the function as "ETF 溢价率监控逻辑" (ETF premium monitoring logic), which suggests observation and reporting. In practice, when thresholds are met the function returns an imperative action "QUEUE_ETF_LIMIT_UP" and a message urging use of a trading channel, which is more than monitoring and contradicts the stated intent of passive watch logic.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
The script's user-facing strings are entirely in Chinese, including status messages, headings, and error output. This imposes a specific language on users without any opt-in, fallback, or documentation that the skill is intended only for a Chinese-speaking or region-specific audience.

Intent-Code Divergence

Medium
Confidence
90% confidence
Finding
The user-facing banner and in-code comments present the tool as a proprietary 'hot money radar' for speculative pre-market selection, which conflicts with the stated role of a neutral A-share market data watcher. This inconsistency increases the risk of operator deception and misuse, especially in financial settings where users may rely on branding and descriptions to judge suitability, data provenance, and compliance boundaries.

Static analysis

No suspicious patterns detected.