Back to skill

Security audit

Noah Stock Trade

Security checks for vulnerabilities and agentic risk

Overview

The skill is a mostly coherent read-only trading/account query helper, but its bearer-token handling and unrestricted API destination create a serious review concern.

Review before installing. Use only a least-privilege read-only token, keep secret files in a user-owned protected location, verify NOAH_TRADE_API_BASE_URL is HTTPS and the expected Noah API host before each run, and avoid running this skill in shared or untrusted workspaces until destination allowlisting and safer secret-file handling are added.

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 (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/config.py:7
Finding

Untrusted secret-file loading can redirect bearer-authenticated requests

Content
View full analysis
None: if not path.exists(): return for line in path.read_text(encoding='utf-8').splitlines(): line = line.strip() if not line or line.startswith('#') or '=' not in line: continue key, value = line.split('=', 1) os.environ[key.strip()] = value.strip() for _env_file in SECRETS_FILES: load_env_file(_env_file) ``` ```python def load_trade_config() -> TradeConfig: base_url = os.getenv("NOAH_TRADE_API_BASE_URL", "https://stock-open-api.noahgroup.com").strip() token = os.getenv("NOAH_MARKET_APIKEY", "").strip() or os.getenv("NOAH_MARKET_TOKEN", "").strip() env = os.getenv("NOAH_TRADE_ENV", "test").strip() or "test" read_only = os.getenv("NOAH_TRADE_READ_ONLY", "true").lower() != "false" timeout_seconds = int(os.getenv("NOAH_TRADE_TIMEOUT", "15")) if not base_url: raise ConfigError("NOAH_TRADE_API_BASE_URL is missing", hint="请先配置交易 API Base URL") if not token: raise ConfigError("NOAH_MARKET_APIKEY is missing", hint="请先配置统一 Bearer token(trade 与 market 共用)") return TradeConfig( base_url=base_url.rstrip("/"), token=token, env=env, read_only=read_only, timeout_seconds=timeout_seconds, ) ``` ```python class NoahTradeClient: def __init__(self, config): self.config ...[truncated 4661 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (31)

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

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

md
先做代码标准化,再进入交易脚本。
若标的存在歧义,不要猜,先要求用户澄清市场或代码。

## Output Rule

默认输出顺序:
1. 一句话结论

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill orchestrates access to environment variables, local files, and networked trading/account endpoints, but it does not declare an explicit tool/permission scope in its manifest. In a financial-domain skill, missing least-privilege boundaries increases the chance that an agent can access secrets or invoke networked capabilities beyond the intended read-only workflow, especially if downstream scripts evolve to support writes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The markdown instructs the skill to present results in a specific language style, including '优先说人话' and translating statuses and fee items into user-readable wording, while the file overall is written as a Chinese-only operating policy. This creates a locale/language constraint without stating that the user may choose another language, which matches the policy's language opt-in concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This README presents the purpose and document descriptions entirely in Chinese, which effectively forces a specific language for users reading the skill documentation. The file does not offer an alternative language, opt-in, or justification that the skill is intended only for a Chinese-language or region-specific audience.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The file's substantive instructions and status notes are written entirely in Chinese, which can constitute a language/locale policy issue if users or collaborators are not given an explicit choice. There is no indication that the skill or document is region-specific or that Chinese is required for compliance or operational reasons.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The document states that the trade module '默认采用' a specific Chinese-language end-user assistant mode. This is a natural-language policy constraint that appears to prescribe a fixed output language/locale without mentioning user preference, opt-in, or multilingual support.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file contains user-facing instructions exclusively in Chinese, and nowhere indicates that the skill is China-specific or that users may choose another language. That creates a natural-language policy risk because the documentation effectively forces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This code automatically reads local secret files and injects their contents into process environment variables at import time. There is no confirmation prompt, logging, or inline warning explaining that credential material from user/home directories will be accessed and loaded.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The formatter returns all user-facing labels and explanatory text in Chinese, such as account info, positions, and capital flow headings. This imposes a specific language/locale in natural-language output without any opt-in, fallback, or justification that the skill is intended only for a Chinese-language context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code returns a natural-language error hint in Chinese, which imposes a specific language on users. The policy requires either user opt-in/choice or a clearly documented and justified locale constraint, neither of which is evident in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill generates numerous user-facing summaries in Chinese across its formatter functions. Because these messages are presented to users and no language-selection mechanism or documented regional justification appears in the file, this is a language policy violation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The manifest limits the skill to stock-trading order/deal queries, portfolio/account views, and pre-trade evaluation scenarios. The additional query-push-data command retrieves generic push data by serial range, which is not mentioned among the declared user-facing scenarios and appears broader than the described purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The CLI fetches and prints raw trading, account, holdings, asset, and capital-flow responses, which can contain highly sensitive financial and personal information. Because the tool is designed for agent use and emits JSON directly to stdout, any caller, log sink, transcript, or downstream tool may receive more data than needed, creating a real confidentiality risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This code performs authenticated network requests to external trade endpoints and sends user/trading data in query parameters and JSON payloads. There is no confirmation prompt, print/log disclosure, or explanatory comment/docstring in this file warning that account and order-related data will be transmitted over the network.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The manifest says the skill currently only promises read-only queries and pre-trade evaluation, and emphasizes using controlled CLI/script entrypoints rather than directly assembling trading API calls. This file implements a reusable _post method that can send arbitrary JSON payloads to arbitrary endpoints under the configured trade service, which is broader than the narrowly described read-only/query intent.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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 · scripts/trade_client.py (reported line 89)May include surrounding context.

python
headers = dict(self.headers)
        headers['Content-Type'] = 'application/json'
        try:
            resp = requests.post(
                url,
                headers=headers,
                json=payload,

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
80% confidence
Finding

The manifest enumerates order/deal/holding/account/asset/fund-flow queries and pre-trade assessment scenarios, but does not mention querying push-stream data or serial-range feed retrieval. query_push_data adds a separate capability to access push data by date and serial number range, which is not clearly covered by the declared skill purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document's instructional content is written primarily in Chinese, with no indication that users may choose another language or that the locale restriction is required for a region-specific purpose. Under the policy, forcing a specific language without opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

SQP-3 applies to all file types and covers language or locale policy violations. The status notes and operational descriptions in these lines are written only in Chinese, while the document heading and capability names are in English, and the file does not state that the skill is intentionally Chinese-only or provide any user opt-in for language selection.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file contains repeated 'Typical User-facing Message' content exclusively in Chinese, which can amount to a language/locale policy issue when no opt-in or locale justification is provided. The policy allows locale constraints only when explicitly justified or when users are given a choice, neither of which appears here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The title, description, and tag descriptions are entirely in Chinese, which can indicate a language-specific constraint in the skill's natural-language interface or documentation. The file does not state that the API is intentionally region-specific or that users may choose another language, so this may conflict with a policy requiring language choice or explicit locale justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file's user-facing interpretations and output guidance are entirely in Chinese, including the suggested downstream presentation language. This can violate a language/locale policy when no user opt-in or explicit region-specific justification is provided.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The manifest emphasizes using a unified CLI/script entry for read-only stock queries and pre-trade evaluation, and does not mention direct secret-loading behavior. This module automatically reads credential material from multiple local secret files into process environment state, which is a broader capability than the user-facing purpose suggests, even though it may support backend API access.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The ConfigError hints are presented only in Chinese, which imposes a specific language on users without any opt-in or locale selection. This is a natural-language policy issue because the file contains user-facing text that does not accommodate language choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The validation error hint is written only in Chinese ("请传入证券代码,例如 HK.00700 或 US.AAPL"), which imposes a specific language on users without offering a choice. This is a natural-language policy issue because the file contains user-facing text that does not provide locale flexibility or documented justification.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.