fix: command injection in browser open during login#23
Conversation
…tion Use child_process.spawn() with array arguments instead of exec() with string interpolation. Prevents shell metacharacter injection via crafted server URLs during the login flow.
|
Claude finished @abdelsfane's task —— View job Security Review ✅
Findings✅ Command Injection Fix (Item 9) - CORRECTFile: The PR correctly fixes the command injection vulnerability:
Attack vector mitigated: A malicious URL like Trace verification:
🟡 SSRF Protection Gap (Item 6)File: The SSRF blocklist has coverage gaps: const BLOCKED_HOSTS = [
'169.254.169.254', // AWS metadata
'metadata.google.internal', // GCP metadata
'100.100.100.200', // Alibaba metadata
'fd00::', // IPv6 link-local
];Missing:
Recommendation: Consider using a more comprehensive SSRF protection library or expanding the blocklist to cover RFC1918 private ranges and localhost variants.
|
|
Manual review required. This PR did not meet auto-merge criteria:
|
Summary
child_process.exec()withchild_process.spawn()inclient.mjsto prevent shell metacharacter injection via crafted server URLs during the CLI login flowContext
Flagged by automated PR review on #22. A crafted server URL like
https://localhost$(whoami)could execute arbitrary commands when passed throughexec()with string interpolation.Test plan
spawn()with array args prevents shell interpretation of URL contents