T06 · System Persistence
- Location
SKILL.md:111- Finding
Recurring Cron Job Creates Cross-Session Persistence
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a real SnapTrade portfolio helper, but it also enables live trading, persistent scheduled financial reports, and local credential storage with insufficient guardrails.
Review carefully before installing. Use it only if you intentionally want SnapTrade scripts that can store brokerage credentials locally, read account data, create scheduled reports, and potentially place live trades. Avoid enabling trading scope or cron-based WhatsApp delivery unless you have verified the exact account, destination, permissions, and removal steps.
SKILL.md:111Recurring Cron Job Creates Cross-Session Persistence
scripts/snaptrade_common.py:24Credential File Permissions Are Applied After Writing and Fail Open
scripts/snaptrade_reconnect.py:37Reconnect Workflow Selects Unintended Connections and Requests Trading Scope
scripts/snaptrade_accounts.py:12Brokerage Account Numbers Are Disclosed Through Standard Output
scripts/snaptrade_order.py:9Trade Orders Are Submitted Without Adequate Numeric Validation or Confirmation
scripts/snaptrade_total.py:203Balances in Different Currencies Are Added Without Conversion
The documented ability to watch and track brokerage orders is omitted from the stated purpose. In a financial context, undisclosed order-status polling expands the operational scope from passive reporting into active trade workflow support, which can expose sensitive trading activity and enable actions the user did not reasonably expect.
The documented ability to watch and track brokerage orders is omitted from the stated purpose. In a financial context, undisclosed order-status polling expands the operational scope from passive reporting into active trade workflow support, which can expose sensitive trading activity and enable actions the user did not reasonably expect.
The skill presents itself as generating portfolio reports, yet the primary workflow also includes placing buy/sell orders. This mismatch is particularly dangerous in an investment context because a user may grant or trigger the skill expecting read-only reporting while the skill supports irreversible market activity.
The documented ability to place securities orders is not justified by the stated purpose of connectivity and portfolio summaries. Unnecessary high-risk capability increases blast radius: if the skill is selected for benign account-linking or reporting tasks, it still exposes trade execution paths that could be misused or accidentally invoked.
The documentation describes live buy/sell orders with a default market order and no explicit warning about financial loss, slippage, or irreversibility. Defaulting to market orders in particular can produce unintended execution prices, making accidental or misunderstood use especially harmful.
This script enables live order placement and post-trade monitoring, which materially exceeds the skill's declared scope of brokerage connectivity and portfolio reporting. Scope expansion into trading is dangerous because an agent or user expecting read-oriented account access could instead trigger irreversible financial transactions.
The code directly calls a force-order trading API to buy or sell securities, but the stated skill purpose only covers account connectivity, portal links, registration, and portfolio summaries. In this context, live trading capability is unjustified and increases the risk of unauthorized or unexpected financial actions through the agent.
Order submission occurs immediately from command-line inputs with no confirmation prompt, no human-in-the-loop warning, and no secondary validation for a destructive financial action. A mistaken symbol, units value, account selection, or automated invocation could therefore result in real trades and direct monetary loss.
The skill declares no explicit tool scope or permissions even though its documented workflows require shell execution, local file reads/writes, and access to secrets. In a financial-account skill, missing scope boundaries materially increases the chance the agent can use broader capabilities than intended, including handling credentials and executing trading-related scripts without clear confinement.
The workflow instructs sending portfolio values via WhatsApp without warning that sensitive financial data is being transmitted through a third-party messaging platform. Even if only total value is sent, this can expose private financial information to external services, compromised devices, or misdirected recipients.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
- Request signing is handled by the SDK via `request_after_hook` using `consumer_key`.
- The total is computed by summing each account’s `account.balance.total` from holdings; this avoids errors when accounts are added or removed.
- If multiple currencies are present, the script uses the first currency encountered.
- Keep secrets in the local config file with `chmod 600` permissions.
This function writes credential-bearing configuration data to disk silently, which increases the chance that API secrets are persisted without the operator fully realizing it. In a brokerage-integration skill handling SnapTrade client credentials, undisclosed local secret storage raises the risk of credential exposure through backups, shared workspaces, misconfigured permissions, or later file disclosure.
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
def save_config(data: Dict[str, Any], path: str = DEFAULT_CONFIG_PATH) -> None:
p = Path(path)
p.parent.mkdir(parents=True, exist_ok=True)
p.write_text(json.dumps(data, indent=2))
try:
os.chmod(p, 0o600)
except Exception:
The code persists user_secret directly into the local config via save_config(cfg) without any indication of encryption, access control hardening, or user disclosure. Because this secret is later used to authenticate SnapTrade user actions, storing it in plaintext or weakly protected config increases the risk of credential theft from disk, logs, backups, or multi-user environments.