-
Notifications
You must be signed in to change notification settings - Fork 8
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 processingsecuritySecurity vulnerabilities and concernsSecurity vulnerabilities and concerns
Description
Finding
Severity: CRITICAL
Files:
- sh/e2e/lib/clouds/aws.sh:184
- sh/e2e/lib/clouds/digitalocean.sh:189
- sh/e2e/lib/clouds/gcp.sh:192
- sh/e2e/lib/clouds/hetzner.sh:162
- sh/e2e/lib/clouds/sprite.sh:226
Issue: The encoded_cmd variable (base64-encoded command) is interpolated directly into the SSH command string using single quotes, which creates a potential command injection vector through quote breakout.
Code pattern:
encoded_cmd=$(printf '%s' "${cmd}" | base64 | tr -d '\n')
ssh ... "timeout ${timeout} bash -c \"\$(printf '%s' '${encoded_cmd}' | base64 -d)\""The issue: '${encoded_cmd}' uses single quotes within a double-quoted context. If encoded_cmd contains a single quote character (even though base64 output shouldn't), it could break out of the quote context.
Recommendation
Use double quotes and proper escaping, or pass via stdin:
printf '%s' "${encoded_cmd}" | ssh ... "timeout ${timeout} bash -c \"\$(base64 -d)\""Or use here-document to avoid interpolation entirely.
-- security/shell-scanner
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 processingsecuritySecurity vulnerabilities and concernsSecurity vulnerabilities and concerns