Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest version
- Search the existing issues.
Steps to reproduce
The MOTW implementation introduced in v9.1.0.0 (see #1964 and PowerShell/openssh-portable#614) breaks deployments of binaries through sftp.
I'm using sftp to transfer .NET binaries (.dll files) to a test machine as part of my local build process, because these binaries need to be debugged/tested/verified on that remote machine. Since v9.1.0.0 the deployed binaries are blocked by windows because they are flagged with the MOTW which causes the .NET runtime to refuse loading the assemblies. Of course, I can unblock them manually, but as soon as I build &deploy again the MOTW gets re-applied. There is no real workaround available since I cannot disable the MOTW flagging.
This could also get troublesome for configuration management tools like ansible, which transfer all files per sftp by default, including scripts and possibly binaries.
As per "definition" for MOTW here: https://www.microsoft.com/en-us/msrc/windows-security-servicing-criteria I can't see why MOTW should be applied on files that are uploaded to a server. The reasoning behind this security mechanism is to protect users from downloaded, (untrusted) files from the Internet. This is an entirely different case compared to when I open a SSH session, using my credentials to authenticate to a server and then upload a file. It just doesn't make any sense to authenticate a user, using impersonation to restrict access to the well-defined user privileges and then still handling it like it was an anonymous untrusted third party that wants to push malicious files to the system.
I also tried fiddling with the internet security zones so that the sftp server would treat the upload as trusted but since there is no documentation about how to do that, I wasn't successful.
Frankly, I don't understand why this has been implemented the way it is although there were a lot of good reasons and warning signs in this discussion here not to do it: #1964
Expected behavior
MOTW should not be applied to files that are uploaded to a sftp server.
It only should be applied for downloads executed by the sftp client. This would be in sync with files downloaded through browsers.
Actual behavior
MOTW is applied on all files I upload to the server.
Error details
When checking the file properties of the uploaded files, they are marked as blocked.
Environment data
N/A
Version
9.1.0.0p1
Visuals
No response