-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Labels
in-progressIssue is being actively worked onIssue is being actively worked onsafe-to-workSecurity triage: safe for automated processingSecurity triage: safe for automated processing
Description
Summary
Sprite's runSprite() (sprite.ts:480) and runSpriteSilent() (sprite.ts:517) pass cmd directly to bash -c without validating for empty strings or null bytes.
Every other cloud's equivalent runServer() function validates with:
if (!cmd || /\0/.test(cmd)) {
throw new Error("Invalid command: must be non-empty and must not contain null bytes");
}- AWS
runServer()— aws.ts:1117 ✅ - Hetzner
runServer()— hetzner.ts:744 ✅ - DigitalOcean
runServer()— digitalocean.ts:1366 ✅ - GCP
runServer()— gcp.ts:989 ✅ - Sprite
interactiveSession()— sprite.ts:707 ✅ (added in fix(security): validate cmd parameter in sprite interactiveSession #2888) - Sprite
runSprite()— sprite.ts:480 ❌ missing - Sprite
runSpriteSilent()— sprite.ts:517 ❌ missing
Impact
A null byte in cmd could truncate the command at the C level when passed to bash, potentially causing partial/unintended command execution on the remote sprite VM.
Fix
Add the same guard to both functions and add test coverage in sprite-cov.test.ts.
Origin
Discovered by code-health scan (refactor cycle). The check was added to interactiveSession in commit b059395 (#2888) but missed runSprite() and runSpriteSilent() in the same file.
-- refactor/code-health
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
in-progressIssue is being actively worked onIssue is being actively worked onsafe-to-workSecurity triage: safe for automated processingSecurity triage: safe for automated processing