T09 · Insecure Skill Coding Practices
- 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 inprompts/default.md:217-221and referenced inprompts/default.md:265-270
Vulnerability Type: Plaintext sensitive financial data embedded in reusable skill instructions
Risk Level: MediumEvidence
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:执行持仓复盘:
- 获取最新行情数据
- 计算各项量化指标
- 给出买卖点建议
- 输出操作指示
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
- Remove the specific holding, cost basis, allocation, and score from both
SKILL.mdandprompts/default.md. - Collect portfolio information only at runtime after an explicit user request.
- Keep submitted portfolio data scoped to the active session unless the user expressly authorizes persistent storage.
- Replace examples with unmistakably fictional placeholders such as
STOCK_CODE,EXAMPLE_COST, andEXAMPLE_ALLOCATION. - Clearly label all sample data as fictional and prohibit the agent from treating examples as current user holdings.
- Require user confirmation before including portfolio details in exported files, shared reports, or messaging integrations.
- Apply data minimization to generated reports and omit cost basis or allocation where those fields are not required.
- Add regression tests verifying that a portfolio-review request without user-supplied holdings does not produce any preconfigured position.
- Review version history and previously generated artifacts for copies of the embedded data and remove them according to the project's data-retention policy.
- Remove the specific holding, cost basis, allocation, and score from both
