4.8 KiB
Safe Installation Audit — OpenClaw-On-Android
Every external curl|bash pattern has been audited. Here's what actually runs, and the safe alternatives that replace it.
The Three Dangerous Patterns
1. curl -fsSL https://code-server.dev/install.sh | sh
Found in: scripts/install-code-server.sh (inside proot-distro Debian)
What it actually does:
- Fetches latest version from GitHub API
- Downloads
code-server-${VERSION}-linux-arm64.tar.gzfromgithub.com/coder/code-server/releases - Extracts to
~/.local/lib/code-server-${VERSION} - Symlinks
code-serverbinary to~/.local/bin/
Safe alternative — download directly:
VERSION=$(curl -fsSL https://api.github.com/repos/coder/code-server/releases/latest | grep '"tag_name"' | sed 's/.*"v\([^"]*\)".*/\1/')
curl -fsSL "https://github.com/coder/code-server/releases/download/v${VERSION}/code-server-${VERSION}-linux-arm64.tar.gz" -o /tmp/code-server.tar.gz
tar -xzf /tmp/code-server.tar.gz -C ~/.local/lib
mv ~/.local/lib/code-server-${VERSION}-linux-arm64 ~/.local/lib/code-server-${VERSION}
ln -sf ~/.local/lib/code-server-${VERSION}/bin/code-server ~/.local/bin/code-server
Risk level: Medium. The install script is legitimate, but piping curl to sh is never safe.
2. curl -fsSL https://bun.sh/install | bash
Found in: scripts/install-opencode.sh
What it actually does:
- Detects platform (
linux-aarch64for Termux) - Downloads
bun-linux-aarch64.zipfromgithub.com/oven-sh/bun/releases - Extracts to
$BUN_INSTALL/bin(default:~/.bun/bin) - chmods +x the binary
Safe alternative — download directly:
BUN_URI="https://github.com/oven-sh/bun/releases/latest/download/bun-linux-aarch64.zip"
curl --fail --location --progress-bar -o /tmp/bun.zip "$BUN_URI"
unzip -oqd ~/.bun /tmp/bun.zip
chmod +x ~/.bun/bun
Risk level: Medium. Bun's install script is clean, but the curl|bash pattern is not auditable without downloading first.
3. curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
Found in: scripts/install-playwright.sh (inside proot-distro Debian)
What it actually does:
- Installs
apt-transport-https ca-certificates curl gnupg - Downloads GPG key from
deb.nodesource.com/gpgkey/nodesource-repo.gpg.key - Imports with
gpg --dearmorto/usr/share/keyrings/nodesource.gpg - Creates
/etc/apt/sources.list.d/nodesource.sourceswith Node.js 22.x repo - Runs
apt update
Safe alternative — manual repo setup:
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg
echo "Types: deb
URIs: https://deb.nodesource.com/node_22.x
Suites: nodistro
Architectures: arm64
Signed-By: /usr/share/keyrings/nodesource.gpg" > /etc/apt/sources.list.d/nodesource.sources
apt update
apt install -y nodejs
Risk level: Low-Medium. Nodesource is a trusted source, but the install script also modifies apt preferences in ways that may surprise you (nsolid pinning).
Clean Downloads (No curl|bash)
These are direct downloads and are safe:
| URL | What it is | Verified by |
|---|---|---|
https://nodejs.org/dist/v${VERSION}/node-v${VERSION}-linux-arm64.tar.xz |
Node.js official tarball | Checksum optional, official source |
https://go.dev/dl/go${VERSION}.linux-arm64.tar.gz |
Go official tarball | Official source |
https://packages-cf.termux.dev/apt/termux-main/... |
Termux .deb packages | Termux official CDN |
https://service.termux-pacman.dev/gpkg/aarch64/... |
Termux pacman packages | Termux official |
https://github.com/coder/code-server/releases/... |
code-server GitHub releases | GitHub |
https://github.com/oven-sh/bun/releases/... |
Bun GitHub releases | GitHub |
npm installs (also clean)
These use npm install -g for:
@qwen-code/qwen-code@latest@google/gemini-cli@anthropic-ai/claude-codeopencode-aiplaywright/playwright-corecode-server
npm is a package manager with its own integrity checks. Risk is in the packages themselves, not the install mechanism.
Mirror Fallback Risk
lib.sh falls back to third-party GitHub proxies if GitHub is unreachable:
ghfast.topghproxy.netmirror.ghproxy.com
These proxies see all downloaded script content. This is a network-level risk, not a code-malicious risk, but worth noting.
Our Rewrite Approach
All three dangerous patterns have been replaced in the safe/ directory:
safe/install-code-server.sh— downloads directly from GitHub, no curl|bashsafe/install-bun.sh— downloads bun zip directly, no curl|bashsafe/install-nodesource.sh— sets up NodeSource repo manually, no pipe to bash
Each script:
- Downloads to a local file first
- Prints what it is about to do
- Shows the URL and file being downloaded
- Executes only after showing the command