Back to skill

Security audit

Stock Alert Workflow

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent finance analysis tool, but it stores portfolio data locally and contacts third-party market/news services when run.

Before installing, be comfortable with saving portfolio holdings and cost basis in a local JSON file, sending ticker lookups to external financial/news services, and running Python dependencies resolved by uv. Avoid storing sensitive portfolios if the machine is shared, and be careful with delete/remove commands because the CLI does not ask for confirmation.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
scripts/analyze_stock.py:3
Finding

Unpinned Runtime Dependencies Allow Mutable Third-Party Code Execution

Content
View full analysis

Vulnerability Details

File Location: scripts/analyze_stock.py:3-10; the same pattern also occurs in scripts/earnings_alert.py:3-7 and scripts/portfolio.py:3-5
Vulnerability Type: Insecure third-party dependency resolution
Risk Level: Medium

Vulnerable Code

scripts/analyze_stock.py:3-10:

python
# /// script
# requires-python = ">=3.10"
# dependencies = [
#     "yfinance>=0.2.40",
#     "pandas>=2.0.0",
#     "fear-and-greed>=0.4",
#     "edgartools>=2.0.0",
#     "feedparser>=6.0.0",
# ]
# ///

scripts/earnings_alert.py:3-7:

python
# /// script
# requires-python = ">=3.10"
# dependencies = [
#     "yfinance>=0.2.40",
#     "pandas>=2.0.0",
# ]
# ///

scripts/portfolio.py:3-5:

python
# /// script
# requires-python = ">=3.10"
# dependencies = ["yfinance>=0.2.40"]
# ///

These PEP 723 dependency declarations are invoked by documented commands such as:

bash
uv run {baseDir}/scripts/analyze_stock.py AAPL

Technical Analysis

The dependency declarations use lower-bound constraints rather than exact, reviewed versions. When a documented uv run command is executed, uv may resolve and download any currently available release satisfying these constraints, together with its transitive dependencies.

The repository does not contain a dependency lockfile, integrity hashes, or vendored reviewed packages. Consequently, the code that ultimately executes can change after the Skill itself has been audited. This violates reproducible-build principles and leaves execution dependent on the current state of the configured package index and upstream dependency accounts.

This finding does not establish that any currently named package is malicious. The risk arises because a future compromised release, compromised maintainer account, malicious transitive dependency, or untrusted package-index configuration could introduce arbitrary ...[truncated 1526 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace open-ended lower-bound constraints with exact versions that have been reviewed and tested.
  2. Move dependency management into a standard uv project and commit the generated uv.lock file, including all transitive dependencies.
  3. Require locked execution, such as uv run --locked, and use uv sync --frozen in automated environments so resolution cannot silently change.
  4. Configure a trusted package index or internal mirror rather than inheriting an uncontrolled index configuration.
  5. Apply package integrity verification where supported and retain reviewed artifacts in a controlled cache or registry.
  6. Add automated dependency vulnerability and provenance checks to the update process.
  7. Update dependencies through explicit, reviewed pull requests rather than resolving newer compatible versions at every execution.
  8. Run the scripts in a sandbox with restricted filesystem access, minimal environment variables, and outbound-network access limited to documented financial-data services.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (23)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · App-Plan.md (reported line 114)May include surrounding context.

md
GET  /portfolios
   POST /portfolios
   PUT  /portfolios/{id}
   DELETE /portfolios/{id}

   GET  /portfolios/{id}/assets
   POST /portfolios/{id}/assets

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · App-Plan.md (reported line 119)May include surrounding context.

md
GET  /portfolios/{id}/assets
   POST /portfolios/{id}/assets
   PUT  /portfolios/{id}/assets/{ticker}
   DELETE /portfolios/{id}/assets/{ticker}

   GET  /portfolios/{id}/performance?period=weekly
   GET  /portfolios/{id}/summary

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · App-Plan.md (reported line 126)May include surrounding context.

md
GET  /alerts
   POST /alerts
   DELETE /alerts/{id}

   GET  /user/subscription
   POST /user/subscription/upgrade

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The core purpose substantially aligns: this code does perform stock and crypto analysis, supports top-20-style crypto handling, and provides portfolio analysis/reporting. However, there are notable description/behavior mismatches. First, the description frames the skill as using Yahoo Finance data, but the code also pulls from non-Yahoo sources: fear-and-greed/CNN, SEC EDGAR via edgartools, and Google News RSS via feedparser. Those are material external capabilities, not just implementation details. Second, the code includes undeclared breaking-news and geopolitical-risk analysis. Third, the description mentions earnings surprise alerts with WhatsApp push, but this code chunk contains no WhatsApp integration or push-alert mechanism. Fourth, while the description advertises portfolio management (create/add/remove assets), this chunk only reads portfolios for analysis and reporting; management functionality is not present here. Therefore the description does not accurately represent this supplied code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The code accurately matches one declared feature: earnings surprise alerts enriched with analyst ratings and formatted for WhatsApp-style output, using Yahoo Finance data. However, the declared description presents the skill as a much broader stock/crypto analysis and portfolio tracking system. In the provided code chunk, behavior is limited to scanning equity tickers for EPS surprises and formatting alerts; there is no evidence of portfolio CRUD, crypto monitoring, top-20 market-cap analysis, periodic performance reporting, or multi-dimension analysis. This is a material description-to-behavior mismatch in scope and primary represented capabilities, even though one subfeature is correctly represented.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The description claims a comprehensive analysis and alerting skill, but this code chunk is narrowly focused on portfolio CRUD and display. It does use Yahoo Finance data for ticker validation and current price lookup, which partially aligns with the description, and it supports portfolio management as declared. However, the primary behavior shown is not the full declared capability set: there is no evidence of 8 stock analysis dimensions, 3 crypto dimensions, market-cap ranking, scheduled reporting, earnings surprise monitoring, or WhatsApp integration. This is therefore a material description-to-behavior mismatch, mainly due to substantial declared capabilities not present in the code provided.

Content

No source excerpt is available for this finding.

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · TODO.md (reported line 88)May include surrounding context.

md
- [ ] Add timeout per indicator (10s max)
- [ ] Test with multiple stocks in sequence
- [ ] Measure actual runtime improvement
- [ ] Update SKILL.md with new runtime (target: 3-4s)

**Expected Impact**:
- Reduce runtime from 6-10s to 3-4s per stock

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · TODO.md (reported line 193)May include surrounding context.

md
- [ ] Add timeout per indicator (10s max)
- [ ] Test with multiple stocks in sequence
- [ ] Measure actual runtime improvement
- [ ] Update SKILL.md with new runtime (target: 3-4s)

**Expected Impact**:
- Reduce runtime from 6-10s to 3-4s per stock

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The plan explicitly includes Mixpanel/Amplitude and Sentry for analytics and error tracking but does not mention any user-facing consent flow, privacy notice, data minimization, or opt-out controls. In a consumer finance app that handles portfolio and behavioral data, collecting telemetry without clear disclosure can expose sensitive usage patterns and create compliance and privacy risk.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 31)May include surrounding context.

Portfolio Management

bash
# Create and manage portfolios
uv run scripts/portfolio.py create "My Portfolio"
uv run scripts/portfolio.py add AAPL --quantity 100 --cost 150
uv run scripts/portfolio.py add BTC-USD --quantity 0.5 --cost 40000

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill advertises executable commands that read/write local files, may access environment-dependent tooling, and fetch remote data, but it does not declare any explicit tool scope such as allowed tools or permissions. In an agent setting, missing scope declarations weakens least-privilege controls and can let the skill run with broader file/network capabilities than a user would reasonably expect.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

The skill maintains persistent portfolio state in a home-directory JSON file, which introduces session persistence and possible retention of sensitive financial holdings across runs. Even if intended, persistent state can increase privacy and integrity risk if other skills, users, or processes on the same environment can read, modify, or act on stale portfolio data.

Content

Scanner excerpt · SKILL.md (reported line 50)May include surrounding context.

Portfolio Management (v5.0)

Create and manage portfolios with mixed assets (stocks + crypto):

bash
# Create portfolio

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script sends user-requested tickers and related portfolio-derived symbols to multiple third-party services including Yahoo Finance, Google News, and SEC EDGAR without clearly informing the user. In this skill context, ticker queries can reveal trading interests or actual holdings patterns, so undisclosed outbound transmission creates a meaningful privacy and data-governance issue.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest frames this skill around analyzing stocks and cryptocurrencies using Yahoo Finance data, with portfolio tracking and earnings alerts. This function adds a separate news-ingestion capability from Google News RSS and uses it to influence analysis outputs, which is a materially different behavior than the stated data source and scope.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest emphasizes Yahoo Finance data for stock and crypto analysis, but this function fetches and processes SEC Form 4 filings via edgartools. Insider-trading surveillance is a distinct data source and capability that meaningfully exceeds the described Yahoo Finance-only analysis behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

Portfolio summary generation processes and prints sensitive financial holdings, position sizes, cost basis, concentration, and profit/loss without any privacy notice, minimization, or output-suppression control. In an agent setting, this can expose highly sensitive investment data to logs, calling applications, shared terminals, or downstream model context, creating a real confidentiality risk even though the behavior is not overtly malicious.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/portfolio.py (reported line 10)May include surrounding context.

python
Portfolio management for stock-analysis skill.

Usage:
    uv run portfolio.py create "Portfolio Name"
    uv run portfolio.py list
    uv run portfolio.py show [--portfolio NAME]
    uv run portfolio.py delete "Portfolio Name"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The delete command removes stored portfolio data by calling the deletion path and immediately prints success, but there is no confirmation prompt or explicit user warning before the destructive action. Although the file contains a generic usage docstring, it does not warn that the operation permanently deletes local portfolio data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file states that portfolios are stored in a local JSON file under the user's home directory, which affects user data persistence. While the path is documented, there is no explicit warning or notice that portfolio contents will be written and retained on disk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill exposes create/update/remove/delete commands for persistent portfolio data without prominently warning that these operations modify or delete a local file in the user's home directory. In agent-driven workflows, this can cause unintended destructive changes if a user or upstream prompt triggers management commands assuming they are read-only or ephemeral.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The WhatsApp message formatter uses Chinese strings for all user-facing output in the alert body and disclaimer. This imposes a specific language on users without opt-in, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The script stores portfolio contents in a local JSON file under the user's home or state directory, which affects user data persistence. While the helper function has an internal docstring/comment for developers, there is no clear user-facing disclosure in command output or CLI help that portfolio information will be saved to disk at this location.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The script uses yfinance to validate tickers and retrieve market data, which transmits user-supplied tickers to an external service. The code does not provide a visible disclosure in CLI help or runtime output that add/show operations may contact external network services.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.