JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.41k stars 5.45k forks source link

Use Unix sockets or named pipes for IPC for security reasons #21437

Open boosterignition opened 7 years ago

boosterignition commented 7 years ago

TCP sockets on localhost run the risk that untrusted code running on the same machine (under a different user) could connect to the system. Windows named pipes or Unix domain sockets should be used instead to avoid this vulnerability.

ararslan commented 7 years ago

Hi @boosterignition, thanks for the report. We already have the capability to use Unix domain sockets. See here.

yuyichao commented 7 years ago

I think this is talking about IPC between workers? addproc uses localhost by default (does it actually support using a unix domain socket?)

ararslan commented 7 years ago

Ah, sorry. No I don't believe it supports Unix domain sockets.

yuyichao commented 7 years ago

Also, since this pretty much only applies to local workers, can't it just use socketpairs? (at least on unix). For a normal socket file you have to take care of deleting it later and a linux abstract namespace unix domain socket doesn't seem to offet better permission control than a tcp socket.

JeffBezanson commented 7 years ago

There is an implementation of a unix domain socket -based cluster manager here: https://github.com/JuliaLang/julia/tree/master/examples/clustermanager/simple

This should perhaps be a package.