Back to skill

Security audit

openai-whisper-api

Security checks for vulnerabilities and agentic risk

Overview

This skill is a small OpenAI transcription wrapper whose network and API-key use match its stated purpose, with privacy and credential-handling caveats.

Install only if you are comfortable sending selected audio files to OpenAI for transcription and storing or supplying an OpenAI API key. Avoid using it for highly sensitive recordings unless your OpenAI account, project permissions, and data-handling requirements allow that use.

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:78
Finding
Unquoted Optional curl Arguments Allow Argument and URL Injection<![CDATA[ ## Vulnerability Details **File Location**: `scripts/transcribe.sh`, lines 78–79 **Vulnerability Type**: Shell argument injection through unsafe parameter expansion **Risk Level**: High ### Vulnerable Code ```bash curl -sS https://api.openai.com/v1/audio/transcriptions \ -H "Authorization: Bearer $OPENAI_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" ``` ### Technical Analysis The optional `language` and `prompt` curl arguments are constructed using unquoted parameter expansions: ```bash ${language:+-F "language=${language}"} ${prompt:+-F "prompt=${prompt}"} ``` Because the outer expansions are not safely passed as array elements, attacker-controlled values are subject to shell word splitting and pathname expansion. Quote characters appearing within the replacement expression do not make this pattern equivalent to passing a preconstructed argument array. If an attacker can influence `--language` or `--prompt`, a crafted whitespace-delimited value may be interpreted as additional curl arguments rather than solely as multipart field content. This can modify curl behavior, introduce another URL, or manipulate output handling. The curl invocation applies the following authorization header globally: ```bash -H "Authorization: Bearer $OPENAI_API_KEY" ``` Consequently, an injected destination may receive the OpenAI API key if curl processes an attacker-selected URL while retaining the configured header. ### Attack Path 1. An attacker gains control over a value supplied to `--prompt` or `--language`, directly or through an application that invokes this script. 2. The attacker supplies a crafted value containing whitespace-separated curl arguments, such as options that introduce an additional URL. 3. The unquoted parameter expansion allows the shell to split the crafted v ...[truncated 1244 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Construct every curl argument using a Bash array so each user-controlled value remains exactly one argument: ```bash curl_args=( -sS --fail-with-body -H "Authorization: Bearer $OPENAI_API_KEY" -H "Accept: application/json" -F "file=@${in}" -F "model=${model}" -F "response_format=${response_format}" ) if [[ -n "$language" ]]; then curl_args+=(-F "language=${language}") fi if [[ -n "$prompt" ]]; then curl_args+=(-F "prompt=${prompt}") fi curl "${curl_args[@]}" \ "https://api.openai.com/v1/audio/transcriptions" \ >"$out" ``` Additional hardening measures: 1. Validate `language` against the expected language-code syntax or an explicit allowlist. 2. Apply reasonable length limits to `prompt`, `language`, and `model`. 3. Keep the destination URL fixed and separate from user-controlled arguments. 4. Use `--fail-with-body` so HTTP failures are not silently written as successful transcript files. 5. Write responses to a temporary file and rename it atomically only after curl succeeds. 6. Restrict the API key to the minimum required project permissions and configure usage limits. 7. Rotate the API key if this script has already processed values from untrusted sources. ]]>
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 (4)

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill exposes shell-based execution via a script invocation but does not declare any explicit tool scope such as permissions or allowed-tools. This weakens containment and reviewability because an agent may be able to invoke shell capabilities more broadly than users expect, increasing the risk of unintended command execution or misuse in environments that rely on manifest-declared restrictions.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill instructs users to send local audio files to OpenAI’s transcription endpoint but does not clearly warn that the audio content leaves the local environment and is transmitted to a third party. This creates a privacy and data-handling risk, especially if users process sensitive recordings without realizing they are being uploaded externally.

External Transmission

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

curl -sS https://api.openai.com/v1/audio/transcriptions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Accept: application/json" \
  -F "file=@${in}" \
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
This code uploads the input audio file, and optionally language/prompt metadata, to the OpenAI transcription endpoint. While the script checks for an API key, it provides no confirmation prompt, logging, or inline comment warning the user that local file contents are being sent off-system.

Static analysis

No suspicious patterns detected.