Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions server/embed/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@ if [ "$OS" = "Windows_NT" ]; then
fi

case $(uname -sm) in
"Darwin x86_64")
target="darwin-amd64"
;;
"Darwin arm64")
target="darwin-arm64"
;;
"Darwin x86_64")
target="darwin-x64"
;;
"Linux aarch64")
target="linux-arm64"
;;
*)
target="linux-amd64"
target="linux-x64"
;;
esac

dl_url="https://github.com/esm-dev/esm.sh/releases/download/${VERSION}/cli-${target}.gz"
bin_dir="$HOME/.esm.sh/bin"
exe="$bin_dir/esm.sh"
exe_path="$bin_dir/esm.sh"

if [ ! -d "$bin_dir" ]; then
mkdir -p "$bin_dir"
fi

curl --fail --location --progress-bar --output "$exe.gz" "$dl_url"
tar -xzf "$exe.gz" -C "$bin_dir"
chmod +x "$exe"
rm "$exe.gz"
curl --fail --location --progress-bar --output "$exe_path.gz" "$dl_url"
tar -xzf "$exe_path.gz" -C "$bin_dir"
chmod +x "$exe_path"
rm "$exe_path.gz"
Comment on lines +35 to +38
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This install script downloads and extracts a remote CLI binary from https://github.com/esm-dev/esm.sh/... via curl and tar without any checksum or signature verification. If the release artifact or distribution channel is compromised, an attacker can ship a malicious binary that will be installed into bin_dir and later executed by users, resulting in a supply chain compromise. Add integrity verification (e.g., validating a pinned SHA-256 checksum or cryptographic signature for the downloaded archive) before extracting and installing the binary.

Copilot uses AI. Check for mistakes.

shell_name=$(basename "$SHELL")
case $shell_name in
Expand Down