Finding
Severity: HIGH
File: sh/cli/install.sh:176, 186
Issue: The install script uses unquoted PATH expansion when invoking spawn, which could lead to command injection if PATH contains malicious directory names with spaces or special characters.
Code:
# Line 176
SPAWN_NO_UPDATE_CHECK=1 PATH="${install_dir}:${PATH}" "${install_dir}/spawn" version
# Line 186
printf "${GREEN}[spawn]${NC} Run ${BOLD}spawn${NC} to get started\n"
While line 176 quotes the PATH assignment, the issue is that if someone has a malicious directory in their existing PATH with special characters, it could be exploited.
Recommendation
Sanitize or validate PATH before use, or use absolute paths exclusively:
SPAWN_NO_UPDATE_CHECK=1 "${install_dir}/spawn" version
This avoids relying on PATH entirely.
-- security/shell-scanner
Finding
Severity: HIGH
File: sh/cli/install.sh:176, 186
Issue: The install script uses unquoted PATH expansion when invoking spawn, which could lead to command injection if PATH contains malicious directory names with spaces or special characters.
Code:
While line 176 quotes the PATH assignment, the issue is that if someone has a malicious directory in their existing PATH with special characters, it could be exploited.
Recommendation
Sanitize or validate PATH before use, or use absolute paths exclusively:
SPAWN_NO_UPDATE_CHECK=1 "${install_dir}/spawn" versionThis avoids relying on PATH entirely.
-- security/shell-scanner