Back to skill

Security audit

A股短线营收分析助手

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent China A-share analysis assistant, but it has under-disclosed local prompt storage and overbroad API-key-bearing network configuration.

Review carefully before installing. Prefer a process environment variable or credential manager for EASTMONEY_APIKEY, do not rely on the package to ignore .env files, and avoid custom EASTMONEY_* URL settings unless you fully trust the destination. Consider disabling or patching the router's plaintext request persistence if your stock prompts may include portfolio, strategy, or personal financial details.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/stock_utils.py:604
Finding

API Key Can Be Forwarded to an Arbitrary Network Destination

Content
View full analysis
dict: """ POST wrapper 3: East Money-specific wrapper """ apikey = get_eastmoney_apikey(required=True) target_url = _build_eastmoney_url(endpoint) quota = None if use_daily_limit: quota = consume_eastmoney_daily_quota() LOGGER.info( "Calling East Money POST url=%s apikey=%s quota=%s payload=%s", target_url, _mask_secret(apikey), quota or "skip", _desensitize_payload(payload), ) headers = { "apikey": apikey, "X-Api-Key": apikey, } return post_json_with_retry( url=target_url, payload=payload, headers=headers, timeout=timeout, retries=retries, ) def _build_eastmoney_url(endpoint: str) -> str: target = (endpoint or "").strip() if not target: return EASTMONEY_BASE_URL.rstrip("/") if target.startswith(("http://", "https://")): return target base = EASTMONEY_BASE_URL.rstrip("/") + "/" return urljoin(base, target.lstrip("/")) ``` ### Technical Analysis The East Money base URL and endpoint paths can be supplied through environment variables. In addition, `_build_eastmoney_url()` accepts any absolut ...[truncated 2088 chars]
Remediation
View remediation
str: endpoint = str(endpoint or "").strip() if endpoint not in ALLOWED_ENDPOINTS: raise ValueError("Unsupported East Money endpoint") target = urljoin(DEFAULT_EASTMONEY_BASE_URL.rstrip("/") + "/", endpoint.lstrip("/")) parsed = urlparse(target) if ( parsed.scheme != "https" or parsed.hostname != ALLOWED_HOST or parsed.port not in (None, 443) or not parsed.path.startswith(ALLOWED_PATH_PREFIX) ): raise ValueError("Untrusted East Money destination") return target ``` ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/team_router.py:309
Finding

Raw User Requests Are Persisted Locally Without Consent or Restrictive Permissions

Content
View full analysis
bool: payload = _load_json_file(_INTENT_ROUTE_LOG_FILE, default={"routes": []}) routes = payload.get("routes", []) routes.append(route_result) if len(routes) > 200: routes = routes[-200:] payload["routes"] = routes ok = _save_json_file(_INTENT_ROUTE_LOG_FILE, payload) if not ok: _INTENT_RUNTIME_FALLBACK["last_route"] = dict(route_result) return ok ``` ```python def _save_json_file(file_path: Path, payload: dict) -> bool: try ...[truncated 2682 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
README_EN.md:71
Finding

Documented Secret-Exclusion Controls Are Missing From the Packaged Project

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (54)

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

md
### 关键函数

- `stock_utils.get_eastmoney_apikey()` - 读取 API Key(环境变量 → .env.local → .env)
- `stock_utils.post_eastmoney(endpoint, payload)` - 东财专用 POST 封装(含脱敏日志)
- `stock_utils.eastmoney_news_search()` / `eastmoney_query()` / `eastmoney_stock_screen()` - 三类能力入口
- `team_router.route_eastmoney_intent()` - 意图路由与门控判定

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

md
### 关键函数

- `stock_utils.get_eastmoney_apikey()` - 读取 API Key(环境变量 → .env.local → .env)
- `stock_utils.post_eastmoney(endpoint, payload)` - 东财专用 POST 封装(含脱敏日志)
- `stock_utils.eastmoney_news_search()` / `eastmoney_query()` / `eastmoney_stock_screen()` - 三类能力入口
- `team_router.route_eastmoney_intent()` - 意图路由与门控判定

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

md
| 硬编码 API Key | ✅ 未发现 |
| 硬编码绝对路径 | ✅ 未发现(脚本用 `Path(__file__).resolve()` 相对解析) |
| 密钥脱敏 | ✅ `stock_utils._mask_secret()` 正确实现 |
| .env 文件泄露 | ✅ `.gitignore` 已忽略 `.env` 和 `.env.local` |
| .env.example 模板 | ✅ 使用占位符,无真实密钥 |
| 日志脱敏 | ✅ POST 日志中 apikey 使用 `_mask_secret()` |

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · REVIEW_REPORT.md (reported line 211)May include surrounding context.

  1. 移除非股票相关 Agent 文件
    bash
    rm agents/bug-analyzer.md agents/code-reviewer.md agents/dev-planner.md \
       agents/story-generator.md agents/ui-sketcher.md
    

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The implementation is described as request routing/orchestration with guards, external query routing, local fallback strategies, and file-backed cache/log persistence, while the manifest frames it as a pure stock-analysis assistant. This divergence is dangerous because orchestration and routing layers often have broader system visibility and side effects than domain-analysis logic, making undocumented behavior more likely to bypass user expectations and security review.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The implementation is described as request routing/orchestration with guards, external query routing, local fallback strategies, and file-backed cache/log persistence, while the manifest frames it as a pure stock-analysis assistant. This divergence is dangerous because orchestration and routing layers often have broader system visibility and side effects than domain-analysis logic, making undocumented behavior more likely to bypass user expectations and security review.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The implementation is described as request routing/orchestration with guards, external query routing, local fallback strategies, and file-backed cache/log persistence, while the manifest frames it as a pure stock-analysis assistant. This divergence is dangerous because orchestration and routing layers often have broader system visibility and side effects than domain-analysis logic, making undocumented behavior more likely to bypass user expectations and security review.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The implementation is described as request routing/orchestration with guards, external query routing, local fallback strategies, and file-backed cache/log persistence, while the manifest frames it as a pure stock-analysis assistant. This divergence is dangerous because orchestration and routing layers often have broader system visibility and side effects than domain-analysis logic, making undocumented behavior more likely to bypass user expectations and security review.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The implementation is described as request routing/orchestration with guards, external query routing, local fallback strategies, and file-backed cache/log persistence, while the manifest frames it as a pure stock-analysis assistant. This divergence is dangerous because orchestration and routing layers often have broader system visibility and side effects than domain-analysis logic, making undocumented behavior more likely to bypass user expectations and security review.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The implementation is described as request routing/orchestration with guards, external query routing, local fallback strategies, and file-backed cache/log persistence, while the manifest frames it as a pure stock-analysis assistant. This divergence is dangerous because orchestration and routing layers often have broader system visibility and side effects than domain-analysis logic, making undocumented behavior more likely to bypass user expectations and security review.

Content

No source excerpt is available for this finding.

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/stock_utils.py (reported line 29)May include surrounding context.

python
LOGGER = logging.getLogger(__name__)
EASTMONEY_APIKEY_ENV = "EASTMONEY_APIKEY"
_SKILL_ROOT = Path(__file__).resolve().parents[1]
_ENV_FILE_CANDIDATES = (".env.local", ".env")
DEFAULT_EASTMONEY_BASE_URL = "https://mkapi2.dfcfs.com/finskillshub/api/claw"
DEFAULT_EASTMONEY_ENDPOINT_NEWS_SEARCH = "/news-search"
DEFAULT_EASTMONEY_ENDPOINT_QUERY = "/query"

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 · tests/test_stock_skill.py (reported line 1611)May include surrounding context.

python
LOGGER = logging.getLogger(__name__)
EASTMONEY_APIKEY_ENV = "EASTMONEY_APIKEY"
_SKILL_ROOT = Path(__file__).resolve().parents[1]
_ENV_FILE_CANDIDATES = (".env.local", ".env")
DEFAULT_EASTMONEY_BASE_URL = "https://mkapi2.dfcfs.com/finskillshub/api/claw"
DEFAULT_EASTMONEY_ENDPOINT_NEWS_SEARCH = "/news-search"
DEFAULT_EASTMONEY_ENDPOINT_QUERY = "/query"

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 · tests/test_stock_skill.py (reported line 1618)May include surrounding context.

python
LOGGER = logging.getLogger(__name__)
EASTMONEY_APIKEY_ENV = "EASTMONEY_APIKEY"
_SKILL_ROOT = Path(__file__).resolve().parents[1]
_ENV_FILE_CANDIDATES = (".env.local", ".env")
DEFAULT_EASTMONEY_BASE_URL = "https://mkapi2.dfcfs.com/finskillshub/api/claw"
DEFAULT_EASTMONEY_ENDPOINT_NEWS_SEARCH = "/news-search"
DEFAULT_EASTMONEY_ENDPOINT_QUERY = "/query"

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/stock_utils.py (reported line 29)May include surrounding context.

python
LOGGER = logging.getLogger(__name__)
EASTMONEY_APIKEY_ENV = "EASTMONEY_APIKEY"
_SKILL_ROOT = Path(__file__).resolve().parents[1]
_ENV_FILE_CANDIDATES = (".env.local", ".env")
DEFAULT_EASTMONEY_BASE_URL = "https://mkapi2.dfcfs.com/finskillshub/api/claw"
DEFAULT_EASTMONEY_ENDPOINT_NEWS_SEARCH = "/news-search"
DEFAULT_EASTMONEY_ENDPOINT_QUERY = "/query"

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This AGENTS.md switches into Chinese from the project overview onward and provides all operational guidance in that language. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern unless the locale restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This file presents operational guidance primarily in Chinese, including section headings and key instructions, but does not state that the skill is intentionally limited to Chinese-speaking users or offer an alternative language. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill declares access to environment variables, file read/write, and network-backed capabilities in practice, but does not explicitly scope or constrain those tools in the manifest. In an agent setting, this creates an oversized trust boundary: a stock-analysis skill could exfiltrate secrets such as ${EASTMONEY_APIKEY}, persist unreviewed data locally, or access arbitrary files/network resources beyond what users would reasonably expect from the description.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The description and operating instructions are entirely in Chinese and define fixed output text and field guidance in Chinese, which imposes a language choice on users without stating that Chinese is optional. This matches the policy category for language or locale constraints lacking user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description and all operating instructions are written as mandatory Chinese-only content, with no indication that users may choose another language or locale. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description and operating instructions are entirely in Chinese and define output values in Chinese only, which imposes a specific language/locale on the interaction. The file does not offer a user language choice or explain that the skill is intentionally limited to a China-specific audience as a documented opt-in constraint.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly says it must not output a final trading decision, but the required JSON schema includes decision_hint with actionable values like 可做, 观察, and 回避. This creates an instruction conflict that can cause downstream systems or users to treat the output as investment advice despite the stated limitation, increasing compliance and misuse risk in a financial decision-support context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description and all operational instructions are written exclusively in Chinese, and the required JSON example uses Chinese values such as evidence text and user tips. This imposes a specific language/locale on the interaction without any opt-in or documented regional justification, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest description and body instructions are entirely in Chinese and the required JSON enum values and field content are specified in Chinese, which imposes a language/locale constraint on users. The file does not offer any language choice or explain a region-specific need, so this is a natural-language policy issue under the locale rule.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The description and operational instructions are entirely in Chinese, and the required JSON schema includes Chinese enum values and field content examples such as "宽松|中性|收紧" and "可做|观察|回避". This imposes a specific language/locale on users without offering a choice or documenting a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The natural-language instructions and required output schema are entirely specified in Chinese, including mandated Chinese enum values such as "主力净流入|主力净流出|分歧" and "延续|震荡|反转". This constrains the skill to a specific language/locale without any opt-in or explicit justification, which matches the locale-policy violation criteria.

Content

No source excerpt is available for this finding.