T09 · Insecure Skill Coding Practices
- Location
fix_feishu_cache.sh:5- Finding
Privileged and Unsafe Replacement of Globally Installed OpenClaw Source Code
- Content
View full analysis
"$PROBE_FILE" << 'EOF' ``` ### Technical Analysis Executing the complete script with `sudo` grants every command in the script unrestricted root privileges, although the legitimate task only requires narrowly scoped permission to update one installed file. The replacement operation is not implemented defensively: - The script does not use `set -euo pipefail`, so it may continue after a failed backup. - It does not verify that the target exists, is a regular file, and is not a symbolic link. - It does not check whether the installed OpenClaw version is compatible with the replacement source. - It overwrites any existing `.bak` file, potentially destroying the last usable backup. - It writes directly to the destination rather than validating a temporary file and atomically installing it. - It does not validate the resulting TypeScript file before reporting success. - It asks the user to trust and run the entire package script as root rather than applying only the necessary operation with elevated privileges. No evidence was found that the current script intentionally executes an external payload, exfiltrates information, establishes persistence, or contains hidden malicious behavior. The vulnerability arises from excessive privilege and unsafe file replacement practices. ### Attack Path 1. A user follows the instruction in `SKILL.md:21` and runs the bundled shell script with `sudo`. 2. ...[truncated 1695 chars]- Remediation
View remediation
