Security Finding
Severity: HIGH
Category: Compatibility / shell safety (macOS bash 3.2)
Description
Multiple files violate the codebase's own macOS bash 3.x compatibility rules (documented in CLAUDE.md), which can cause silent failures or unexpected behavior:
1. ((var++)) with potential set -e exit
- File:
sprite/lib/common.sh:142 - Issue:
((attempt++)) — when attempt is 0, ((0++)) evaluates as falsy, causing set -e to terminate the script - Fix: Replace with
attempt=$((attempt + 1))
2. source <() in test context
- File:
test/run.sh:313 - Issue:
source <(curl -fsSL ...) fails in bash <(curl ...) context on macOS - Fix: Replace with
eval "$(curl -fsSL ...)"
3. set -u (nounset) in test/run.sh
- File:
test/run.sh:18 - Issue:
set -uo pipefail enables nounset, which CLAUDE.md explicitly prohibits - Fix: Change to
set -o pipefail without -u
4. echo -e in cli/install.sh (already tracked in #753)
- File:
cli/install.sh:24-26 - Issue:
echo -e is not portable to macOS bash 3.2 - Fix: Use
printf '%b\n' instead
Remediation
These are straightforward fixes that should be applied to match the documented conventions. The ((var++)) issue is the most dangerous as it can cause silent early termination.
Found by
Automated security scan (spawn security team)
Security Finding
Severity: HIGH
Category: Compatibility / shell safety (macOS bash 3.2)
Description
Multiple files violate the codebase's own macOS bash 3.x compatibility rules (documented in CLAUDE.md), which can cause silent failures or unexpected behavior:
1.
((var++))with potential set -e exitsprite/lib/common.sh:142((attempt++))— whenattemptis 0,((0++))evaluates as falsy, causingset -eto terminate the scriptattempt=$((attempt + 1))2.
source <()in test contexttest/run.sh:313source <(curl -fsSL ...)fails inbash <(curl ...)context on macOSeval "$(curl -fsSL ...)"3.
set -u(nounset) in test/run.shtest/run.sh:18set -uo pipefailenables nounset, which CLAUDE.md explicitly prohibitsset -o pipefailwithout-u4.
echo -ein cli/install.sh (already tracked in #753)cli/install.sh:24-26echo -eis not portable to macOS bash 3.2printf '%b\n'insteadRemediation
These are straightforward fixes that should be applied to match the documented conventions. The
((var++))issue is the most dangerous as it can cause silent early termination.Found by
Automated security scan (spawn security team)