Back to skill

Security audit

双策略A股选股器

Security checks for vulnerabilities and agentic risk

Overview

This stock-selection skill is mostly straightforward, but its install metadata declares unnecessary npm dependencies for a Python tool, creating avoidable supply-chain risk during installation.

Review the package metadata before installing. The Python stock-screening code itself is narrow, but the npm dependency declarations should be removed or replaced with proper pinned Python requirements. Treat the generated stock picks as informational only, verify the input data, and be aware that a results CSV may be written in the current directory.

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
package.json:10
Finding
Unbounded and Incorrect-Ecosystem Package Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `package.json:10-13` **Vulnerability Type**: Uncontrolled third-party dependency resolution **Risk Level**: Medium ### Vulnerable Code ```json "dependencies": { "pandas": ">=1.3.0", "numpy": ">=1.21.0" } ``` ### Technical Analysis The project is implemented in Python, but its Python library names are declared as npm dependencies. This causes npm to resolve packages named `pandas` and `numpy` from the npm registry rather than installing the Python libraries used by `dual_strategy_selector.py`. Both dependency constraints are open-ended lower bounds. The project also contains no package lockfile, so separate installations may resolve different package versions. This unnecessarily exposes users to mutable npm packages that are not required to execute the Python application. If one of these npm packages or a transitive dependency is compromised, transferred to a malicious maintainer, or publishes a malicious version satisfying the open-ended constraint, npm may download it during installation. npm lifecycle scripts can execute automatically under ordinary installation configurations. ### Attack Path 1. An attacker gains control of one of the named npm packages, compromises its publishing credentials, or compromises a transitive dependency. 2. The attacker publishes a malicious version that satisfies `>=1.3.0` or `>=1.21.0`. 3. A user runs `npm install` in the project directory. 4. Because there is no lockfile or upper version bound, npm resolves the attacker-controlled release. 5. Malicious package code or an npm lifecycle script executes with the privileges of the user running npm. This path depends on compromise or malicious modification of an upstream npm package; the audited repository itself does not contain a malicious installation script. ### Impact Assessment Successful exploitation could execute arbitrary code with the privileges of the user performing installation. Depending on those p ...[truncated 708 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the npm dependencies because the application does not use JavaScript packages: ```json "dependencies": {} ``` 2. Declare the required Python libraries in `requirements.txt` or `pyproject.toml`. Use reviewed, bounded versions, for example: ```text pandas==<reviewed-version> numpy==<reviewed-version> ``` 3. Generate and commit a Python dependency lockfile using a tool such as `pip-tools`, Poetry, or uv. 4. Where supported, verify downloaded artifacts with hashes, such as through `pip install --require-hashes`. 5. Remove `package.json` entirely if npm is not an intended installation or execution interface. Otherwise, ensure its scripts invoke a controlled Python environment and do not duplicate Python dependencies in the npm registry. 6. Add automated dependency scanning and periodically update pinned versions after security review and compatibility testing. ]]>
Vulnerability Patterns
  • 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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The module docstring, usage instructions, and data-interface guidance are written entirely in Chinese, and the CLI description/help strings are also Chinese-only. Under the stated policy, a skill that effectively requires a specific language without opt-in or alternative language support is a natural-language policy violation.

Natural-Language Policy Violations

Low
Confidence
90% confidence
Finding
The skill documentation is written entirely in Chinese, including usage instructions and warnings, with no indication that users may choose another language or that the skill is intended only for a Chinese-speaking or China-region audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.

Intent-Code Divergence

Low
Confidence
99% confidence
Finding
The top-level documentation lists `python dual_strategy_selector.py --data your_data.csv --watch` as a supported usage pattern, implying a watch/monitoring capability. However, the argument parser only defines `--data`, `--date`, and `--top`, so `--watch` is unsupported and the documented intent contradicts actual behavior.

Missing User Warnings

Low
Confidence
95% confidence
Finding
This file is a markdown file containing embedded code/instructions, and it describes behavior that saves output to `selection_YYYYMMDD.csv`. There is no explicit warning in the surrounding skill description that running the tool will create or overwrite a local file, which is a user-data/system-impacting behavior under the markdown-file criteria.

Intent-Code Divergence

Low
Confidence
97% confidence
Finding
The `load_data` docstring lists `target_date` as a parameter, implying the function uses it when loading data. In implementation, `target_date` is accepted but never referenced, so the documented intent of date-aware loading contradicts the actual behavior.

Natural-Language Policy Violations

Low
Confidence
82% confidence
Finding
The manifest’s human-facing description and keywords are entirely in Chinese, which imposes a specific language/locale in the skill metadata without indicating that users can choose another language. There is no documented opt-in or region-specific justification in this file, so it may violate language/locale policy guidance.

Static analysis

No suspicious patterns detected.