Back to skill

Security audit

QuantAll

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent stock-analysis purpose, but it asks for broad local execution, service startup, database access, and plaintext credential handling that users should review carefully before installing.

Install only if you are comfortable granting this skill local process execution, a localhost MCP service, DuckDB database reads/writes, and access to a Tushare token. Do not use the sandbox-disable workaround, do not run untrusted JSON task files or Python scripts through QuantAll, and store or rotate the Tushare token carefully.

Vulnerability Patterns
  • 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
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/UpdateStock_skill.py:1419
Finding

SQL Injection in MCP-Exposed Stock Query Tools

Content
View full analysis
= '{start_date}' " if end_date: sql += f"AND trade_date <= '{end_date}' " sql += " ORDER BY trade_date;" with duckdb.connect(DB_path) as conn: df = conn.execute(sql).df() ``` The `get_stock` tool repeats the same unsafe construction: ```python DB_path = fd.get("db_path", "") sql = f"SELECT * FROM stock WHERE symbol='{symbol}' " if start_date: sql += f"AND trade_date >= '{start_date}' " if end_date: sql += f"AND trade_date <= '{end_date}' " sql += " ORDER BY trade_date;" with duckdb.connect(DB_path) as conn: df = conn.execute(sql).df() ``` ### Technical Analysis The MCP-exposed `get_adj_stock` and `get_stock` tools concatenate `symbol`, `start_date`, and `end_date` directly into DuckDB SQL statements. The type annotations and natural-language field descriptions do not enforce the documented six-digit symbol or date formats. A caller can supply quote characters and SQL syntax that alter the intended query. Because the query runs through a DuckDB connection opened with the service's user-level filesystem permissions, exploitation may extend beyond bypassing the stock filters. Depending on the DuckDB configuration and available functionality, an attacker may be able to query unintended tables, modify database content, or access files readable by the service process. The attack surface is particularly relevant because these methods are MCP tools and their parameters may be generated by an AI agent. Prompt injection or an untrusted instruction could the ...[truncated 1294 chars]
Remediation
View remediation
= ?" params.append(start_date) if end_date: sql += " AND trade_date <= ?" params.append(end_date) sql += " ORDER BY trade_date" with duckdb.connect(DB_path) as conn: df = conn.execute(sql, params).df() ``` Apply defense in depth: 1. Require `symbol` to match `^\d{6}$` before executing the query. 2. Parse dates with a strict format such as `%Y-%m-%d`, then pass parsed date values as parameters. 3. Reject unexpected characters rather than attempting to escape SQL manually. 4. Open the database in read-only mode for query-only MCP tools where supported. 5. Use a dedicated database account or sandbox with access only to the intended database directory. 6. Add automated tests containing quotes, comments, union clauses, and stacked-statement payloads to verify that inputs cannot change query structure. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/UpdateStock_skill.py:1528
Finding

Tushare API Token Stored in a Plaintext File

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:73
Finding

Installation Guidance Recommends Disabling the Host Sandbox

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Security-Sensitive Runtime Is Installed and Executed Without Artifact Integrity Verification

Content
View full analysis
/scripts/.venv/Scripts/python.exe -m pip install quantall -i https://pypi.tuna.tsinghua.edu.cn/simple ``` The update procedure also downloads and replaces the installed package without hash verification: ```text /scripts/.venv/Scripts/python.exe -m pip install --upgrade quantall -i https://pypi.tuna.tsinghua.edu.cn/simple ``` The local launcher immediately imports and executes the installed package: ```python import os from QuantAll import Start_main Start_main(os.path.dirname(__file__)) ``` ### Technical Analysis The core QuantAll HTTP MCP implementation is not included in the audited project. Instead, the launcher imports `Start_main` from an externally installed package and gives it the Skill directory path. The Skill documentation states that this runtime supports local task-file execution and local Python-script execution. Consequently, this dependency occupies a high-trust position: it starts a local service, accesses local data, and provides code-execution functionality. Pinning `quantall==1.0.8` prevents unintentional version drift, but it does not verify the identity or integrity of the downloaded wheel. No cryptographic hash, signed artifact, provenance record, or vendored auditable source is supplied. The package source configured in the documentation is not by itself evidence of malicious behavior, and the reviewed project contains no evidence that `quantall` is malicious. The confirmed weakness is the absence of artifact verification for a security-sensitive executa ...[truncated 1365 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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (25)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented behavior goes beyond a quantitative analysis engine and includes database setup, updater functionality, local file/config creation, and service/process management. This mismatch is dangerous because users and orchestrators may grant trust based on the declared purpose while the skill actually enables broader system-changing operations and data-ingestion workflows.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Exposing execution of local Python scripts gives the skill a generic arbitrary code execution path on the user's machine, far beyond the stated quant-analysis use case. If an attacker can influence the script path or convince the agent/user to run an untrusted script, this can lead to full local compromise, credential theft, destructive file changes, or persistence.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest explicitly says operations affecting the user's computer require prior notice and consent, but the implementation creates and modifies local files, reads/writes configuration, creates credential files, and starts services directly. This violates an important security expectation and increases the chance that an AI agent performs impactful host changes without informed user authorization.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The prompt explicitly documents a capability to execute a local Python file in the QuantAll Python environment. That expands the skill from constrained vectorized quant-analysis snippets into arbitrary script execution on the user's machine, which can access local files, spawn processes, or make network calls depending on the runtime, creating a strong path to host compromise or data exfiltration if the agent is induced to use it.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill explicitly describes creating virtual environments, installing packages, editing MCP configuration, starting a local HTTP service, and creating files, yet it declares no tool scope or permission boundaries. Without manifest-level restrictions, an agent may invoke file and shell capabilities more broadly than users expect, increasing the chance of unsafe local modifications.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Running local JSON-defined task files creates a generic automation surface that can chain operations outside the skill's declared purpose. Even if the file format is structured, task files can become a proxy for executing privileged workflows such as file edits, service control, or code execution, especially when combined with other exposed tools.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The markdown advertises execution of local scripts and task files without an equally explicit warning that these features can run arbitrary local logic and affect the host system. In this context, the omission matters because the skill already performs system modifications and starts services, so users may underestimate the risk of approving these execution paths.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The entire playbook is written as instructions to the AI in Chinese and does not indicate that users may choose another language or locale. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The playbook declares loops forbidden in the execution environment, then later recommends a for loop pattern to construct a DataFrame. This inconsistency can cause the agent to generate code that fails at runtime or bypasses the intended constrained/vectorized model, reducing reliability and potentially encouraging unsafe workarounds in a local code-execution environment.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The playbook gives conflicting guidance about whether select_by_code can constrain the universe for strategy_backtest, while elsewhere stating it does not filter backtest scope. In a trading-analysis skill, this can mislead the agent into presenting results as if they apply to a selected subset when they were actually computed on the full market, causing materially incorrect analysis and decisions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file exposes broad stock database creation, update, retrieval, configuration, and service-start capabilities beyond the manifest's narrow framing of quantitative computation support. Capability overreach is dangerous because users and orchestrators may invoke privileged local operations they did not expect from the advertised skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill provides stock-data retrieval endpoints that make it function as a data-serving MCP, not just a local computation helper. That mismatch matters because it broadens exposure of locally stored data and encourages uses outside the narrowly disclosed purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The tool automatically creates and reads a local file intended to hold the Tushare API credential, but gives no user-facing warning about secret storage, file location, or permissions. Plaintext secret handling in an AI-triggerable skill increases the risk of accidental disclosure, weak file protection, and uninformed credential persistence.

Content

No source excerpt is available for this finding.

Unbounded Resource Access

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.

Content

Scanner excerpt · scripts/UpdateStock_skill.py (reported line 1624)May include surrounding context.

python
str: 包含服务状态、PID(若新启动)和连接地址的提示信息。
    """
    # 1. 检查端口是否已占用(服务已在运行)
    if _is_port_open("127.0.0.1", 8686, timeout=0.5):
        return (f"QuantAll 服务已在运行,可直接连接 http://127.0.0.1:8686/mcp 。\n"
                "如需重启,请先终止已有进程。")

Unbounded Resource Access

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.

Content

Scanner excerpt · scripts/UpdateStock_skill.py (reported line 1680)May include surrounding context.

python
str: 包含服务状态、PID(若新启动)和连接地址的提示信息。
    """
    # 1. 检查端口是否已占用(服务已在运行)
    if _is_port_open("127.0.0.1", 8686, timeout=0.5):
        return (f"QuantAll 服务已在运行,可直接连接 http://127.0.0.1:8686/mcp 。\n"
                "如需重启,请先终止已有进程。")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code both writes a launcher script and starts a detached background subprocess, while suppressing I/O and not presenting an execution-time warning. In a local AI skill, that combination is dangerous because it can establish a persistent or semi-persistent service footprint with limited transparency to the user.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
93% confidence
Finding

This subprocess launch starts a background local service using a script in the skill directory, with no interactive consent check at execution time. In the context of an AI-triggerable skill, spawning a persistent process on the user's machine materially expands the trust boundary and can be abused to run unintended local code or maintain an unexpected listening service.

Content

Scanner excerpt · scripts/UpdateStock_skill.py (reported line 1656)May include surrounding context.

python
try:
        # 启动子进程(忽略 I/O)
        if sys.platform == "win32":
            process = subprocess.Popen(
                [python_exe, str(target_script)],
                cwd=str(current_dir),
                creationflags=subprocess.CREATE_NEW_PROCESS_GROUP,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
93% confidence
Finding

The non-Windows branch also launches a detached subprocess with stdio suppressed, making execution hard for the user to observe or audit. Hidden background execution is risky in a skill because it can start services or long-running tasks without the user realizing what changed on their machine.

Content

Scanner excerpt · scripts/UpdateStock_skill.py (reported line 1665)May include surrounding context.

python
stdin=subprocess.DEVNULL
            )
        else:
            process = subprocess.Popen(
                [python_exe, str(target_script)],
                cwd=str(current_dir),
                stdout=subprocess.DEVNULL,

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language content of the prompt file is written entirely in Chinese and instructs agent behavior in Chinese throughout, with no indication that the user may choose another language or locale. This is a locale/language policy issue because the skill implicitly enforces a specific language rather than offering an opt-in or alternative.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The run_task_file feature allows the agent to read a local JSON file and dispatch whichever QuantAll tool name and parameters the file specifies. This creates an indirect local-file-to-tool-execution bridge that can bypass normal conversational scrutiny, letting malicious or unexpected local content drive sensitive operations such as analysis actions or other higher-risk tools.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill description, trigger phrases, configuration names, and instructions are written entirely in Chinese and include Chinese-only labels such as 全A解析, with no note that another language can be used. That can amount to a locale/language policy issue because the skill does not document user choice or justify the restriction as a region-specific tool.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The top-level natural-language description is entirely in Chinese and does not offer an alternative language or indicate that language is optional. This can amount to a language-policy issue because it implicitly forces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The code auto-writes a local configuration file when one is absent, without an execution-time notice. Silent config creation is a smaller issue than code execution, but it still modifies the user's environment unexpectedly and can steer later operations such as database path selection.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The documentation says the tool checks the port and launches QuantAll, but the implementation also writes a new startup script to disk if missing. Undisclosed side effects reduce user awareness and can create executable artifacts that later get invoked, which is especially sensitive in an agent-run local skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This file maps all field names to Chinese natural-language labels, which imposes a specific language/locale across the dataset. Because there is no indication that the skill is China-specific or that users can opt into this locale, it may violate the language-choice policy.

Content

No source excerpt is available for this finding.