T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/config-loader.js:11- Finding
Credential file path traversal through an unvalidated user identifier
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Alpaca trading skill is mostly about its stated purpose, but it includes under-documented scripts that can place real trades automatically and handles brokerage credentials too broadly.
Review carefully before installing. Use paper-trading credentials only unless you have audited and modified the scripts to require explicit confirmation, live-mode opt-in, endpoint allowlisting, credential-path validation, and clear risk limits. Do not run the undocumented aggressive or momentum strategy scripts with live credentials.
scripts/config-loader.js:11Credential file path traversal through an unvalidated user identifier
scripts/trading.js:31Alpaca API credentials can be transmitted to arbitrary configured hosts
scripts/trading.js:420Automated strategies submit market orders without enforcing explicit confirmation
scripts/aggressive-strategy.js:13Shell command construction creates a latent command-injection sink
A description-behavior mismatch is dangerous in a financial trading skill because users and reviewers may approve it based on a benign summary while the underlying behavior is materially different and potentially more aggressive. If the skill can execute strategies or allocations not clearly disclosed, it could cause unauthorized or unexpectedly risky trades, especially when real trading is supported.
A description-behavior mismatch is dangerous in a financial trading skill because users and reviewers may approve it based on a benign summary while the underlying behavior is materially different and potentially more aggressive. If the skill can execute strategies or allocations not clearly disclosed, it could cause unauthorized or unexpectedly risky trades, especially when real trading is supported.
buyMaxShares computes shares from the full available cash balance and then submits a buy order for the maximum amount, effectively enabling an all-in trade without a strong warning or confirmation step. In the context of a skill capable of real trading, this materially raises the chance of catastrophic loss from accidental invocation, stale prices, slippage, or misuse.
The strategy automatically submits sell orders when profit or stop-loss thresholds are met, with no user confirmation or safeguard before placing real trades. In a trading skill that supports real-money accounts, this can cause irreversible liquidation from parsing errors, faulty market data, or accidental execution in the wrong environment.
The RSI strategy can place live market buy and sell orders automatically with no confirmation prompt, dry-run default, or explicit warning that real funds may be used depending on configuration. In a trading skill, this is especially dangerous because a simple command invocation can trigger irreversible financial transactions and losses, amplified by support for both paper and real Alpaca endpoints.
The skill documents access to sensitive environment variables and operational shell commands, but does not declare an explicit tool scope such as allowed tools or permissions. In a trading skill that can place real orders, missing scope boundaries increases the chance of overbroad execution or unintended access to secrets and command execution paths.
The skill instructs users to store Alpaca API keys in local JSON files or environment variables without warning about secret exposure, filesystem permissions, accidental commits, or multi-user isolation risks. Because these credentials can enable real trades, leakage could directly lead to account abuse, unauthorized orders, or financial loss.
The script wraps child_process.execSync in a generic exec helper and uses shell command strings to drive trading actions. Even though current call sites use mostly fixed commands, this adds unnecessary command-execution capability to a financial automation script and includes one interpolated argument path (symbol), increasing the blast radius if inputs are ever widened or reused unsafely.
The script loads apiKey and apiSecret from config.json and uses them for outbound API requests, which is access to sensitive credentials. While the file contains technical comments and runtime logs, there is no explicit warning or disclosure to the user that credentials will be read and transmitted to a brokerage API.
The check command prints configuration status and setup guidance in Chinese, while most other output in the script is in English. This creates a fixed language experience without opt-in or documented locale justification, which matches the language/locale policy violation criteria.
The file's natural-language comments and all console output are written in Chinese, and there is no indication that the user can choose another language or locale. This can violate language/locale policy when a skill imposes a specific language without opt-in.
The manifest describes trading, quotes, orders, positions, and an RSI strategy, but does not mention portfolio equity history or performance-curve reporting. This file adds a broader account analytics capability by querying and displaying historical account equity and profit/loss over time.
Detected: suspicious.dangerous_exec, suspicious.exposed_secret_literal