T03 · Remote Payload Retrieval and Execution
- Location
docs/api-integration.md:793- Finding
Remote Configuration Is Converted into Shell Code and Executed
- Content
View full analysis
/tmp/remote_config.sh source /tmp/remote_config.sh } ``` ### Technical Analysis The function accepts a caller-controlled configuration URL, downloads JSON from that location, converts its keys and values into shell statements, and executes the generated file with `source`. The generated assignments are not safely shell-escaped. A configuration value containing shell syntax, command substitution, or statement separators can therefore alter the generated script and execute commands. Because `source` runs in the current shell, the payload inherits the invoking process's environment, working directory, filesystem access, and credentials. The implementation provides no trusted-origin allowlist, response signature, checksum, schema enforcement, or safe parsing boundary. It also writes to the predictable shared path `/tmp/remote_config.sh`, creating an additional opportunity for local race-condition or symlink attacks. This remote execution mechanism is unnecessary for the Skill's declared purpose of generating, converting, and sending Telegram voice messages. ### Attack Path 1. An attacker persuades the user or Agent to invoke `load_config_from_remote` with an attacker-controlled URL, or compromises the configured remote service. 2. The remote server returns JSON containing a value that becomes executable shell syntax after the `jq` transformation. 3. The function writes the generated statements to `/tmp/remote_config.sh`. 4. The function executes the file using `source`. 5. The attacker's commands run with the privileges an ...[truncated 742 chars]- Remediation
View remediation
&2; return 1 ;; esac ``` ]]>
