Back to skill

Security audit

Cloudflare Whisper Worker

Security checks for vulnerabilities and agentic risk

Overview

The skill’s transcription purpose is clear, but its helper script can send both the audio file and bearer token to any URL supplied at runtime.

Review before installing. Use this only with audio you are comfortable sending to the stated remote service, protect WHISPER_WORKER_TOKEN as a secret, and avoid using the helper script’s optional URL argument unless the package is changed to enforce an allowlisted HTTPS endpoint.

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:4
Finding
Attacker-Controlled Destination Can Receive the Bearer Token and Audio Data## Vulnerability Details **File Location**: `scripts/transcribe.sh`, lines 4–10 and 34–39 **Vulnerability Type**: Unvalidated destination URL causing credential and data disclosure **Risk Level**: High ### Vulnerable Code ```bash if [[ $# -lt 1 ]]; then echo "Usage: $0 <audio-file> [url]" exit 1 fi FILE="$1" URL="${2:-https://lotfi-whisper-worker.medtouradmin.workers.dev/transcribe}" ``` ```bash curl -sS -X POST "$URL" \ -H "content-type: $ctype" \ -H "authorization: Bearer $WHISPER_WORKER_TOKEN" \ --data-binary "@$FILE" \ | jq -r '.result.text // .text // .result.response // empty' ``` ### Technical Analysis The script accepts an optional second command-line argument and uses it directly as the destination supplied to `curl`. It does not restrict the URL scheme or validate the destination hostname against the documented Cloudflare Worker. Every request includes the `WHISPER_WORKER_TOKEN` bearer credential and the complete contents of the selected audio file. Consequently, anyone able to influence the script invocation can redirect both assets to an arbitrary server. A non-HTTPS URL can additionally expose them to network interception. This is not shell command injection because `"$URL"` is quoted. The vulnerability is instead an unsafe trust-boundary decision: attacker-controlled input determines which origin receives sensitive authentication and user data. ### Attack Path 1. An attacker persuades a user or agent to invoke the script with an attacker-controlled URL as its second argument. 2. The user has a valid `WHISPER_WORKER_TOKEN` in the environment and selects an audio file for transcription. 3. The script assigns the supplied URL to `URL` without scheme or hostname validation. 4. `curl` sends the bearer token in the `Authorization` header and uploads the complete audio file to that destination. 5. The attacker records the credential and audio data. 6. The attacker may re ...[truncated 779 chars]
Remediation
## Remediation Suggestions 1. Remove the optional URL argument and hardcode the documented endpoint: ```bash URL="https://lotfi-whisper-worker.medtouradmin.workers.dev/transcribe" ``` 2. If endpoint overrides are operationally necessary, require HTTPS and enforce an exact hostname and path allowlist before attaching credentials. 3. Reject URLs containing alternate schemes, unexpected ports, embedded credentials, redirects to untrusted origins, or non-allowlisted hosts. 4. Configure `curl` to use HTTPS-only protocols and fail on HTTP errors: ```bash curl --proto '=https' --fail-with-body --silent --show-error ... ``` 5. Avoid forwarding authorization headers across redirects. Prefer disabling redirects; if redirects are required, validate the final destination and ensure credentials are never sent to another origin. 6. Rotate any token suspected of having been used with an untrusted URL and apply least-privilege scope, expiration, and usage limits to future tokens. 7. Clearly notify users that transcription uploads the selected audio to an external service.
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 (5)

Lp3

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding
The skill invokes shell-based network actions but does not declare an explicit tool scope or allowed-tools boundary. That increases the chance an agent can use broader shell capability than intended, making it harder to constrain execution and review what external actions the skill is permitted to perform.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill instructs users to upload raw audio and a bearer token to a third-party remote endpoint without any privacy, retention, or consent warning. Audio content may contain sensitive personal or business information, and users are not informed that data leaves the local environment or how the remote service handles it.

External Transmission

Medium
Category
Data Exfiltration
Content
## Transcribe a file (JSON response)

```bash
curl -sS -X POST "https://lotfi-whisper-worker.medtouradmin.workers.dev/transcribe" \
  -H "content-type: audio/wav" \
  -H "authorization: Bearer $WHISPER_WORKER_TOKEN" \
  --data-binary "@audio.wav"
Confidence
92% confidence
Finding
This command performs external transmission of user-supplied audio to a remote Cloudflare Worker while attaching a bearer token for authorization. Even if intended functionality is transcription, it creates data exfiltration and credential exposure risk if used with sensitive files, untrusted endpoints, or in environments where command history/logging may capture details.

External Transmission

Medium
Category
Data Exfiltration
Content
*) ctype="application/octet-stream" ;;
esac

curl -sS -X POST "$URL" \
  -H "content-type: $ctype" \
  -H "authorization: Bearer $WHISPER_WORKER_TOKEN" \
  --data-binary "@$FILE" \
Confidence
70% 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
96% confidence
Finding
The script performs an HTTP POST that uploads the provided audio file to a remote transcription service, which can affect user privacy by transmitting potentially sensitive audio data off-system. While the usage string shows required arguments, there is no explicit warning, confirmation, or user-facing disclosure near the network operation about the upload behavior.

Static analysis

No suspicious patterns detected.