Passive socket leak after failed command #257
Labels
bug
A defect or bug that affects the original indended use of the application
good first issue
Hacktoberfest
security
When running in passive mode, if a command fails to execute for some reason (such as being blacklisted), the socket that was going to be used for the data connection indefinitely in the LISTENING state.
Repro 1:
node . ftp://0.0.0.0:2222 --read-only
LIST
). Observe that it uses the next passive port (1025) and succeeds.netstat
on the server's machine (netstat -nlt
on Linux,netstat -nf inet
on Mac).Expected: Node will no longer be listening on the port used for the failed command (1024 in this example).
Actual:
netstat
shows port inLISTENING
(Linux) orCLOSE_WAIT
(Mac) state indefinitely, even after ftp client terminates.Repro 2 (lower level):
node . ftp://0.0.0.0:2222
telnet localhost 2222
and issue the following commands directly to the server:telnet localhost <port returned by EPSV command>
and then close the connection.netstat
as above.The text was updated successfully, but these errors were encountered: