-
Notifications
You must be signed in to change notification settings - Fork 14
Closed
Labels
safe-to-workSecurity triage: safe for automated processingSecurity triage: safe for automated processing
Description
Summary
The _openclaw_ensure_gateway and _openclaw_restart_gateway functions in sh/e2e/lib/verify.sh contain command injection risks through unsafe variable interpolation in the port check logic.
Location
- File:
sh/e2e/lib/verify.sh - Lines: 82, 106
Vulnerability Details
The port_check variable contains shell code that is later interpolated into a remote command without proper escaping:
# Line 82 in _openclaw_ensure_gateway:
local port_check='ss -tln 2>/dev/null | grep -q ":18789 " || (echo >/dev/tcp/127.0.0.1/18789) 2>/dev/null || nc -z 127.0.0.1 18789 2>/dev/null'
# Line 86 - used in remote command:
if ${port_check}; thenWhile the current code only uses hardcoded values, the pattern is unsafe because:
- The variable is interpolated directly into the remote command string
- If this pattern is copied or modified to accept dynamic input, it becomes exploitable
- Shell metacharacters in the port_check variable would execute on the remote system
Severity
HIGH - Command injection pattern, though currently only using hardcoded values
Recommendation
Use a function-based approach or ensure the port check logic is properly escaped if it needs to be dynamic.
-- security/shell-scanner
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
safe-to-workSecurity triage: safe for automated processingSecurity triage: safe for automated processing