Back to skill

Security audit

tradedaily

Security checks for vulnerabilities and agentic risk

Overview

This trading workflow skill is mostly purpose-aligned, but it handles sensitive portfolio data and uses unauthenticated HTTP market data in ways users should review before installing.

Review before installing. Treat the bundled portfolio data as sensitive, replace it with your own private local file or a synthetic example, and do not share generated reports without redaction. The risk monitor contacts an external quote service over HTTP and should not be relied on for trading decisions unless you replace it with an authenticated HTTPS data source and validate the results. The trading thresholds should be treated as examples, not financial advice.

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

Error
Location
scripts_files/risk_monitor.py:23
Finding
Unauthenticated HTTP Market Data Can Be Manipulated to Produce False Risk Alerts<![CDATA[ ## Vulnerability Details **File Location**: `scripts_files/risk_monitor.py`, lines 23-31 **Vulnerability Type**: Unencrypted and unauthenticated external market-data transport **Risk Level**: High ### Vulnerable Code ```python url = f'http://qt.gtimg.cn/q={code}' try: r = requests.get(url, timeout=5) data = r.text.split('~') if len(data) > 45: return { 'price': float(data[3]), 'change_pct': float(data[32]), 'name': data[1] } ``` ### Technical Analysis The risk monitor obtains security prices from a plaintext HTTP endpoint. HTTP provides neither transport encryption nor server authentication, so an attacker able to observe or modify network traffic can intercept the requested stock code and alter the returned price fields. The program directly trusts response fields `data[3]` and `data[32]`. These values control portfolio profit-and-loss calculations and the generation of stop-loss, take-profit, intraday-crash, and intraday-surge alerts. The implementation does not authenticate the response, verify the HTTP status, restrict redirects to HTTPS, or validate the returned quote against an independent source. Although the code checks the number of response fields, that structural check does not establish the integrity or authenticity of the data. ### Attack Path 1. A user invokes `risk_monitor.py` while connected through a network controlled or observable by an attacker, such as a hostile Wi-Fi access point, compromised router, or malicious proxy. 2. The script sends the portfolio stock code to `http://qt.gtimg.cn`. 3. The attacker intercepts the plaintext response. 4. The attacker substitutes forged values for the current price or daily percentage change. 5. The script parses the forged fields and treats them as authentic market data. 6. The risk calculations produce false results, potentially suppressing a genuine stop-loss warning or creating a fraudulent alert. 7. The user may make ...[truncated 735 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace the plaintext endpoint with a supported HTTPS market-data API that provides valid certificate-based server authentication. 2. Reject redirects from HTTPS to HTTP and allow only explicitly approved hosts. 3. Validate transport and response status before processing data: ```python response = requests.get(approved_https_url, timeout=5, allow_redirects=False) response.raise_for_status() ``` 4. Validate the response schema, stock identifier, expected encoding, numeric types, and plausible price ranges before using returned values. 5. Treat missing, malformed, or unauthenticated data as a monitoring failure rather than reporting that portfolio risk is normal. 6. Consider checking high-impact alerts against a second independent authenticated data provider. 7. Avoid including portfolio identifiers in logs or error reports beyond what is operationally necessary. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
config_files/portfolio.json:2
Finding
Real Personal Portfolio and Asset Data Is Distributed in Plaintext<![CDATA[ ## Vulnerability Details **File Location**: `config_files/portfolio.json`, lines 2-49; duplicated in `SKILL.md`, lines 163-181 **Vulnerability Type**: Plaintext disclosure of sensitive financial data **Risk Level**: Medium ### Vulnerable Code The packaged portfolio configuration explicitly identifies the information as a real portfolio and discloses cash, total assets, securities, quantities, purchase costs, and market values: ```json { "name": "Alex的真实持仓", "update_time": "2026-03-08", "cash": 2307880.54, "total_assets": 5310139.54, "positions": [ { "code": "002353", "name": "杰瑞股份", "quantity": 7400, "cost": 117.30, "current_price": 122.50, "market_value": 906500, "stop_loss": -8, "take_profit": 5, "sector": "油气装备" }, { "code": "000975", "name": "山金国际", "quantity": 28300, "cost": 30.99, "current_price": 30.49, "market_value": 862867, "stop_loss": -8, "take_profit": 5, "sector": "贵金属/黄金" }, { "code": "688027", "name": "国盾量子", "quantity": 900, "cost": 711.23, "current_price": 699.88, "market_value": 629892, "stop_loss": -8, "take_profit": 5, "sector": "量子通信" }, { "code": "300502", "name": "新易盛", "quantity": 1500, "cost": 393.35, "current_price": 402.00, "market_value": 603000, "stop_loss": -8, "take_profit": 5, "sector": "光模块/AI算力" } ] } ``` The project documentation also reproduces sensitive values: ```json { "positions": [ { "code": "002353", "name": "杰瑞股份", "quantity": 7400, "cost": 117.30, "stop_loss": -8, "take_profit": 5 } ], "cash": 2307880.54, "total_assets": 5310139.54 } ``` ### Technical Analysis Sensitive financial information is embedded directly in the distributable project rather than being maintained as private runtime data. ...[truncated 1709 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the real portfolio data from the current package, published releases, repository history, caches, and retained build artifacts. 2. Replace it with a clearly fictional `portfolio.example.json` containing synthetic names, quantities, prices, and balances. 3. Remove or sanitize the duplicated financial values in `SKILL.md`. 4. Store live portfolio files outside the distributable Skill directory. 5. Add the live configuration path to version-control and packaging exclusion rules. 6. Restrict local file permissions so only the intended user can read the live portfolio. 7. If portfolio data must be stored or synchronized, use an approved encrypted storage mechanism with appropriate access controls. 8. Review prior recipients and repository history to determine whether disclosure notifications or data-removal actions are necessary. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The code partially matches the declared description only in one area: it generates opening, closing, and end-of-day report templates from a local portfolio file. However, the broader declared purpose describes a comprehensive trader task management system with real-time monitoring, risk alerts, task scheduling, trade log recording, and review functionality. None of those operational capabilities are present in this code chunk. The script is limited to formatting markdown text with mostly placeholder values and printing it to stdout. Therefore, the description materially overstates the implemented functionality, making this a mismatch.

Lp3

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding
Without declared permissions the skill's intent is opaque and cannot be validated.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This markdown file presents all user-facing instructions and report templates exclusively in Chinese, and does not indicate that language selection is optional or user-configurable. Under the policy rule for natural-language constraints, forcing a specific language without opt-in is a locale/language policy violation.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
This file gives highly prescriptive trading instructions such as fixed stop-loss, take-profit, liquidation, and position-sizing rules without any disclaimer that the material is not financial advice and may be unsuitable for a user's circumstances. In the context of a trading workflow skill, users may treat these rules as authoritative operational guidance, which can lead to financial losses or inappropriate risk-taking if applied blindly.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
This code file contains natural-language instructions and descriptions that assume Chinese as the mandatory language for usage and operation. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation because users are not offered any locale or language choice.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The generated report content is hard-coded in Chinese across the report templates, and the script does not provide any user-controlled language or locale option. This creates a language policy issue because the skill imposes one language rather than offering an opt-in or clearly justified region-specific constraint.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
User-facing natural-language strings including the module description, help text, and runtime messages are exclusively in Chinese. Under the policy, forcing a specific language without opt-in or documented justification is a natural-language policy violation.

Missing User Warnings

Low
Confidence
84% confidence
Finding
The report templates encourage handling portfolio positions, prices, and trading records without warning that these outputs may contain highly sensitive financial information. In a trading workflow, users may paste, save, or share these reports broadly, increasing the risk of unauthorized disclosure of holdings, strategy, and P&L.

Missing User Warnings

Low
Confidence
82% confidence
Finding
The portfolio monitoring and configuration examples expose exact holdings, cash, and total asset values without any caution about sensitivity. In this skill context, that information can reveal trading strategy, concentration risk, and financial exposure, making accidental disclosure materially harmful.

Context-Inappropriate Capability

Low
Confidence
79% confidence
Finding
The manifest describes task scheduling, report generation, portfolio/risk monitoring, trading logs, and performance review. The documented workflow also includes 'Screen Stocks for Tomorrow' to prepare a watchlist, which is a distinct investment research/screening capability not declared in the manifest's features or use cases.

Natural-Language Policy Violations

Low
Confidence
87% confidence
Finding
The JSON content uses Chinese-only field values such as the portfolio name and stock/sector names, which imposes a specific language context without any documented user choice or locale opt-in. Under the language/locale policy, natural-language content should either offer a language choice or clearly justify the locale restriction.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
The entire skill document is written in Chinese and presents all task outputs, reporting steps, and workflow instructions in that language, with no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking or China-market-only audience. This can violate language/locale policy when a skill forces one language without user opt-in.

Missing User Warnings

Low
Confidence
85% confidence
Finding
The script sends portfolio stock codes to an external third-party API over plain HTTP without any explicit disclosure or consent mechanism. While stock codes are not highly sensitive by themselves, outbound transmission can leak portfolio interests or trading activity patterns, and use of unencrypted transport allows interception or tampering of the response.

Static analysis

No suspicious patterns detected.