uv: reject remote clients to windows named pipes
Checklist
-
tests and code linting passes -
a test and/or benchmark is included -
documentation is changed or added -
the commit message follows commit guidelines
Affected core subsystem(s)
uv
Description of change
The server.listen(path[,backlog][,callback]) API claims to create a local server. On UNIX NodeJS ensures this behavior of local IPC by using AF_UNIX sockets. However, on Windows platform NodeJS uses named pipes that are created without specifying “PIPE_REJECT_REMOTE_CLIENTS” flag in the “dwPipeMode” parameter of the Win32 CreatNamedPipe API. As a result, users can remotely connect to these named pipe servers from other machines. This fix is to prevent such behavior by adding this flag during named pipe creation.