Back to skill

Security audit

主板股票查询

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward China A-share stock-list query tool, with a notable dependency-packaging weakness but no evidence of hidden, destructive, credential-seeking, or exfiltration behavior.

Install this in an isolated Python environment and avoid running npm dependency installation from the provided package.json. Prefer pinning baostock and pandas in a Python-native requirements file before use. Expect the tool to contact Baostock and create JSON/CSV output files in its own 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:18
Finding

Unpinned and Incorrectly Declared Third-Party Dependencies

Content
View full analysis

Vulnerability Details

File Location: package.json:18-20; skill.md:30-34
Vulnerability Type: Supply-chain dependency confusion and mutable dependency resolution
Risk Level: Medium

Vulnerable Code

package.json:18-20:

json
"dependencies": {
  "baostock": "^1.0",
  "pandas": "^2.0"
}

skill.md:30-34:

markdown
## Dependencies

```bash
pip install baostock pandas
text

### Technical Analysis

The project uses Python modules, but declares `baostock` and `pandas` in the npm `dependencies` field. An npm-compatible installer can therefore attempt to resolve packages with these names from the npm registry rather than installing the intended Python packages from PyPI. This creates a package-ecosystem confusion risk and may install unrelated packages.

The documented pip command also installs both Python packages without exact version constraints or integrity hashes. Consequently, installation results can change over time and will automatically trust whichever package versions the configured package index currently serves. No `requirements.txt`, `pyproject.toml`, lockfile, or hash verification is present to constrain dependency resolution to reviewed artifacts.

Dependency installation can execute package lifecycle or build scripts. Thus, compromise of a resolved package, use of an untrusted package registry, or installation of a wrong-ecosystem package could cause attacker-controlled code to run before the stock-query script is executed.

### Attack Path

1. A user or automated deployment process installs the project dependencies.
2. If npm is used with `package.json`, npm resolves packages named `baostock` and `pandas` from the npm registry rather than the intended Python package ecosystem.
3. Alternatively, the documented unpinned pip command resolves the latest versions available from the configured Python package index.
4. An attacker compromises a dependency release, contr
...[truncated 1017 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the Python dependencies from the npm dependencies section of package.json. If package.json is retained only as package metadata or a command wrapper, do not represent Python modules as npm packages.
  2. Declare Python dependencies in a Python-native manifest such as pyproject.toml or requirements.txt.
  3. Pin every dependency and relevant transitive dependency to an explicitly reviewed version.
  4. Generate and verify cryptographic hashes for all resolved artifacts. For a requirements-based workflow, install with:
    bash
    python3 -m pip install --require-hashes -r requirements.txt
    
  5. Generate a lockfile using a suitable dependency-management tool and commit it to the repository.
  6. Configure installers to use an approved package index over TLS and avoid untrusted mirrors or unrestricted extra indexes.
  7. Add automated dependency vulnerability and integrity scanning to the release process.
  8. Install and run the Skill in a dedicated, least-privileged virtual environment or container without access to unrelated credentials or sensitive files.
  9. Update skill.md and README.md so their installation instructions reference only the reviewed, hash-locked Python dependency manifest.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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 (7)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest describes the skill as querying the沪深主板 A股股票列表, which implies retrieving and returning the list. The implementation additionally persists the results to files in the script directory as JSON and CSV, which is a behavioral expansion beyond a simple query operation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The name and instructions are fine, but the natural-language description and all user-facing documentation are exclusively in Chinese, with no indication that the skill is region-specific or that users may choose another language. Under the policy rule, forcing a specific language without opt-in is a locale/language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The README content and usage/output descriptions are entirely in Chinese, and the example output indicates the skill communicates in Chinese by default. There is no indication that users can choose another language or that the skill is intentionally limited to a China-specific audience for compliance or regional reasons.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The package description and author-facing text are written only in Chinese, which can constitute a language/locale policy issue when no user opt-in or alternative language is provided. Nothing in the manifest indicates that the skill is intentionally limited to Chinese-speaking users or a China-only deployment context.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
88% confidence
Finding

Using caret ranges for dependencies allows installation of newer package versions within the major version, which can introduce unreviewed code changes or supply-chain compromise into the skill at install time. In a package that depends on external libraries for data access and processing, this increases the risk of unexpected vulnerable or malicious transitive behavior.

Content

Scanner excerpt · package.json (reported line 19)May include surrounding context.

json
"author": "飞书助手",
  "license": "MIT",
  "dependencies": {
    "baostock": "^1.0",
    "pandas": "^2.0"
  }
}

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
88% confidence
Finding

The pandas dependency is specified with a caret range, permitting automatic adoption of later minor/patch releases that have not been explicitly vetted for this skill. This creates a supply-chain risk because dependency updates may introduce vulnerabilities, breaking changes, or malicious code that would be pulled in during installation.

Content

Scanner excerpt · package.json (reported line 20)May include surrounding context.

json
"license": "MIT",
  "dependencies": {
    "baostock": "^1.0",
    "pandas": "^2.0"
  }
}