Skip to content
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

[Windows] Trojan alert from windows defender and other anti-virus providers #2486

Open
Shotman opened this issue Aug 18, 2021 · 61 comments
Open
Labels
help wanted Help is requested to fix this issue platform: Windows type: bug

Comments

@Shotman
Copy link

Shotman commented Aug 18, 2021

Describe the bug

After building from source a Tauri app, Commandos after doing a npm run tauri dev, at some point Windows Defender freaks out and I get a Trojan:Script/Wacatac.B!ml alert from it

To Reproduce

Steps to reproduce the behavior:

  1. Clone the repo
  2. Run the dev process of the app
  3. Use the app a bit
  4. Alert shoudl happen at some point

Expected behavior

Windows Defender shouldn't flag this app as a Trojan

Platform and Versions (required):

Operating System - Windows, version 10.0.19043 X64
Webview2 - 92.0.902.73

Node.js environment
  Node.js - 16.5.0
  @tauri-apps/cli - 1.0.0-beta.7
  @tauri-apps/api - 1.0.0-beta.6

Global packages
  npm - 7.20.3
  yarn - 1.22.5

Rust environment
  rustc - 1.54.0
  cargo - 1.54.0

App directory structure
/.git
/.github
/.vscode
/e2e
/images
/logo
/node_modules
/src
/src-tauri

App
  tauri.rs - 1.0.0-beta.7
  build-type - bundle
  CSP - default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
  distDir - ../dist/commandos
  devPath - http://localhost:5200
  framework - Angular
  bundler - Webpack

Additional context

Not my app just wanted to tested it and ran into this issue

@nothingismagick
Copy link
Sponsor Member

Should we escalate this to the webview2 crew? @wusyong

@lemarier
Copy link
Member

lemarier commented Aug 18, 2021

Not my app just wanted to tested it and ran into this issue

Could you make a virustotal.com submission and include the report link here, please? Thanks

@Shotman
Copy link
Author

Shotman commented Aug 18, 2021

Not my app just wanted to tested it and ran into this issue

Could you make a virustotal.com submission and include the report link here, please? Thanks

https://www.virustotal.com/gui/file/d582212961c8d2fe95b700d721d8972aa52d0b6c978e93917fddb85e419f1687/detection

@Verequies
Copy link

During testing my app on Windows I also had this experience. Came up as "Trojan:Script/Wacatac.B!ml". This was a debug build as well.

@frnco
Copy link

frnco commented Nov 13, 2021

During testing my app on Windows I also had this experience. Came up as "Trojan:Script/Wacatac.B!ml". This was a debug build as well.

Just wanted to add that I never compiled a debug build for Windows, and Windows never complained like that for any of my non-debug-builds. Dunno if there's actually any relation to using a debug build, but I've built a few things on windows and shared with a few friends and family, and although Windows does complain quite a bit about signing and not knowing the publisher or whatever, windows defender never reported any threats like viruses or trojans or whatever, so this doesn't apply to all windows builds, and if it's not the debug-thing there's something else causing this.

@lucasfernog
Copy link
Member

@Shotman do you still see this alert? No one else has reported it :/

@Shotman
Copy link
Author

Shotman commented Jun 24, 2022

@lucasfernog I haven't tried it so far, but recently I've set up Tauri 1.0 on a few PCs and it didn't trigger anything sooo I guess it might be safe to assume something between beta7 and 1.0 fixed it
Closing the issue for now but let's reopen if it ever comes back

@Shotman Shotman closed this as completed Jun 24, 2022
@giohappy
Copy link

FYI it also happens to me. Tauri 1.1, Windows 11, on a couple of PCs.
I built the react template, as it is.

@Endunry
Copy link

Endunry commented Feb 7, 2023

A friend of mine sent his .exe and .msi to test it on my system and my MS-Defender instantly alarms me about "Trojan:Script/Wacatac.B!ml". He doesnt get the same error as i and virustotal says its harmless.

So the issue is defently not fixed

Version used: Tauri 1.2
Windows Version: Windows 11 21H2

@kbeirne
Copy link

kbeirne commented Feb 10, 2023

We've had similar experience with our Tauri app v1.2. No problems from several playtesters but have 2 new testers now and they immediately got it, as well as a block from both Chrome and Edge. Testers were on Windows 10. Similar trojan alert but slightly different name:

image

I've noticed a commonality between our project and Commandos. Both uses Windows cmd direct in the project. See here.
I was trying to avoid this if possible because of problems just like this. I'm gonna run a build with cmd removed and see if the issues persist.

Update: Got a second playtester recreating the issue. Tried a build without any cmd or any interop at all really except for some REST APIs (and UI), practically no extra rust outside some empty tauri::commands and an empty on_window_event->WindowEvent::Destroyed hook) and got the same result.

@mrjackwills
Copy link
Contributor

I had the Trojan:Script/Wacatac.H!ml trojan alert when I installed the latest version of my application.

Installing fresh on a different machine didn't cause the alert. Removing all traces of the application before installing also again didn't cause any Security alert.

However, I am now unable to re-create the Trojan alert (I have made sure what Microsoft Security Centre is NOT allowing it), so I am none the wiser.

The only aspect of my application that I think might trigger an alert is a dependency, auto-launch, to allow the application to, as the name suggests, run at boot. On windows, I think this is achieved via a registry change

@kbeirne
Copy link

kbeirne commented Feb 13, 2023

Anyone tested with/without certs out of interest? Hadn't signed our msi yet, will try that.

Also, @Shotman, are we alright to reopen this? Happy to help if I can, this is a blocker for me atm.

@Shotman Shotman reopened this Feb 13, 2023
@Shotman
Copy link
Author

Shotman commented Feb 13, 2023

I reopened the issue to allow referencing and data collection etc

@kbeirne
Copy link

kbeirne commented Feb 13, 2023

Sent out a new version with an IV sha256 code-sign and the problem was not reproducible for the two testers who were previously having trouble (they had each tried at least two previous versions without code-sign that were reproducing the issue).

Will update again if I get more trojan reports.

@vasilvestre
Copy link

I actually have this issue with Windows 11. The release here got the issue : https://github.com/vasilvestre/totk-mod-manager-for-yuzu/releases/tag/v0.6.0

@Bigaston
Copy link

Hello!
I've just discover Tauri yesterday and build one of my app with it. I use the official Github Actions template to build the thing. It's seems to work with the .MSI file, but the NSIS is flagged as a virus, and VirusTotal said it's safe

The release is here: https://github.com/Bigaston/PatThePupuce/releases/download/app-v1.1.0/patthepupuce_1.1.0_x64-setup.exe

@Raphiiko
Copy link
Contributor

I just ran into the same issue here. The following release I have is marked in the same way: https://github.com/Raphiiko/Oyasumi/releases/download/oyasumi-v1.7.0/OyasumiVR_1.7.0_x64-setup.exe

image

@Kespuzzuo
Copy link

Kespuzzuo commented Jun 30, 2023

I did get the same issue.
I created an app through cmd, and then opened it on VS Code and BOOM! my antivirus was sending me messages upon messages saying they're deleting the libs stored in a folder deep inside the project folder I created.

I'm really surprised how developers would be able to develop an app while at the same time having to disable their antivirus. How do you even go to the internet to see how to code an specific thing you need for your project?

@FabianLars
Copy link
Member

@Kespuzzuo Most anti virus programs really don't like compiled programming languages, and i guess rust especially so since it often compiles multiple executables and executes them to create the actual app executable. On normal user systems, which anti virus software primarily targets, this is a big no-no.

fwiw even without the warnings, i personally can't live without whitelisting my dev folder because the real-time scanning often causes insane compilation slowdowns...

Either way, this is something we can control even less then issues when running the resulting tauri app.

@Shotman
Copy link
Author

Shotman commented Aug 18, 2023

Trying to install "DataFlare", not open source from what I understand, from the showcase channel on Discord, I got another warning with the nsis exe setup

@FabianLars FabianLars added help wanted Help is requested to fix this issue platform: Windows labels Aug 18, 2023
@ddublon
Copy link

ddublon commented Jun 26, 2024

is there a solution in mind?

@FabianLars
Copy link
Member

Well, if someone has a solution for us, we're all ears. Or at least knows what could cause this. To react to the only comment in that direction:

Don't download files to random names in temp, download them to a fixed folder under the app's root folder, with predictable names and proper extensions

Hmm, i guess that's valid, other installers/updaters do the same but i can see how this can be problematic. One problem is that the app's root folder is read only for msi and nsis@perMachine apps.

Don't run with /quiet - let the MSI pop a dialog

We don't. We use /passive, but even apps that use a user interaction UI have the same issues.

Don't ShellExecute, call the MSI functions directly (or at least CreateProcess it)

This issue is older than our switch to ShellExecute. Before that we used CreateProcess via Rust's Commands. I don't understand the "call the MSI function directly" part (if we remove the "or at least CreateProcess" appendix).

Lastly, apps without the updater also see those same alerts (potentially less often, maybe the same)

@martpie
Copy link

martpie commented Jun 26, 2024

Lastly, apps without the updater also see those same alerts (potentially less often, maybe the same)

I can confirm that point, I built binaries for an app without auto-updater, and the Trojan alert is still present.

@merabtenei
Copy link

merabtenei commented Jun 26, 2024

What solved the issue for us was updating the version number of the app in the config file, updating cargo and all the dependencies and then generate a new build.

@FabianLars FabianLars changed the title [Windows] Trojan alert from windows defender [Windows] Trojan alert from windows defender and other anti-virus providers Jul 16, 2024
@AzeezDa
Copy link

AzeezDa commented Aug 11, 2024

I, too, was impacted by this issue. VirusTotal and my Windows Defender also flagged the (.msi) installer and the installed application of my project with, among others, the Trojan:Script/Wacatac.B!ml threat.

@martpie
Copy link

martpie commented Aug 11, 2024

Is there any chance this will get investigated before the stable 2.0 release? This is kind of a big issue for distributing binaries to people that may not trust your product and just think you are disturbing a Trojan horse.

@ddublon
Copy link

ddublon commented Aug 11, 2024

a coworker of mine solve this issue with this

Dolev
 
Dublon
 No  Need  I  noticed that the Tauri generates temp files  that the anti virus deal with it as  virus all you need  is to:
1- window r 
2-  type %temp% and remove all the Temp files  when you remove them the anti virus is no longer blocks the exe after Tauri Build 

@ddublon
Copy link

ddublon commented Aug 11, 2024

Is there any chance this will get investigated before the stable 2.0 release? This is kind of a big issue for distributing binaries to people that may not trust your product and just think you are disturbing a Trojan horse.

i don't think your customers will see this issue , due the the comment I just put above^^^ only the PC that do the build process get the alert

@Nakroma
Copy link

Nakroma commented Aug 12, 2024

Is there any chance this will get investigated before the stable 2.0 release? This is kind of a big issue for distributing binaries to people that may not trust your product and just think you are disturbing a Trojan horse.

i don't think your customers will see this issue , due the the comment I just put above^^^ only the PC that do the build process get the alert

I don't think this is true, multiple people I sent the binary had it flagged as a virus until I sent it in to Windows

@devRoemer
Copy link

Is there any chance this will get investigated before the stable 2.0 release? This is kind of a big issue for distributing binaries to people that may not trust your product and just think you are disturbing a Trojan horse.

i don't think your customers will see this issue , due the the comment I just put above^^^ only the PC that do the build process get the alert

I don't think this is true, multiple people I sent the binary had it flagged as a virus until I sent it in to Windows

Our installer is built on a build server, and we get the virus warning locally on our local machines, so it's definitely not only related to the machine that does the build

@FabianLars
Copy link
Member

Is there any chance this will get investigated before the stable 2.0 release? This is kind of a big issue for distributing binaries to people that may not trust your product and just think you are disturbing a Trojan horse.

Yes and no, we won't do a special investigation session or will delay stable for this but it's really under constant investigation. We unfortunetely don't have any more insight (into AV software etc) either and even the friends we have at relevant companies couldn't help us yet.

I was told that someone saw similar reports (including Wacatac) with basically a plain Wry app which is pretty concerning.

I am at a point where i think that it's the use of WebView2 itself and/or Rust that's the issue here. Considering that projects like Wails also seem to deal with false positives (Wacatac being among them) the former seems to be even more likely...

For now it seems like we can only keep asking you to submit your apps to AV software providers :(

@Selyatin
Copy link

I'm thinking of building a solution to automate this submission process since it's a pain in the ass to do it manually every time and I don't think paying few hundred bucks for a license is the way. Should I make it a cheap SaaS (like 3.50$/month cheap), are you guys interested?

@ddublon
Copy link

ddublon commented Aug 12, 2024

I dont know if i need this service right now , but might maybe in the future

@SommerEngineering
Copy link

In our AI Studio app, we have the same issue (link to our issue). However, the virus scanners (as expected) seem to be a little more critical once a sidecar comes into play: we use a .NET server as a sidecar.

@betamos
Copy link
Contributor

betamos commented Aug 27, 2024

Another affected developer here.

  • tauri 1.5.3 with auto updater
  • auto-launch 0.5.0
  • not signed with any cert
  • sidecar written in Go that does a bunch of networking (although that executable isn't flagged itself)

Detections (will update if I see more):

  • Trojan:win32/Bearfoos.A!ml in Windows Defender
  • Trojan:Script/Wacatac.H!ml in Windows Defender

Strangely, Virustotal currently says it's clean.

Notes:

  • The !ml suffix apparently indicates that it's not a hash match but a machine learning heuristic (sad yay)
  • The installation works fine and the exe is allowed to run for some time before it gets force-killed and quarantined, possibly suggesting that it's runtime/behavior analysis (as opposed to static analysis)
  • This is a massive UX issue especially for non-technical users, since (1) it's easy to miss or misunderstand the notification and (2) it's very much non-obvious how to restore it without googling, and knowing what to search for
  • Microsoft Defender (realtime protection) is disproportionally crucial to address, since it's enabled by default and may skew towards less technical users. A quick search suggests >50% of users use system defaults.
  • Updating the app creates a new binary with a new signature, which then needs to rebuild reputation. This may disincentivize developers to release updates as frequently as appropriate. We may lose users permanently, unless they manually restore the executable.

Questions:

  • Does code signing help mitigate or stop the false positives and force-quarantine behavior from occurring?
  • Any information as to why detection occurs would be very helpful in triaging these issues and help developers. Right now it's very hard to say what role Tauri plays, if any.

@kbeirne
Copy link

kbeirne commented Sep 9, 2024

Does code signing help mitigate or stop the false positives and force-quarantine behavior from occurring?

It doesn't stop it. We have a full hardware EV on ours now and we got another report on our Tauri 1.6 app. Wacatac Trojan warning that auto-uninstalled the app.

Any information as to why detection occurs

Not much help here, but see comments on an earlier post: #2486 (comment)

@kbeirne
Copy link

kbeirne commented Sep 9, 2024

Tried converting our nsis installer to msix so we can run the Microsoft App Store validator:
https://techcommunity.microsoft.com/t5/modern-work-app-consult-blog/how-to-validate-if-your-application-is-compliant-with-the/ba-p/316783

It passed but with the following errors:

FAILED Registry checks

    Error Found: The registry checks test detected the following errors:
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\AARSVC_133933BFD] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\bam] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\BCASTDVRUSERSERVICE_133933BFD] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\BLUETOOTHUSERSERVICE_133933BFD] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\CAPTURESERVICE_133933BFD] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\CBDHSVC_133933BFD] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\CDPUSERSVC_133933BFD] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\CONSENTUXUSERSVC_133933BFD] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\CREDENTIALENROLLMENTMANAGERUSERSVC_133933BFD] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\DEVICEASSOCIATIONBROKERSVC_133933BFD] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\DEVICEPICKERUSERSVC_133933BFD] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\DEVICESFLOWUSERSVC_133933BFD] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\LXSSMANAGERUSER_133933BFD] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\MESSAGINGSERVICE_133933BFD] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\ONESYNCSVC_133933BFD] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\PIMINDEXMAINTENANCESVC_133933BFD] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\PRINTWORKFLOWUSERSVC_133933BFD] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\SecurityHealthService] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\UDKUSERSVC_133933BFD] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\UNISTORESVC_133933BFD] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\USERDATASVC_133933BFD] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\WPNUSERSERVICE_133933BFD] found.
        NT Services cannot be installed. Registry path REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\wscsvc] found.
    Impact if not fixed: Apps should not install drivers or NT services.
    How to fix: Do not install drivers or NT services.  
    
    FAILED:  Blocked executables
    Error Found: The blocked executables test has detected the following errors:    
        File VFS\Local AppData\MyApp\uninstall.exe contains a reference to a "Launch Process" related API kernel32.dll!CreateProcessW
        File VFS\Local AppData\MyApp\uninstall.exe contains a reference to a "Launch Process" related API shell32.dll!ShellExecuteExW
        File VFS\Local AppData\MyApp\MyApp.exe contains a reference to a "Launch Process" related API kernel32.dll!CreateProcessW
        File VFS\Local AppData\MyApp\MyApp.exe contains a reference to a "Launch Process" related API shell32.dll!ShellExecuteW
        File Registry.dat contains a blocked executable reference to "\Device\HarddiskVolume2\Windows\System32\cmd.exe".
        File nvdrsdb0.bin contains a blocked executable reference to "powershell_ise.exe".
        File nvdrsdb0.bin contains a blocked executable reference to "powershell.exe".
        File nvdrsdb0.bin contains a blocked executable reference to "cmd.exe".
        File nvdrsdb0.bin contains a blocked executable reference to "WinDbg".
        File nvdrsdb0.bin contains a blocked executable reference to "PowerShell".
        File IconCache.db contains a blocked executable reference to "\system32\cmd.exe".
        File IconCache.db contains a blocked executable reference to "PowerShell".
        File IconCache.db contains a blocked executable reference to "menu\programs\powershell\powershell".
        File IconCache.db contains a blocked executable reference to "pinned\taskbar\powershell".
        File IconCache.db contains a blocked executable reference to "bash.exe".
        File MyApp.exe contains a blocked executable reference to "cmd".
        File MyApp.exe contains a blocked executable reference to "\System32\WindowsPowerShell\v1.0\powershell.exe".
        File uninstall.exe contains a blocked executable reference to "cDb".
        
    Impact if not fixed: Launching executable files is restricted on Windows 10 S systems. Apps that rely on this capability might not run correctly on Windows 10 S systems.
    How to fix: Identify which of the flagged entries represent a call to launch an executable file that is not part of your app and remove those calls. If the flagged files are part of your application, you may ignore the warning.

This isn't proof that these are related to the trojan but it shows some issues Microsoft cares about that might be causing problems.

Some errors similar to the "Launch Process" errors above were found in an electron app that was caused by temp file creation. Someone earlier also mentioned deleting temp files helped their tauri issue so perhaps it is related:
https://github.com/electron-userland/electron-builder/issues/2029#issuecomment-335375161

Would also apply to potential issue with the installer mentioned earlier in the thread:

Don't download files to random names in temp, download them to a fixed folder under the app's root folder, with predictable names and proper extensions

@FabianLars

@vednig
Copy link

vednig commented Sep 13, 2024

If the code signing isn't working, then the problem could be memory consumption on start, when in dev atleast is high. Slowing down the timeline of resource utilisation may help.
Similar to how Antivirus Work.
Another implementation could be asking user to disable path to repo for scanning, how Android Studio works.
Would need to understand each aspect of the Windows Native Build Process and compare it with Tauri's build process.

@martpie
Copy link

martpie commented Sep 13, 2024

Windows Code certificates are crazy expensive though. As a a dev working on personal projects, paying 100 bucks per year for an Apple dev license is ok, but it's 300-500 for Windows ._.

Publishing to Microsoft Store apparently helps with this issue though.

@jf908
Copy link

jf908 commented Sep 25, 2024

To add another data point, I encountered this issue with a Tauri 1.8.0 .msi installer being flagged as Trojan:Script/Wacatac.B!ml by Windows Defender when the file was downloaded, even before it was executed. The installer app were even signed using Trusted Signing.

I tried upping the version number, updating dependencies and building the application again and it didn't happen again. It seems like an issue that appears randomly.

@anggoran
Copy link

anggoran commented Oct 6, 2024

I think this issue is not specific to Tauri. I've ever found it in Flutter. It's either the Windows Security Defender did false positive detection, or something wrong with how we sign the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Help is requested to fix this issue platform: Windows type: bug
Projects
Status: 📬Proposal
Development

No branches or pull requests