security: can access other containers' private ports by default
The default setup (no ALLOWED_DEST_FQDN used`) allows the SOCKS proxy client to access private addresses of the machine on which the SOCKS server is running on. In particular, it can access the services running on other Docker containers with the default network (bridge).
PoC:
-
docker run -d --name socks5 -p 1080:1080 serjs/go-socks5-proxy. -
docker run --rm --name web-test crccheck/hello-worldto launch a server. Note that we don't use-pto publish a port! -
docker network inspect bridge | grep "hello-world-server" -A 5to find the IP of the HTTP server. -
Now, use another machine to connect to the SOCKS server. Run
curl --proxy "socks5://localhost:2080" http://172.42.0.3:8000Replace
172.42.0.3with the IP address from step 3.
You got the response! But perhaps you shouldn't have. I say only public IPs should be accessible by default, especially given that this project seems to be noob-oriented. At least we should have a warning in the README.