T08 · Insecure Dependencies
Warning
- Location
- scripts/monitor.sh:207
- Finding
- Unverified Execution of an External Sibling Skill<![CDATA[ ## Vulnerability Details **File Location**: `scripts/monitor.sh:207-208` **Vulnerability Type**: Unsafe execution of an unverified external dependency **Risk Level**: Medium ### Vulnerable Code ```bash if [ -d "$BASE_DIR/../feishu-edge-tts/scripts" ]; then bash "$BASE_DIR/../feishu-edge-tts/scripts/send_voice.sh" -t "$message" --no-send false 2>&1 | tail -3 else echo "语音:$message" fi ``` ### Technical Analysis The monitoring script executes `send_voice.sh` from a sibling directory that is not included in the audited package. It only checks whether the containing directory exists. It does not verify that the script: - Is a regular file rather than a symbolic link. - Is owned by a trusted user. - Has not been modified. - Matches a pinned version or cryptographic digest. - Originates from a declared and trusted dependency. The child process inherits the monitor's environment. This environment includes the Feishu and Noiz credentials required by `scripts/monitor.sh:86-92`. Consequently, a substituted sibling script could read those credentials and perform arbitrary actions with the account privileges of the user running the monitor. This is particularly relevant when the monitor is launched through cron, because the substituted script would subsequently execute without additional user interaction whenever an alert condition invokes `send_voice_alert`. ### Attack Path 1. An attacker obtains local write access to the parent skills directory or can pre-create the expected `feishu-edge-tts/scripts` sibling path. 2. The attacker places a malicious `send_voice.sh` at the expected location or replaces it with a symbolic link to attacker-controlled code. 3. The stock monitor runs with Feishu and Noiz credentials present in its environment. 4. A monitored stock meets an alert condition, causing `send_voice_alert` to execute. 5. The monitor launches the attacker-controlled script through `bash`. 6. The malicious script reads inherited credentials, a ...[truncated 648 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Package the notification implementation with the Skill or declare it as an explicit, version-pinned dependency. 2. Use a configured absolute path rather than discovering a sibling project by directory name. 3. Verify the script before execution: - Require a regular file. - Reject symbolic links. - Validate expected ownership and permissions. - Compare the file against a trusted cryptographic digest or signed release. 4. Invoke the dependency with a minimal environment. Pass only variables strictly required by the notifier rather than allowing it to inherit every credential and process setting. 5. Run the monitor as a dedicated unprivileged service account and ensure that other users cannot write to the Skill or dependency directories. 6. Fail closed when dependency validation fails and emit a clear diagnostic rather than executing an unverified file. ]]>
