Back to skill

Security audit

super-stock-analysis

Security checks for vulnerabilities and agentic risk

Overview

The skill largely matches a stock and crypto analysis purpose, but it asks users to expose X session cookies and broad local access and includes risky local file-modifying code.

Install only if you are comfortable reviewing and limiting the optional social scanner. Avoid granting Terminal Full Disk Access, avoid storing X cookies in the skill directory, do not run batch_refactor.py, and keep any portfolio or watchlist data in a private directory with restrictive permissions. The core market-analysis idea is coherent, but the credential handling and local mutation risks deserve manual review before use.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (8)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
docs/HOT_SCANNER.md:132
Finding

Excessive Full Disk Access Requested for Social-Media Scanning

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/rumor_scanner.py:30
Finding

Complete Process Environment Passed to Hard-Coded Third-Party Executable

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/trend_scanner.py:22
Finding

Trend Scanner Exposes All Environment Secrets to the Social-Media CLI

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
README.md:127
Finding

Live X Session Cookies Stored in a Plaintext Project File

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/market_analyzer.py:2
Finding

Runtime Dependencies Are Not Reproducibly Pinned

Content
View full analysis
=3.10" # dependencies = [ # "yfinance>=0.2.40", # "pandas>=2.0.0", # "fear-and-greed>=0.4", # "edgartools>=2.0.0", # "feedparser>=6.0.0", # ] # /// ``` Other executable scripts use the same minimum-version-only pattern, for example: ```python # /// script # requires-python = ">=3.10" # dependencies = ["yfinance>=0.2.40"] # /// ``` ### Technical Analysis The documented execution model uses `uv run`, while dependencies specify only lower bounds. No reviewed lockfile or hashes were identified in the project. A future invocation can therefore resolve package versions different from those reviewed during the audit. This is a supply-chain hardening deficiency rather than evidence that any named dependency is currently malicious. However, Python packages execute code inside the Skill's process and inherit its filesystem, network, and environment access. ### Attack Path 1. A user invokes a documented `uv run` command. 2. The dependency resolver selects the newest package versions satisfying the lower bounds. 3. A newly compromised, malicious, or incompatible release is downloaded. 4. Package code executes during import or normal use. 5. That code operates with the user's privileges and can access data available to the Skill. ### Impact Assessment A compromised resolved dependency could execute arbitrary Python code with the privileges of the user running the Skill. It could access portfolio files, X credentials, process environment variables, and network resources. ]]>
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/batch_refactor.py:107
Finding

Batch Refactoring Utility Automatically Rewrites the Entire Script Directory

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/portfolio_manager.py:42
Finding

Portfolio Records Are Written Without Enforced Private Permissions

Content
View full analysis
Path: """Get the portfolio storage path.""" # Use ~/.clawdbot/skills/stock-analysis/portfolios.json state_dir = os.environ.get("MARKETPULSE_DATA_DIR", os.path.expanduser("~/.clawdbot")) portfolio_dir = Path(state_dir) / "skills" / "stock-analysis" portfolio_dir.mkdir(parents=True, exist_ok=True) return portfolio_dir / "portfolios.json" ``` ```python def _save(self) -> None: """Save portfolios to disk with atomic write.""" if self._data is None: return # Ensure directory exists self.path.parent.mkdir(parents=True, exist_ok=True) # Atomic write: write to temp file, then rename tmp_path = self.path.with_suffix(".tmp") try: with open(tmp_path, "w", encoding="utf-8") as f: json.dump(self._data, f, indent=2) tmp_path.replace(self.path) except Exception: if tmp_path.exists(): tmp_path.unlink() raise ``` ### Technical Analysis Portfolio names, positions, quantities, and cost bases are stored as plaintext JSON. The code relies on the process umask and does not explicitly enforce mode `0700` on the directory or `0600` on the file. The rename provides useful atomicity, but the predictable `.tmp` path and lack of explicit ownership, symlink, and permission checks weaken local data protection, especially when `MARKETPULSE_DATA_DIR` points to a shared or attacker-influenced location. ### Attack Path 1. The Skill is executed with a permissive umask or a shared `MARKETPULSE_DATA_DIR`. 2. It creates the portfolio directory and file without explicitly restrictive modes. 3. Another local principal or service with filesystem access reads the JSON data. 4. The principal obtains the user's holdings, ...[truncated 279 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/watchlist_manager.py:31
Finding

Watchlist, Trading Thresholds, and Notes Are Stored Without Enforced Private Permissions

Content
View full analysis
list[WatchlistItem]: """Load watchlist from file.""" if WATCHLIST_STORAGE.exists(): data = json.loads(WATCHLIST_STORAGE.read_text()) return [WatchlistItem(**item) for item in data] return [] def write_watchlist(items: list[WatchlistItem]): """Save watchlist to file.""" initialize_storage() data = [asdict(item) for item in items] WATCHLIST_STORAGE.write_text(json.dumps(data, indent=2)) ``` ### Technical Analysis The watchlist can contain tickers, acquisition-time prices, target prices, stop prices, recommendation state, and free-form notes. It is written as plaintext using default filesystem permissions. The code neither enforces private modes nor validates ownership or symlinks. Unlike the portfolio writer, this function writes directly to the destination file. Interruption or concurrent writes can leave the file partially written, corrupting alert state. ### Attack Path 1. The Skill creates its storage under a permissive umask or in a directory accessible to another local principal. 2. The watchlist is written without an explicit private mode. 3. Another process reads the file and obtains investment interests, price thresholds, and notes. 4. Alternatively, process interruption during `write_text()` leaves partial JSON and prevents subsequent watchlist loading. ### Impact Assessment The vulnerability can disclose sensitive investment plans and user-authored notes. Direct non ...[truncated 185 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (61)

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
99% confidence
Finding

If the underlying implementation stores portfolio data locally without clearly declaring that persistence in the permission/scope model, users may expose sensitive financial holdings information unintentionally. In a finance context, silent or under-disclosed local persistence increases privacy risk even if the data is not overtly exfiltrated.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

If the underlying implementation stores portfolio data locally without clearly declaring that persistence in the permission/scope model, users may expose sensitive financial holdings information unintentionally. In a finance context, silent or under-disclosed local persistence increases privacy risk even if the data is not overtly exfiltrated.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

If the underlying implementation stores portfolio data locally without clearly declaring that persistence in the permission/scope model, users may expose sensitive financial holdings information unintentionally. In a finance context, silent or under-disclosed local persistence increases privacy risk even if the data is not overtly exfiltrated.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the underlying implementation stores portfolio data locally without clearly declaring that persistence in the permission/scope model, users may expose sensitive financial holdings information unintentionally. In a finance context, silent or under-disclosed local persistence increases privacy risk even if the data is not overtly exfiltrated.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

If the underlying implementation stores portfolio data locally without clearly declaring that persistence in the permission/scope model, users may expose sensitive financial holdings information unintentionally. In a finance context, silent or under-disclosed local persistence increases privacy risk even if the data is not overtly exfiltrated.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

If the underlying implementation stores portfolio data locally without clearly declaring that persistence in the permission/scope model, users may expose sensitive financial holdings information unintentionally. In a finance context, silent or under-disclosed local persistence increases privacy risk even if the data is not overtly exfiltrated.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The document explicitly instructs users to retrieve auth_token and ct0 cookie values from their browser and reuse them in a local tool. This is credential handling that bypasses standard authorization mechanisms and can enable account compromise, session hijacking, or unauthorized reuse if the tokens are leaked, logged, or reused by other components.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
89% confidence
Finding

Storing live session credentials in a project .env file within the skill directory creates a realistic risk of accidental disclosure through source control, backups, logs, workspace sharing, or local compromise. While .env usage is common, the specific secrets here are browser-derived session tokens, which are especially sensitive because they can directly impersonate a user account.

Content

Scanner excerpt · docs/HOT_SCANNER.md (reported line 149)May include surrounding context.

Create .env file in the skill directory:

bash
# /path/to/stock-analysis/.env
AUTH_TOKEN=your_auth_token_here
CT0=your_ct0_token_here

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This file is a bulk refactoring utility that scans local Python files and rewrites them in place, which is unrelated to the advertised stock and cryptocurrency analysis purpose of the skill. In an agent skill context, unjustified local file modification is dangerous because it expands the skill’s capabilities into source-code tampering, enabling accidental corruption or intentional persistence/backdoor insertion if triggered.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script enumerates Python files in its directory and prepares to rewrite all matching files, giving the skill mass source-code rewriting capability that is not justified by stock analysis functionality. In a mismatched skill, this kind of broad file-editing behavior materially increases the risk of supply-chain style tampering, destructive changes, or stealthy modification of adjacent code.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
97% confidence
Finding

Copying the full process environment after loading .env contents enables broad credential exposure to the external Bird CLI. In a skill context, invoking third-party tooling with inherited secrets is especially dangerous because the tool boundary is where data exfiltration or accidental secret disclosure commonly occurs.

Content

Scanner excerpt · scripts/rumor_scanner.py (reported line 79)May include surrounding context.

python
for query in queries[:4]:  # Limit to avoid rate limits
        try:
            cmd = [BIRD_CLI, 'search', query, '-n', '10', '--json']
            env = os.environ.copy()
            
            result = subprocess.run(cmd, capture_output=True, text=True, timeout=30, env=env)

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
97% confidence
Finding

This second environment copy repeats the same secret-propagation problem in another subprocess path. Any sensitive variables loaded into the parent environment become available to the external binary, unnecessarily expanding credential exposure.

Content

Scanner excerpt · scripts/rumor_scanner.py (reported line 132)May include surrounding context.

python
for query in queries[:3]:
        try:
            cmd = [BIRD_CLI, 'search', query, '-n', '15', '--json']
            env = os.environ.copy()
            
            result = subprocess.run(cmd, capture_output=True, text=True, timeout=30, env=env)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/rumor_scanner.py (reported line 33)May include surrounding context.

python
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor, as_completed

# Load .env file if exists
ENV_FILE = Path(__file__).parent.parent / ".env"
if ENV_FILE.exists():
    with open(ENV_FILE) as f:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/trend_scanner.py (reported line 22)May include surrounding context.

python
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor, as_completed

# Load .env file if exists
ENV_FILE = Path(__file__).parent.parent / ".env"
if ENV_FILE.exists():
    with open(ENV_FILE) as f:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/rumor_scanner.py (reported line 30)May include surrounding context.

python
from concurrent.futures import ThreadPoolExecutor, as_completed

# Load .env file if exists
ENV_FILE = Path(__file__).parent.parent / ".env"
if ENV_FILE.exists():
    with open(ENV_FILE) as f:
        for line in f:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/trend_scanner.py (reported line 23)May include surrounding context.

python
from concurrent.futures import ThreadPoolExecutor, as_completed

# Load .env file if exists
ENV_FILE = Path(__file__).parent.parent / ".env"
if ENV_FILE.exists():
    with open(ENV_FILE) as f:
        for line in f:

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The scanner executes an external 'bird' binary to collect Twitter/X content, which introduces arbitrary code execution through a local executable outside the Python codebase. Even though arguments are passed safely as a list, trust is shifted to whatever 'bird' resolves to on disk, making the skill more dangerous than a read-only analysis tool and widening the attack surface substantially.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
97% confidence
Finding

Using os.environ.copy() passes the full inherited environment, including any secrets loaded from .env or the host runtime, into the external 'bird' subprocess. If that binary logs, crashes, uploads diagnostics, or is replaced by a malicious executable, exposed credentials could be disclosed or abused far beyond the Twitter integration itself.

Content

Scanner excerpt · scripts/trend_scanner.py (reported line 387)May include surrounding context.

python
for sector, query in searches:
                try:
                    env = os.environ.copy()
                    result = subprocess.run(
                        [bird_bin, "search", query, "-n", "15", "--json"],
                        capture_output=True, text=True, timeout=30, env=env

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The roadmap explicitly plans product analytics and error tracking, but the surrounding document does not describe a user-facing notice, consent flow, or telemetry controls for collecting behavioral and diagnostic data. In a financial app handling portfolios, alerts, and potentially sensitive usage patterns, undisclosed telemetry can create privacy and compliance risk even if the collection is not overtly malicious.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README instructs users to extract and place Twitter/X session-related tokens (AUTH_TOKEN and CT0) from browser cookies into a local .env file. These are sensitive authentication artifacts, and documenting manual cookie extraction without an explicit warning about account/session risk, secure handling, token scope, and possible terms-of-service implications can encourage unsafe credential handling or reuse. In a market-trend skill that automates social-media access, this is more dangerous because users may routinely operationalize these secrets in scripts, logs, or shared environments.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The manifest advertises executable capabilities such as shell, network, file read/write, and environment access but does not declare any explicit tool scope or permissions boundaries. In a skill that can run local scripts and persist data, missing scope declarations weakens reviewability and increases the chance of over-privileged execution or accidental misuse.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description uses broad invocation language like 'use for stock analysis, portfolio tracking, crypto monitoring, trending stocks, or finding rumors before they hit mainstream' without clear activation constraints. Over-broad trigger language can cause the skill to be selected in contexts beyond user intent, which is riskier when the skill can access network, shell, and local files.

Content

No source excerpt is available for this finding.