Back to skill

Security audit

Etf Assistant 1.0.1

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches an ETF quote assistant, but its calculator accepts unvalidated inputs that can execute shell commands locally.

Review before installing. Do not run the calc command with untrusted or agent-generated amount/year values until strict numeric validation is added. If installed anyway, use it only in a sandbox or with trusted numeric inputs, and expect price/compare to send ETF codes to Yahoo Finance.

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

Error
Location
etf-assistant.sh:232
Finding

Arbitrary Command Execution Through Bash Arithmetic Injection

Content
View full analysis
Remediation
View remediation
&2 return 1 fi if ! [[ "$years" =~ ^[1-9][0-9]*$ ]]; then echo "Years must be a positive integer." >&2 return 1 fi if (( amount > 100000000 || years > 100 )); then echo "Amount or duration exceeds the supported range." >&2 return 1 fi ``` After validation, force base-10 interpretation to prevent leading-zero values from being treated as octal: ```bash local amount_num=$((10#$amount)) local years_num=$((10#$years)) local months=$((years_num * 12)) local total_invest=$((amount_num * months)) ``` Construct the `bc` input exclusively from these validated numeric variables: ```bash local future_value future_value=$(printf '%s\n' \ "scale=2; $amount_num * ((1 + $monthly_return)^$months - 1) / $monthly_return" | bc) ``` Additional hardening should include: - Reject signs, whitespace, decimal points, variable names, brackets, parentheses, and shell metacharacters unless explicitly required. - Check for integer overflow before multiplication. - Use `local variable; variable=$(...)` rather than combining declaration and command substitution, so command failures are not masked by `local`. - Handle `bc` failures explicitly and return a nonzero status. - Run the Skill with a restricted account and minimal filesystem, environment, and network access. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · etf-assistant.sh (reported line 195)May include surrounding context.

sh
echo ""
    
    # 获取两只ETF的行情
    local price1=$(curl -s "https://query1.finance.yahoo.com/v8/finance/chart/${code1}.SS" 2>/dev/null | python3 -c "
import json, sys
try:
    data = json.load(sys.stdin)

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · etf-assistant.sh (reported line 204)May include surrounding context.

sh
except: print('N/A')
" 2>/dev/null)
    
    local price2=$(curl -s "https://query1.finance.yahoo.com/v8/finance/chart/${code2}.SS" 2>/dev/null | python3 -c "
import json, sys
try:
    data = json.load(sys.stdin)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

All user-facing strings, usage text, and command descriptions are presented only in Chinese, with no indication that the skill is region-specific or that users can opt into another language. This creates a language/locale policy issue because the skill implicitly enforces a single language without user choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This shell script sends the user-provided ETF code to an external Yahoo Finance endpoint via curl, but there is no explicit warning, confirmation, or disclosure that the query will contact a third-party service. Although the code comment mentions Yahoo Finance, that is not user-facing and the help output does not inform users that their requests rely on a remote API.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The compare command issues two curl requests to Yahoo Finance for the supplied ETF codes, but users are not informed in the CLI help or command output that external API calls will occur. This is a missing disclosure for a network operation that transmits user input to a third party.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.