mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-15 01:16:50 +00:00
fix: reject non-ASCII filenames in install.sh download validation (#1802)
Fixes #1800 - explicit ASCII check blocks Unicode lookalike bypass Agent: ux-engineer Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
5a1929f6d4
commit
9aa41bfa67
1 changed files with 8 additions and 0 deletions
|
|
@ -205,6 +205,14 @@ clone_cli() {
|
|||
curl -fsSL "${SPAWN_RAW_BASE}/cli/bun.lock" -o "${dest}/cli/bun.lock"
|
||||
curl -fsSL "${SPAWN_RAW_BASE}/cli/tsconfig.json" -o "${dest}/cli/tsconfig.json"
|
||||
for f in $files; do
|
||||
# SECURITY: Reject non-ASCII characters (Unicode lookalikes/homoglyphs)
|
||||
if [[ "$f" =~ [^[:ascii:]] ]]; then
|
||||
log_error "Security: Non-ASCII characters in filename: $f"
|
||||
log_error "Only ASCII filenames are allowed."
|
||||
log_error "Installation aborted for safety."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# SECURITY: Strict allowlist — only alphanumeric, underscore, hyphen, .ts extension
|
||||
if [[ ! "$f" =~ ^[a-zA-Z0-9_-]+\.ts$ ]]; then
|
||||
log_error "Security: Invalid filename from API: $f"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue