T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:360- Finding
Agent-Directed Extraction and Handling of Financial Trading Credentials
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This trading skill is not clearly malicious, but it gives agents high-impact financial and credential-handling workflows with inconsistent consent boundaries and risky plaintext secret persistence.
Install only after carefully reviewing the credential and trading implications. Prefer completing Alpaca registration, email verification, API key generation, and credential entry yourself in a trusted session; use paper-trading keys first; avoid live-trading credentials unless you understand that shell-stored environment variables may be readable by agents and local processes; rotate keys if they were exposed to an agent transcript or shell profile you do not trust.
SKILL.md:360Agent-Directed Extraction and Handling of Financial Trading Credentials
SKILL.md:89Persistent Plaintext Trading Secrets Stored in Shell Startup Files
SKILL.md:66Unpinned Third-Party Packages Installed and Executed Without Integrity Verification
The setup workflow states that the agent runs alpaca init, which conflicts with earlier guidance not to run setup autonomously without explicit permission. In a trading skill, normalizing agent-initiated setup can lead to shell config modification, credential collection workflows, and persistent secret exposure in environments where the user may not fully understand or approve the trust boundary.
These lines tell agents to use browser automation to obtain API keys and then call a command that saves them persistently in shell startup files. Directing an agent to both acquire and install secrets creates a clear secret-handling vulnerability, because any agent compromise, logging, prompt injection, or mis-execution could expose credentials or alter the user's environment without informed consent.
The automated setup section directs handling of highly sensitive personal and credential data during signup, email verification, API key generation, and secret installation, but it does not establish strong prohibitions on collection, retention, or exposure of those secrets. That omission makes it more likely an agent will capture or persist credentials insecurely, especially because the workflow normalizes secret extraction as part of setup.
The workflow explicitly instructs agents to generate a new API key pair, extract both keys, and save them to shell configuration. This is dangerous because it operationalizes end-to-end automated secret acquisition and persistence, giving the agent direct access to credentials capable of trading actions and making accidental leakage, unauthorized reuse, or hostile exfiltration much more plausible.
The example agent flow presents signup, email verification, API key extraction, and local secret installation as a normal integrated automation path. Normalizing this pattern is dangerous because it encourages agents to cross multiple trust boundaries—identity, email, financial account, and local machine configuration—in one flow, greatly magnifying the consequences of mistakes or abuse.
The quick summary reiterates that agents should use browser automation to complete registration, extract API keys, and save them. Repetition in the summary increases the likelihood of downstream execution by agents or toolchains that only ingest condensed instructions, reinforcing unsafe secret-handling behavior in a financial context.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
" Run: alpaca auth",
" This will prompt for API Key, Secret Key, and trading mode (Paper/Live)",
" Credentials are saved to your shell config (~/.zshrc, ~/.bashrc, or ~/.profile)",
"5. Get API keys from https://alpaca.markets (Dashboard → API Keys)",
" - Use Paper Trading keys for testing (virtual $100k, no real money)",
" - Use Live Trading keys only after thorough testing",
"6. If using Homebrew Python, update the alpaca script shebang:",
The Quick Start section prominently tells users to run alpaca init but does not repeat the nearby operational risk that the command modifies shell startup files and persists API keys. Users who jump directly to Quick Start may initiate credential setup without understanding persistence, shell config changes, or that agents with shell access may later read those variables.
The README makes a contradictory safety claim: it says API keys stored in shell configuration are accessible to processes in the shell, then later asserts an agent cannot access keys directly. In an agent-with-shell-access context, that statement can mislead users into granting setup or execution permissions under a false assumption of key isolation, increasing the risk of credential exposure and unauthorized trading actions.
The metadata says setup requires user interaction and warns not to run setup autonomously, but later sections say agents can automate registration and then save credentials. This contradictory guidance can cause downstream agents to bypass consent boundaries or treat sensitive setup steps as implicitly approved, increasing the chance of unauthorized actions on the user's system and accounts.
The skill explicitly instructs agents to use browser and email automation to register an Alpaca account, generate API keys, extract them, and proceed with setup. That expands the skill from trading operations into automated identity, account-creation, and credential-handling workflows, which materially increases the attack surface and creates a path for unauthorized collection or misuse of sensitive credentials.
The example activation uses a broad prompt such as a user wanting to 'start trading stocks,' which can cause the skill to engage on generic investing requests and then steer into account creation and secret-handling flows. In this context, broad triggering is risky because the skill includes credential persistence and automated onboarding behavior, not just harmless informational responses.
The setup instructions direct users to enter Alpaca API credentials and explicitly state they will be saved to shell startup files such as ~/.zshrc or ~/.bashrc, but they do not warn about the security implications of storing secrets in plaintext in broadly read configuration files. This can expose trading credentials to local compromise, accidental disclosure through backups/dotfile sync, or leakage during support/debugging, especially if users later enable live trading.
No suspicious patterns detected.