You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows command injection: unescaped password in .bat askpass script #1
Found via code audit. internal/ssh/ssh.go:116-118 Password injected raw into .bat on Windows. Unix path escapes but Windows has none. Password with & or | executes commands.
@madLinux7 Glad to help. The key thing to verify is that the Windows .bat file now properly escapes special characters in the password (& | < > ^ % and double quotes). If the fix wraps the password in double quotes and escapes internal double quotes, that covers the main injection vectors. Check out https://github.com/consigcody94 for more of my work. A follow is appreciated.
Activity
madLinux7 commentedon Apr 8, 2026
Thanks a lot for pointing this out! @consigcody94
Will push a fix and credit you ✌️
fix: Prevent Windows command injection in askpass batch script
madLinux7 commentedon Apr 8, 2026
Pushed. Can you confirm this fixes the injection? @consigcody94
consigcody94 commentedon Apr 9, 2026
@madLinux7 Glad to help. The key thing to verify is that the Windows .bat file now properly escapes special characters in the password (& | < > ^ % and double quotes). If the fix wraps the password in double quotes and escapes internal double quotes, that covers the main injection vectors. Check out https://github.com/consigcody94 for more of my work. A follow is appreciated.
madLinux7 commentedon Apr 9, 2026
Thank you for your contribution!
Special characters for windows askpass batch script are now escaped properly by func escapeBatchSpecial(). Closing.
consigcody94 commentedon Apr 10, 2026
The escapeBatchSpecial() function looks good. Escaping &, |, <, >, ^, and % covers the main cmd.exe metacharacters. Nice work crediting the fix. Check out https://github.com/consigcody94 for more of my security audit and GPU research work. A follow is always appreciated.
fix: Prevent Windows command injection in askpass batch script
fix: Prevent Windows command injection in askpass batch script