T09 · Insecure Skill Coding Practices
- Location
scripts/trigger_call.sh:12- Finding
Arbitrary Command Execution Through Sourced Environment File
- Content
View full analysis
Vulnerability Details
File Location:
scripts/trigger_call.sh, lines 12-17
Vulnerability Type: Unsafe execution of configuration data
Risk Level: HighVulnerable Code:
bash ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../" && pwd)" ENV_FILE="${ENV_FILE:-$ROOT/.env.elevenlabs-call}" if [[ -f "$ENV_FILE" ]]; then # shellcheck disable=SC1090 set -a; source "$ENV_FILE"; set +a fiTechnical Analysis
The script loads the selected environment file with the Bash
sourcebuilt-in.sourcedoes not treat the file as passive key-value configuration; it interprets every line as shell code in the current process.The
ENV_FILEpath can be supplied through an environment variable. Consequently, anyone able to influence that variable or modify the default.env.elevenlabs-callfile can introduce command substitutions, function calls, redirections, or arbitrary shell commands. These commands execute with the permissions of the user or agent running the skill.This is a configuration-to-code injection vulnerability. The use of
set -adoes not mitigate the issue because it only controls automatic variable export.Attack Path
- An attacker creates or modifies an environment file accessible to the victim.
- The file contains apparently valid configuration followed by a malicious shell command.
- The attacker causes
ENV_FILEto reference that file, or replaces the default workspace configuration file. - A user or agent invokes
scripts/trigger_call.sh. - Bash evaluates the file through
source. - The malicious command executes before the outbound API request is made.
Exploitation requires control over the selected configuration file, the
ENV_FILEenvironment variable, or the default workspace configuration.Impact Assessment
Successful exploitation provides arbitrary command execution with the privileges of the account running the skill. An attacke ...[truncated 333 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not load configuration files with
source,., oreval. - Parse the file as data using a non-executing dotenv parser.
- Accept only an explicit allowlist of keys:
ELEVENLABS_API_KEYELEVENLABS_AGENT_IDELEVENLABS_OUTBOUND_PHONE_IDTO_NUMBER
- Reject command substitutions, shell metacharacters, malformed assignments, duplicate keys, and unexpected variables.
- Resolve the configuration file to an approved path rather than accepting an unrestricted caller-provided
ENV_FILE. - Verify that the file is a regular file owned by the expected user and is not writable by other users.
- Require restrictive permissions such as
0600. - Validate each parsed value before using it, including strict E.164 validation for
TO_NUMBER.
- Do not load configuration files with
