Back to skill

Security audit

Trading Quant

Security checks for vulnerabilities and agentic risk

Overview

This skill is a market-data analysis tool whose network requests and local caches fit its purpose, with some dependency and disclosure caveats.

Install only in an isolated Python environment, expect the skill to call public finance/news websites and write local market-data caches, and avoid optional sentiment model warm-up/downloads unless you are comfortable with HuggingFace network access and mutable model artifacts.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding
Unpinned Python Dependencies and Mutable Machine-Learning Model Artifacts## Vulnerability Details **File Location**: `requirements.txt:1-6`, `README.md:29`, and `scripts/lib/analysis/sentiment.py:249-255` **Vulnerability Type**: Supply-chain integrity weakness **Risk Level**: Medium ### Vulnerable Code `requirements.txt:1-6`: ```text pandas>=2.0.0 pandas-ta>=0.3.14b httpx>=0.27.0 aiohttp>=3.9.0 pyyaml>=6.0 python-dateutil>=2.9.0 ``` `README.md:29`: ```text After installation, run `pip install -r requirements.txt` to install the Python dependencies. ``` `scripts/lib/analysis/sentiment.py:249-255`: ```python tokenizer = AutoTokenizer.from_pretrained( model_name, cache_dir=self.cache_dir ) model = AutoModelForSequenceClassification.from_pretrained( model_name, cache_dir=self.cache_dir ) ``` ### Technical Analysis The dependency manifest uses lower-bound version constraints without exact versions, upper bounds, or cryptographic hashes. As a result, identical installation commands can resolve to different package artifacts over time. The audited source therefore does not fully determine the code that will be installed and imported at runtime. The sentiment module first attempts to load models from the local cache, but if this fails it retrieves tokenizer and model artifacts from Hugging Face using repository names without an immutable `revision` value. A repository owner or compromised upstream account could replace artifacts associated with the mutable repository reference after this project has been reviewed. This issue does not establish that any currently referenced package or model is malicious. It is an integrity and reproducibility weakness that allows future upstream changes or compromises to affect the effective runtime components without a corresponding change to this repository. ### Attack Path 1. An attacker compromises a referenced package publisher, package index distribution path, or Hugging Face model repository. 2. The attacker publishes a malicious or altered artifact und ...[truncated 1573 chars]
Remediation
## Remediation Suggestions 1. Replace lower-bound dependency constraints with exact, reviewed versions. 2. Generate and commit a lock file appropriate to the supported installation workflow. 3. Record cryptographic hashes for all resolved distributions and require hash verification during installation, such as with `pip install --require-hashes`. 4. Review and update dependencies through a controlled process that includes vulnerability scanning and regression testing. 5. Pin each Hugging Face model and tokenizer to an immutable repository commit using the `revision` parameter: ```python tokenizer = AutoTokenizer.from_pretrained( model_name, revision="REVIEWED_COMMIT_SHA", cache_dir=self.cache_dir, ) model = AutoModelForSequenceClassification.from_pretrained( model_name, revision="REVIEWED_COMMIT_SHA", cache_dir=self.cache_dir, ) ``` 6. Prefer safe tensor formats and disable remote custom code where supported. Explicitly retain `trust_remote_code=False`. 7. Validate downloaded artifacts against documented checksums or deploy them from an internally controlled, immutable artifact store. 8. Document that model warm-up and first-use sentiment analysis may perform external downloads. 9. Run installation and model loading as an unprivileged account in an isolated virtual environment or container with only the filesystem and network access required by the application.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
Findings (69)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The mention of historical/current OHLCV retrieval and caching, while the description omits caching and broader data handling details, creates an undisclosed persistence behavior. Even if the cached data is not highly sensitive, undocumented local storage can leak usage patterns, symbols queried, and internal state across runs.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The mention of historical/current OHLCV retrieval and caching, while the description omits caching and broader data handling details, creates an undisclosed persistence behavior. Even if the cached data is not highly sensitive, undocumented local storage can leak usage patterns, symbols queried, and internal state across runs.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The mention of historical/current OHLCV retrieval and caching, while the description omits caching and broader data handling details, creates an undisclosed persistence behavior. Even if the cached data is not highly sensitive, undocumented local storage can leak usage patterns, symbols queried, and internal state across runs.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The mention of historical/current OHLCV retrieval and caching, while the description omits caching and broader data handling details, creates an undisclosed persistence behavior. Even if the cached data is not highly sensitive, undocumented local storage can leak usage patterns, symbols queried, and internal state across runs.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The mention of historical/current OHLCV retrieval and caching, while the description omits caching and broader data handling details, creates an undisclosed persistence behavior. Even if the cached data is not highly sensitive, undocumented local storage can leak usage patterns, symbols queried, and internal state across runs.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The mention of historical/current OHLCV retrieval and caching, while the description omits caching and broader data handling details, creates an undisclosed persistence behavior. Even if the cached data is not highly sensitive, undocumented local storage can leak usage patterns, symbols queried, and internal state across runs.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The mention of historical/current OHLCV retrieval and caching, while the description omits caching and broader data handling details, creates an undisclosed persistence behavior. Even if the cached data is not highly sensitive, undocumented local storage can leak usage patterns, symbols queried, and internal state across runs.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The mention of historical/current OHLCV retrieval and caching, while the description omits caching and broader data handling details, creates an undisclosed persistence behavior. Even if the cached data is not highly sensitive, undocumented local storage can leak usage patterns, symbols queried, and internal state across runs.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The mention of historical/current OHLCV retrieval and caching, while the description omits caching and broader data handling details, creates an undisclosed persistence behavior. Even if the cached data is not highly sensitive, undocumented local storage can leak usage patterns, symbols queried, and internal state across runs.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The mention of historical/current OHLCV retrieval and caching, while the description omits caching and broader data handling details, creates an undisclosed persistence behavior. Even if the cached data is not highly sensitive, undocumented local storage can leak usage patterns, symbols queried, and internal state across runs.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The mention of historical/current OHLCV retrieval and caching, while the description omits caching and broader data handling details, creates an undisclosed persistence behavior. Even if the cached data is not highly sensitive, undocumented local storage can leak usage patterns, symbols queried, and internal state across runs.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The mention of historical/current OHLCV retrieval and caching, while the description omits caching and broader data handling details, creates an undisclosed persistence behavior. Even if the cached data is not highly sensitive, undocumented local storage can leak usage patterns, symbols queried, and internal state across runs.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The mention of historical/current OHLCV retrieval and caching, while the description omits caching and broader data handling details, creates an undisclosed persistence behavior. Even if the cached data is not highly sensitive, undocumented local storage can leak usage patterns, symbols queried, and internal state across runs.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The mention of historical/current OHLCV retrieval and caching, while the description omits caching and broader data handling details, creates an undisclosed persistence behavior. Even if the cached data is not highly sensitive, undocumented local storage can leak usage patterns, symbols queried, and internal state across runs.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The mention of historical/current OHLCV retrieval and caching, while the description omits caching and broader data handling details, creates an undisclosed persistence behavior. Even if the cached data is not highly sensitive, undocumented local storage can leak usage patterns, symbols queried, and internal state across runs.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill advertises executable commands and the analyzer detected environment, file read/write, and network capabilities, but the manifest does not declare any tool scope or permissions boundaries. That creates an avoidable over-privilege and transparency problem: callers cannot easily tell what the skill may access, and a runtime may grant broader access than necessary.

Vague Triggers

Medium
Confidence
95% confidence
Finding
An overly broad activation condition can cause the skill to trigger for many generic finance questions, increasing unnecessary exposure of its network and file capabilities. In a tool-executing agent environment, overbroad routing is dangerous because it expands opportunities for unintended data access, surprising side effects, and misuse outside the intended domain.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The manifest description and body are predominantly in Chinese and present the skill as operating in that language, but they do not state that users may choose another language or that the Chinese-only constraint is intentional and region-justified. This is a natural-language policy concern because it can impose a locale preference without user opt-in.

Description-Behavior Mismatch

Medium
Confidence
82% confidence
Finding
The manifest describes a market data analysis tool for querying quotes, scores, flows, anomalies, and overviews. In the closing profile, this script invokes a `save_daily` action, which indicates a persistence/export operation rather than a user-facing analysis/query capability described in the manifest.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
This code embeds user-facing descriptive strings entirely in Chinese, including the documented data schema and all generated signal messages. There is no indication that the skill is China-region-specific or that users can opt into this locale, which creates a language/locale policy issue under the stated rules.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This Python file contains numerous user-facing strings in Chinese, including confidence labels and risk/status messages, with no indication that the user can opt into or change the language. That creates a natural-language locale policy concern because the skill effectively forces a specific language in outputs.

Description-Behavior Mismatch

Medium
Confidence
81% confidence
Finding
The manifest describes the skill as a quantitative trading data analysis tool for real-time quotes, scoring, limit-up/down pools, northbound funds, market overview, and capital-flow analysis. This file instead implements standalone financial news sentiment analysis using FinBERT and keyword heuristics, which is a distinct capability not mentioned in the manifest description or usage guidance.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The top-level docstring states the module is a Chinese financial sentiment analyzer and all user-facing documentation is written only in Chinese. Under the policy, locale-specific behavior should either be optional or clearly justified as region-specific; this file does not offer opt-in or explain why Chinese-only use is required.

Context-Inappropriate Capability

Medium
Confidence
92% confidence
Finding
The code automatically falls back to downloading models from HuggingFace at runtime when they are not present locally. This creates unannounced outbound network access and introduces supply-chain risk, because remote model artifacts are pulled into the execution environment without explicit integrity pinning, user consent, or an allowlisted provenance policy.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
When local loading fails, the module downloads models remotely without any user-facing warning or consent path. That can leak metadata such as requested model identifiers, timing, IP/runtime environment information, and may violate deployment expectations in restricted or privacy-sensitive environments.

Static analysis

No suspicious patterns detected.