Back to skill

Security audit

optionwhales

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed API helper for option-flow data and AI trade reports, with normal credential and privacy risks but no evidence of hidden or destructive behavior.

Install only if you trust OptionWhales and the AI report service with your API keys, report requests, user identifier, and any orders JSON you explicitly provide. Prefer a pseudonymous user_id instead of an email where possible, use revocable least-privilege tokens, and rotate keys if you suspect redirects or logs may have exposed them.

Vulnerability Patterns
  • 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
  • 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 (3)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/optionflow.py:41
Finding

OptionWhales API Key May Be Forwarded During Cross-Origin Redirects

Content
View full analysis
dict: """Make an authenticated GET request to the Pro API.""" url = f"{API_BASE}{path}" req = urllib.request.Request(url, headers={"X-API-Key": api_key}) try: with urllib.request.urlopen(req, timeout=30) as resp: return json.loads(resp.read().decode()) ``` ### Technical Analysis The client attaches `OPTIONWHALES_API_KEY` to an HTTP request and passes it to `urllib.request.urlopen()`. Python's default URL opener automatically processes HTTP redirects, but this client does not verify that the final destination retains the original HTTPS scheme and hostname. Because the API key is added as a regular request header, redirect handling can copy it to a redirected request. If the trusted API endpoint is compromised or returns a malicious cross-origin redirect, the credential may be sent to an attacker-controlled destination. The initial destination is a fixed, documented HTTPS endpoint, and user-controlled path components cannot directly change its origin. Therefore, exploitation requires control of, or the ability to influence, a response from the trusted endpoint or its infrastructure. A DNS change alone would not normally be sufficient without a valid TLS certificate. ### Attack Path 1. A user configures a valid `OPTIONWHALES_API_KEY` and invokes `optionflow.py`. 2. The client sends an authenticated request to `https://api.optionwhales.io/v1`. 3. A compromised or malicious upstream endpoint responds with an HTTP redirect to an attacker-controlled HTTPS URL. 4. The default redirect handler follows the redirect without an application-level same-origin check. 5. The `X-API-Key` header is forwarded to the attacker-controlled service. 6. The at ...[truncated 660 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/aireport.py:45
Finding

AI Service Bearer Token May Be Forwarded During Cross-Origin Redirects

Content
View full analysis
dict: """Make an authenticated request to the AI service.""" url = f"{API_BASE}{path}" data = json.dumps(body).encode() if body else None req = urllib.request.Request(url, data=data, method=method) req.add_header("Authorization", f"Bearer {token}") if body: req.add_header("Content-Type", "application/json") try: with urllib.request.urlopen(req, timeout=60) as resp: return json.loads(resp.read().decode()) ``` ```python def api_request_raw(method: str, path: str, token: str) -> str: """Make an authenticated request and return raw text (for markdown).""" url = f"{API_BASE}{path}" req = urllib.request.Request(url, method=method) req.add_header("Authorization", f"Bearer {token}") try: with urllib.request.urlopen(req, timeout=60) as resp: return resp.read().decode() ``` ### Technical Analysis Both request functions add the reusable `AI_API_TOKEN` as an `Authorization: Bearer` header and then use the default `urllib` opener. The implementation does not reject redirects or verify that a redirect remains on `ai-service-production-b44b.up.railway.app`. A redirect response from a compromised trusted service can therefore cause the bearer token to be included in a request to another origin. The risk applies both to JSON API requests and raw Markdown artifact downloads. The initial API origin is fixed and uses HTTPS, so arbitrary CLI input cannot directly select another host. Exploitation requires influence over the trusted service's redirect response or associated infrastructure. ### Attack Path 1. A user configures a valid `AI_ ...[truncated 1022 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/aireport.py:145
Finding

Unencoded Query Parameters Permit HTTP Parameter Injection

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (29)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared purpose does not fully match the documented behavior: the skill also exposes account usage, service health/session status, and momentum endpoints not clearly captured by the top-level description. Security review and user consent often rely on the declared purpose, so this mismatch can hide the real data flows and operational reach of the skill.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

Current Flow Rankings

bash
curl -s -H "X-API-Key: $OPTIONWHALES_API_KEY" \
  "https://api.optionwhales.io/v1/flow/current" | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

Ticker Detail (Clusters + Time Series)

bash
curl -s -H "X-API-Key: $OPTIONWHALES_API_KEY" \
  "https://api.optionwhales.io/v1/flow/current/AAPL" | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

bash
# System health and session status
curl -s -H "X-API-Key: $OPTIONWHALES_API_KEY" \
  "https://api.optionwhales.io/v1/flow/sessions" | python3 -m json.tool

# Get a specific session's rankings

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

md
"https://api.optionwhales.io/v1/flow/sessions" | python3 -m json.tool

# Get a specific session's rankings
curl -s -H "X-API-Key: $OPTIONWHALES_API_KEY" \
  "https://api.optionwhales.io/v1/flow/2025-06-02" | python3 -m json.tool

# Get a specific ticker from a historical session

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

"https://api.optionwhales.io/v1/flow/2025-06-02" | python3 -m json.tool

Get a specific ticker from a historical session

curl -s -H "X-API-Key: $OPTIONWHALES_API_KEY"
"https://api.optionwhales.io/v1/flow/2025-06-02/AAPL" | python3 -m json.tool

text

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

Momentum Rankings

bash
curl -s -H "X-API-Key: $OPTIONWHALES_API_KEY" \
  "https://api.optionwhales.io/v1/momentum/rankings" | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

Momentum History

bash
curl -s -H "X-API-Key: $OPTIONWHALES_API_KEY" \
  "https://api.optionwhales.io/v1/momentum/AAPL/history" | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

bash
# Current session
curl -s -H "X-API-Key: $OPTIONWHALES_API_KEY" \
  "https://api.optionwhales.io/v1/abnormal-trades/current" | python3 -m json.tool

# Historical session

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

Account Usage

bash
curl -s -H "X-API-Key: $OPTIONWHALES_API_KEY" \
  "https://api.optionwhales.io/v1/account/usage" | python3 -m json.tool

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README explicitly shows commands that send a user identifier such as an email address to the AI Reports service, but it does not warn users about privacy implications, retention, sharing, or the need to avoid personal data where unnecessary. In an agent skill context, documentation strongly influences operator behavior, so this can lead to routine transmission of personally identifiable information to a third-party service without informed consent or minimization.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill documents use of environment variables, local helper scripts, and multiple outbound network calls, but it declares no explicit tool scope or permission boundaries. That creates an authorization gap where an agent may invoke broader capabilities than reviewers or users expect, increasing the chance of unintended data access or transmission.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The AI report examples send a user_id formatted as an email address to an external third-party AI service, but the skill provides no explicit privacy warning, consent language, or minimization guidance. This can lead to inadvertent disclosure of personally identifying information to an external processor during normal use.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
97% confidence
Finding

This example performs an outbound POST to an external AI service and includes user-identifying data (user_id) in the request body. In context, the transmission is part of the feature, but it is still security-relevant because it exports user-linked data to a third party and may trigger privacy, compliance, or consent issues.

Content

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

Generate a Report

bash
curl -s -X POST \
  -H "Authorization: Bearer $AI_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"user_id":"user@example.com","user_tier":"PRO","ticker":"TSLA","session_date":"2026-03-25","session_type":"live","large_orders":[]}' \

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
78% confidence
Finding

For a skill presented as option-flow intelligence and AI trade reporting, direct handling of an API bearer token and endpoints for quotas, eligibility, and health checks are infrastructure/account capabilities rather than core analytical behavior. These may be valid implementation details for backend integration, but they are not justified by the manifest as written because the manifest only frames analytical/reporting use cases.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest describes a skill for querying real-time option flow intelligence and generating AI-powered trade analysis reports. This CLI also exposes operational account/service capabilities such as quota inspection, eligibility prechecks, asynchronous job management, and per-user historical report retrieval, which extend beyond a straightforward option-flow query/report interface.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
import urllib.request
import urllib.error

API_BASE = "https://api.optionwhales.io/v1"


def get_api_key() -> str:

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
import urllib.request
import urllib.error

API_BASE = "https://api.optionwhales.io/v1"


def get_api_key() -> str:

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
import urllib.request
import urllib.error

API_BASE = "https://api.optionwhales.io/v1"


def get_api_key() -> str:

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
import urllib.request
import urllib.error

API_BASE = "https://api.optionwhales.io/v1"


def get_api_key() -> str:

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
import urllib.request
import urllib.error

API_BASE = "https://api.optionwhales.io/v1"


def get_api_key() -> str:

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
import urllib.request
import urllib.error

API_BASE = "https://api.optionwhales.io/v1"


def get_api_key() -> str:

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
import urllib.request
import urllib.error

API_BASE = "https://api.optionwhales.io/v1"


def get_api_key() -> str:

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
import urllib.request
import urllib.error

API_BASE = "https://api.optionwhales.io/v1"


def get_api_key() -> str:

Static analysis

No suspicious patterns detected.