3 ms·
Is it just me or does this seem like a bad design where a TCP port is exposed to share information?
by zitterbewegung 2y ago
Is it just me or does this seem like a bad design where a TCP port is exposed to share information?
- marginalia_nu 2y agoAs long as you bind to localhost it's fine in theory. Though any network code still needs to be rigorously hardened.
- echoangle 2y ago> As long as you bind to localhost it's fine in theory But only if you assume that the data being transferred is public, right? With the described method, any non-privilieged user could access the data from the TCP socket, right?
- marginalia_nu 2y agoInformation in top isn't much of a secret though.
- kevincox 2y agoYes. Any local process can connect to a TCP port (unless special care is taken) so it should be a last-resort option. Additionally the sever either needs to be run as root to bind a privileged port or any application can race over binding that port. UNIX sockets are a much better option as they can be protected by filesystem permissions including who can bind the socket and who can connect to it. This can be mitigated by having authentication inside the socket, but now your authentication code is an attack surface and how are you going to share the secrets? On the filesystem? You are basically back to a UNIX socket with extra steps.