Back to skill

Security audit

Stock Quote

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed stock-quote helper, but it also tells agents to create recurring portfolio-memory updates using hard-coded holdings and a stop-loss value that may not belong to the user.

Review the Daily Heartbeat section before installing. Do not let the skill add HEARTBEAT.md or MEMORY.md entries unless the holdings, share counts, stop-losses, recurrence, and deletion path are explicitly provided and approved by the user. Treat quote data as informational, especially because the default source may be delayed end-of-day, and install dependencies in an isolated, pinned environment for higher assurance.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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 (2)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:106
Finding

Unpinned Third-Party Dependencies Permit Supply-Chain Substitution

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:106-112
Vulnerability Type: Unpinned and unverified Python dependencies
Risk Level: Medium

Vulnerable Code

bash
## Dependencies

```bash
# Primary (recommended)
pip install yfinance

# Fallback (if yfinance unavailable)
pip install requests
text

### Technical Analysis

The installation instructions retrieve the latest available versions of `yfinance`, `requests`, and their transitive dependencies without version constraints, package hashes, a lockfile, or index restrictions. Consequently, the code installed and subsequently imported can differ from the version reviewed during this audit.

Python package installation and import may execute package-controlled code. A compromised upstream release, malicious dependency substitution, or unreviewed future release could therefore introduce arbitrary behavior into the Skill's execution environment.

The same unpinned `yfinance` installation guidance also appears in `references/api-sources.md:21`.

### Attack Path

1. An attacker compromises an upstream package or one of its transitive dependencies, or publishes a malicious release through a supply-chain attack.
2. A user follows the documented `pip install yfinance` or `pip install requests` command.
3. `pip` resolves and installs the attacker-controlled release because no reviewed version or hash is required.
4. Malicious code executes during package installation or when `quote.py` imports the package.
5. The payload operates with the privileges of the user running `pip` or the Skill.

### Impact Assessment

Successful exploitation may permit arbitrary code execution under the installing user's account. The resulting access may include reading or changing user-accessible files, accessing environment variables and credentials available to the process, making network requests, and altering the Skill's quote results. The exact scope is bounded by th
...[truncated 62 chars]
Remediation
View remediation

Remediation Suggestions

  • Pin every direct dependency to a reviewed version.
  • Maintain a lockfile that records all resolved transitive dependency versions.
  • Require package hashes, such as through pip install --require-hashes -r requirements.txt.
  • Configure an explicit trusted package index and disable unintended extra indexes.
  • Install dependencies in an isolated virtual environment or restricted container rather than a privileged system environment.
  • Add automated dependency vulnerability and integrity scanning.
  • Review and deliberately update pinned versions on a controlled schedule.
  • Replace all unpinned installation examples, including the example in references/api-sources.md, with the hardened installation procedure.

T02 · Agent Memory Poisoning

Warning
Location
SKILL.md:88
Finding

Hard-Coded Financial Instructions Can Poison Persistent Agent State

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:88-94
Vulnerability Type: Persistent memory and recurring-task poisoning
Risk Level: Medium

Vulnerable Code

markdown
Add to `HEARTBEAT.md`:
  • Fetch current prices for all holdings (NVDA, TSLA, BABA, ORCL, UNH, AAL, AMZN)
  • Update MEMORY.md position table with latest market values
  • Check if any position within 5% of stop loss
  • Alert if TSLA approaches $385.90 stop loss
text

Technical Analysis

The Skill documentation instructs an agent to place recurring instructions in HEARTBEAT.md and to update MEMORY.md. The proposed instructions contain a hard-coded portfolio and a hard-coded TSLA stop-loss threshold that do not originate from the current user's request.

If an agent follows this template without explicit confirmation and provenance validation, package-authored financial data becomes persistent user state. Future sessions may treat these holdings and thresholds as trustworthy user preferences. This creates a cross-session influence channel beyond the Skill's legitimate quote-retrieval function.

The Python implementation itself does not write these files automatically. Exploitation depends on an agent interpreting and applying the documentation instructions.

Attack Path

  1. An agent loads the Skill documentation while handling a stock-price or portfolio task.
  2. The agent follows the instruction to add the supplied block to HEARTBEAT.md.
  3. The recurring heartbeat task treats the hard-coded symbols and TSLA threshold as user-authorized portfolio data.
  4. The task repeatedly writes derived values into MEMORY.md.
  5. Later sessions consume the poisoned persistent state and may generate incorrect portfolio valuations, stop-loss alerts, or trading guidance.

Impact Assessment

This issue does not directly grant operating-system privileges or code execution. Its impact is limited to persistent agent state and decisi ...[truncated 282 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove all hard-coded holdings, stop-loss values, and other user-specific financial data from the persistent-state example.
  • Do not instruct an agent to modify HEARTBEAT.md, MEMORY.md, or equivalent persistent files as part of ordinary quote retrieval.
  • Require explicit, informed user confirmation before creating recurring tasks or modifying persistent memory.
  • Populate templates exclusively with values supplied and verified by the current user.
  • Record the provenance, timestamp, and authorizing user action for every persistent financial value.
  • Separate fetched market data from user-owned portfolio configuration.
  • Validate existing persistent values before using them for alerts or financial decisions.
  • Provide a review and deletion mechanism for recurring tasks and stored portfolio data.
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill claims a narrower, real-time stock quote function, but the documented behavior includes additional external providers and Yahoo Finance web scraping that are not fully reflected in the declared purpose. This mismatch can mislead operators about outbound connectivity, data provenance, scraping behavior, and timeliness of returned prices, which is especially risky for portfolio valuation or pre-trade decisions.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill documents network-backed functionality but does not declare any tool scope or permissions boundary. In an agent environment, missing scope metadata can cause the skill to run with broader-than-expected network access, reducing auditability and making policy enforcement harder.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The example output includes Chinese field labels such as '市值' and '52 周' even though the rest of the skill documentation is in English. This suggests a locale-specific output format without any documented user opt-in or explanation, which can violate language/locale policy expectations.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The formatter only prints a simple error line when an error entry has exactly two keys, but all fetch functions populate error results with at least 'symbol', 'error', and 'source'. As a result, failed lookups will not follow the apparent intended error path and may instead be formatted like normal quotes, contradicting the function's stated purpose of formatting quote output meaningfully.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code emits user-facing text in mixed languages, with labels such as '市值' and '52 周' hard-coded into the CLI output. The file does not provide any user opt-in, locale selection, or documentation justifying a Chinese-only or mixed-locale interface, which conflicts with the language/locale policy requirement.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.