Back to skill

Security audit

A Stock Info

Security checks for vulnerabilities and agentic risk

Overview

This stock-data skill appears purpose-related, but it publishes a real-looking API token, encourages plaintext credential storage, and overstates several features that are only placeholders.

Review before installing. Use your own QGDATA_TOKEN, do not reuse the token shown in the documentation, and avoid storing secrets in shared plaintext files unless permissions are locked down. Expect the working capability to be mainly minute-level K-line queries; realtime and trade-detail commands appear unfinished.

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)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:25
Finding

Hard-Coded API Token and Insecure Plaintext Credential Storage

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:25-32
Vulnerability Type: Hard-coded secret and plaintext credential persistence
Risk Level: High

bash
### API Key配置
```bash
# 环境变量
export QGDATA_TOKEN="Kj9mN2xP5qR8vL3tY7wZ1aB4cD6eF8gH9nX4pL2qR7sT5vY8wZ1aB3cD6eF0gH2i"

# 或.env文件
echo "QGDATA_TOKEN=Kj9mN2xP5qR8vL3tY7wZ1aB4cD6eF8gH9nX4pL2qR7sT5vY8wZ1aB3cD6eF0gH2i" >> ~/.openclaw/.env
text

### Technical Analysis

The Skill documentation publishes what appears to be a reusable QGData API token and instructs users to persist it in `~/.openclaw/.env`. Hard-coded credentials violate secret-management principles because every recipient of the Skill receives the same credential.

The shell command appends the token to a shared plaintext configuration file without creating the file with restrictive permissions or checking its existing ownership and mode. The shared file may also contain credentials belonging to other Skills. Although `scripts/astock_query.py` only parses the `QGDATA_TOKEN` entry, the process receives filesystem-level access to the entire file.

The append operation may produce duplicate token entries. Because the parser returns the first matching entry, rotation or replacement by appending a new value may not work as expected.

### Attack Path

1. An attacker downloads the published Skill, examines its documentation, or gains read access to a user's `~/.openclaw/.env`.
2. The attacker extracts the hard-coded `QGDATA_TOKEN`.
3. The attacker configures the token in their own process and invokes the QGData API through the official client or direct supported interfaces.
4. Requests are attributed to the token owner's account until the credential is revoked or expires.
5. If the user's `.env` file has permissive access, another local account or compromised process may similarly recover the persisted token.

### Impact Assessment

An attacker could authenticate with the exposed credentia
...[truncated 463 chars]
Remediation
View remediation

Remediation Suggestions

  1. Revoke and rotate the exposed token immediately; assume it has been compromised.
  2. Remove the real value from the current package, source history, releases, logs, and examples. Use a placeholder such as YOUR_QGDATA_TOKEN.
  3. Require every user to provide an independently issued token through a secret manager or protected environment variable.
  4. Prefer environment-only credential handling rather than reading a shared .env file.
  5. If file-based storage is unavoidable, use a dedicated credential file, verify ownership, and enforce mode 0600 before reading or writing it.
  6. Replace append-based updates with an atomic configuration process that prevents duplicate keys and preserves restrictive permissions.
  7. Configure minimum server-side token privileges, usage limits, expiration, rotation, and monitoring.
  8. Avoid exposing raw provider errors if they could contain request or authentication details.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:34
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:34-37
Vulnerability Type: Unpinned software supply-chain dependencies
Risk Level: Medium

bash
### 依赖安装
```bash
pip install qgdata pandas
text

### Technical Analysis

The installation instructions request `qgdata` and `pandas` without pinned versions, cryptographic hashes, a lock file, or a specified trusted package repository. Consequently, installations may resolve to different package and transitive dependency versions over time.

Python packages may execute code during installation and import. In this project, `qgdata` is imported before the Skill reads and supplies `QGDATA_TOKEN`, and its methods receive the token through `ts.set_token(token)`. A compromised upstream release, package-index account, configured mirror, or dependency could therefore execute with the user's process privileges and potentially access the process environment, local files, and API credential.

The audit found no evidence that the currently intended packages are malicious. The vulnerability is the absence of dependency integrity and reproducibility controls.

### Attack Path

1. An attacker compromises a dependency publisher, distribution account, configured package mirror, or a transitive dependency.
2. A malicious or compromised package release becomes eligible for resolution under the unpinned installation command.
3. A user follows the documentation and runs `pip install qgdata pandas`.
4. Attacker-controlled code executes during package installation or when `astock_query.py` imports the package.
5. The malicious package operates with the invoking user's permissions and may access `QGDATA_TOKEN`, `~/.openclaw/.env`, market data, or other files available to that user.

### Impact Assessment

Successful exploitation could result in arbitrary code execution with the privileges of the user running `pip` or the Skill. Potential consequences include credential theft, unautho
...[truncated 333 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin direct and transitive dependencies to reviewed versions in a lock file.
  2. Require cryptographic hashes, such as with pip install --require-hashes -r requirements.txt.
  3. Use a trusted, controlled package index or mirror and verify the package publisher and provenance.
  4. Run dependency vulnerability, malware, and license scans before publishing updates.
  5. Install dependencies in an isolated virtual environment under a non-privileged account.
  6. Establish a reviewed update process rather than allowing automatic resolution to arbitrary future releases.
  7. Minimize the environment and filesystem data visible to the dependency process, especially API credentials.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill description promises market-data features that are reportedly not actually implemented, while also accessing credentials from environment variables and ~/.openclaw/.env without clearly disclosing that resource access. This mismatch can mislead users into granting trust or secrets under false assumptions, increasing the chance of credential exposure or unsafe deployment.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill shows real-looking API tokens without warning users to replace them or avoid committing credentials. In the context of a skill that explicitly relies on secrets, this materially increases the likelihood of accidental secret reuse, credential leakage, and downstream compromise of the associated API account.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

The documentation instructs users to write a token into ~/.openclaw/.env and includes a real-looking secret value. This is dangerous because it normalizes local credential storage in a predictable file path and, combined with the embedded token, can lead to credential theft, reuse, or unintended disclosure through logs, backups, or repository sync.

Content

Scanner excerpt · SKILL.md (reported line 31)May include surrounding context.

export QGDATA_TOKEN="Kj9mN2xP5qR8vL3tY7wZ1aB4cD6eF8gH9nX4pL2qR7sT5vY8wZ1aB3cD6eF0gH2i"

或.env文件

echo "QGDATA_TOKEN=Kj9mN2xP5qR8vL3tY7wZ1aB4cD6eF8gH9nX4pL2qR7sT5vY8wZ1aB3cD6eF0gH2i" >> ~/.openclaw/.env

text

### 依赖安装

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/astock_query.py (reported line 28)May include surrounding context.

python
return token.strip()

    # 从.env文件获取
    env_path = os.path.expanduser("~/.openclaw/.env")
    if os.path.exists(env_path):
        try:
            with open(env_path, 'r', encoding='utf-8') as f:

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.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The natural-language description and user-facing title/content are entirely in Chinese, which can amount to a language/locale policy violation when no language choice or opt-in is offered. The policy allows locale constraints only when explicitly justified or optional, which is not stated here.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation includes a concrete, real-looking API token value directly in the skill file. Embedding secrets in distributed documentation can leak credentials to anyone with repository or package access and encourages insecure copy-paste practices.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

模块说明及清单描述强调“提供实时股价、分钟K线、分时数据等专业数据”,但代码中真正调用 qgdata 查询的只有 stk_mins 分钟级 K 线接口。所谓实时股价和成交明细/分时相关入口仅返回“开发中”的占位信息,因此技能对外描述超出了实际能力。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code loads QGDATA_TOKEN from the environment or a local .env file and immediately initializes a remote API client, which implies network transmission of authentication data and user query inputs. While the code has internal docstrings, it lacks a user-facing warning in output, prompt, or comments near execution that the skill reads credentials and contacts an external service.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

函数文档字符串声明该函数用于“获取实时股价数据”,且命令行参数也以实时数据查询对外暴露该能力,但函数实际只初始化 API 后返回“功能开发中”的占位信息,没有执行任何实时数据获取操作。这属于代码文档/接口意图与实际行为直接不一致。

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

函数文档字符串声明该函数用于“获取成交明细数据”,并通过 --trades 参数对外宣称支持该能力,但实际实现仅返回“功能开发中”的说明与占位字段,未执行成交明细查询。这是注释/接口意图与真实代码行为的直接背离。

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.