Back to skill

Security audit

AgentPit 财经综合分析

Security checks for vulnerabilities and agentic risk

Overview

This stock-analysis skill is purpose-aligned but should be reviewed carefully because it collects and stores a reusable billing key and documents unsafe shell-based API calls.

Install only if you are comfortable giving this skill an AgentPit consumerKey that can be used for billable API calls. Prefer a short-lived or low-balance key if available, confirm each paid call before it runs, and avoid analyzing untrusted or malformed ticker strings until the skill adds strict ticker validation and safer credential storage.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:87
Finding

Unvalidated Stock Symbol Can Enable Shell Command Injection

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:51
Finding

Consumer Key Is Collected Through Conversation and Stored in Plaintext

Content
View full analysis
~/.openclaw/secrets/agentpit.cpk chmod 600 ~/.openclaw/secrets/agentpit.cpk export AGENTPIT_CPK="$USER_CPK" ``` ### Technical Analysis The skill directs the user to paste a long-lived AgentPit consumer key into the conversation. It then stores that credential unencrypted at the predictable path `~/.openclaw/secrets/agentpit.cpk` and exports it into the process environment. File mode `600` is a useful access-control measure, but it does not protect against every relevant disclosure channel. The key may remain in conversation history, application telemetry, backups, crash reports, process environments, or diagnostic output. Privileged processes and any process compromised under the same user account may also read the file. Exporting the key increases the possibility that child processes inherit it. The instructions do not require redaction, secret-store integration, environment cleanup after use, or controls preventing the credential from appearing in logs. ### Attack Path 1. The user pastes the consumer key into the chat as instructed. 2. The credential becomes part of the conversation data and may be retained by systems that store or process chat history. 3. The skill writes the same credential to a predictable plaintext file and exports it into the process environment. 4. An attacker who gains access to the conversation records, the user's account, a process environment, a backup, or the local file can recover the key. 5. The attacker reuses the key in the `Authorization: Bearer` header when calling AgentPit endpoints. 6. Unauthorized calls may consume the victim's account balance or expose data available through the associated account. ### Impact Assessment Exposure allows un ...[truncated 581 chars]
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (12)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

L003 写明“当用户提到分析股票、买不买某股票、股票行情时触发”,其中“股票行情”这类表述非常常见且范围宽,缺少更明确的触发边界。文件也没有给出排除条件或负例,无法清楚区分一般聊天提及股票与真正希望调用该 skill 的场景。

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs the agent to solicit a reusable billing credential from the user and persist it locally, which expands the skill from stock analysis into credential handling and secret storage. This increases exposure of a sensitive token and creates a durable authentication foothold that could be abused by the skill itself, other skills, or anyone with access to the host account.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Persisting a reusable billing credential in ~/.openclaw/secrets/agentpit.cpk is not essential to producing stock analysis results and creates ongoing risk beyond the immediate task. If the token is later read by another process, leaked in backups, or reused silently, it can authorize billable external actions and account access without fresh user approval.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
93% confidence
Finding

This duplicate finding points to the same session-persistence behavior: writing a reusable billing token to ~/.openclaw/secrets and exporting it for ongoing reuse. The stock-analysis context does not justify durable token residency, so the persistence meaningfully increases the chance of silent future use and credential theft.

Content

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

  1. 保存到本地(shell 示例,实际按 agent 能力执行等价操作):
    bash
    mkdir -p ~/.openclaw/secrets
    printf '%s' "$USER_CPK" > ~/.openclaw/secrets/agentpit.cpk
    chmod 600 ~/.openclaw/secrets/agentpit.cpk
    export AGENTPIT_CPK="$USER_CPK"
    

Session Persistence

Medium
Category
Rogue Agent
Confidence
93% confidence
Finding

This duplicate finding points to the same session-persistence behavior: writing a reusable billing token to ~/.openclaw/secrets and exporting it for ongoing reuse. The stock-analysis context does not justify durable token residency, so the persistence meaningfully increases the chance of silent future use and credential theft.

Content

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

  1. 保存到本地(shell 示例,实际按 agent 能力执行等价操作):
    bash
    mkdir -p ~/.openclaw/secrets
    printf '%s' "$USER_CPK" > ~/.openclaw/secrets/agentpit.cpk
    chmod 600 ~/.openclaw/secrets/agentpit.cpk
    export AGENTPIT_CPK="$USER_CPK"
    

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

bash
   mkdir -p ~/.openclaw/secrets
   printf '%s' "$USER_CPK" > ~/.openclaw/secrets/agentpit.cpk
   chmod 600 ~/.openclaw/secrets/agentpit.cpk
   export AGENTPIT_CPK="$USER_CPK"

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This call transmits user-selected stock data together with a bearer credential to an external third-party API for paid processing. External transmission is expected for this skill's purpose, but it remains security-relevant because it sends a reusable authentication token off-host and initiates billable actions; users must clearly understand and consent to that behavior.

Content

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

提交异步任务:

bash
curl -s -X POST "https://api.agentpit.io/api/v1/skill-invoke/stock-analyze" \
  -H "Authorization: Bearer $AGENTPIT_CPK" \
  -H "Content-Type: application/json" \
  -d '{"stock_code":"TICKER","async_mode":true}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This call transmits user-selected stock data together with a bearer credential to an external third-party API for paid processing. External transmission is expected for this skill's purpose, but it remains security-relevant because it sends a reusable authentication token off-host and initiates billable actions; users must clearly understand and consent to that behavior.

Content

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

提交异步任务:

bash
curl -s -X POST "https://api.agentpit.io/api/v1/skill-invoke/stock-analyze" \
  -H "Authorization: Bearer $AGENTPIT_CPK" \
  -H "Content-Type: application/json" \
  -d '{"stock_code":"TICKER","async_mode":true}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · SKILL.md (reported line 119)May include surrounding context.

得到 task_id 后每 10 秒轮询一次(注意 taskId 走 query 参数):

bash
curl -s "https://api.agentpit.io/api/v1/skill-invoke/stock-status?taskId=TASK_ID" \
  -H "Authorization: Bearer $AGENTPIT_CPK"

External Transmission

Medium
Category
Data Exfiltration
Confidence
86% confidence
Finding

This endpoint sends ticker, analysis depth, language preference, and bearer credentials to a third-party service for potentially expensive processing. The skill context makes outbound analysis expected, but the combination of external transmission and reusable billing authorization still creates meaningful risk if invoked unexpectedly or without clear informed consent.

Content

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

调用系统2(TradingAgents)

bash
curl -s --max-time 600 -X POST "https://api.agentpit.io/api/v1/skill-invoke/trading-sync" \
  -H "Authorization: Bearer $AGENTPIT_CPK" \
  -H "Content-Type: application/json" \
  -d '{"ticker":"TICKER","depth":"full","language":"zh"}'

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

L131 在调用 TradingAgents 时将 language 固定为 zh,而文档整体也默认以中文与用户交互,没有说明可根据用户偏好切换语言。根据规则,未经用户选择而强制特定语言/locale 属于自然语言策略违规。

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
86% confidence
Finding

This request sends stock symbols and a reusable authorization token to an external hedge-fund analysis service, again triggering billable third-party processing. While aligned with the feature's purpose, it is dangerous if the token is overprivileged or persistently stored because unauthorized reuse could lead to account abuse and financial cost.

Content

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

调用系统3(AI对冲基金)

bash
curl -s --max-time 300 -X POST "https://api.agentpit.io/api/v1/skill-invoke/hedgefund-quick-run" \
  -H "Authorization: Bearer $AGENTPIT_CPK" \
  -H "Content-Type: application/json" \
  -d '{"tickers":["TICKER"],"analyst":"aswath_damodaran"}'