TLS over FTP security issue

Need help with FileZilla Server? Something does not work as expected? In this forum you may find an answer.

Moderator: Project members

Post Reply
Message
Author
roffer
500 Command not understood
Posts: 3
Joined: 2021-01-24 20:17

TLS over FTP security issue

#1 Post by roffer » 2021-01-24 20:41

Filezillasettings.jpg
Filezillasettings.jpg (116.91 KiB) Viewed 506 times
In scanning our environment for security vectors I have identified a configuration issue with how TLS over FTP is working on our Filezilla Server. Currently the server will accept a login attempt without requiring a TLS session be established first. That means that an attacker can sniff network traffic and potentially capture clear text login and password information.

I have the following settings configured on the server:

FTP over TLS settings

X - Enable FTP over TLS support
X - Disallow plain unencrypted FTP
X - Force PROT P to encrypt file transfers when using FTP over TLS
X - Require TLS session resumption on data connection when using PROT P

I am using a self signed 2048 bit certificate and using 990 for implicit TLS connections (disallowing explicit FTP over TLS)

Any guidance on closing this vulnerability would be appreciated. Below is the security scan report:

Medium (CVSS: 4.8 )
NVT: FTP Unencrypted Cleartext Login (OID: 1.3.6.1.4.1.25623.1.0.108528)


Summary
The remote host is running a FTP service that allows cleartext logins over unencrypted connections.

Vulnerability Detection Result
The remote FTP service accepts logins without a previous sent 'AUTH TLS' command. Response(s):

- Non-anonymous sessions: 331 This server does not allow plain FTP. You have to use FTP over TLS.
- Anonymous sessions: 331 This server does not allow plain FTP. You have to use FTP over TLS.

Impact
An attacker can uncover login names and passwords by sniffing traffic to the FTP service.

Solution
Solution type: Mitigation

Enable FTPS or enforce the connection via the 'AUTH TLS' command. Please see the manual of the FTP service for more information.

Vulnerability Detection Method
Tries to login to a non FTPS enabled FTP service without sending a 'AUTH TLS' command first and checks if the service is accepting the login without enforcing the use of the 'AUTH TLS' command.

Details: FTP Unencrypted Cleartext Login (OID: 1.3.6.1.4.1.25623.1.0.108528)

Version used: $Revision: 13611 $

User avatar
boco
Contributor
Posts: 25448
Joined: 2006-05-01 03:28
Location: Germany

Re: TLS over FTP security issue

#2 Post by boco » 2021-01-25 01:07

On the General settings page, clear the "Listen on these ports" field and press OK. There might be a warning about Explicit FTP over TLS in the log that you can disregard in your case. The server will stop listening on the main port used for plain FTP and FTP over TLS Explicit. The port 990 you selected on the FTP over TLS settings is still available. The security warning should not be displayed, anymore.

Note the the security warning is wrong and made on assumptions. Just because the server is listening on port 21 it does not necessarily mean that it will accept plaintext logins (as you denied plain FTP, plain- or cleartext logins do NOT work). However, that is obviously never tested, or the software would have encountered the error message you get when attempting a plaintext login.

Code: Select all

530 This server does not allow plain FTP. You have to use FTP over TLS.
### BEGIN SIGNATURE BLOCK ###
No support requests per PM! You will NOT get any reply!!!
FTP connection problems? Do yourself a favor and read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
### END SIGNATURE BLOCK ###

User avatar
botg
Site Admin
Posts: 33357
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

Re: TLS over FTP security issue

#3 Post by botg » 2021-01-25 11:18

Faulty scanner. Does it actually succeed in logging in?

roffer
500 Command not understood
Posts: 3
Joined: 2021-01-24 20:17

Re: TLS over FTP security issue

#4 Post by roffer » 2021-01-25 14:10

Removing the port did the trick, thanks so much!

You both clearly know alot more about FTP servers than I do, but I believe what the scanner was picking up was the ability to attempt a clear text login with port 21 enabled even though FTP over TLS was set as implicit on 990. The server does properly respond with 530 and redirects to FTP over TLS but sometimes after the clear text login attempt; that's apparent in my log collection. Even though FileZilla does not permit the login to proceed, the user credentials are transmitted in cleartext and can be sniffed on the network. You may want to trigger the removal of port 21 when Explicit FTP over TLS is the expected behavior. Please let me know if you would like the before and after logs to dive deeper on the matter, I am happy to send those to you privately.

Thanks for a great product and the quick reply to solve the issue!

User avatar
botg
Site Admin
Posts: 33357
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

Re: TLS over FTP security issue

#5 Post by botg » 2021-01-25 16:13

Purely scanning the server isn't enough. See it this way, there is nothing the server can do to prevent the user from posting his password on Twitter. ;)

What you also need is a client that tries FTP over TLS by default and explicitly asks for confirmation before falling back to plaintext FTP. FileZilla is such a client.

User avatar
boco
Contributor
Posts: 25448
Joined: 2006-05-01 03:28
Location: Germany

Re: TLS over FTP security issue

#6 Post by boco » 2021-01-26 01:48

You may want to trigger the removal of port 21 when Explicit FTP over TLS is the expected behavior.
That is not possible as FTP over TLS Explicit (the recommended one btw.) uses the very same port, too. Only Implicit needs a different port.
Explicit FTPS always starts out as a plaintext connection. It's the very definition of "Explicit"; you explicitly upgrade the plaintext connection to FTPES, through the AUTH TLS / AUTH SSL commands.

However, an FTP server is purely reactive. It can only take action re-actively on things when they have arrived. But, it cannot pro-actively prevent dumb users from sending dumb things (such as passwords) through the connection before they send AUTH. That must be resolved client-side, as botg mentioned, already.
### BEGIN SIGNATURE BLOCK ###
No support requests per PM! You will NOT get any reply!!!
FTP connection problems? Do yourself a favor and read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
### END SIGNATURE BLOCK ###

roffer
500 Command not understood
Posts: 3
Joined: 2021-01-24 20:17

Re: TLS over FTP security issue

#7 Post by roffer » 2021-01-28 18:10

Thank you both for your help. Based on your feedback I now have the following setup:

FileZilla Client
- Protocol set to "FTP - File Transfer Protocol"
- Encryption set to "Require Implicit FTP over TLS"

FileZilla Server
Server Settings
- Cleared the "Listen on these ports" field
- Selected "Enable FTP over TLS support (FTPS)"
- Selected "Disallow plain unencrypted FTP"
- Using a self signed 2048 bit certificate
- Configured implicit TLS connections by unselecting "Allow explicit FTP over TLS (default: yes))" on port 990
- Selected "Force PROT P to encrypt file transfers when using FTP over TLS"
- Selected "Require TLS session resumption on data connection when using PROT P"
User Settings
- Selected "Force TLS for user login"

The security scan no longer reports any known vulnerabilities when analyzing the server. I am hoping this is an accurate characterization of this configuration and not just jumping through hoops to make the security scanner happy. I assume that this setup does not allow a clear text exchange anymore based on the server settings alone, correct? Not even if the user tries to share their clear text username/password, correct?

The user may still decide to post their credentials on Twitter but at least I have locked down things on my end!

User avatar
boco
Contributor
Posts: 25448
Joined: 2006-05-01 03:28
Location: Germany

Re: TLS over FTP security issue

#8 Post by boco » 2021-01-29 03:41

As the name states, an Implicit FTPS connection is encrypted right from the start. Implicit does never start as plaintext session, that's the actual reason it needs a distinct port. The server has no way to detect if the arriving gibberish is actually an encrypted FTPS stream or just noise. It simply has to assume it is so.

There's nothing more you can do, security-wise. Please note that there is a new, modern FileZilla Server in the works, to get it to the 21st century. There's just no release date, yet.
### BEGIN SIGNATURE BLOCK ###
No support requests per PM! You will NOT get any reply!!!
FTP connection problems? Do yourself a favor and read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
### END SIGNATURE BLOCK ###

Post Reply