Back to skill

Security audit

Access Finnhub API for real-time stock quotes, company news, market data, financial statements, and trading signals

Security checks for vulnerabilities and agentic risk

Overview

This is a documentation-only Finnhub integration skill with a real API-key handling caution but no hidden execution, persistence, or unrelated data access.

Use a restricted Finnhub key if possible, store it with owner-only permissions, avoid pasting expanded URLs into logs or support tickets, and rotate the key if it may have appeared in command output, telemetry, or proxy logs.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:49
Finding

API Credential Exposed Through URL Query Parameters

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 49–55
Vulnerability Type: API credential exposure through command-line URL expansion
Risk Level: Medium

Vulnerable Code

markdown
All requests require `?token=${FINNHUB_API_KEY}` parameter.

### Stock Quotes (Real-time)

Get current stock price:

```bash
curl "https://finnhub.io/api/v1/quote?symbol=AAPL&token=${FINNHUB_API_KEY}"
text

This pattern is repeated throughout the documented API examples.

### Technical Analysis

The examples place `FINNHUB_API_KEY` in a URL query parameter passed directly to `curl`. The shell expands the environment variable before starting the process, causing the resulting command-line URL to contain the plaintext credential.

Although HTTPS protects the request while it is in transit, it does not protect the expanded token from local process inspection, shell or execution tracing, command telemetry, HTTP client diagnostics, proxy logs, or server-side URL access logs. Query parameters are also more likely than authorization headers to be retained by monitoring infrastructure.

The examples preserve the variable reference in shell history under ordinary interactive use, but the expanded value may remain visible in process arguments while `curl` is running. The network destination is the declared Finnhub service, so this is an insecure credential-handling issue rather than unrelated exfiltration.

### Attack Path

1. A user configures `FINNHUB_API_KEY` and executes one of the documented `curl` commands.
2. The shell expands `${FINNHUB_API_KEY}` into the command-line URL.
3. A local user, process-monitoring service, diagnostic tool, proxy, or URL-logging component captures the expanded command or request URL.
4. An attacker extracts the Finnhub API token from the recorded URL.
5. The attacker submits requests to Finnhub using the stolen token until it is revoked or expires.

### Impact Assessment

An at
...[truncated 576 chars]
Remediation
View remediation

Remediation Suggestions

  1. Prefer a supported authorization header or another authentication mechanism that does not place the token in the URL.
  2. If Finnhub requires query-string authentication, use a client implementation that avoids exposing the completed URL through process arguments.
  3. Disable verbose shell tracing and HTTP debug logging when credentials are present.
  4. Configure application, proxy, telemetry, and server logs to redact the token query parameter.
  5. Restrict access to process information and diagnostic logs according to least privilege.
  6. Store ~/.openclaw/.env with owner-only permissions, such as mode 0600, and avoid duplicating the credential across both apiKey and env configuration fields unless required.
  7. Rotate any key suspected of appearing in process captures, telemetry, or URL logs.
  8. Add an explicit warning to the documentation explaining that API tokens must never be pasted directly into commands, source files, issue reports, or logs.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
60% 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 · SKILL.md (reported line 58)May include surrounding context.

Get current stock price:

bash
curl "https://finnhub.io/api/v1/quote?symbol=AAPL&token=${FINNHUB_API_KEY}"

Returns: c (current price), h (high), l (low), o (open), pc (previous close), t (timestamp)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation repeatedly instructs users to place the FINNHUB_API_KEY directly in URL query strings. Query-string credentials are commonly exposed through shell history, terminal scrollback, proxy/server logs, browser history, process listings, and monitoring systems, which can lead to credential disclosure even when the API itself uses HTTPS. In this skill context, the risk is real because the examples are meant to be copied verbatim by users.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.