Back to skill

Security audit

Zeyang Strategy Lab Free

Security checks for vulnerabilities and agentic risk

Overview

This is a local research backtesting skill that reads user-provided CSV files and writes local result artifacts, with no evidence of credential access, networking, persistence, or live trading.

Install in an isolated virtual environment and consider pinning Pillow before use. Provide only the local CSV files you intend to analyze, review the generated runs directory before sharing results, and treat all outputs as historical research rather than investment advice.

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
README.md:87
Finding
Unpinned Third-Party Dependency Installation## Vulnerability Details **File Location**: `README.md`, lines 87-93 **Vulnerability Type**: Unpinned package installation from an external package index **Risk Level**: Medium **Vulnerable Code Snippet**: ```text ## Install Use Python 3.10 or later. The basic PNG charts require Pillow: ```text python -m pip install Pillow ``` ``` ### Technical Analysis The documented installation command requests Pillow without specifying an exact version or verifying package hashes. Although `THIRD-PARTY-NOTICES.md` identifies Pillow 12.3.0 as the version detected in the acceptance environment, the installation command does not enforce that version. Package resolution therefore depends on the current state of the configured Python package index. A future, compromised, or incompatible Pillow release could be installed without review. Installation may execute package build or installation logic with the privileges of the user running `pip`. This is a software supply-chain weakness rather than evidence that the currently referenced Pillow package is malicious. ### Attack Path 1. An attacker compromises a future Pillow distribution, a configured package index, or the dependency delivery path. 2. A user follows the documented command: `python -m pip install Pillow`. 3. `pip` resolves and downloads the currently available package instead of a specifically audited artifact. 4. Malicious package installation or build logic executes under the installing user's account. 5. The malicious dependency can access resources available to that account when installed or imported. ### Impact Assessment Successful exploitation could execute arbitrary code with the privileges of the user installing or running the dependency. Potential scope includes files, environment variables, credentials, and network resources accessible to that user. No privilege escalation beyond the invoking user's permissions is established by the reviewed pro ...[truncated 102 chars]
Remediation
## Remediation Suggestions 1. Pin Pillow to a reviewed exact version, such as `Pillow==12.3.0`, after confirming that version is appropriate and supported. 2. Place dependencies in a version-controlled requirements or lock file. 3. Record cryptographic hashes and install with hash enforcement, for example: ```text python -m pip install --require-hashes -r requirements.txt ``` 4. Generate and review hashes from a trusted package index for every supported platform and Python version. 5. Document the trusted package source and avoid unreviewed mirrors. 6. Use an isolated virtual environment and avoid installing dependencies with administrator or root privileges. 7. Add automated dependency vulnerability and integrity checks to the release process.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (27)

Credential Access

High
Category
Privilege Escalation
Content
data/
*.docx
*.pdf
.env
.venv/
venv/
__pycache__/
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
代码总体仍属于本地单资产历史研究/回测工具,这一点与声明的大方向相符,也没有发现实盘交易、联网、越权访问等额外高风险能力。但声明中的若干核心能力与实际行为存在明显不一致。首先,描述称支持 EMA、SMA 或 RSI 的多空规则,而代码并未计算任何技术指标,也没有基于这些指标生成仓位信号;它要求 CSV 中已有 signal 列,并将其作为外部未验证信号使用。其次,代码多处明确限制 signal 必须在 [0,1],并写明“V1 仅支持 long/cash,不支持做空”,因此与“支持做多/空仓规则”不符。再次,描述称会生成 JSON、CSV、Markdown 和图表文件,但当前代码只会打印/写出 JSON 结果,并不生成 CSV、Markdown 或图表。故应判定为描述与实际代码行为存在实质性不匹配。

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
声明描述的是一个完整的本地历史研究与策略验证工具,并明确会输出多种研究产物。但提供的代码块只包含“strategy contract core”层面的能力:验证 contract 字段、限制仅支持 EMA/SMA/RSI 与 long_cash、从文本理解简单规则、构建摘要与展示字段、计算哈希、加载 JSON 合约。代码中没有任何历史行情读取、回测撮合、绩效计算、文件导出 CSV/Markdown、图表生成等逻辑。因此代码的实际主用途比声明更窄且不同,属于描述与行为不符。另一方面,代码没有发现明显越权资源访问或实盘交易能力。

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
声明的核心功能是历史研究与策略验证/回测,而代码的核心功能是数据质量校验。这不是简单的实现细节差异,而是主要用途不同。代码没有计算任何技术指标(EMA/SMA/RSI),没有生成研究报告图表,也没有进行策略收益或仓位验证。相反,它验证输入 CSV 的结构与数值质量,并输出 JSON 结果。此外,代码对 signal 明确限制为 [0,1] 且报错说明“不支持做空”,与声明中的多/空仓规则不符。因此描述不能准确代表该代码行为,属于明显不匹配。

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The manifest states the skill supports 'long/cash rules' in English but also says in Chinese it supports '做多/空仓规则'; however the broader manifest explicitly mentions EMA, SMA, or RSI strategy validation and the code here enforces that any provided signal must be between 0 and 1 and explicitly rejects negative values as unsupported. This means the implementation only validates long/cash target signals and does not support short positions, contradicting the claimed strategy capability.

Intent-Code Divergence

High
Confidence
96% confidence
Finding
The code's own inline user-facing message says 'V1 only supports long/cash' and 'does not support short', which directly conflicts with the skill documentation claiming support for long/short rule research and validation. This is an active intent contradiction, not merely omitted detail.

Env Variable Harvesting

High
Category
Data Exfiltration
Content
def invoke(strategy: str, input_path: Path, output_root: Path, cwd: Path, *extra: str) -> tuple[int, dict]:
    env = dict(os.environ)
    env.pop("PYTHONPATH", None)
    env.update({"PYTHONUTF8": "1", "PYTHONIOENCODING": "utf-8", "PYTHONDONTWRITEBYTECODE": "1"})
    completed = subprocess.run(
Confidence
60% confidence
Finding
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Env Variable Harvesting

High
Category
Data Exfiltration
Content
capture_output=True,
        text=True,
        encoding="utf-8",
        env={**os.environ, "PYTHONIOENCODING": "utf-8"},
    )
    try:
        payload = json.loads(completed.stdout)
Confidence
60% confidence
Finding
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill declares behavior that implies filesystem, environment, and shell access but does not explicitly scope or constrain those capabilities. In an agent environment, missing tool/permission declarations can lead to over-broad runtime access, making prompt-injection or operator mistakes more likely to trigger unintended local file access or command execution.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The file presents all user-facing instructional content in Chinese and does not indicate that users may choose another language or that the skill is intended only for a Chinese-language audience. Under the stated policy, forcing a specific language without opt-in is a natural-language policy violation.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
This Python file contains natural-language user-facing error text in Chinese, and similar Chinese-only strings appear throughout the CLI help and runtime messages. The policy scope for SQP-3 applies to all file types, and there is no indication that the tool offers language selection or that a Chinese-only locale is required for a region-specific purpose.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The manifest describes a strategy research skill supporting EMA, SMA, or RSI rules, which implies the skill can generate or evaluate those rule-based signals. In this file, the CLI requires a CSV containing a signal column and merely records optional signal provenance text, while the engine explicitly states it cannot verify how the external signal was produced.

Natural-Language Policy Violations

Medium
Confidence
98% confidence
Finding
This code generates the markdown summary entirely in Chinese, including headings and explanatory text, regardless of user preference. The policy requires avoiding a forced language/locale unless the skill offers a choice or clearly documents a justified regional constraint, which is not present here.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
Argument help strings, failure hints, progress updates, and completion messages are all presented in Chinese. Because the file does not provide any language selection or document a justified locale limitation, it enforces a specific language in violation of the language/locale policy.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
This Python file contains multiple user-facing messages in Chinese, such as the error raised for unsupported indicators, with no visible option for the user to choose language or locale. That creates a natural-language policy concern because the skill effectively enforces a specific language rather than offering opt-in or documenting a justified region-specific constraint.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
This code emits user-facing error text in Chinese (for example, the timezone parsing error), and similar hard-coded Chinese strings appear throughout validation and CLI output paths. For a general-purpose validation script, forcing one language without opt-in or documented locale scope is a natural-language policy concern.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
env = dict(os.environ)
    env.pop("PYTHONPATH", None)
    env.update({"PYTHONUTF8": "1", "PYTHONIOENCODING": "utf-8", "PYTHONDONTWRITEBYTECODE": "1"})
    completed = subprocess.run(
        [sys.executable, str(ENTRYPOINT), "--strategy", strategy, "--input", str(input_path), "--output-root", str(output_root), *extra],
        cwd=cwd,
        capture_output=True,
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
This Python file includes natural-language error text in Chinese ("Free 入口输出不是 JSON") and multiple assertion messages in Chinese, which imposes a specific language in user-visible outputs. Under the policy, locale or language constraints should either be optional for the user or clearly justified as region-specific.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
def invoke(script: Path, *args: str) -> tuple[int, dict]:
    completed = subprocess.run(
        [sys.executable, str(script), *args],
        cwd=ROOT,
        capture_output=True,
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Scope Creep

Low
Category
Excessive Agency
Content
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
Confidence
70% confidence
Finding
Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Scope Creep

Low
Category
Excessive Agency
Content
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
Confidence
70% confidence
Finding
Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Natural-Language Policy Violations

Low
Confidence
87% confidence
Finding
The file includes duplicated Chinese and English descriptions, but it does not state that users may choose their preferred language or that the skill is intentionally limited to these locales. Under the policy, forcing or implicitly constraining language without opt-in can be a natural-language policy issue.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The function signature hard-codes Chinese default labels ("策略" and "买入持有") for generated charts. This creates a language-specific default in a general-purpose utility file without user opt-in or justification that the skill is region-specific.

Natural-Language Policy Violations

Low
Confidence
96% confidence
Finding
This Python file contains a natural-language error string in Chinese (`Free Core 不支持指标:{kind}`) with no indication that the skill is intentionally region-specific or that users can choose their preferred language. That creates a locale policy concern because the skill may present mandatory user-facing output in a fixed language without opt-in.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The raised `ValueError` uses the Chinese message `不支持比较运算符:{operator}`, which is user-visible natural language in a fixed locale. The file does not offer language selection or document a justified locale restriction, so this appears to violate the language/locale policy criteria.

Static analysis

No suspicious patterns detected.