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

Dylibs built on 1.78.0 <->1.87.0 gets flagged as trojans #137443

Open
Godnoken opened this issue Feb 22, 2025 · 8 comments
Open

Dylibs built on 1.78.0 <->1.87.0 gets flagged as trojans #137443

Godnoken opened this issue Feb 22, 2025 · 8 comments
Labels
C-external-bug Category: issue that is caused by bugs in software beyond our control

Comments

@Godnoken
Copy link

Godnoken commented Feb 22, 2025

Code

Building dylibs from 1.78.0 stable and onwards creates .dlls that are flagged as trojans.
Tested on two different Windows 10 PCs with fresh installs.

1.78.0 cargo init dylib https://www.virustotal.com/gui/file/65e2ea31d0bc03ef70e3c342a7cddcabd22be2db5fd84dfbb4db18dd01e3c083/detection

1.77.0 cargo init dylib https://www.virustotal.com/gui/file/5b4fb7bfa7a13acc42f640bb4d6382cc820b499d010a64727326f006b23a4e46/detection

Version it worked on

It most recently worked on: 1.77.0

Version with regression

Anything past 1.77.0


I've looked here in the issues, forums, discord, google.. nada. I wonder how this hasn't been mentioned before?

This is quite annoying even though it is a false positive. My users are messaging me wondering why there is a trojan coming with the installation.

@Godnoken Godnoken added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Feb 22, 2025
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 22, 2025
@saethlin
Copy link
Member

Similar issues have been reported in the past:
https://github.com/rust-lang/rust/issues?q=is%3Aissue%20virustotal%20

And I have seen discussion in the community of false positive virus detection on Rust programs. Perhaps this is the first report I've seen of this specific issue, but the pattern is well known.

It is extremely unlikely that we will make any change to the compiler or standard library to prevent these false positives. These usually happen because virus detection tools get trained on some piece of malware written in Rust and then the people who maintain those tools don't realize that the pattern they've extracted is Rust in general, not the specific malware. Even if we change the relevant compiler output, these tools will just get re-trained to again claim Rust programs are malware. The fix needs to be in those tools.

@fmease fmease added C-external-bug Category: issue that is caused by bugs in software beyond our control and removed C-bug Category: This is a bug. I-prioritize Issue: Indicates that prioritization has been requested for this issue. regression-untriaged Untriaged performance or correctness regression. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 22, 2025
@Godnoken
Copy link
Author

Similar issues have been reported in the past:
https://github.com/rust-lang/rust/issues?q=is%3Aissue%20virustotal%20

Still can't see any virus false positives in there, but I'm sure you're right.

And I have seen discussion in the community of false positive virus detection on Rust programs. Perhaps this is the first report I've seen of this specific issue, but the pattern is well known.

Yup, saw a few older posts about similar issues, I was just surprised that I couldn't find anything on this specific flag.

It is extremely unlikely that we will make any change to the compiler or standard library to prevent these false positives. These usually happen because virus detection tools get trained on some piece of malware written in Rust and then the people who maintain those tools don't realize that the pattern they've extracted is Rust in general, not the specific malware. Even if we change the relevant compiler output, these tools will just get re-trained to again claim Rust programs are malware. The fix needs to be in those tools.

Alright, thank you very much for the insight on this. Makes it easier to explain for end-users.

@saethlin
Copy link
Member

Still can't see any virus false positives in there

#90647 and #93187.

@workingjubilee
Copy link
Member

@Godnoken All the cases flag it as a "Gen" variant. As in "General" or "Generic". The program's behavior was examined and found to do something that looks like a virus, it was not found to be malware beyond a doubt.

For example, reading files, then writing files, especially "outside the program's initial directory", is arguably what anything that steals secrets or replicates itself would be doing.

Or, for instance, trying to call system software that most programs don't need, like e.g. the tools for examining and unwinding the stack...

...You know, so a backtrace can be generated?

@workingjubilee
Copy link
Member

workingjubilee commented Feb 22, 2025

Almost all the vendors in question have somewhere on their site you can submit a false positive report. Sometimes it's only an email, usually it's a little webform. Sometimes they even have an API you can work with to automate correct detection (this is, unfortunately, rarely the case with the majority of those that have many false positives). I recommend submitting all instances of your dylib that get a false positive detection on VirusTotal to those vendors.

@workingjubilee
Copy link
Member

As for your clientele, I recommend pointing out that many antivirus vendors on VirusTotal, including ones that extensively work with Rust (like, say, Microsoft), do not flag these binaries. If you feel confident in their average technical acumen, you may wish to try to delve into the technical explanation.

My understanding of most such software vendors is that they take into account "the user said there wasn't anything bad about this file" if enough such "that was a false positive" reports come in, which may combine with your direct report as the developer to get a swifter response.

@Godnoken
Copy link
Author

@Godnoken All the cases flag it as a "Gen" variant. As in "General" or "Generic". The program's behavior was examined and found to do something that looks like a virus, it was not found to be malware beyond a doubt.

For example, reading files, then writing files, especially "outside the program's initial directory", is arguably what anything that steals secrets or replicates itself would be doing.

Or, for instance, trying to call system software that most programs don't need, like e.g. the tools for examining and unwinding the stack...

...You know, so a backtrace can be generated?

Thank you for elaborating on this, makes it a whole lot easier to understand. My knowledge of viruses and antiviruses has been extremely superficial up till this point.

Almost all the vendors in question have somewhere on their site you can submit a false positive report. Sometimes it's only an email, usually it's a little webform. Sometimes they even have an API you can work with to automate correct detection (this is, unfortunately, rarely the case with the majority of those that have many false positives). I recommend submitting all instances of your dylib that get a false positive detection on VirusTotal to those vendors.

As for your clientele, I recommend pointing out that many antivirus vendors on VirusTotal, including ones that extensively work with Rust (like, say, Microsoft), do not flag these binaries. If you feel confident in their average technical acumen, you may wish to try to delve into the technical explanation.

My understanding of most such software vendors is that they take into account "the user said there wasn't anything bad about this file" if enough such "that was a false positive" reports come in, which may combine with your direct report as the developer to get a swifter response.

Thank you very much, I will look into it, hopefully they'll be receptive and be able to get rid of these flags. And I'll take your advice on explaining this to users! :) Cheers.

@Godnoken
Copy link
Author

Still can't see any virus false positives in there

#90647 and #93187.

I just clicked on the same link but from my PC this time, now I see the same issues. Turns out that the link either doesn't work on the mobile version or it shows completely different results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-external-bug Category: issue that is caused by bugs in software beyond our control
Projects
None yet
Development

No branches or pull requests

5 participants