Back to skill

Security audit

Deepgram Asr

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its Deepgram transcription purpose, but it should be reviewed because its API call is constructed incorrectly and may mishandle the Deepgram API key.

Review or fix the curl command before installing. Only use this skill for audio you are comfortable sending to Deepgram, use a narrowly scoped Deepgram key with billing limits where possible, and rotate the key if this script has already been run in an environment where command errors or proxy logs may have captured arguments.

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:106
Finding
Incorrect curl End-of-Options Placement Can Expose the API Key and Break Requests<![CDATA[ ## Vulnerability Details **File Location**: `scripts/transcribe.sh`, lines 106–110 **Vulnerability Type**: Improper command-line option construction and potential credential exposure **Risk Level**: Medium ### Vulnerable Code ```bash # Call API (-- prevents option injection from filenames starting with -) http_code=$(curl -sS -w '%{http_code}' -o "$tmpfile" -- "$url" \ -H "Authorization: Token $DEEPGRAM_API_KEY" \ -H "Content-Type: ${mime}" \ --data-binary "@${in}") ``` ### Technical Analysis The `--` argument terminates curl option parsing, but it is placed before the request headers and `--data-binary` option. Arguments following the end-of-options marker can therefore be interpreted as URL operands rather than curl options. As a result: - The authorization header may not be attached to the intended Deepgram request. - The audio file may not be submitted as the HTTP request body. - The expanded `Authorization: Token $DEEPGRAM_API_KEY` argument may enter curl URL parsing, diagnostic output, or proxy-related processing. - The transcription request is likely to fail or behave inconsistently. The comment states that `--` protects against option injection through filenames. That protection is appropriate, but the marker must appear immediately before the URL after all curl options have been supplied. The audio filename is already passed as part of the quoted `--data-binary` argument and should remain before the marker. No remote script retrieval or `curl | bash` execution was found. The reviewed network operation is intended to upload audio to the declared Deepgram API, but this implementation error exceeds the necessary exposure of the API credential. ### Attack Path 1. A user configures `DEEPGRAM_API_KEY` and invokes the documented transcription script. 2. The shell expands the API key inside the authorization argument. 3. Curl encounters `--` before the authorization and body options, ending option parsing. 4. Curl may process `-H`, th ...[truncated 1191 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Move the end-of-options marker so that all curl options precede it and the destination URL is the final operand: ```bash http_code=$(curl -sS -w '%{http_code}' -o "$tmpfile" \ -H "Authorization: Token $DEEPGRAM_API_KEY" \ -H "Content-Type: ${mime}" \ --data-binary "@${in}" \ -- "$url") ``` Additional hardening measures: 1. Add an automated test using a mocked curl executable to verify that: - Exactly one URL is requested. - The URL uses HTTPS and targets `api.deepgram.com`. - The API key is supplied only through the authorization header. - The input file is supplied as the value of `--data-binary`. 2. Ensure tests cover input and output filenames beginning with `-`, containing spaces, and containing shell metacharacters. 3. Avoid logging the complete curl argument vector or authorization header. 4. Use a narrowly scoped Deepgram API key with billing or usage limits where supported. 5. Rotate the API key if the defective command has been executed in an environment where curl diagnostics, shell tracing, or proxy logs may have captured it. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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 Script Fetching

High
Category
Supply Chain
Content
trap 'rm -f "$tmpfile"' EXIT

# Call API (-- prevents option injection from filenames starting with -)
http_code=$(curl -sS -w '%{http_code}' -o "$tmpfile" -- "$url" \
  -H "Authorization: Token $DEEPGRAM_API_KEY" \
  -H "Content-Type: ${mime}" \
  --data-binary "@${in}")
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill advertises shell-based execution via a script but does not declare any explicit tool scope such as permissions or allowed-tools. That creates an avoidable trust and policy gap: an agent may invoke shell capabilities without a clear least-privilege contract, increasing the chance of unintended command execution or broader filesystem/network access than reviewers expect.

External Transmission

Medium
Category
Data Exfiltration
Content
esac

# Build URL
url="https://api.deepgram.com/v1/listen?model=${model}&smart_format=true&punctuate=true"
if [[ -n "$language" ]]; then
  url="${url}&language=${language}"
fi
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
esac

# Build URL
url="https://api.deepgram.com/v1/listen?model=${model}&smart_format=true&punctuate=true"
if [[ -n "$language" ]]; then
  url="${url}&language=${language}"
fi
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
94% confidence
Finding
The script uploads the provided audio file to Deepgram via an HTTP request, which transmits potentially sensitive user data off the local system. While this behavior is inferable from the script's purpose, there is no explicit confirmation prompt or user-facing disclosure near execution that the audio content will be sent to a third-party service.

External Transmission

Medium
Category
Data Exfiltration
Content
trap 'rm -f "$tmpfile"' EXIT

# Call API (-- prevents option injection from filenames starting with -)
http_code=$(curl -sS -w '%{http_code}' -o "$tmpfile" -- "$url" \
  -H "Authorization: Token $DEEPGRAM_API_KEY" \
  -H "Content-Type: ${mime}" \
  --data-binary "@${in}")
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.