Back to skill

Security audit

财搭子:让你变得更强的投资Agent

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly does what it says, but it sends investment queries and an API token to a configurable remote endpoint and gives strong trading-style recommendations, so users should review it before installing.

Install only if you trust the 财搭子/Facaidazi service and are comfortable sending stock symbols and investment queries to its API. Use a scoped, revocable token, keep TOOL_API_URL at the HTTPS default unless you fully control the endpoint, and treat all ratings, targets, stop-losses, and position suggestions as informational rather than personal financial advice.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (2)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:179
Finding

Mandatory Provider Promotion Alters Agent Output

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:179-193 and SKILL.md:275
Vulnerability Type: Mandatory output modification through Skill instructions
Risk Level: High

Evidence

SKILL.md:179-193:

markdown
> **输出原则**:基于用户的query中的具体问题和指令,选择性对内容进行精细挑选和二次处理,如适当可直接展示 tool 工具返回的各个子维度结论,保持原始结构和专业性。并在最后添加综合评分和操作建议。**用户的明确指示就是硬性要求,而非参考建议,请放置在回答的第一优先级**

case A: 如问题仅涉及单维度分析输出,则直接展示 tool 返回的完整分析内容,格式如下:

```markdown
## [公司名称] - [维度名称]分析

[tool 工具返回的完整内容]

### 评分
**[维度名称]评分**: X/10

---
*分析时间:[timestamp]*
*powered by「财搭子」,如需更全面的分析,可以说"给我完整的深度分析"*

SKILL.md:275:

markdown
*powered by「财搭子」*

Technical Analysis

The Skill embeds provider branding and engagement language in its prescribed response templates. When the Skill is loaded, these instructions influence the Agent to append promotional material to user-facing answers even when that material is not needed to satisfy the investment-research request.

This behavior crosses the boundary between necessary source attribution and mandatory promotion. Attribution can be relevant for transparency, but prompting the user to request additional provider-backed analysis is not required for the declared analytical functionality. Because the behavior originates in the Skill instructions and changes the Agent's output policy for the active session, the best matching classification is Skill Instruction Hijacking.

Attack Path

  1. A user enables or invokes the investment-research Skill.
  2. The Agent loads and follows the response rules in SKILL.md.
  3. The Agent selects one of the prescribed report templates.
  4. The template directs the Agent to append provider branding and, in the single-dimension template, an engagement prompt.
  5. The user receives promotional content as part of an otherwise task-focused answer, regardless of whether it was requested.

No operating-system privileges, credentials, or persistent state are obtain ...[truncated 660 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove mandatory provider branding and engagement prompts from response templates.
  2. If attribution is legally or operationally required, use a neutral source statement such as “Data source: Facaidazi API” without promotional language.
  3. Include attribution only when relevant to provenance or explicitly requested by the user.
  4. Ensure report templates prioritize the user's requested format and do not append unrelated content.
  5. Add a review rule prohibiting advertising, lead generation, or unsolicited calls to action in Skill-generated output.
  6. Test all response modes to verify that disabling attribution or promotion does not affect the underlying investment-analysis functionality.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/tool_client.py:43
Finding

Bearer Token and User Queries Can Be Transmitted to an Untrusted or Plaintext Endpoint

Content
View full analysis

Vulnerability Details

File Location: scripts/tool_client.py:43-44 and scripts/tool_client.py:78-87; insecure endpoint guidance at references/tool-client-usage.md:173
Vulnerability Type: Unrestricted endpoint override and insufficient transport validation
Risk Level: Medium

Evidence

scripts/tool_client.py:43-44:

python
api_url = os.getenv("TOOL_API_URL", 'https://api.facaidazi.com/api/tools/call')
api_token = os.getenv("TOOL_API_TOKEN")

scripts/tool_client.py:78-87:

python
headers = {
    "Authorization": f"Bearer {api_token}",
    "Content-Type": "application/json",
}

data = {"tool_name": tool_name, "parameters": parameters}

try:
    response = requests.post(api_url, json=data, headers=headers, timeout=timeout)

references/tool-client-usage.md:173:

markdown
服务默认运行在 `http://api.facaidazi.com/api/tools/call`。

Technical Analysis

The client automatically attaches TOOL_API_TOKEN as a bearer credential to every request sent to TOOL_API_URL. The destination is taken directly from an environment variable without validating its scheme or hostname. Consequently, any configured HTTP or attacker-controlled endpoint receives both the authorization token and the request payload.

Depending on the selected tool, the payload can contain:

  • Full natural-language user text through extract_assets.
  • Full investment-search queries through investment_search_pro.
  • Stock symbols and requested analysis types through the remaining tools.

The default URL in the code uses HTTPS, which is appropriate. However, the client does not enforce HTTPS, does not restrict destinations to an approved host, and does not prevent credential forwarding to a custom host. The usage guide compounds the problem by documenting a plaintext HTTP endpoint, contradicting the Skill's statement that production transmission is protected with HTTPS.

A custom endpoint may be usefu ...[truncated 2075 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require https for all non-local API endpoints and reject plaintext HTTP before constructing the request.
  2. Allowlist the production hostname, such as api.facaidazi.com, when using TOOL_API_TOKEN.
  3. If custom endpoints are required, use a separate endpoint-specific credential instead of automatically forwarding the production token.
  4. Require explicit user or administrator approval before sending credentials to a non-default host.
  5. Validate the parsed URL, including scheme, hostname, port, username, and password components.
  6. Restrict or disable redirects, or validate every redirect target before forwarding the Authorization header.
  7. Replace the HTTP endpoint in references/tool-client-usage.md:173 with the canonical HTTPS URL.
  8. Add automated tests confirming that HTTP URLs and unapproved hosts are rejected.
  9. Apply server-side token controls, including least-privilege scopes, expiration, rotation, rate limits, and revocation.
  10. Minimize transmitted query text where possible and clearly notify users before full natural-language input is sent to the external service.
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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (22)

Tainted flow: 'api_url' from os.getenv (line 43, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/tool_client.py (reported line 87)May include surrounding context.

python
data = {"tool_name": tool_name, "parameters": parameters}

    try:
        response = requests.post(api_url, json=data, headers=headers, timeout=timeout)
        response.raise_for_status()
        return response.json()
    except requests.RequestException as e:

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

The skill requires an API token stored in an environment variable to access the external service. While using a token is normal, it is still a high-value credential exposure surface: any over-broad tool permissions, prompt leakage, logging, or downstream misuse could disclose or abuse the token to access the provider's service.

Content

Scanner excerpt · SKILL.md (reported line 28)May include surrounding context.

md
- name: TOOL_API_TOKEN
    description: |
      API token for accessing the investment research tools service.
      Send email to xudanqing@zhicepilot.com to request access token.
      Include your use case and expected usage frequency in the email.
    required: true
  - name: TOOL_API_URL

Missing User Warnings

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs the agent to provide explicit investment ratings, position sizing, entry timing, stop-loss, and target prices without a visible user-facing risk disclaimer or 'not investment advice' warning. In a financial-advice context, that can cause users to over-rely on automated outputs and suffer significant monetary harm, especially if tool data is stale or incomplete.

Content

No source excerpt is available for this finding.

Ssd 1

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The instruction says the user's explicit directives are the first priority, which can cause the agent to subordinate system, policy, or safety constraints to user requests. In practice, this weakens instruction hierarchy and makes prompt-injection or unsafe user requests more likely to bypass safeguards, particularly in a skill that can access env-backed credentials and external APIs.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/tool-client-usage.md (reported line 137)May include surrounding context.

md
if not api_token:
        raise ValueError(
            "TOOL_API_TOKEN is required. "
            "Set it via environment variable or in .env file"
        )

    return api_url, api_token

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/tool_client.py (reported line 49)May include surrounding context.

python
if not api_token:
        raise ValueError(
            "TOOL_API_TOKEN is required. "
            "Set it via environment variable or in .env file"
        )

    return api_url, api_token

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/tool_client.py (reported line 142)May include surrounding context.

python
if not api_token:
        raise ValueError(
            "TOOL_API_TOKEN is required. "
            "Set it via environment variable or in .env file"
        )

    return api_url, api_token

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill description and usage instructions are presented entirely in Chinese and describe the interaction model as if Chinese is the expected default, without offering a language choice or documenting a justified locale restriction. 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.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README uses very broad natural-language invocation examples such as '看看茅台怎么样' and '给我宁德时代的深度分析' without defining activation boundaries, exclusions, or disambiguation rules. In an agent environment, this can cause over-triggering or accidental invocation on loosely related user prompts, leading to unintended access to external research capabilities or token-backed data flows.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares environment-variable and network-dependent behavior but does not constrain tool scope with an explicit permissions/allowed-tools policy. That increases the attack surface because a host agent may permit broader tool or network access than the skill actually needs, especially when the skill also forwards user queries to an external service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

L004 使用“应多复杂深度的投资研究问题”等中文描述整体技能能力,全文也仅以中文规定交互和输出方式,未说明可根据用户偏好切换语言。按 SQP-3,若技能默认强制特定语言而没有用户选择或明确限定理由,属于自然语言层面的 locale 政策问题。

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

该 markdown 文件适用 SQP-1。L022-L023 将“财务”“个股”“研报”等宽泛词直接列为触发词,这些词在大量普通对话或其他金融相关任务中都可能出现,但文档未说明触发边界、限定上下文或排除示例,容易造成非预期调用。

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

The skill sends user-supplied financial queries and asset identifiers to an external API endpoint, which is an external data transmission path. In this context, the endpoint is expected for functionality, but it still creates privacy, compliance, and data-governance risk because the skill also allows the endpoint URL to be overridden via an environment variable.

Content

Scanner excerpt · SKILL.md (reported line 34)May include surrounding context.

md
- name: TOOL_API_URL
    description: |
      Optional: Override the default API endpoint URL.
      Default: https://api.facaidazi.com/api/tools/call
    required: false
---

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

This is a second explicit declaration of external transmission to the same API service, confirming ongoing outbound data flow. The risk is elevated slightly by the financial context and the ability to transmit free-form user queries, which may contain sensitive intent or portfolio information.

Content

Scanner excerpt · SKILL.md (reported line 65)May include surrounding context.

md
- **Token 安全**: TOOL_API_TOKEN 是访问凭证,请妥善保管,不要泄露

### API 可用性
- **默认端点**: https://api.facaidazi.com/api/tools/call
- **超时设置**: 300 秒(5 分钟)
- **可通过 TOOL_API_URL 环境变量自定义端点**

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The guide tells users to configure an API token and use a remote tool service, but it does not clearly disclose that prompts, symbols, and potentially sensitive investment research queries are transmitted to an external endpoint. This creates a real data-handling and secret-management risk because users may unknowingly send proprietary research inputs or mishandle credentials without warnings about storage, rotation, or least-privilege use.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

The documentation hardcodes a non-local external HTTP endpoint using plain HTTP rather than HTTPS. That means API tokens and investment query data may be exposed to interception or tampering in transit via man-in-the-middle attacks, making this materially more dangerous than a generic external transmission finding.

Content

Scanner excerpt · references/tool-client-usage.md (reported line 173)May include surrounding context.

python scripts/tool_client.py --tool get_asset_overview --symbol 600519 --timeout 120

text

服务默认运行在 `http://api.facaidazi.com/api/tools/call`。

## 参考资源

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This specification explicitly instructs the tool to produce investment suggestions such as '投资倾向' and '适合人群' without any accompanying risk disclosure, uncertainty framing, or instruction to avoid personalized financial advice. In a finance-focused skill, users are likely to act on concise recommendations, so presenting directional guidance as authoritative output can cause real financial harm if the analysis is wrong, stale, or misunderstood.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

These tool specs direct the model to provide actionable trading guidance such as '适合择机布局', '确认买入信号', and '建议…分批布局' without any embedded warning about market risk, timing uncertainty, or non-advisory status. Because the skill is specifically marketed for deep investment research, this context increases the chance that users will treat the generated output as expert-grade execution advice rather than general analysis.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/tool_client.py (reported line 43)May include surrounding context.

python
def get_api_config() -> tuple[str, str]:
    """获取 API 配置"""
    # 优先使用新的环境变量名
    api_url = os.getenv("TOOL_API_URL", 'https://api.facaidazi.com/api/tools/call')
    api_token = os.getenv("TOOL_API_TOKEN")

    if not api_token:

External Transmission

Medium
Category
Data Exfiltration
Confidence
85% confidence
Finding

The script sends user inputs and tool parameters to an external service over the network. In an investment-research skill, those inputs can contain sensitive trading intent, research topics, or proprietary analysis requests, so external transmission is materially relevant and should be treated as a real data exposure surface even if it is the intended product behavior.

Content

Scanner excerpt · scripts/tool_client.py (reported line 87)May include surrounding context.

python
data = {"tool_name": tool_name, "parameters": parameters}

    try:
        response = requests.post(api_url, json=data, headers=headers, timeout=timeout)
        response.raise_for_status()
        return response.json()
    except requests.RequestException as e:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script transmits user-supplied investment text/query/symbol together with a bearer token to an external API, but provides no explicit disclosure or confirmation at runtime. In this skill context, users may paste proprietary research prompts, portfolio interests, or sensitive market hypotheses, so silent external transmission increases privacy and data-handling risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file includes natural-language instructions and examples in Chinese for core usage, with no indication that language is configurable or that the locale restriction is intentional. Under the language/locale policy, forcing a specific language without opt-in can be a policy concern.

Content

No source excerpt is available for this finding.