-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
SMB outbound gateway may expose sensitive data in headers or payload #9399
Comments
Thank you for the report. |
Are you sure that
|
You did that yourself, so that expected that you may see sensitive data somewhere in logs. |
I am a bit conflicted on this. I also mentioned that this is indeed due to a mistake that I made, yet even in this case I would not expect to get credentials into my logging. The reason I decided to open this issue was primarily that the behavior seems to be different for the other file operations; I tried with FTP and SFTP but I do not get similar logging that exposes my credentials to the logging. I do agree with you that this will not happen during normal, properly configured, situations and have only observed operations being called on the SMBFile that mask the credentials. If due to the difference in nature between (S)FTP and SMB there is no way to align SMB to also have no way of accidentially exposing something in your logging, feel free to close this item. |
Probably that's because of So, in general that's really the problem of the
So, apparently whenever you log the Do I understand that right? |
Might not fully related, but the fix for #9416 could be incorporated to mitigate the problem described in this issue. |
In what version(s) of Spring Integration are you seeing this issue?
Spring integration 6.2.1
Describe the bug
While playing around with a SMB outbound gateway, I encountered it may log the username and password of the SMB share, whereas this would normally be properly masked (when using JCIF's
toString
method on an SMBFile).During some tests where I used 2 outbound gateways that first listed the files, and subsequently removed some of them, I found the full path to the SMB share (i.e.
smb://[username]:[password]:[host]:[port]/path)
) to be put in thefile_remoteDirectory
header and in an INFO level log entry.To Reproduce
Configure the session factory to any SMB share with files on it, and publish any message on the request channel to trigger
I used the following (XML) configuration:
The SMB outbound gateway executing the 'remove' command above will subsequently log the 'path' (that includes the entire SMB URL and thus the username and password) as per SMBSession#113 Additionally, the logger will have the URL including username and password in its file_remoteDirectory header
Expected behavior
I'd expect to not see my username and password of the SMB share in any logging, even if that logging originated from a mistake I made. This was already covered by the JCIFs library in the
toString()
call on the SMBFile#2071I'm not sure whether this is an issue with how the list command creates the SMBFile objects, or if it's something else. I tried to reproduce the same for SFTP and FTP but couldn't reproduce the same case there, in those cases the errors and logs will not log sensitive information about my connection.
The text was updated successfully, but these errors were encountered: