Back to skill

Security audit

Sim Trade

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a local stock-trading simulator, but it asks users to store financial cookies or API tokens insecurely and advertises real account connectivity that is only stubbed out.

Install only if you are comfortable with a Chinese-language local simulator that writes account state under ~/.openclaw/sim_trade and contacts Tencent for stock quotes. Do not place real broker API tokens or browser cookies in its config.json unless you can protect that file yourself and understand the account-access risk; the advertised real-account sync is not actually implemented in the inspected code.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/sync.py:24
Finding

Sensitive authentication credentials are stored in plaintext without enforced access restrictions

Content
View full analysis
{DATA_DIR}/config.json') ``` ```python print(' python3 -c "import json; json.dump({\"mode\":\"broker\",\"broker\":\"htf\",\"token\":\"xxx\"},open(\"~/.openclaw/sim_trade/config.json\",\"w\"))"') ``` ### Technical Analysis The Skill stores authenticated session cookies and broker API tokens directly in `~/.openclaw/sim_trade/config.json`. The file is created with Python's default `open()` behavior, so its effective permissions depend on the process umask. The code does not enforce a mode such as `0600`, verify ownership, reject symbolic links, or use an operating-system credential store. The documented shell commands also embed credentials directly in command text. If users substitute real credentials, those values may remain in shell history or be exposed through process inspection while the command is running. Although the current synchronization functions are stubs and do not transmit the credentials, the credentials remain independently usable against the associated services. Their local storage therefore creates a credential-disclosure risk. ### Attack Path 1. A user follows the Skill documentation and configures an Eastmoney or Tonghuashun session cookie, or a broker API token. 2. The credential is ...[truncated 1228 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/trade.py:53
Finding

Non-positive trade quantities permit persistent account and portfolio corruption

Content
View full analysis
0 else 0.0 ``` ### Technical Analysis The application converts the supplied quantity to an integer but never checks that it is strictly positive. As a result, negative quantities reverse the intended direction of financial calculations. For a negative buy: - `amount` becomes negative. - The calculated fee also becomes negative. - `total_cost` becomes negative. - The insufficient-funds check succeeds because available cash is normally greater than a negative cost. - `account.deduct(total_cost ...[truncated 2841 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (21)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The description presents a broader simulated trading system with account connectivity, holdings management, and P&L features. The actual code chunk is limited to a quote lookup utility that calls Tencent's market data API and prints quote information. While '支持真实行情' is consistent with the code, the primary declared purpose is materially broader than the implemented behavior in this chunk. Therefore, the description does not accurately represent what this code actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description presents a functional simulated trading system with real行情 support, platform connectivity, holdings management, and P/L calculation. In contrast, this code only loads/saves configuration and displays setup instructions for cookies or broker tokens. The sync functions are placeholders that print messages and return False, so the advertised core capabilities are not implemented in the provided chunk. This is a material description-behavior mismatch because the primary described functionality is absent rather than merely partially implemented.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
74% confidence
Finding

The skill advertises capabilities that imply file access and network use, but it does not declare any explicit tool scope or permission boundaries. In an agent environment, missing scope declarations can lead to overbroad access being granted implicitly, making unintended file reads/writes or network requests harder to audit and contain.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation instructs users to extract browser cookies and store cookies or API tokens in local configuration for account connectivity, but it lacks strong security guidance on handling these secrets. Such credentials can grant account access; if stored insecurely, logged, shared, or exfiltrated by other components, they could enable unauthorized trading activity or disclosure of financial information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code performs a file write to ACCOUNT_FILE via reset()->save(), which can overwrite existing account state. While the methods have internal docstrings, there is no user-facing warning or confirmation around the destructive reset operation itself, and the warning only appears after the action has already occurred.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file's human-readable documentation and comments are entirely in Chinese, including the module docstring and configuration headings, without indicating that language choice is optional. This can violate language/locale policy where skills should not force a specific language unless the constraint is documented and justified or the user has opted in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script performs destructive state changes by resetting the account and clearing positions immediately when run, with no confirmation prompt, dry-run mode, or environment guard. In a trading-related skill, accidental execution could erase simulated portfolio state and mislead users about balances or performance, making this a real safety issue even if it is not a code-execution vulnerability.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This Python file contains natural-language docstrings and console output exclusively in Chinese, such as the module description and transaction-status messages. Because the skill does not provide any user opt-in or explain that it is intentionally limited to a Chinese-speaking context, it may violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The clear() method deletes all in-memory holdings and immediately persists the empty state to disk, which is an irreversible data-loss operation for this file. Although the docstring names the action, there is no confirmation prompt, user-visible warning, or logging around the destructive write.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Natural-language strings in the module docstring and function docstring force a specific language, and all user-facing output is also Chinese. The policy requires avoiding language or locale restrictions unless the skill offers user choice or clearly documents a justified locale-specific constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The module docstring and function docstring specify behavior entirely in Chinese (显示持仓信息, 显示所有持仓), and all user-facing output strings are also hard-coded in Chinese. The policy requires flagging language or locale constraints when the skill forces a specific language without 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
97% confidence
Finding

The module docstring and all user-facing messages are written only in Chinese, which imposes a specific language on users without any opt-in or alternative locale support. The policy allows locale constraints only when they are explicitly justified or when users are offered a choice, neither of which appears here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code presents its module description, CLI usage text, and runtime messages in Chinese only, which constitutes a locale/language constraint in natural-language behavior. There is no opt-in, fallback, or justification that the skill is intentionally region-specific, so it conflicts with the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language content forces a single language/locale for all users, including the name, description, setup, and safety notes. The file does not offer an English alternative, user language selection, or explain that the skill is intentionally limited to a Chinese-speaking or region-specific audience.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

Natural-language strings in the module docstrings and printed output are fixed to a specific language. Under the policy, forcing a specific language without user opt-in can be a locale-policy violation unless the constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This Python file performs a filesystem write by creating ~/.openclaw/sim_trade at import time via os.makedirs. Although the surrounding comments describe data storage, there is no user-facing prompt, log message, or explicit warning in this file that importing the module will modify the user's filesystem.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The docstring and user-facing text are written only in Chinese, which imposes a specific language choice without offering an alternative or opt-in. This can violate language/locale policy when skills are expected to avoid forcing a locale unless explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The module-level natural-language documentation is written only in Chinese, and the file provides no indication that language choice is configurable or that the skill is intentionally limited to a Chinese-speaking context. Under the policy, forcing a specific language without opt-in can be a locale-policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module description and all user-facing strings are written only in Chinese, which imposes a specific language/locale on users. The file does not provide any opt-in, alternative locale, or documentation justifying a Chinese-only constraint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This Python code fetches market data via get_quote(code), which is a network operation under the missing-warning criteria for code files. Although the script prints account information, there is no visible comment, docstring detail, or user-facing message disclosing that external quote requests will be made.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

This Python code file performs a network-like quote retrieval via get_quote(code) for each held position, but the file contains no user-facing notice, confirmation, or comment explaining that position symbols will be sent to an external quote provider. For code files, outbound data transmission should have some visible disclosure unless clearly documented as part of the skill's stated purpose, which is not evident from this file alone.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.