Back to skill

Security audit

Stock Select

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed stock-query and trading assistant, but it can place real financial orders without clearly requiring a final user confirmation.

Review this carefully before installing. Use it only if you are comfortable letting an agent handle stock-account authentication and trading API calls. Do not paste real passwords, SMS codes, access tokens, or refresh tokens into ordinary chat or shell commands, verify the API endpoint before login, and require a separate explicit confirmation before any order is submitted.

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:62
Finding

Sensitive authentication data exposed through command-line request bodies

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:62-64, SKILL.md:77-79, and SKILL.md:352-355
Vulnerability Type: Insecure handling of credentials and authentication tokens
Risk Level: Medium

Vulnerable Code

SKILL.md:62-64:

bash
curl -X POST "${STOCKBOOT_API_URL}/auth/login" \
  -H "Content-Type: application/json" \
  -d '{"username": "18680859800", "password": "abcd1234"}'

SKILL.md:77-79:

bash
curl -X POST "${STOCKBOOT_API_URL}/auth/register" \
  -H "Content-Type: application/json" \
  -d '{"phone": "13800138000", "password": "test123", "confirmPassword": "test123", "code": "123456"}'

SKILL.md:352-355:

bash
RESPONSE=$(curl -s -X POST "${STOCKBOOT_API_URL}/auth/login" \
  -H "Content-Type: application/json" \
  -d '{"username":"18680859800","password":"abcd1234"}')
TOKEN=$(echo $RESPONSE | jq -r '.data.token')

Technical Analysis

The documented authentication and registration workflows place usernames, phone numbers, passwords, password confirmations, and SMS verification codes directly in shell command text. Although the displayed values appear to be examples rather than confirmed live credentials, users following the workflow may replace them with real values.

Literal secrets in commands may be retained by shell history, terminal recording, agent execution transcripts, command auditing systems, debugging output, or process-monitoring facilities. The login response is also stored in the RESPONSE shell variable before the bearer token is extracted, which increases the possibility that the complete authentication response will be exposed through diagnostics or logging.

The service destination can be changed through STOCKBOOT_API_URL, as documented at SKILL.md:40-44. The feature supports self-hosting, but no origin allowlist, certificate-pinning policy, redirect restriction, or destination validation is specified. If an attacker can influence t ...[truncated 1918 chars]

Remediation
View remediation

Remediation Suggestions

  1. Do not place passwords, SMS codes, refresh tokens, or other secrets directly in command-line arguments.
  2. Obtain passwords through a non-echoing interactive prompt, protected credential manager, or secret-injection mechanism that does not persist values in shell history.
  3. Supply sensitive request bodies through protected standard input or a permission-restricted temporary file, and securely remove any temporary material immediately afterward.
  4. Replace realistic example values with unmistakable placeholders such as <PHONE_NUMBER>, <PASSWORD>, and <SMS_CODE>.
  5. Disable shell tracing around authentication operations and redact credentials, authorization headers, login responses, access tokens, and refresh tokens from logs and agent transcripts.
  6. Avoid storing the complete login response in a general-purpose shell variable. Parse only the required fields through a controlled pipeline and ensure neither the response nor token is printed.
  7. Validate STOCKBOOT_API_URL before transmitting sensitive data. Use an explicit allowlist for trusted origins, require HTTPS, verify certificates, and reject redirects to different or untrusted origins.
  8. Store tokens only for the minimum necessary duration, apply restrictive permissions, and clear transient variables after use.
  9. Require an explicit final user confirmation of the brokerage account, stock symbol, buy or sell direction, quantity, price, and order type immediately before submitting any financial transaction.
  10. Apply server-side safeguards such as short-lived access tokens, refresh-token rotation, revocation, rate limiting, anomaly detection, and step-up authentication for high-risk trading operations.
Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Credential Access

High
Category
Privilege Escalation
Confidence
78% confidence
Finding

The skill exposes an access-token refresh workflow using a refresh token in the Authorization header, which is standard, but refresh tokens are long-lived credentials with elevated value to attackers. In this skill's context, compromise of a refresh token could enable prolonged unauthorized access to accounts and potentially downstream trading operations.

Content

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

1.4 刷新 Token

  • 接口: POST ${STOCKBOOT_API_URL}/auth/refresh
  • 说明: 使用 refreshToken 刷新 access token
  • Header: Authorization: Bearer ${refreshToken}
  • 示例:
    bash

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill documents direct order placement but does not require a strong execution-time warning, risk disclosure, or irreversible-action confirmation. Because this skill operates in a financial trading context, omission of explicit confirmation can lead to unauthorized or mistaken trades with immediate monetary loss.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger list includes broad phrases such as 股票查询, 股票行情, and especially 交易下单, which can cause accidental activation during ordinary financial conversations. In a skill that can authenticate, access accounts, and place trades, unintended invocation materially increases the chance of sensitive actions being initiated without clear user intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The login examples include a phone number, password, tokens, and token-handling flows without strong warnings against exposing, logging, or persistently storing credentials. In an agent setting, users may imitate these examples and inadvertently reveal secrets to the model, logs, or third-party systems.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

This example sends username and password to an external API endpoint, which is expected for authentication, but it still represents external transmission of highly sensitive credentials. In the context of an agent skill, this is dangerous if users are encouraged to supply real credentials without secure secret handling, because the data may be exposed in prompts, logs, or intermediary services.

Content

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

  • refreshToken: 刷新 Token(有效期14天)
  • 示例:
    bash
    curl -X POST "${STOCKBOOT_API_URL}/auth/login" \
      -H "Content-Type: application/json" \
      -d '{"username": "18680859800", "password": "abcd1234"}'
    

External Transmission

Medium
Category
Data Exfiltration
Confidence
82% confidence
Finding

The documented use of an Authorization bearer token in external requests is functionally necessary, but bearer tokens are reusable secrets that can grant access to market data, account information, or trading capabilities if leaked. In a trading skill, transmitting or handling tokens without strict secrecy and redaction controls increases the blast radius of accidental disclosure.

Content

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

TOKEN=$(echo $RESPONSE | jq -r '.data.token')

2. 获取 Level2 数据

curl "${STOCKBOOT_API_URL}/quote/600519"
-H "Authorization: Bearer $TOKEN"

返回: mainNetInflow(主力净额), mainNetInflowRate(主力净量占比)

text

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

该技能元数据描述与整份操作说明均固定为中文,未说明是否支持其他语言或允许用户选择语言。若组织要求避免未经选择地强制特定语言,这种默认单一语言呈现可能构成语言/locale 策略问题。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The description is written entirely in Chinese and presents the skill as operating through natural-language queries without any indication that users may choose another language. This can violate language/locale policy expectations when no user opt-in or documented locale limitation is provided.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.