Back to skill

Security audit

stock-factor

Security checks for vulnerabilities and agentic risk

Overview

This stock-factor skill is a coherent quantitative research helper, but users should install its external QuantAll dependency carefully.

Install QuantAll only from a source and version you trust, preferably in a dedicated virtual environment under a non-admin account. Review the localhost MCP connector before enabling it, point DB_setting.json only at the intended market database, and avoid broad process-kill actions unless you know which Python process belongs to QuantAll.

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
SKILL.md:100
Finding
Unpinned Third-Party Package Is Installed and Executed Without Integrity Verification## Vulnerability Details **File Location**: `SKILL.md`, lines 100-103; execution entry point in `scripts/Start_QuantAll.py`, lines 1-3 **Vulnerability Type**: Supply-chain exposure through an unpinned dependency and package mirror **Risk Level**: Medium ### Vulnerable Code From `SKILL.md`: ```text □ 2. pip installation: <skill-dir>/scripts/.venv/Scripts/python.exe -m pip install quantall -i https://pypi.tuna.tsinghua.edu.cn/simple □ 3. Create Start_QuantAll.py in the scripts directory: import os from QuantAll import Start_main Start_main(os.path.dirname(__file__)) ``` Corresponding code in `scripts/Start_QuantAll.py`: ```python import os from QuantAll import Start_main Start_main(os.path.dirname(__file__)) ``` ### Technical Analysis The installation command retrieves the latest package matching the name `quantall` from a third-party package mirror. It does not specify an exact version, validate package hashes, use a reviewed lockfile, or otherwise authenticate the expected artifact. The installed package is then imported and its `Start_main` entry point is invoked. Python packages can execute code during installation, module import, and function invocation. Consequently, the effective executable code is mutable after this Skill has been audited. QuantAll is a declared functional dependency, so installing it is not inherently unauthorized. The vulnerability is the absence of supply-chain controls around installation and execution. The Skill itself does not contain evidence that the package or mirror is currently malicious. ### Attack Path 1. An attacker compromises the `quantall` package release, one of its transitive dependencies, the configured mirror, or the relevant publisher account. 2. The attacker publishes or serves a malicious package version under the expected package name. 3. A user follows the documented unpinned `pip install quantall` command. 4. Pip selects the att ...[truncated 1135 chars]
Remediation
## Remediation Suggestions 1. Pin QuantAll to a specifically reviewed version: ```text python -m pip install "quantall==<approved-version>" ``` 2. Generate and distribute a requirements or lock file containing hashes: ```text quantall==<approved-version> \ --hash=sha256:<verified-package-hash> ``` Install it with: ```text python -m pip install --require-hashes -r requirements.txt ``` 3. Pin and hash all transitive dependencies, not only the top-level package. 4. Document the authoritative publisher, package index, expected version, and checksum. Use the authoritative index unless a mirror is operationally necessary. 5. If a mirror is required, use a trusted synchronized mirror and verify downloaded artifacts against independently published hashes or signatures. 6. Run the engine inside a dedicated virtual environment under a non-administrative account with access restricted to the required scripts, output directory, and market database. 7. Review release changes before updating the pinned version, and perform dependency scanning or software-composition analysis as part of the update process. 8. Avoid silently upgrading the dependency. Treat each version change as a separately reviewed deployment.
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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (40)

Ae1

High
Category
analysis-evasion
Content
| Qlib Alpha158 | 158 | ✅ 已转写+已跑 | `facotr-Qlib_alpha158.xlsx` | `facotr-Qlib_alpha158.json` | `Alpha158_因子参考.md` |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| Qlib Alpha158 | 158 | ✅ 已转写+已跑 | `facotr-Qlib_alpha158.xlsx` | `facotr-Qlib_alpha158.json` | `Alpha158_因子参考.md` |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| Qlib Alpha360 | 360 | ✅ 已转写+已跑 | `facotr-Qlib_alpha360.xlsx` | `factor-Qlib-Alpha360.json` | `Alpha360_因子参考.md` |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| Qlib Alpha360 | 360 | ✅ 已转写+已跑 | `facotr-Qlib_alpha360.xlsx` | `factor-Qlib-Alpha360.json` | `Alpha360_因子参考.md` |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| 国泰君安 GTJA Alpha191 | 191 | ✅ 已转写+已跑(全 191 验证) | `factor-GTJA_Alpha191.xlsx` | `GTJA_Alpha191.json` | `国泰君安Alpha191.txt` / `GTJA_Alpha191-30.txt` |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| 国泰君安 GTJA Alpha191 | 191 | ✅ 已转写+已跑(全 191 验证) | `factor-GTJA_Alpha191.xlsx` | `GTJA_Alpha191.json` | `国泰君安Alpha191.txt` / `GTJA_Alpha191-30.txt` |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
ipts/task/factor-Alpha101.json`,含 `scale`/`indneutralize`/`Ts_ArgMax` 等全部算子) | `factor-Alpha101.xlsx`(待跑) | `factor-Alpha101.json` | `Alpha101.txt` |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
ipts/task/factor-Alpha101.json`,含 `scale`/`indneutralize`/`Ts_ArgMax` 等全部算子) | `factor-Alpha101.xlsx`(待跑) | `factor-Alpha101.json` | `Alpha101.txt` |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| stock_daily 基础因子 | 12 | ✅ 已转写+已跑 | `factor-stock_daily.xlsx` | `factor-stock_daily.json` | (估值/市值/换手/量比等) |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| stock_daily 基础因子 | 12 | ✅ 已转写+已跑 | `factor-stock_daily.xlsx` | `factor-stock_daily.json` | (估值/市值/换手/量比等) |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| stock_report 财务因子 | 多 | ✅ 已转写+已跑 | `factor-stock_report.xlsx` | `factor-stock_report.json` | `db_translate.json` 字段 |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| stock_report 财务因子 | 多 | ✅ 已转写+已跑 | `factor-stock_report.xlsx` | `factor-stock_report.json` | `db_translate.json` 字段 |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| TA-Lib 技术指标 + 常用指标(KDJ/BIAS) | 84 | ✅ 已转写+真实引擎验证(0 异常);v1.2.0 已优化命名 | `factor-Indicators.xlsx` | `task/factor-TA_Indicators.json` | `TA-Lib指标参考.md` / `TA_Indi
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| TA-Lib 技术指标 + 常用指标(KDJ/BIAS) | 84 | ✅ 已转写+真实引擎验证(0 异常);v1.2.0 已优化命名 | `factor-Indicators.xlsx` | `task/factor-TA_Indicators.json` | `TA-Lib指标参考.md` / `TA_Indi
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| Barra CNE5 风格因子 | 10 | ✅ 已转写+已跑(0 异常) | `factor-BarraCNE5.xlsx` | `task/factor-BarraCNE5.json` | 华安/中银证券《CNE5 十大风格因子》研报(MSCI Barra CNE5 风险模型) |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| Piotroski F-Score | 10 | ✅ 已转写+已跑(0 异常) | `factor-Piotroski.xlsx` | `task/factor-Piotroski.json` | Piotroski(2000) 9 条二元会计标准(质量改善选股) |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| Altman Z-Score | 6 | ✅ 已转写+已跑(0 异常),**已入库** `task/` | `factor-AltmanZ.xlsx` | `task/factor-AltmanZ.json` | Altman(1968) 5 变量破产预警(困境质量因子) |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**已入库** `task/`;含 4 个强有效反转/波动因子(INTRADAY/MAX20/REVERSAL_M1/IDIOVOL |IR|>0.3) | `factor-ClassicAnomalies.xlsx` | `task/factor-ClassicAnomalies.json` | Sloan 应计 /
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| Fama-French / HXZ 风格 | 7 | ✅ 手写转写+已跑(7/7 通过,0 异常),**已入库** `task/` | `factor-FF_HXZ.xlsx` | `task/factor-FF_HXZ.json` | FF3/FF5(1993/2015)+HXZ q-factor(2015):S
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| 中信/申万 风格因子 | 12 | ✅ 手写转写+已跑(12/12 通过,0 异常),**已入库** `task/` | `factor-CITIC_Shenwan.xlsx` | `task/factor-CITIC_Shenwan.json` | 中信 7 大类 + 申万 10 大类(规模/估值/成长/动量/反
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
写转写+已跑(10/10 通过,0 异常),**已入库** `task/`(基础 101 已入 `task/`,本批为扩展样本,非官方 201/212) | `factor-WorldQuant_formulaic.xlsx` | `task/factor-WorldQuant_formulaic.json` | Wo
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| 收益高阶矩 / 52 周高异象 | 7 | ✅ 手写转写+已跑(7/7 通过,0 异常),**已入库** `task/` | `factor-ReturnMoment.xlsx` | `task/factor-ReturnMoment.json` | 52周高价距离/β/β²/下行半离差/收益偏度/峰度/特质偏度(
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| 违约距离 / 现金流收益率 | 5 | ✅ 手写转写+已跑(5/5 通过,0 异常),**已入库** `task/` | `factor-Merton_CashFlow.xlsx` | `task/factor-Merton_CashFlow.json` | Merton(1974) 违约距离/经营现金流收益率/企
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
本技能所有因子计算都依赖 QuantAll 引擎(本地 HTTP 服务 `localhost:8686`)。下面是给 AI 和用户速查的最小化安装/使用要点;完整细节见 `quantall-mcp` 技能的 `SKILL.md`。
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

MCP Config Access

High
Category
Agent Snooping
Content
1. 启动 QuantAll(bat 或 `python Start_QuantAll.py`)。
2. **首次弹用户协议窗口,需用户确认**;确认后即永久激活,后续不再弹窗。
3. AI 通过 MCP 连接 `http://127.0.0.1:8686/mcp`(`~/.workbuddy/mcp.json` 中 `"全A解析": {"url": "http://127.0.0.1:8686/mcp", "disabled": false}`)。
4. 部分智能体首次需用户在「连接器-自定义连接器」确认许可;且**建议先启动 QuantAll 再启动智能体**,否则需在智能体内「重新连接」。
5. 用 `ping` 工具测试连接是否成功(注意:`ping` 通 ≠ 分析工具可用,必须确认协议窗口已确认)。
Confidence
91% confidence
Finding
The skill explicitly instructs the agent/user to configure and use an MCP endpoint via `~/.workbuddy/mcp.json`, which touches local connector configuration and could normalize access to sensitive local config data. Even though the endpoint is localhost, exposing or modifying MCP configuration is dangerous because it can expand the agent's reachable tool surface and create opportunities for unauthorized connector changes or leakage of local environment details.

Static analysis

No suspicious patterns detected.