Back to skill

Security audit

Precise T Trading

Security checks for vulnerabilities and agentic risk

Overview

This trading skill is mostly purpose-aligned, but it needs Review because it gives actionable financial recommendations while using unsafe and under-disclosed network, filesystem, and privilege practices.

Review carefully before installing or using with real money. Run it only as a normal user, prefer a virtual environment with pinned dependencies, avoid the HTML dashboard unless the JSONP/innerHTML issues are fixed, and treat all trading outputs as educational signals requiring independent verification.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (5)

T03 · Remote Payload Retrieval and Execution

Error
Location
scripts/dashboard.html:158
Finding
Remote JavaScript Payload Execution Through JSONP<![CDATA[ ## Vulnerability Details **File Location**: `scripts/dashboard.html`, lines 158–172 **Vulnerability Type**: Remote script retrieval and execution **Risk Level**: High ### Vulnerable Code ```javascript async function fetchStockData(code) { // 使用JSONP方式获取腾讯数据 return new Promise((resolve) => { const script = document.createElement('script'); const callbackName = 'stockCallback_' + Date.now(); window[callbackName] = function(data) { resolve(data); delete window[callbackName]; document.body.removeChild(script); }; script.src = `https://qt.gtimg.cn/q=${code}&callback=${callbackName}`; script.onerror = () => resolve(null); document.body.appendChild(script); ``` ### Technical Analysis The dashboard creates a `<script>` element whose source points to an external server and inserts it into the document. Unlike a normal data request, a remotely sourced script is executed directly in the dashboard's JavaScript context. Consequently, the effective executable payload is controlled by `qt.gtimg.cn` and can change after the Skill package has been reviewed. HTTPS protects transport integrity but does not protect against compromise of the remote service, DNS or certificate infrastructure failures, or malicious changes made by the service operator. The network access to Tencent is necessary for obtaining market quotes, but granting the quote provider arbitrary script-execution capability exceeds the minimum privilege required to retrieve quote data. ### Attack Path 1. A user opens `scripts/dashboard.html`. 2. `refreshData()` calls `fetchStockData()` for each configured ticker. 3. The function constructs a script URL hosted at `qt.gtimg.cn`. 4. The browser downloads the response and executes it as JavaScript rather than treating it as inert data. 5. If the endpoint or its delivery infrastructure returns malicious JavaScript, that code executes in the dashboard con ...[truncated 820 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove dynamic insertion of third-party `<script>` elements. 2. Retrieve quote data as inert JSON using `fetch()` from an endpoint that explicitly supports CORS. 3. If the upstream API does not provide JSON with CORS, use a small trusted local backend that fetches and parses the quote response, validates it, and returns a strict JSON schema. 4. Validate ticker codes against a restrictive pattern such as `^(sh|sz)[0-9]{6}$`. 5. Validate every returned field's type, range, and maximum length before rendering. 6. Add a restrictive Content Security Policy, for example limiting `script-src` to `'self'` and avoiding `unsafe-inline`. 7. If remote scripts are unavoidable, proxy and pin reviewed content rather than executing a mutable third-party response directly. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/dashboard.html:205
Finding
DOM Injection Through Unescaped Remote Quote Fields<![CDATA[ ## Vulnerability Details **File Location**: `scripts/dashboard.html`, lines 205–281 **Vulnerability Type**: DOM-based HTML injection and potential cross-site scripting **Risk Level**: High ### Vulnerable Code ```javascript function createStockCard(stock, data) { if (!data) { return ` <div class="stock-card"> <div class="stock-header"> <div> <div class="stock-name">${stock.name}</div> <div class="stock-code">${stock.code}</div> </div> </div> <div style="text-align:center;color:#999;">数据获取失败</div> </div> `; } const isUp = data.changePct >= 0; const priceClass = isUp ? 'price-up' : 'price-down'; const badgeClass = isUp ? 'change-up' : 'change-down'; const changeSymbol = isUp ? '+' : ''; return ` <div class="stock-card"> <div class="stock-header"> <div> <div class="stock-name">${data.name}</div> <div class="stock-code">${stock.code}</div> </div> </div> <div class="price-display"> <div class="current-price ${priceClass}">¥${data.price.toFixed(2)}</div> <div class="change-badge ${badgeClass}"> ${changeSymbol}${data.change.toFixed(2)} (${changeSymbol}${data.changePct.toFixed(2)}%) </div> </div> </div> `; } async function refreshData() { const grid = document.getElementById('stockGrid'); grid.innerHTML = '<div style="color:white;text-align:center;">加载中...</div>'; const cards = []; for (const stock of stocks) { const data = await fetchStockData(stock.code); cards.push(createStockCard(stock, data)); } grid.innerHTML = cards.join(''); } ``` ### Technical Analysis `data.name` originates from the remote quote re ...[truncated 1611 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not generate stock cards as HTML strings. 2. Create elements with `document.createElement()` and assign all external values using `textContent`. 3. If HTML rendering is unavoidable, sanitize untrusted values with a maintained sanitizer configured to reject active elements, event attributes, and dangerous URL schemes. 4. Enforce a strict response schema and reject unexpected strings, excessive field lengths, non-finite numbers, and malformed records. 5. Add a Content Security Policy that blocks inline event handlers and unauthorized scripts. 6. Keep all local ticker configuration immutable and validate ticker codes before using them in requests or rendering. ]]>

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding
Unpinned and Globally Installed Third-Party Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `requirements.txt`, lines 1–4; `SKILL.md`, lines 17 and 220; `PUBLISH_GUIDE.md`, line 17; `QUICK_START.md`, line 80 **Vulnerability Type**: Unsafe dependency resolution and global package installation **Risk Level**: Medium ### Vulnerable Code `requirements.txt`: ```text numpy>=1.24.0 scipy>=1.10.0 requests>=2.28.0 colorama>=0.4.6 ``` `SKILL.md`: ```text install: pip install numpy scipy requests colorama ``` ```text | "Module not found" | Run `pip install -r requirements.txt` | ``` `PUBLISH_GUIDE.md` and `QUICK_START.md`: ```bash npm install -g clawhub ``` ### Technical Analysis The Python requirements specify only minimum versions and do not include hashes or upper bounds. The direct installation instruction in `SKILL.md` does not specify versions at all. Future package releases can therefore be selected without having been reviewed with this Skill. The publishing documentation also recommends globally installing an unpinned npm package. Global installation expands the affected scope and may expose the user's command environment to package lifecycle scripts and future package behavior. No evidence indicates that the named dependencies are malicious or that dependency confusion is currently being exploited. The weakness is that package installation trusts mutable registry state and unreviewed future releases. ### Attack Path 1. A user follows the documented pip or npm installation command. 2. The package manager resolves the latest release satisfying the open-ended constraint. 3. A compromised package account, registry incident, malicious update, or dependency-chain compromise introduces hostile installation or runtime code. 4. The package manager downloads and executes the affected package code with the user's privileges. 5. For a global npm installation, the malicious package may also affect commands and files outside this project environment. ### Impact Assessment A compromised dependency c ...[truncated 512 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin every direct Python dependency to an exact reviewed version. 2. Generate a lock file that includes transitive dependencies. 3. Use cryptographic hashes with pip's hash-checking mode. 4. Install dependencies in a dedicated virtual environment rather than the system interpreter. 5. Pin the ClawHub CLI to a reviewed version and avoid `npm install -g`. 6. Prefer a project-local npm installation invoked through `npx --no-install` or an equivalent locked workflow. 7. Run dependency vulnerability and provenance checks as part of release testing. 8. Document the expected package publishers and official registry sources. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:223
Finding
Unnecessary Recommendation to Run the Skill as Administrator<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 223 **Vulnerability Type**: Violation of least privilege **Risk Level**: Medium ### Vulnerable Code ```text | "Permission denied" | Run as administrator on Windows | ``` ### Technical Analysis Fetching public stock quotes, calculating indicators, rendering a dashboard, and writing logs to a user-owned directory do not require Windows administrator privileges. The documentation recommends blanket elevation instead of identifying and correcting the inaccessible path. Running the Skill as administrator increases the privileges available to all imported dependencies and expands the consequences of exploitable defects. This is especially concerning because dependencies are not pinned and the dashboard retrieves executable JavaScript from a remote endpoint. ### Attack Path 1. A user encounters a permission error, potentially because the monitor uses a developer-specific absolute log path. 2. The user follows the troubleshooting instruction and launches the Skill or related command with administrator privileges. 3. Any compromised dependency, malicious remote script interaction, or exploitable local defect then operates in an unnecessarily elevated environment. 4. Code executing in that elevated process may modify administrator-writable files or system configuration that would otherwise be protected. ### Impact Assessment The instruction can elevate the execution context from an ordinary user to a Windows administrator. If another code-execution weakness is exploited in the elevated process, the resulting scope may include system-wide file modification and access to resources protected from standard users. The instruction does not itself bypass Windows access controls and no automated privilege-escalation mechanism is present. Exploitation depends on the user voluntarily following the unsafe guidance. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the blanket instruction to run as administrator. 2. Diagnose permission failures by reporting the exact path and operation that failed. 3. Store logs and cache files under a user-writable project or application-data directory. 4. Check directory permissions before writing and provide a safe configuration option when a directory is unavailable. 5. Explicitly document that the analyzer and monitor should run as a standard user. 6. Add tests confirming that all normal workflows complete without elevated privileges. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/stock_monitor.py:84
Finding
Undeclared Write to a Developer-Specific Absolute Filesystem Path<![CDATA[ ## Vulnerability Details **File Location**: `scripts/stock_monitor.py`, lines 84–90 **Vulnerability Type**: Unsafe and misleading filesystem configuration **Risk Level**: Low ### Vulnerable Code ```python # 保存到日志文件 log_dir = r"I:\OpenClawWorkspace\stocks\监控日志" os.makedirs(log_dir, exist_ok=True) log_file = os.path.join(log_dir, f"stock_monitor_{datetime.now().strftime('%Y-%m-%d')}.log") with open(log_file, 'a', encoding='utf-8') as f: f.write('\n'.join(log_lines) + '\n') ``` ### Technical Analysis The monitor writes to a hard-coded Windows drive and directory outside the project. This conflicts with the permission declaration in `SKILL.md`, which states that monitoring writes to `./monitor_logs/`. The path appears specific to the developer's workstation and is not necessary for the monitoring functionality. On another system, it may fail, create an unexpected directory structure, or target a mounted or shared drive that the user did not intend the Skill to modify. The code appends only timestamps, stock names, public prices, and alerts; it does not write credentials or other sensitive information. ### Attack Path 1. A user runs `scripts/stock_monitor.py`. 2. `monitor_once()` executes automatically from the module's main block. 3. The script attempts to create `I:\OpenClawWorkspace\stocks\监控日志`. 4. If the path exists or can be created, quote logs are written outside the declared project-local directory. 5. On a shared or unexpectedly mapped `I:` drive, other users or systems may receive or modify those files. If creation fails, the user may be induced to follow the separate administrator recommendation. ### Impact Assessment The direct impact is an unexpected filesystem write outside the documented scope. The written information is public market data rather than sensitive user data, so confidentiality impact is low. The script does not overwrite arbitrary files because the file name is date-based and fixed by the program. It also does n ...[truncated 156 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace the absolute path with the documented local directory, such as a `monitor_logs` directory under the project root. 2. Resolve the destination relative to `__file__` rather than the process's current working directory. 3. Allow an explicit environment variable or command-line option to override the log directory. 4. Normalize and validate any configurable path before use. 5. Refuse to write outside approved directories unless the user explicitly supplies and confirms that location. 6. Handle `OSError` and permission failures without recommending administrator execution. 7. Update metadata and documentation so declared write permissions exactly match implementation behavior. ]]>
Vulnerability Patterns
  • 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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (22)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill claims advanced quantitative trading logic, risk management, and optimization that the associated behavior reportedly does not implement. This is dangerous because users or agent orchestrators may rely on false safety and decision-quality claims in a high-risk financial context, leading to harmful actions based on misleading capability descriptions.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The guide tells users to execute local publish scripts that may install global tooling, perform network access, and publish content, but it does not clearly disclose those side effects before execution. This creates a social-engineering and supply-chain risk because users are encouraged to run automation without understanding what system changes or outbound actions will occur.

Lp3

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding
The skill advertises network access and local writes but does not declare an explicit tool scope such as permissions or allowed-tools. In agent environments, that ambiguity can cause the host to grant broader capabilities than users expect, reducing transparency and increasing the chance of unintended network requests or filesystem modification.

Vague Triggers

Medium
Confidence
88% confidence
Finding
The invocation guidance uses broad triggers like general requests about trading strategies, stock analysis, risk management, and monitoring without clear boundaries. In an agentic setting, that can cause over-triggering on ordinary financial conversation, leading the skill to activate unexpectedly, make network calls, write logs, or present authoritative trading advice when the user did not explicitly request this tool.

Vague Triggers

Medium
Confidence
84% confidence
Finding
The example triggers are short, natural conversational phrases that could easily appear in normal dialogue, making accidental invocation more likely. In this financial context, unintended activation is more dangerous because it may generate trading recommendations, open dashboards, or start monitoring workflows with implied authority and side effects.

Description-Behavior Mismatch

Medium
Confidence
97% confidence
Finding
The manifest describes a professional T+0 intraday trading system with quantitative decision optimization, position sizing, and risk control. In this file, the code only fetches Tencent quote data and renders a simple monitoring dashboard with periodic refresh; there is no trading logic, Bayesian inference, Kelly criterion, VaR calculation, or automated decision/risk-control behavior present.

Intent-Code Divergence

Medium
Confidence
96% confidence
Finding
The top-level documentation says the script automatically checks stocks every hour, which implies continuous monitoring. However, the actual entrypoint calls monitor_once() once and leaves the continuous main() loop commented out, so the default behavior contradicts the stated intent.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The file’s natural-language description and user-facing output are entirely in Chinese, including the docstring and console messages. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
The module title, descriptions, and all user-facing terminal output are written in Chinese, and there is no mechanism for user opt-in or language selection. The stated policy requires flagging language or locale constraints unless the skill offers a choice or clearly documents a justified region-specific limitation.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The script outputs explicit GO/WAIT trading recommendations, price bands, position sizing, and expected profit without any warning that the content is informational, model-based, and subject to market/data error. In a financial-decision context, omission of such a warning increases the chance that users will over-trust the tool and act on imperfect or simulated assumptions.

Intent-Code Divergence

Medium
Confidence
95% confidence
Finding
The displayed buy/sell ranges are derived from a hardcoded current price (4.06) instead of the fetched live quote, which can materially misstate actionable trading guidance while presenting the output as real-time analysis. In a trading skill, inconsistent decision inputs and displayed execution levels can directly mislead users into placing trades at inappropriate prices, increasing loss risk.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
This markdown file contains user-facing instructions and promotional content exclusively in Chinese, including headings, steps, and example copy. Under the policy rule, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale restriction is explicitly documented and justified.

Natural-Language Policy Violations

Low
Confidence
86% confidence
Finding
A language or locale policy concern exists when instructions force a specific language without user opt-in. This file presents all operational guidance exclusively in Chinese and does not indicate multilingual availability or that the locale is intentionally limited.

Unpinned Dependencies

Low
Category
Supply Chain
Content
numpy>=1.24.0
scipy>=1.10.0
requests>=2.28.0
colorama>=0.4.6
Confidence
96% confidence
Finding
The dependency is specified with a lower bound only, so builds may resolve to different versions over time. This weakens supply-chain control and can allow accidental installation of vulnerable or incompatible releases, though by itself it does not prove a compromise.

Unverifiable Dependency: numpy has 16 known advisory(ies) (CVE-2014-1859 (Numpy arbitrary file write via symlink attack); CVE-2021-41495 (NumPy NULL Pointer Dereference); CVE-2021-33430 (NumPy Buffer Overflow (Disputed)) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
90% confidence
Finding
numpy has known advisories, and because the manifest does not pin an exact version, there is no way to verify whether installations will avoid affected releases. This creates uncertainty in dependency risk posture rather than proving active exploitation.

Unpinned Dependencies

Low
Category
Supply Chain
Content
numpy>=1.24.0
scipy>=1.10.0
requests>=2.28.0
colorama>=0.4.6
Confidence
96% confidence
Finding
The scipy requirement is unpinned, which makes installations non-reproducible and leaves the environment exposed to whatever newest matching version is available at install time. In a trading skill, inconsistent numerical library behavior can also increase operational risk alongside supply-chain exposure.

Unverifiable Dependency: scipy has 4 known advisory(ies) (CVE-2013-4251 (SciPy creates insecure temporary directories); CVE-2013-4251 (The scipy.weave component in SciPy before 0.12.1 creates insecure temporary dire); CVE-2023-25399 (A refcounting issue which leads to potential memory leak was discovered in scipy) +1 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
89% confidence
Finding
scipy has historical advisories, and the lack of version pinning prevents verification that deployed environments use a safe release. In a quantitative trading context, this is primarily a software supply-chain hygiene issue rather than a direct exploit path from the requirements file alone.

Unpinned Dependencies

Low
Category
Supply Chain
Content
numpy>=1.24.0
scipy>=1.10.0
requests>=2.28.0
colorama>=0.4.6
Confidence
98% confidence
Finding
An unpinned requests dependency is more concerning because it is network-facing and commonly handles redirects, authentication, and TLS-related behavior. Allowing any version above a minimum increases the chance of pulling a release with newly introduced issues or unresolved known vulnerabilities.

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
95% confidence
Finding
requests has multiple security advisories, including issues relevant to credential handling and network interactions, and the unpinned requirement makes it impossible to confirm a safe installed version. Because this skill explicitly uses real-time quote retrieval, a network library with unverifiable versioning is more consequential here than a purely local utility.

Unpinned Dependencies

Low
Category
Supply Chain
Content
numpy>=1.24.0
scipy>=1.10.0
requests>=2.28.0
colorama>=0.4.6
Confidence
93% confidence
Finding
colorama is also unpinned, so the environment is not fully reproducible and may drift over time. The direct security impact is comparatively small because it is typically a terminal-color utility, but it still represents avoidable supply-chain uncertainty.

Natural-Language Policy Violations

Low
Confidence
94% confidence
Finding
The document declares `lang="zh-CN"`, and the UI text and timestamp formatting are consistently fixed to Simplified Chinese. Under the policy, forcing a specific language or locale without user opt-in is a natural-language policy concern unless the restriction is clearly justified or configurable.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
`toLocaleString('zh-CN')` forces date/time presentation in a specific locale. This creates a locale policy issue because the user is not given a choice and the file does not explain why Chinese formatting is mandatory.

Static analysis

No suspicious patterns detected.