Back to skill

Security audit

stock-screener-cn

Security checks for vulnerabilities and agentic risk

Overview

The skill is a public-market stock screener with no account access or persistence, but its Hong Kong stock support and dependency hygiene should be treated cautiously.

Use this as an informational technical screener only, preferably in a virtual environment with reviewed or pinned dependencies. Do not rely on its Hong Kong stock results unless the historical-data support is fixed or independently validated, and do not treat the generated signals as investment advice.

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
SKILL.md:77
Finding
Unpinned Third-Party Dependencies Create a Supply-Chain Risk## Vulnerability Details **File Location**: `SKILL.md:77-79`; related imports in `scripts/screen_stocks.py:14-16` **Vulnerability Type**: Unpinned and integrity-unverified Python dependencies **Risk Level**: Medium **Vulnerable installation command:** ```bash pip install akshare pandas numpy ``` **Related dependency imports:** ```python import akshare as ak import pandas as pd import numpy as np ``` ### Technical Analysis The documented installation command retrieves the latest available releases of three third-party packages without exact version constraints, cryptographic hashes, a lockfile, or an explicitly trusted package index. Consequently, the dependency code installed for two different users or at two different times may differ from the code reviewed during this audit. Python packages can execute package-controlled code during installation and import. The application imports all three dependencies at startup, so a compromised upstream release, compromised package repository, dependency-resolution attack, or malicious transitive dependency could execute arbitrary Python code with the privileges of the user running the screener. No evidence indicates that the currently named packages are malicious. The vulnerability is the absence of controls ensuring that users install the same reviewed artifacts. ### Attack Path 1. An attacker compromises a direct or transitive dependency release, its maintainer account, or the package distribution channel. 2. The attacker publishes a malicious release under a dependency name accepted by the unrestricted installation command. 3. A user follows the documented `pip install akshare pandas numpy` instruction. 4. Pip resolves and installs the attacker-controlled release because no approved version or artifact hash is enforced. 5. The user starts `scripts/screen_stocks.py`. 6. Malicious package initialization or import code executes under the invoking user's account. # ...[truncated 639 chars]
Remediation
## Remediation Suggestions 1. Define exact, reviewed direct and transitive dependency versions in a lockfile generated by a reproducible dependency-management tool. 2. Require cryptographic hashes for every distributed artifact, for example through a fully pinned requirements file used with `pip install --require-hashes`. 3. Configure installations to use an explicitly trusted package index or an internally controlled artifact repository. 4. Install dependencies in an isolated virtual environment under a non-privileged account; do not recommend administrative or root installation. 5. Add automated dependency vulnerability and provenance checks to the release process. 6. Review dependency updates before changing pins, regenerate hashes in a controlled environment, and publish the updated lockfile with the project. 7. Replace the installation documentation with a controlled command such as: ```bash python -m pip install --require-hashes -r requirements.txt ```
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding
The skill claims support for both A-shares and Hong Kong stocks, but the finding indicates the historical-data logic only uses A-share interfaces. This can cause the agent to produce incorrect or misleading screening results for Hong Kong equities, which is dangerous in a finance context because users may rely on false signals for investment decisions.

Vague Triggers

Medium
Confidence
86% confidence
Finding
The activation description is broad enough to match many generic stock-related questions, not just technical screening requests. In an agent environment, this can cause the skill to trigger outside its intended scope and answer with inappropriate or overconfident screening behavior, increasing the chance of misleading financial outputs.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
This code file contains user-facing natural-language descriptions entirely in Chinese, including the module docstring and CLI help text, indicating the skill is designed to operate in a fixed language/locale. The policy category requires flagging language or locale constraints when the skill does not explicitly offer user opt-in or an alternative language choice.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The command-line description, argument help text, status messages, and output-facing error/status strings are all hard-coded in Chinese. Because the skill does not provide any mechanism to select another language or explicitly obtain user opt-in for the locale, this is a natural-language policy concern.

Vague Triggers

Low
Confidence
74% confidence
Finding
The natural-language examples are open-ended and do not clearly constrain the skill's trigger boundary. This ambiguity can make the router invoke the skill for loosely related financial queries, which may lead to irrelevant or misleading outputs, though the impact is somewhat limited because the examples still center on screening-style requests.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
This markdown file is written exclusively in Chinese and includes no indication that users may choose another language or that the skill is intentionally restricted to a Chinese-speaking or region-specific audience. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern.

Static analysis

No suspicious patterns detected.