Files

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:

  1. Fetches latest version from GitHub API
  2. Downloads code-server-${VERSION}-linux-arm64.tar.gz from github.com/coder/code-server/releases
  3. Extracts to ~/.local/lib/code-server-${VERSION}
  4. Symlinks code-server binary 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:

  1. Detects platform (linux-aarch64 for Termux)
  2. Downloads bun-linux-aarch64.zip from github.com/oven-sh/bun/releases
  3. Extracts to $BUN_INSTALL/bin (default: ~/.bun/bin)
  4. 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:

  1. Installs apt-transport-https ca-certificates curl gnupg
  2. Downloads GPG key from deb.nodesource.com/gpgkey/nodesource-repo.gpg.key
  3. Imports with gpg --dearmor to /usr/share/keyrings/nodesource.gpg
  4. Creates /etc/apt/sources.list.d/nodesource.sources with Node.js 22.x repo
  5. 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-code
  • opencode-ai
  • playwright / playwright-core
  • code-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.top
  • ghproxy.net
  • mirror.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|bash
  • safe/install-bun.sh — downloads bun zip directly, no curl|bash
  • safe/install-nodesource.sh — sets up NodeSource repo manually, no pipe to bash

Each script:

  1. Downloads to a local file first
  2. Prints what it is about to do
  3. Shows the URL and file being downloaded
  4. Executes only after showing the command