Back to skill

Security audit

A Stock

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent A-share market-data purpose, but its required API client can expose the API key to an unintended host and uses unpinned npx execution.

Review before installing. This skill should only be used after the client enforces an allowlist of /api/stock endpoints, verifies the final origin is api.aipmedia.cn before attaching the API key, and replaces unpinned `npx tsx` with a locked local or compiled runner.

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
scripts/api-client.ts:76
Finding

API Key Exfiltration Through Unvalidated Endpoint Input

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:14
Finding

Unpinned Runtime Package Execution Through npx

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (29)

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 · SKILL.md (reported line 171)May include surrounding context.

md
* 安全说明(Security Notice)
 * ─────────────────────────────────────────────────────────────────
 * 此脚本仅做两件事:
 *   1. 从本地 .env 文件或环境变量中读取 ASTOCK_API_KEY
 *   2. 将该 Key 作为 HTTP Header 发送至 https://api.aipmedia.cn
 *
 * 不会读取任何其他文件,不会上传本地文件内容,

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 · SKILL.md (reported line 172)May include surrounding context.

md
* 安全说明(Security Notice)
 * ─────────────────────────────────────────────────────────────────
 * 此脚本仅做两件事:
 *   1. 从本地 .env 文件或环境变量中读取 ASTOCK_API_KEY
 *   2. 将该 Key 作为 HTTP Header 发送至 https://api.aipmedia.cn
 *
 * 不会读取任何其他文件,不会上传本地文件内容,

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/api-client.ts (reported line 7)May include surrounding context.

ts
* 安全说明(Security Notice)
 * ─────────────────────────────────────────────────────────────────
 * 此脚本仅做两件事:
 *   1. 从本地 .env 文件或环境变量中读取 ASTOCK_API_KEY
 *   2. 将该 Key 作为 HTTP Header 发送至 https://api.aipmedia.cn
 *
 * 不会读取任何其他文件,不会上传本地文件内容,

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/api-client.ts (reported line 11)May include surrounding context.

ts
* 安全说明(Security Notice)
 * ─────────────────────────────────────────────────────────────────
 * 此脚本仅做两件事:
 *   1. 从本地 .env 文件或环境变量中读取 ASTOCK_API_KEY
 *   2. 将该 Key 作为 HTTP Header 发送至 https://api.aipmedia.cn
 *
 * 不会读取任何其他文件,不会上传本地文件内容,

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/api-client.ts (reported line 23)May include surrounding context.

ts
* 安全说明(Security Notice)
 * ─────────────────────────────────────────────────────────────────
 * 此脚本仅做两件事:
 *   1. 从本地 .env 文件或环境变量中读取 ASTOCK_API_KEY
 *   2. 将该 Key 作为 HTTP Header 发送至 https://api.aipmedia.cn
 *
 * 不会读取任何其他文件,不会上传本地文件内容,

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/api-client.ts (reported line 35)May include surrounding context.

ts
* 安全说明(Security Notice)
 * ─────────────────────────────────────────────────────────────────
 * 此脚本仅做两件事:
 *   1. 从本地 .env 文件或环境变量中读取 ASTOCK_API_KEY
 *   2. 将该 Key 作为 HTTP Header 发送至 https://api.aipmedia.cn
 *
 * 不会读取任何其他文件,不会上传本地文件内容,

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/api-client.ts (reported line 60)May include surrounding context.

ts
* 安全说明(Security Notice)
 * ─────────────────────────────────────────────────────────────────
 * 此脚本仅做两件事:
 *   1. 从本地 .env 文件或环境变量中读取 ASTOCK_API_KEY
 *   2. 将该 Key 作为 HTTP Header 发送至 https://api.aipmedia.cn
 *
 * 不会读取任何其他文件,不会上传本地文件内容,

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/api-client.ts (reported line 61)May include surrounding context.

ts
* 安全说明(Security Notice)
 * ─────────────────────────────────────────────────────────────────
 * 此脚本仅做两件事:
 *   1. 从本地 .env 文件或环境变量中读取 ASTOCK_API_KEY
 *   2. 将该 Key 作为 HTTP Header 发送至 https://api.aipmedia.cn
 *
 * 不会读取任何其他文件,不会上传本地文件内容,

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/api-client.ts (reported line 38)May include surrounding context.

ts
// 1. 尝试读取 .env 文件(仅解析 ASTOCK_API_KEY 行,忽略其他所有内容)
  const searchDirs = [process.cwd(), path.resolve(process.cwd(), "..")];
  for (const dir of searchDirs) {
    const envPath = path.join(dir, ".env");
    if (fs.existsSync(envPath)) {
      const lines = fs.readFileSync(envPath, "utf-8").split("\n");
      for (const line of lines) {

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill declares environment and network capabilities but does not define an explicit tool permission boundary such as allowed-tools or permissions. That increases the chance an agent runtime may execute the documented shell-based workflow with broader-than-intended access, especially since the skill instructs use of bash_tool and secret-backed API calls.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
92% confidence
Finding

The manifest-level runtime reference to 'npx tsx' without version pinning embeds a supply-chain risk directly into the declared execution model. Because this is part of the skill metadata, automated systems may rely on it without additional scrutiny.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

Invoking 'npx tsx' without pinning exact package versions introduces supply-chain risk because npx may resolve or download packages at runtime. A compromised or changed upstream package could execute arbitrary code in the agent environment, potentially exposing the ASTOCK_API_KEY or other local data.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

This repeated instruction to use unpinned 'npx tsx' carries the same runtime package resolution risk throughout the skill. Repetition makes the unsafe execution path the primary supported workflow, increasing the likelihood of exploitation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger description is extremely broad and can activate on many generic stock-related mentions, causing the skill to run unexpectedly. In an agent setting, overbroad activation can lead to unnecessary network calls, inadvertent disclosure of user prompts to external services, and execution of shell workflows when the user did not intend a live-data action.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The skill again mandates an unpinned npx-based execution path, which can pull mutable code at runtime. In a skill that also handles API credentials, this creates a meaningful opportunity for code execution and secret exposure if the dependency chain is compromised.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
**所有 A 股数据必须通过下方 API 接口获取,严禁使用 Google Search、网页搜索或训练数据中的历史行情作为答案。**

- ✅ 正确:用 `bash_tool` 执行 TypeScript 脚本调用 `https://api.aipmedia.cn/api/stock/...`
- ❌ 错误:调用搜索引擎查询行情、引用训练数据中的股价、给出"大约/估计"的数字

如果接口调用失败,明确告知用户失败原因,不要用搜索结果替代。

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The standard invocation example uses 'npx tsx' without version pinning, normalizing a supply-chain-sensitive pattern. Users or agents following the example may unknowingly execute updated third-party code with access to environment variables and filesystem context.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

This command example repeats the same unpinned npx execution risk, and because it processes user-supplied endpoint parameters, it may be used frequently in normal operation. Frequent execution amplifies the blast radius of any upstream compromise.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

Another unpinned 'npx tsx' example exposes the same supply-chain issue. The problem is not the API endpoint itself but the mutable command runner used to access it.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The documentation continues to direct agents to an unpinned runtime resolver, preserving the possibility of arbitrary code execution through dependency substitution or malicious updates. In an agent context, documented examples often become de facto trusted automation paths.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

This example again relies on unpinned npx execution, which is dangerous because it can run non-reproducible code while the process has access to secrets and network. The skill context makes this more serious because API usage is mandatory, so the risky path is unavoidable during normal use.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The repeated unpinned npx pattern remains a true supply-chain vulnerability. Even if the script path is local, the command runner itself is mutable unless pinned and locked.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

This final invocation example still uses unpinned 'npx tsx', preserving the same arbitrary-code-execution risk. Consistent repetition across the file indicates the unsafe practice is systemic rather than incidental.

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.