If I read the code correctly, the proxy server is vulnerable to Windows shell code injection at the moment if native_ms implementation is configured. The same for the new implementation. I am fine with all the other minor remarks I had, but I vote for fixing this using the same patter (escape_for_shell methods) as we do for UNIX here and in native_ms. One small method to be used in both implementation. That would be nice.