Back to skill

Security audit

Deepgram Voice Workflow

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Deepgram voice workflow, but it needs Review because it automatically uses a root-scoped credential file and has unsafe default temporary-file handling on shared or privileged hosts.

Review before installing. Use an explicitly provided, least-privilege DEEPGRAM_API_KEY, avoid relying on /root/.openclaw/.env, do not run these scripts as root, and set private explicit output directories with restrictive permissions. Assume input audio, reply text, transcripts, and generated speech are sent to Deepgram or written locally.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/deepgram-transcribe.sh:70
Finding

Deepgram API Token Exposed Through Process Arguments

Content
View full analysis
"$json_out" ``` ```bash # scripts/deepgram-tts.sh:59-62 curl -sS --max-time 120 "https://api.deepgram.com/v1/speak?model=${model}" \ -H "Authorization: Token ${DEEPGRAM_API_KEY}" \ -H 'Content-Type: application/json' \ --data "$payload" > "$out" ``` ### Technical Analysis Both scripts interpolate `DEEPGRAM_API_KEY` directly into a `curl` command-line argument. The resulting authorization header can therefore be present in the process argument vector while the request is running. Depending on operating-system process visibility controls, command-line arguments may be accessible through process inspection interfaces such as `/proc//cmdline`, `ps`, monitoring software, diagnostic tooling, or process accounting. The exposure window is longer for large audio uploads or slow network requests. The token is not hardcoded in the project, but handling an environment-supplied secret this way unnecessarily transfers it into a more observable channel. ### Attack Path 1. An attacker obtains local process-inspection capability, such as access under the same service account or access permitted by the host's `/proc` configuration. 2. The victim starts either Deepgram script with a valid `DEEPGRAM_API_KEY`. 3. While `curl` is uploading audio or requesting generated speech, the attacker repeatedly enumerates running processes. 4. The attacker reads the `curl` argument vector and extracts the ...[truncated 812 chars]
Remediation
View remediation
"$config_file" curl --config "$config_file" \ -sS --max-time 120 \ "https://api.deepgram.com/v1/listen?model=${model}&smart_format=true&language=${language}&punctuate=true" \ -H "Content-Type: ${content_type}" \ --data-binary @"${in}" > "$json_out" ``` ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/neko-voice-pipeline.sh:42
Finding

Predictable Shared Temporary Paths Permit Symlink-Based File Overwrite

Content
View full analysis
/dev/null ``` The pipeline may also create a predictable reply path inside the same directory: ```bash # scripts/neko-voice-pipeline.sh:52-56 reply_mp3="" if [[ "$reply" != "" ]]; then reply_mp3="$out_dir/reply.mp3" "$script_dir/deepgram-tts.sh" "$reply" --out "$reply_mp3" >/dev/null fi ``` The standalone TTS script uses a timestamp-based shared temporary path: ```bash # scripts/deepgram-tts.sh:50-54 if [[ "$out" == "" ]]; then out="/tmp/deepgram-tts-$(date +%Y%m%d-%H%M%S).mp3" fi mkdir -p "$(dirname "$out")" ``` The TTS response is subsequently written using ordinary shell redirection: ```bash # scripts/deepgram-tts.sh:59-62 curl -sS --max-time 120 "https://api.deepgram.com/v1/speak?model=${model}" \ -H "Authorization: Token ${DEEPGRAM_API_KEY}" \ -H 'Content-Type: application/json' \ --data "$payload" > "$out" ``` ### Technical Analysis The pipeline derives its default directory from an attacker-influenced input basename and places it directly under the shared `/tmp` directory. The standalone TTS script derives its default output from a timestamp with one-second precision. Neither construction provides unpredictable, exclusive creation. `mkdir -p` accepts an already-existing directory and may traverse an existing symbolic link to a directory. Subsequent file operations use normal path resolution a ...[truncated 2972 chars]
Remediation
View remediation
` redirection where practical. - Avoid running the scripts as root. Use a dedicated service account with access only to the required input and output locations. - If outputs must persist, create a private application-owned storage directory outside shared `/tmp`. Example pipeline hardening pattern: ```bash umask 077 if [[ -z "$out_dir" ]]; then out_dir="$(mktemp -d "${TMPDIR:-/tmp}/neko-voice.XXXXXXXX")" else if [[ -L "$out_dir" ]]; then echo "Refusing symbolic-link output directory: $out_dir" >&2 exit 1 fi mkdir -m 700 -p -- "$out_dir" fi transcript_out="$out_dir/transcript.txt" if [[ -e "$transcript_out" || -L "$transcript_out" ]]; then echo "Refusing pre-existing transcript output: $transcript_out" >&2 exit 1 fi ``` Example standalone TTS default: ```bash umask 077 temp_dir="$(mktemp -d "${TMPDIR:-/tmp}/deepgram-tts.XXXXXXXX")" out="$temp_dir/reply.mp3" ``` For stronger protection, open destination files with exclusive, no-follow semantics through a small helper implemented in a language that exposes `O_CREAT | O_EXCL | O_NOFOLLOW`, then pass the already-open descriptor to the writing process. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (22)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The description presents a broader bidirectional voice pipeline with both STT and TTS and possible messaging-platform automation. This code chunk only performs TTS from text to an MP3 via Deepgram's speak API. It does not transcribe audio, ingest voice messages, or integrate with Telegram, QQ, or OneBot. While TTS is part of the declared purpose, the declared description materially overstates the implemented functionality for this specific code chunk.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

The script accesses a root-scoped .env file to obtain credentials, which is a form of credential access beyond the minimum necessary interface for a simple transcription helper. In agent or automation contexts, this can blur trust boundaries and allow the script to operate with secrets inherited from the host rather than explicitly granted by the caller.

Content

Scanner excerpt · scripts/deepgram-transcribe.sh (reported line 54)May include surrounding context.

sh
exit 1
fi

if [[ "${DEEPGRAM_API_KEY:-}" == "" && -f /root/.openclaw/.env ]]; then
  export DEEPGRAM_API_KEY="$(sed -n 's/^DEEPGRAM_API_KEY=//p' /root/.openclaw/.env | tail -n1)"
fi

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

The sed extraction on the root .env file operationalizes unauthorized secret discovery behavior if the script is run in an environment containing broader host credentials. Although the secret is used for the advertised API call, silently harvesting it from a privileged location increases the blast radius if the skill is executed by automation.

Content

Scanner excerpt · scripts/deepgram-transcribe.sh (reported line 55)May include surrounding context.

sh
fi

if [[ "${DEEPGRAM_API_KEY:-}" == "" && -f /root/.openclaw/.env ]]; then
  export DEEPGRAM_API_KEY="$(sed -n 's/^DEEPGRAM_API_KEY=//p' /root/.openclaw/.env | tail -n1)"
fi

if [[ "${DEEPGRAM_API_KEY:-}" == "" ]]; then

Credential Access

High
Category
Privilege Escalation
Confidence
93% confidence
Finding

The script probes a privileged local secret store under /root/.openclaw/.env and extracts a credential for use. Accessing credentials from a root-scoped path is a strong indicator of credential harvesting capability, and in an agent skill this broadens trust assumptions significantly beyond simple TTS processing.

Content

Scanner excerpt · scripts/deepgram-tts.sh (reported line 39)May include surrounding context.

sh
esac
done

if [[ "${DEEPGRAM_API_KEY:-}" == "" && -f /root/.openclaw/.env ]]; then
  export DEEPGRAM_API_KEY="$(sed -n 's/^DEEPGRAM_API_KEY=//p' /root/.openclaw/.env | tail -n1)"
fi

Credential Access

High
Category
Privilege Escalation
Confidence
93% confidence
Finding

The extraction command reads DEEPGRAM_API_KEY from a root-owned .env file and exports it into the process environment. This is dangerous because it operationalizes unauthorized host-secret access and could normalize secret consumption from locations unrelated to the user's explicit configuration for this script.

Content

Scanner excerpt · scripts/deepgram-tts.sh (reported line 40)May include surrounding context.

sh
done

if [[ "${DEEPGRAM_API_KEY:-}" == "" && -f /root/.openclaw/.env ]]; then
  export DEEPGRAM_API_KEY="$(sed -n 's/^DEEPGRAM_API_KEY=//p' /root/.openclaw/.env | tail -n1)"
fi

if [[ "${DEEPGRAM_API_KEY:-}" == "" ]]; then

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding

The skill advertises shell execution, environment-variable use, and file read/write behavior but does not declare an explicit tool scope such as permissions or allowed-tools. That omission weakens reviewability and can cause the skill to run with broader capabilities than users or orchestrators expect, especially since it references shell scripts and secret-bearing environment variables.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs users to send audio and text to Deepgram but does not clearly disclose that potentially sensitive voice content, transcripts, and reply text are transmitted to an external third-party service. In the context of voice-message automation for chat platforms, this can expose personal, confidential, or regulated data without informed consent or proper handling expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

These notes specify default language/voice behavior that may force Chinese transcription and an English speaking voice regardless of user preference. The file does not frame this as an opt-in regional tool or explicitly offer a language/locale choice at the skill-description level.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The markdown sets language: zh as a default but does not mention that users can choose another language or that the locale restriction is required for a specific regional use case. This creates a natural-language policy concern because it imposes a language setting without documented user opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The default language is hard-coded to "zh", which imposes a specific locale choice unless the user explicitly overrides it with --language. This is a natural-language policy concern because the skill does not offer a neutral default or prompt the user to choose their preferred language.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script automatically reads a Deepgram API key from a hard-coded sensitive path under /root if the environment variable is unset. This creates an unexpected credential access behavior and couples the skill to privileged local secrets, which is risky in shared or agent-driven environments because the script may consume credentials the caller did not intend to expose.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/deepgram-transcribe.sh (reported line 70)May include surrounding context.

sh
mkdir -p "$(dirname "$out")"
json_out="${out}.json"

curl -sS --max-time 120 "https://api.deepgram.com/v1/listen?model=${model}&smart_format=true&language=${language}&punctuate=true" \
  -H "Authorization: Token ${DEEPGRAM_API_KEY}" \
  -H "Content-Type: ${content_type}" \
  --data-binary @"${in}" > "$json_out"

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/deepgram-transcribe.sh (reported line 70)May include surrounding context.

sh
mkdir -p "$(dirname "$out")"
json_out="${out}.json"

curl -sS --max-time 120 "https://api.deepgram.com/v1/listen?model=${model}&smart_format=true&language=${language}&punctuate=true" \
  -H "Authorization: Token ${DEEPGRAM_API_KEY}" \
  -H "Content-Type: ${content_type}" \
  --data-binary @"${in}" > "$json_out"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script performs a network upload of the input audio file to an external transcription API using curl, which can transmit potentially sensitive user data off-system. There is no confirmation prompt or user-facing disclosure near the operation, and the usage text does not warn that the audio will be sent to a third-party service.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script silently falls back to reading a hardcoded credential file at /root/.openclaw/.env to obtain DEEPGRAM_API_KEY. This expands the skill's privilege boundary beyond its stated TTS function and can cause it to use host secrets without explicit user awareness or consent, which is especially risky in shared or agent-driven environments.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Reading an API credential from a local .env file without user-facing disclosure is a security-relevant hidden behavior. It can unexpectedly consume sensitive credentials from the host environment and makes it harder for users to understand what secrets the skill accesses during execution.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

This curl request sends data and an authorization token to an external service. External transmission is inherent to Deepgram cloud TTS, but it remains security-relevant because sensitive user text and API credentials are involved, and the skill does not provide explicit disclosure or controls around that transmission.

Content

Scanner excerpt · scripts/deepgram-tts.sh (reported line 60)May include surrounding context.

sh
PY
)"

curl -sS --max-time 120 "https://api.deepgram.com/v1/speak?model=${model}" \
  -H "Authorization: Token ${DEEPGRAM_API_KEY}" \
  -H 'Content-Type: application/json' \
  --data "$payload" > "$out"

External Transmission

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

This curl request sends data and an authorization token to an external service. External transmission is inherent to Deepgram cloud TTS, but it remains security-relevant because sensitive user text and API credentials are involved, and the skill does not provide explicit disclosure or controls around that transmission.

Content

Scanner excerpt · scripts/deepgram-tts.sh (reported line 60)May include surrounding context.

sh
PY
)"

curl -sS --max-time 120 "https://api.deepgram.com/v1/speak?model=${model}" \
  -H "Authorization: Token ${DEEPGRAM_API_KEY}" \
  -H 'Content-Type: application/json' \
  --data "$payload" > "$out"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script transmits user-provided text to Deepgram's external API, which is necessary for cloud TTS but still constitutes external data exfiltration if users are not clearly informed. In voice-message automation contexts, that text may include sensitive or private content, increasing the privacy impact of undisclosed transmission.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script sends input audio to Deepgram for transcription and may send reply text for TTS without any explicit notice, consent check, or confirmation at the point of use. In a voice-message automation context, this can expose sensitive or personal content to a third-party service unexpectedly, creating privacy, compliance, and data-handling risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The script silently sources an API key value from a sensitive environment file without notifying the caller. Even though it only extracts one variable, this implicit secret usage reduces transparency and can surprise operators who did not intend this script to access privileged local configuration.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The script chooses a default output path under /tmp and creates parent directories before writing the response to disk. Although file output is part of TTS behavior, the script does not clearly disclose in its help text that it will create and write an MP3 file if --out is not provided.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.