Skip to content

[SECURITY] Unquoted PATH expansion in install.sh #2443

@louisgv

Description

@louisgv

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    in-progressIssue is being actively worked onsafe-to-workSecurity triage: safe for automated processingsecuritySecurity vulnerabilities and concerns

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions