Back to skill

Security audit

openai-whisper-api

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it claims, but its custom API endpoint setting can send both the user's audio and OpenAI API key to an arbitrary configured URL without validation.

Install only if you understand that selected recordings and prompt text will be uploaded to the configured transcription endpoint. Avoid using OPENAI_BASE_URL unless you fully trust that gateway, and do not point it at HTTP or third-party endpoints with your primary OpenAI API key.

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

Error
Location
scripts/transcribe.sh:69
Finding
Unrestricted API Base URL Can Expose the API Key and Audio Data<![CDATA[ ## Vulnerability Details **File Location**: `scripts/transcribe.sh`, lines 69–108 **Vulnerability Type**: Unvalidated external endpoint configuration and sensitive-data disclosure **Risk Level**: High ### Vulnerable Code ```bash api_base="${OPENAI_BASE_URL:-https://api.openai.com/v1}" api_base="${api_base%/}" request_format="text" if [[ "$json_output" == "1" ]]; then request_format="json" fi diarize=0 case "$model" in gpt-4o-transcribe | gpt-4o-mini-transcribe | gpt-4o-mini-transcribe-*) request_format="json" ;; gpt-4o-transcribe-diarize) diarize=1 request_format="diarized_json" ;; esac if [[ "$diarize" == "1" && "$prompt" != "" ]]; then echo "--prompt is not supported with gpt-4o-transcribe-diarize" >&2 exit 2 fi target="$out" tmp="" if [[ "$json_output" == "0" && ( "$request_format" == "json" || "$request_format" == "diarized_json" ) ]]; then tmp="$(mktemp)" trap '[[ "$tmp" == "" ]] || rm -f "$tmp"' EXIT target="$tmp" fi curl_args=( -sS "${api_base}/audio/transcriptions" -H "Authorization: Bearer $OPENAI_API_KEY" -H "Accept: application/json" -F "file=@${in}" -F "model=${model}" -F "response_format=${request_format}" ) ``` The corresponding configurable-proxy behavior is documented in `SKILL.md` at lines 29 and 58. ### Technical Analysis The script obtains the transcription endpoint directly from the environment variable `OPENAI_BASE_URL`. It removes a trailing slash but performs no validation of the URL scheme, destination host, port, or embedded credentials. The resulting endpoint is passed to `curl` together with two sensitive assets: 1. `OPENAI_API_KEY`, transmitted in the `Authorization` header. 2. The complete user-selected audio file, transmitted as multipart form data. Consequently, any party capable of controlling the process environment or active OpenClaw configuration can redirect the request to an arbitrary server. The implementation also permits plaintext `http://` endpoints, ...[truncated 1897 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Require HTTPS for all remote transcription endpoints and reject plaintext HTTP URLs. 2. Allowlist trusted endpoint hosts, with `api.openai.com` as the default. If custom gateways are required, maintain an explicit administrator-controlled allowlist. 3. Parse and validate the URL before invoking `curl`. Reject malformed URLs, embedded usernames or passwords, unexpected schemes, and disallowed ports. 4. Do not automatically forward `OPENAI_API_KEY` to arbitrary OpenAI-compatible gateways. Support a separate gateway-specific credential, such as `OPENAI_PROXY_API_KEY`. 5. Require explicit user confirmation when a non-default endpoint will receive an audio file, and clearly display the destination host without revealing credentials. 6. Consider rejecting environment-based endpoint overrides in privileged or automated execution contexts unless they originate from a trusted configuration source. 7. Add tests confirming that HTTP URLs, embedded credentials, malformed URLs, and unapproved hosts are rejected. 8. Document the trust implications of custom gateways and advise users that both audio content and authentication credentials may be disclosed to the configured provider. A hardened implementation should validate the endpoint before constructing the request, for example by using a dedicated URL parser and comparing its protocol and hostname against an explicit policy. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

External Model or Provider Selection

High
Category
Excessive Agency
Content
## Useful flags

```bash
{baseDir}/scripts/transcribe.sh /path/to/audio.ogg --model gpt-4o-transcribe --out /tmp/transcript.txt
{baseDir}/scripts/transcribe.sh /path/to/audio.ogg --model gpt-4o-mini-transcribe
{baseDir}/scripts/transcribe.sh /path/to/audio.ogg --model gpt-4o-transcribe-diarize --json
{baseDir}/scripts/transcribe.sh /path/to/audio.ogg --model whisper-1
Confidence
90% confidence
Finding
Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

External Model or Provider Selection

High
Category
Excessive Agency
Content
```bash
{baseDir}/scripts/transcribe.sh /path/to/audio.ogg --model gpt-4o-transcribe --out /tmp/transcript.txt
{baseDir}/scripts/transcribe.sh /path/to/audio.ogg --model gpt-4o-mini-transcribe
{baseDir}/scripts/transcribe.sh /path/to/audio.ogg --model gpt-4o-transcribe-diarize --json
{baseDir}/scripts/transcribe.sh /path/to/audio.ogg --model whisper-1
{baseDir}/scripts/transcribe.sh /path/to/audio.m4a --language en
Confidence
90% confidence
Finding
Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

External Model or Provider Selection

High
Category
Excessive Agency
Content
```bash
{baseDir}/scripts/transcribe.sh /path/to/audio.ogg --model gpt-4o-transcribe --out /tmp/transcript.txt
{baseDir}/scripts/transcribe.sh /path/to/audio.ogg --model gpt-4o-mini-transcribe
{baseDir}/scripts/transcribe.sh /path/to/audio.ogg --model gpt-4o-transcribe-diarize --json
{baseDir}/scripts/transcribe.sh /path/to/audio.ogg --model whisper-1
{baseDir}/scripts/transcribe.sh /path/to/audio.m4a --language en
{baseDir}/scripts/transcribe.sh /path/to/audio.m4a --prompt "Speaker names: Peter, Daniel"
Confidence
90% confidence
Finding
Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Lp3

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding
The skill documents shell-based execution (`scripts/transcribe.sh`, `curl`, `node`) but does not declare an explicit tool scope such as permissions or allowed-tools. That omission can cause users or orchestrators to underestimate the skill's ability to execute commands and transmit local files, increasing the risk of unintended shell access and data handling without clear consent boundaries.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill interfaces with a remote transcription endpoint and accepts both local audio and optional prompt text, but the description does not clearly warn that these inputs are uploaded off-host. Users may provide sensitive recordings, names, or contextual prompts under the false assumption that processing is local, leading to unintended disclosure of private or regulated data.

External Transmission

Medium
Category
Data Exfiltration
Content
mkdir -p "$(dirname "$out")"

api_base="${OPENAI_BASE_URL:-https://api.openai.com/v1}"
api_base="${api_base%/}"

request_format="text"
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Static analysis

No suspicious patterns detected.