You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FluentFTP Version: 51.1.0 Framework: Happens on both .NET Framework 4.8 and .NET 8.0
Summary
LogMaskModule tries to replace UserName instances with a fixed mask string, but if UserName is empty, then String.Replace throws an exception saying "System.ArgumentException: 'The value cannot be an empty string. (Parameter 'oldValue')'".
Applicability
FTP spec (RFC 959) doesn't allow an empty username, but there's nothing that prevents an FTP client from sending an empty USER command, and the server from accepting it.
Ideally, LogMaskModule should check for empty UserName and skip processing. FtpClient should reject an empty UserName directly in the constructor preferably with a manual override for exotic use cases.
Workarounds
Enable LogUserName = true in configuration (which isn't ideal)
Repro:
Here's a simple test program. Removing NetworkCredential parameter fixes this issue:
FluentFTP Version: 51.1.0
Framework: Happens on both .NET Framework 4.8 and .NET 8.0
Summary
LogMaskModule
tries to replaceUserName
instances with a fixed mask string, but ifUserName
is empty, thenString.Replace
throws an exception saying "System.ArgumentException: 'The value cannot be an empty string. (Parameter 'oldValue')'".Applicability
FTP spec (RFC 959) doesn't allow an empty username, but there's nothing that prevents an FTP client from sending an empty
USER
command, and the server from accepting it.Ideally,
LogMaskModule
should check for empty UserName and skip processing.FtpClient
should reject an empty UserName directly in the constructor preferably with a manual override for exotic use cases.Workarounds
LogUserName = true
in configuration (which isn't ideal)Repro:
Here's a simple test program. Removing NetworkCredential parameter fixes this issue:
The text was updated successfully, but these errors were encountered: