-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using the PASV command can leave the opened socket hanging open permantently #434
Comments
Hi, @dani-garcia sorry for the late response. Thanks for this find and the suggested fix! We will discuss this in our standup. |
@dani-garcia We can just hard-code it for now. We can add an option for it at a later stage. This setting would be different from Would you like to make an MR or should we take it from here? |
I can open a PR with the changes yeah, do you think the 30 seconds value is a good default for it? I assume clients would normally connect immediately so the value could be reduced to 10 seconds or less, but maybe we prefer to be a bit more conservative at first. |
@dani-garcia Thanks!! lets make it 15. |
Done #436 |
We didn't log anything when the client's connection to the data port did not succeed. Relates to #434
We didn't log anything when the client's connection to the data port did not succeed. Relates to #434
@dani-garcia Thank you for your contribution. I just made a release that also includes this change. |
When a client uses the PASV command, but doesn't connect to the returned port (because of flaky internet or a faulty FTP implementation), the opened TCP listener gets stuck permanently open without a timeout. This can exhaust all the available passive ports, given enough time.
This is the current implementation, the socket will remain open unless someone tries to connect to it.
libunftp/src/server/controlchan/commands/pasv.rs
Lines 126 to 132 in ca88d0f
I've tested the code changing it to the following and it works, but I'm not sure if it should be configurable with
idle_session_timeout
, a new option, or simply hardcoded:The text was updated successfully, but these errors were encountered: