Back to skill

Security audit

虾皮A股选股器

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its stock-screening purpose, but it should be reviewed because it repeatedly runs a mutable npm CLI and handles the API token in exposed plaintext workflows.

Install only if you are comfortable with the DAXIAPI CLI and can run it in a restricted environment. Prefer a pinned reviewed CLI version, avoid putting real tokens directly in command lines or source code, do not print token config files into agent logs, and rotate the DAXIAPI token if it may have been exposed.

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

T08 · Insecure Dependencies

Error
Location
SKILL.md:46
Finding

Runtime Execution of an Unpinned npm Package

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:46-72
Additional Locations: SKILL.md:152,193,206,299,364; references/cli-commands.md:8-182; references/pattern-types.md:16-337
Vulnerability Type: Unpinned third-party dependency execution
Risk Level: High

Vulnerable Code

bash
npx daxiapi-cli@latest config get token
bash
npx daxiapi-cli@latest config set token YOUR_TOKEN_FROM_DAXIAPI
bash
npx daxiapi-cli@latest stock pattern vcp

The same npx daxiapi-cli@latest execution pattern is repeatedly prescribed throughout the Skill and its reference documents.

Technical Analysis

The Skill directs the Agent to execute daxiapi-cli through npx using the mutable @latest version selector. If the package is not already available locally, npx can download it from the configured npm registry and immediately execute its entry point.

Because @latest does not identify a fixed, previously audited release, the code executed during a future Skill invocation may differ from the code that existed when this project was reviewed. A malicious package update, compromised publisher account, registry compromise, or transfer of package ownership could therefore introduce arbitrary executable code without requiring any modification to this Skill.

The package executes with the permissions of the user or Agent process. It may consequently access files, environment variables, npm configuration, shell credentials, and the DAXIAPI token available to that process.

Attack Path

  1. An attacker compromises the daxiapi-cli publisher account, package repository, release process, or relevant npm distribution channel.
  2. The attacker publishes a malicious release and assigns it the latest distribution tag.
  3. A user invokes the Skill for token configuration or stock screening.
  4. Following the Skill instructions, the Agent runs:
    bash
    npx daxiapi-cli@latest stock pattern vcp
    
  5. npx retrieves and executes the ...[truncated 960 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace every @latest reference with an exact, reviewed version:
    bash
    npx --yes daxiapi-cli@1.2.3 stock pattern vcp
    
  2. Verify the selected package version, publisher identity, repository, release provenance, and transitive dependencies before approving it.
  3. Use a lockfile and npm integrity hashes where the deployment model permits dependency installation.
  4. Prefer a centrally installed, administratively approved executable over downloading code at each invocation.
  5. Execute the CLI in a restricted environment with:
    • Minimal filesystem access.
    • No unrelated environment secrets.
    • Restricted outbound network access.
    • No administrative privileges.
  6. Establish an explicit dependency-update process in which new versions are reviewed and tested before changing the pinned version.
  7. Apply the correction consistently across SKILL.md, references/cli-commands.md, and references/pattern-types.md.

T09 · Insecure Skill Coding Practices

Warning
Location
references/token-setup.md:24
Finding

API Token Exposure Through Process Arguments, Terminal Output, and Plaintext Configuration

Content
View full analysis

Vulnerability Details

File Location: references/token-setup.md:24-30
Additional Locations: references/token-setup.md:50-57,80-90; SKILL.md:50,63,364; references/cli-commands.md:129,135,179,182
Vulnerability Type: Insecure credential handling and plaintext secret disclosure
Risk Level: Medium

Vulnerable Code

bash
# Set Token
npx daxiapi-cli@latest config set token YOUR_TOKEN_FROM_DAXIAPI

# Verify configuration
npx daxiapi-cli@latest config get token

The document also recommends directly embedding the token in application code:

javascript
const api = require('daxiapi-cli/lib/api');

// Directly pass Token
const data = await api.getPatternStocks('YOUR_TOKEN', 'vcp');

Its troubleshooting procedure instructs the user to print the plaintext configuration file:

bash
# Check configuration file
cat ~/.daxiapi/config.json

# Reconfigure
npx daxiapi-cli@latest config set token YOUR_TOKEN_FROM_DAXIAPI

# Verify
npx daxiapi-cli@latest config get token

Technical Analysis

Passing a secret as a command-line argument can expose it through shell history, command logging, process-monitoring facilities, terminal recording, and Agent execution transcripts. Although process-list visibility varies by operating system and configuration, command arguments should not be treated as a secure secret-input channel.

The config get token command may print the credential into terminal output or the Agent context if it returns the complete value. The documentation does not require masking or status-only output. Similarly, cat ~/.daxiapi/config.json explicitly prints the token-bearing configuration file and can expose it to terminal scrollback, session logs, screen sharing, support transcripts, or subsequent model context.

The JavaScript example encourages placing a token literal in source code. Such a value may later be committed to version control, included in build artifacts, copied into diagnostics, or disclosed during ...[truncated 1888 chars]

Remediation
View remediation

Remediation Suggestions

  1. Do not accept API tokens as visible command-line arguments. Use hidden interactive input, standard input, or a supported operating-system secret store.
  2. Replace the setup flow with a non-echoing mechanism, for example:
    bash
    read -s DAXIAPI_TOKEN
    export DAXIAPI_TOKEN
    
    The CLI should preferably provide its own hidden prompt so the secret does not need to be exported.
  3. Change token-status checks to return only a boolean status or a masked suffix, such as:
    text
    Token configured: yes
    Token ending in: ****a1b2
    
  4. Remove the instruction to run:
    bash
    cat ~/.daxiapi/config.json
    
    Provide a diagnostic command that validates file existence, ownership, permissions, and JSON structure without printing secret values.
  5. Remove the JavaScript example containing 'YOUR_TOKEN'. Load credentials from a secret manager or environment variable instead:
    javascript
    const data = await api.getPatternStocks(process.env.DAXIAPI_TOKEN, 'vcp');
    
  6. Ensure any local credential file is created with restrictive permissions, such as owner read/write only on Unix-like systems.
  7. Redact tokens from errors, debug output, telemetry, Agent transcripts, and support bundles.
  8. Add token rotation and immediate revocation instructions for suspected exposure.
  9. Apply the hardened guidance consistently in SKILL.md, references/cli-commands.md, and references/token-setup.md.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (93)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

L003 的触发词列表包含“选股”“技术形态”“创新高”等较宽泛表达,其中“选股”尤其缺少上下文约束,容易与一般性投资讨论重叠。虽然文档列出了一些不适用场景,但没有给出负例或更明确的触发边界来避免非预期调用。

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

L016-L024 将“挖掘动量强势股或价值股”“进行自下而上的选股分析”等广义投资需求都视为触发条件,但未明确何时应改用其他技能或普通问答流程。该描述虽有用途示例,但缺少排除条件和负例,仍可能造成与通用股票分析请求的边界混淆。

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
96% confidence
Finding

The skill instructs use of npx daxiapi-cli@latest, which fetches and executes whatever package version is current at runtime. This creates a supply-chain risk: a compromised publisher account, malicious new release, or dependency hijack could cause arbitrary code execution on the host when the skill runs.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
96% confidence
Finding

The command uses npx daxiapi-cli@latest config set token ..., which executes an unpinned package version before handling sensitive credentials. If a malicious or tampered release is served, it could exfiltrate the API token or run arbitrary code on the system.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The verification step again invokes npx daxiapi-cli@latest, preserving the same remote-code-execution and supply-chain exposure. Repeated inclusion across setup steps increases the chance that users will run the unsafe pattern in practice.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The main data-fetch workflow depends on an unpinned npx execution path, so routine operation of the skill requires trust in the latest published package at every run. In agent contexts, this can turn ordinary user requests into arbitrary code execution opportunities if the upstream package changes.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The example workflow repeats execution of npx daxiapi-cli@latest during multi-condition screening. Because the skill is operational and likely to be followed verbatim, this is a practical supply-chain weakness rather than a theoretical documentation issue.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The loop instructions direct repeated use of an unpinned remote package, multiplying exposure over time. A later malicious release could compromise systems even if earlier runs were safe, making the risk persistent and hard to control.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The report template cites npx daxiapi-cli@latest as the data source, reinforcing unsafe operational guidance throughout the skill. Embedding this in reference output normalizes dynamic execution of unreviewed code in future reuse and automation.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
96% confidence
Finding

A second unpinned npx daxiapi-cli@latest invocation appears on the same line/location in troubleshooting, carrying the same supply-chain and credential-exposure risk. The duplication indicates the unsafe pattern is systemic across the skill rather than accidental.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.