Back to skill

Security audit

因子投资

Security checks for vulnerabilities and agentic risk

Overview

This skill is not executable malware, but it embeds a real-looking portfolio holding that could be reused or exposed as if it belonged to the installer.

Review this skill before installing if you do not want a preconfigured stock holding to influence analysis or appear in generated reports. The safer version would remove the specific holding or clearly mark it as fictional sample data and only use portfolio details explicitly provided by the user.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:153
Finding

Hardcoded Sensitive Portfolio Information in Reusable Skill Context

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:153-157; duplicated in prompts/default.md:217-221 and referenced in prompts/default.md:265-270
Vulnerability Type: Plaintext sensitive financial data embedded in reusable skill instructions
Risk Level: Medium

Evidence

SKILL.md:153-157:

markdown
## 八、已知持仓信息

| 股票代码 | 名称 | 成本价 | 仓位 | 评分 |
|----------|------|--------|------|------|
| 600905 | 三峡能源 | 4.57元 | 80% | 8.5分 |

prompts/default.md:217-221:

markdown
## 九、已知持仓信息

| 股票代码 | 名称 | 成本价 | 仓位 | 评分 |
|----------|------|--------|------|------|
| 600905 | 三峡能源 | 4.57元 | 80% | 8.5分 |

prompts/default.md:265-270:

markdown
### 示例2:持仓复盘

用户:三峡能源600905,成本4.57元,仓位80%,请复盘 Agent:执行持仓复盘:

  1. 获取最新行情数据
  2. 计算各项量化指标
  3. 给出买卖点建议
  4. 输出操作指示
text

The source excerpts above are reproduced verbatim as audit evidence.

Technical Analysis

The reusable skill definition and its default prompt hardcode a specific security identifier, company name, acquisition cost, portfolio allocation, and investment score. These values constitute potentially sensitive financial-position information and are unnecessary for implementing a generic factor-investment workflow.

Because both files are loaded as reusable agent context, the embedded position can be treated as current user data rather than as a hypothetical example. The prompt reinforces that interpretation by labeling it as a known holding and separately using the same values in a portfolio-review example. Consequently, ordinary requests for portfolio analysis, report generation, or stock recommendations may cause the agent to reproduce, analyze, or attribute this position without the affected user's explicit submission or consent.

This is an insecure data-handling practice rather than evidence of malicious execution. The audited project contains no demonstrated outbound endpoint, credential, executable script, or automat ...[truncated 1382 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the specific holding, cost basis, allocation, and score from both SKILL.md and prompts/default.md.
  2. Collect portfolio information only at runtime after an explicit user request.
  3. Keep submitted portfolio data scoped to the active session unless the user expressly authorizes persistent storage.
  4. Replace examples with unmistakably fictional placeholders such as STOCK_CODE, EXAMPLE_COST, and EXAMPLE_ALLOCATION.
  5. Clearly label all sample data as fictional and prohibit the agent from treating examples as current user holdings.
  6. Require user confirmation before including portfolio details in exported files, shared reports, or messaging integrations.
  7. Apply data minimization to generated reports and omit cost basis or allocation where those fields are not required.
  8. Add regression tests verifying that a portfolio-review request without user-supplied holdings does not produce any preconfigured position.
  9. Review version history and previously generated artifacts for copies of the embedded data and remove them according to the project's data-retention policy.
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 (2)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s user-facing description and instructions are entirely in Chinese, and there is no indication that users can choose another language or that the skill is intentionally limited to Chinese-speaking users. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file's natural-language instructions, examples, and reporting formats are all presented exclusively in Chinese, and there is no indication that users may opt into another language. Under the policy, forcing a specific language without user choice is a locale/language policy issue unless it is explicitly justified as region-specific.

Content

No source excerpt is available for this finding.