T08 · Insecure Dependencies
Error
- Location
- feishu_backup.sh:17
- Finding
- Execution of Unbundled and Unverified External Dependencies## Vulnerability Details **File Location**: `feishu_backup.sh`, lines 17–24 **Vulnerability Type**: Execution of external local dependencies without integrity verification **Risk Level**: High ### Vulnerable Code ```bash DOWNLOADER="$SCRIPT_DIR/../shared/feishu_downloader.py" BACKUP_DIR="${BACKUP_DIR:-$HOME/.openclaw/doc/backup}" mkdir -p "$BACKUP_DIR" source "$SCRIPT_DIR/../shared/feishu_args.sh" python3 "$DOWNLOADER" "${FEISHU_ARGS[@]}" "$BACKUP_DIR" ``` ### Technical Analysis The script relies on `../shared/feishu_args.sh` and `../shared/feishu_downloader.py`, neither of which is included in the audited project. Their behavior and integrity therefore cannot be established from the reviewed package. The `source` command executes the entire contents of `feishu_args.sh` in the current shell process. It is not limited to defining `FEISHU_ARGS`; the dependency can run arbitrary shell commands and modify variables or process state. The subsequent Python invocation similarly executes the unverified `feishu_downloader.py`. No cryptographic hash, trusted ownership check, permission validation, canonical-path restriction, or symlink rejection occurs before execution. Consequently, project review and integrity controls over the two packaged files do not cover the code that implements the effective backup operation. ### Attack Path 1. An attacker obtains write access to the expected sibling `shared` directory, replaces one of the referenced files, or redirects it through a malicious symlink. 2. The attacker places arbitrary shell commands in `feishu_args.sh` or arbitrary Python code in `feishu_downloader.py`. 3. A user or AI agent invokes `feishu_backup.sh` for a legitimate Feishu backup operation. 4. The script sources or executes the attacker-controlled dependency without verifying its identity or integrity. 5. The malicious code runs with the invoking user's privileges and inherits the script's environment and avail ...[truncated 877 chars]
- Remediation
- ## Remediation Suggestions 1. Bundle `feishu_args.sh` and `feishu_downloader.py` inside the reviewed skill package rather than resolving them from a sibling directory. 2. Resolve every executable dependency to a canonical path and verify that it remains beneath an approved, immutable skill directory. 3. Reject symbolic links and files with unexpected ownership or group/world-writable permissions. 4. Pin and verify cryptographic hashes or signed manifests for executable dependencies before loading them. 5. Avoid sourcing an external shell file. Parse declarative configuration as data or invoke a narrowly scoped helper process instead. 6. Execute the downloader with a minimal environment and only the filesystem and network permissions required for the backup operation. 7. Include all effective runtime dependencies in future security reviews and release artifacts.
