Back to skill

Security audit

ANY WHISPER API

Security checks for vulnerabilities and agentic risk

Overview

This transcription skill is purpose-aligned, but it can send audio and an API key to any configured Whisper server, including insecure or unintended hosts, without enough validation or warning.

Review this skill before installing. Use it only with a trusted HTTPS endpoint or a truly local server, and avoid sending a production OpenAI API key to custom Whisper servers. Treat submitted recordings as sensitive data because the skill uploads the complete file to the configured API host.

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
scripts/transcribe.sh:73
Finding

Unvalidated and Unquoted API Host Can Expose Audio and Bearer Credentials

Content
View full analysis

Vulnerability Details

File Location: scripts/transcribe.sh:73-82
Vulnerability Type: Unrestricted sensitive-data destination, plaintext transport, and curl argument injection
Risk Level: Medium

bash
curl -sS ${WHISPER_API_HOST:-https://api.openai.com}/v1/audio/transcriptions \
  -H "Authorization: Bearer $WHISPER_API_KEY" \
  -H "Accept: application/json" \
  -F "file=@${in}" \
  -F "model=${model}" \
  -F "response_format=${response_format}" \
  ${language:+-F "language=${language}"} \
  ${prompt:+-F "prompt=${prompt}"} \
  >"$out"

echo "$out"

Technical Analysis

WHISPER_API_HOST is used directly as the destination for a request containing both the API bearer credential and the selected audio file. The script does not validate the URL scheme, hostname, port, or trust boundary. Consequently, it permits plaintext HTTP and arbitrary remote destinations.

The host expansion is also unquoted:

bash
${WHISPER_API_HOST:-https://api.openai.com}/v1/audio/transcriptions

Bash therefore applies word splitting and pathname expansion to a configured value. A value containing whitespace and curl options can introduce additional command-line arguments and alter curl's request behavior. Although this does not create direct shell metacharacter execution, it can manipulate curl options, destinations, configuration loading, or output handling.

The documentation explicitly demonstrates an HTTP endpoint on a local network. Bearer credentials and audio sent to such an endpoint are not protected against interception by parties capable of observing or manipulating that network.

Attack Path

  1. An attacker influences WHISPER_API_HOST through inherited environment configuration, Skill configuration, deployment settings, or social engineering.
  2. The attacker sets it to a malicious HTTPS server, a plaintext HTTP endpoint, or a value containing whitespace followed by curl options.

...[truncated 1294 chars]

Remediation
View remediation

Remediation Suggestions

  1. Store the host in a variable and always quote the completed URL:

    bash
    api_host="${WHISPER_API_HOST:-https://api.openai.com}"
    endpoint="${api_host%/}/v1/audio/transcriptions"
    
    curl --fail-with-body --silent --show-error \
      "$endpoint" \
      -H "Authorization: Bearer $WHISPER_API_KEY" \
      -H "Accept: application/json" \
      -F "file=@${in}" \
      -F "model=${model}" \
      -F "response_format=${response_format}" \
      >"$out"
    
  2. Validate that the URL uses HTTPS. If plaintext HTTP is needed for local development, restrict it to explicit loopback addresses such as 127.0.0.1, localhost, or ::1, and require an explicit insecure-development option.

  3. Consider an allowlist of approved Whisper API hosts, especially in managed or automated environments.

  4. Reject host values containing whitespace, control characters, embedded credentials, fragments, or unsupported schemes. Parse the URL with a suitable URL parser rather than relying only on a regular expression.

  5. Use separate, least-privileged credentials for each custom Whisper server. Do not send a production OpenAI API key to third-party or locally operated endpoints that do not require it.

  6. Add --fail-with-body so HTTP error responses cause a nonzero exit status, and write responses to a temporary file before atomically replacing the requested output. This prevents failed or attacker-controlled responses from silently appearing to be successful transcripts.

  7. Update SKILL.md to clearly warn that a custom host receives the complete audio file, prompt, and authorization credential, and that non-loopback HTTP endpoints expose them in plaintext.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill sends user-provided audio to a configurable Whisper API endpoint, including potentially local or third-party servers, but the description does not clearly warn users that their audio leaves the local environment. This can cause unintentional disclosure of sensitive spoken content, especially because WHISPER_API_HOST is arbitrary and may point to untrusted infrastructure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script uploads the provided audio file to a remote transcription endpoint via curl, but it does not present an explicit warning, confirmation, or consent step at the point of transmission. This can cause users to unknowingly send sensitive audio content and metadata to an external service, especially since the host is configurable and may point to third-party or non-local servers.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
SKILL.md:43