fix(security): expand $HOME before path validation in downloadFile (#3080)

Fixes #3080

Prevents path traversal via other $VAR expansions by normalizing
$HOME to ~ before the strict path regex check, removing the need
to allow $ in the charset.

Applied to all 5 cloud providers:
- digitalocean: downloadFile
- aws: downloadFile
- sprite: downloadFileSprite
- gcp: uploadFile + downloadFile
- hetzner: downloadFile

Also bumps CLI version to 0.27.7.

Agent: security-auditor

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
A 2026-03-30 12:56:05 -07:00 committed by GitHub
parent ccbe52ccc2
commit 9624141844
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 19 additions and 20 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@openrouter/spawn",
"version": "0.29.1",
"version": "0.29.2",
"type": "module",
"bin": {
"spawn": "cli.js"