T09 · Insecure Skill Coding Practices
- 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: MediumVulnerable 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
- Prefer a supported authorization header or another authentication mechanism that does not place the token in the URL.
- If Finnhub requires query-string authentication, use a client implementation that avoids exposing the completed URL through process arguments.
- Disable verbose shell tracing and HTTP debug logging when credentials are present.
- Configure application, proxy, telemetry, and server logs to redact the
tokenquery parameter. - Restrict access to process information and diagnostic logs according to least privilege.
- Store
~/.openclaw/.envwith owner-only permissions, such as mode0600, and avoid duplicating the credential across bothapiKeyandenvconfiguration fields unless required. - Rotate any key suspected of appearing in process captures, telemetry, or URL logs.
- Add an explicit warning to the documentation explaining that API tokens must never be pasted directly into commands, source files, issue reports, or logs.
