Nim and Go programs identified by Carbon Black as malware on Windows
forum.nim-lang.org
forum.nim-lang.org
1. The problem is occurring primarily with Carbon Black, a third-party product acquired by VMWare a few years ago. Microsoft is not involved.
2. This has nothing at all to do with code signing.
3. Carbon Black is part of the category of "next generation antivirus" which are notorious for false positive problems. It relies heavily on cloud-based machine learning heuristic techniques to identify "malware-like" behavior. It's fairly well known in the industry that these methods are prone to mislearning uncommon runtimes and compression/obfuscation tools as malware.
4. Vendors of these products usually suggest that the false positive problem will be mitigated by the corporate security operations center reviewing and dismissing alerts, but in practice most corporations configure the product very conservatively and do not invest the resources in managing the false positives.
They advertise high detection rates, but the secret is just flagging everything as malware - and thus also catching the sample malware in a stopped-clock-is-sometimes-right kind of way
I can't imagine the paranoia I'd feel with having spyware on my machine constantly calling home.
1. Do not use your work computer for personal data.
2. There is no step 2.
Additionally, my work requires the ability to pivot quick with software and requires root access, hardware control, etc. I've regularly worked with coworkers in other areas of the company who spend a week setting up a workaround to the managed machine.
My colleagues and I all run personalized linux configurations and a typical managed machine would greatly hamper that. The company is large enough that the IT dept would not have time to manage all our exceptions so they just let us be.
The other thing to consider: why should you care about what you work on being monitored? The most obvious reason is using work equipment for personal things, which is just a bad idea for a number of reasons starting with liability and data loss (e.g. if you get laid off, does anything get lost when your now-former employer does a remote wipe?). The other reason is if you don't have a good relationship with the security people, which is a social problem which needs to be addressed at a higher level since it'll show up in other areas, too. Rather than looking like you're being difficult or non-compliant, it's probably better to try to figure out what rules make sense - e.g. having some relationship with the endpoint monitoring people to get policy updates on a non-geologic time scale, having an official policy for who in IT security has access to data and how that's logged, etc. It's good to get that kind of thing nailed down before, say, the company gets hit with a lawsuit because one of the ITSec analysts thought it was okay to stalk that hot intern & spy on their personal web activity.
Do you justify constant GPSs surveilance because your work keys/cards might get stolen if you visit a bad neighbourhood? I hope not.
It's always a tradeoff of security vs. actually being able to do your job. Sure, a breach will cost a company but if you only have access to (mostly worthless) company "secrets" and no customer data then you really need to consider the likelyhood of having your data/credentials stolen, the cost that would have as well as the cost of the proposed security measures to your daily operation.
Someone running random JavaScript out of a downloaded ZIP file matches the signature of a lot of attacks, and almost no legitimate activity: that's a super common technique to use something built-in like JScript rather than their own binary which might be blocked, and even web developers never do that intentionally since their code is running in a browser or something else like Node.
> Sure, a breach will cost a company but if you only have access to (mostly worthless) company "secrets" and no customer data then you really need to consider the likelyhood of having your data/credentials stolen, the cost that would have as well as the cost of the proposed security measures to your daily operation.
Some other costs to think about:
1. If you have any sort of cloud credential on your system, how quickly can you spend money before someone revokes it?
2. Can your system be used to attack any internal infrastructure? Deploy something in the cloud for further attacks?
3. Can your system be used to phish other people at your company by, say, sending realistic messages? What about customers?
Now, it's true that you have to consider the impact on daily work but in this case it's pretty low unless your job actually is to run random downloads and at any organization over a certain size the majority of times that alert trips it's probably going to be something where the cost of the malware which people routinely try to run would be non-trivial, too, even if you just measured it in the time it takes to investigate and cleanup.
(ohh and it bypasses carbon black too, because .js isn't an executable :) )
Or at least that used to be the case, not sure if this is still a thing in Windows 10/11.
It's sad that these salesmen seem to have convinced lots of the right industry people that you really need them.
In this case maybe not, but MS Defender doesn't like Nim (and Nimble), either[0][1].
Not sure the current status but at least a few times a year I have Windows Defender flag Go programs I compiled myself locally as potential malware. This has happened as recently as November.
The posted thread links others concerning other tools' detections. This problem is widespread and affects the entire AV industry, including Microsoft's products. It also affects pretty much every browser via "Google Safe Browsing" - and Google certainly does not care any more about false positives than the AV vendors they source their detections from. Also, Google runs VirusTotal, which greatly widens the reach of these shitty AV tools. For some reason Google feels the need to hide that association.
> 2. This has nothing at all to do with code signing.
Perhaps. It shouldn't, but that doesn't mean that lazy AV writers won't consider signing as a signal that something is safe - after all, Windows itself does. There are at least many developers claiming that signing helps against false positive detections.
My solution to this "problem" is to simply ignore it - there isn't anything i can do about it anyway - and tell anyone who asks that it is a false positive.
Though FWIW Windows Defender (or whatever the antivirus installed by default is called) so far never had a false positive. Perhaps other antiviruses are over-eager to justify their existence - and price - so they have an incentive to scare the clueless users.
Any Windows EXE can be signed. It doesn't matter what compiler you used. The problem here isn't actually anything specific to Nim or Go, it's rather, the underlying UNIX oriented culture in which developers rarely sign their binaries. It'd affect any language with that culture. The Go FAQ on virus detection doesn't even mention signing at all - no wonder they have such problems.
It's one thing for a developer to get to distribute apps on an app store full hog with no oversight, and even there app stores are onerous. It's another to stop users from running their own software. Calling that a cultural difference is way too much. Heck, teenage Bill Gates made money selling his own software without someone forbidding it running on their own computers, it'd be hard imagining microsoft being what it is if this is the environment we're leaving the next generation of young hackers.
You just self sign. Conveyor does it by default, even. You can always run your own software on your own machine. Now, other people's Windows machines out of the box won't treat that as signed of course. Users would have to install your signing certificate. But you certainly can sign code without paying for it, it's just not meaningful to a fresh Windows install. Self signing is useful for distributing software internal to organizations for example.
To distribute more widely, well, neither OV nor EV is actually an extensive review process. Even for EV they just verify that you're actually buying a certificate by looking you up in a business directory and calling you via the published contact details. Nothing about your software is reviewed.
I don't think any AV wants to present false positives though. That's just annoying to users and they're going to disable the AV if it tries to tell them half the things that they download are viruses.
On the contrary, every application should ship their dependencies!
Does LLVM work? Does is there a Nim frontend for LLVM? I guess you can always compile Nim into C as it was done in the past I believe.
Yes there is. https://github.com/arnetheduck/nlvm
That works most of the time, but there are some orgs (e.g., US gov) where it will not.
This is a problem that's existed since the creation of the AV/EDR industry and is not going away as vendors have 0 motivation to address it. All programming languages have had to deal with this issue, this is definitely not targeted towards the Nim language.
- If you're a Nim developer trying to deploy a production app in a Windows environment: get a code signing cert and slap it on your application (signing the compiler won't help).
- If you're trying to develop a Nim app in an organization that has an EDR/AV deployed: you're going to have to talk with your friendly neighborhood security folks and work with them to whitelist the Nim compiler, tooling and folders where you work with Nim code.
You'll still be subjected to the EDR/AVs WinAPI hooking and behavioral heuristics even with the code signing cert and sometimes even after whitelisting depending on the product so you still might get issues were the AV/EDR is affecting your application but at least it won't straight up quarantine it and go ape shit.
EDIT: just to be clear, the root cause of this is the AV/EDR industry not doing due diligence. Unfortunately, I'm very skeptical of them doing anything about this as their entire business model revolves around "cast a wide net in the attempt to catch as many things as possible".
Windows antivirus companies are basically a scam and are worse than the protection they offer. They are more likely to mine Bitcoin ( https://www.theverge.com/2022/1/7/22869528/norton-crypto-min... ) or man-in-the-middle ( https://www.thesafemac.com/avasts-man-in-the-middle/ ). Antivirus companies have become the bad actors they tried but failed to stop. (https://www.cbc.ca/news/science/antivirus-software-1.3668746 )
I recommend Nim does nothing with regards with AV as there is nothing it can do but wait...
AVs often panic with any sockets or registry code.
Cars are just one of the implementations, based off an iteration of the horse cart.
I wasn't planning on monetizing the utility and I didn't expect a lot of people to use it so I just posted it with a disclaimer to ignore Windows Defender, and the source code was available on Github.
It was pretty devastating for me a few years back because I spent a year and half making some software and then ended up with the best potential users accusing me of developing malware and being very hostile.
Also when I tried to get the certificate the company was a nightmare to deal with. Truly garbage people.
The whole thing is a racket. It's just another way for Microsoft to extract money.
Because they are a bunch of mafia goons.
I am guessing that the situation got worse with the introduction of the Windows Store with Windows 8 ?
But avoiding malware strikes me as a hard-to-solve problem, particular for non-open-source software.
Is it possible that paid-for-certification is one of the last-bad known approaches?
Certifying is a good business to be in, but deadly boring.
Code signing in modern operating systems does the same thing as having a secure origin for web apps or a DKIM key for email: it ties code to a stable long term identifier controlled by a specific person or group of people. It doesn't say anything about whether the results are good or bad, which is why Windows still learns reputations over certificates. If you sign software and distribute malware it'll learn that and you'll get blocked.
On top of that, the certification process isn't great either. Even honest certificate authorities have occasionally cut a corner too many and allowed malicious certificates to be printed; and there's some rather sketchy authorities that don't take the requirements too seriously. (StartCom e.g. offered to ignore the requirements for bribes years before they finally got removed from trust databases.)
So I don't think that certificates offer any security benefit. Might as well drop them.
Malware authors spend a lot of time trying to steal signing keys exactly to try and avoid AV detection, so it's not worthless. It's certainly not easier for criminals to get one than honest developers.
Too late to edit, but I meant to write "... least-bad ...".
However, it is also sufficient to observe that with the way signatures are often done, it is very easy for someone to write a virus signature against a minority compiler and accidentally write a signature that identifies the output of that compiler, or something that compiler is very likely to output, and not realize it, because all the test cases against the majority compiler executables in the test suite pass just fine.
One need not choose one or the other; an accident at the engineer level can be considered a wonderful thing at the business strategy level. But the issue of minority compilers creating target-rich environments for signature writers is a sufficient explanation.
(At least for a time; one would think by now the virus test suites would have a good sampling of Go executables by now....)
If you're remotely serious about indie game development, it's the way to go.
Valve is guilty of anti-competitive behavior, and effectively has a monopoly on PC gaming.
> If you're remotely serious about indie game development, it's the way to go.
It's basically impossible to be successful on PC without publishing on Steam. It's "the way to go" because there are no other real options, not because $100 is "a bargain".
The problem is that I somehow have to pay $300 to get a certificate, never mind the annoying process of doing it. All the issuer is doing is verify that a) my company exists and b) I'm allowed to act on my company's behalf. Both of these are public information in my country, and any intern can verify it in about 3 minutes. That's not worth $300, and smells like illegal price fixing.
However, that doesn’t seem to be the case. “Microsoft will not charge any fee for including a CA’s certificates in the Program.” https://learn.microsoft.com/en-us/previous-versions/cc751157...
That said, they do have a great deal of requirements that impose costs for 3rd party Audits etc.
Windows Defender detected Trojan.AndroidOS/Multiverze in Nim-1.6.10_64.zip https://forum.nim-lang.org/t/9744#64108
Trojan:Win32/Wacatac.B!ml
There are many problems which an honest and competent legal system, working from timely and well-written laws, can ~cure. In the real world...the favorable adjectives are usually less applicable.
Once we found that out, we told them to call VMware. They ended up whitelisting us.
Complete shitshow.
VMware want to keep bad stuff off of their customers' machines, and they want to do so without pissing off their customers too much. Carbon Black is a "next gen" endpoint solution, meaning essentially that it uses some kind of ML model in addition to classic AV signatures. I don't know anything about their ML model, but I would guess that it is very probably tuned to slightly prefer false positives to false negatives.
With that background, imagine that a new language called FooBar gets invented. FooBar doesn't get a huge amount of traction for Windows and OSX apps, but pentesters take to it and FooBarRed becomes super popular. That means that the dataset that the ML model is being trained on doesn't contain a lot of FooBar, but when it does, the FooBar is always bad. Naturally, the model decides that as it has only ever tasted bad FooBar, all FooBar is bad.
That's "wrong" from a fairness standpoint, and the solution is for VMware to manually tune the model. But without customer complaints, they are not likely to do so. They're not acting maliciously; they just aren't incentivised to care.
Originally, I tried the USB forwarding from RDP, where I had it plugged in locally at my workstation (a Mac). The feature of forwarding devices exists in macOS MS RDP, but it doesn't work for the device I had.
It took me about a month of effort to get the EV code signing certificate to work. I'm pretty bitter about it.
EV certificates tend to be quite trusted by AV vendors, even if you're new and never had any downloads before, because you have to go through more validation. OV certificates are cheaper and less work to get but start out with neutral trust, so your early downloads will get warnings that the binaries aren't downloaded very often.
The sort of AV problem is unfortunately quite common on Windows, partly because a lot of devs and especially the sort of UNIX-oriented devs that write Nim and Go programs simply won't sign their software. It's the nature of modern platforms: you either sign your software and build up reputation, like with sending email, or you don't and end up being hit by the full brunt of heuristic guessing (or on macOS, refusal to run at all without workarounds). Not signing on Windows is a bit like sending email without SPF or DKIM, it's going to land you in the spam folder a lot.
Windows will show a warning dialog for essentially any unknown executable downloaded from the internet. The only way out of this is to buy a somewhat expensive EV code signing certificate and sign the binary. Or to have that binary become popular enough to get known, but then you have the same issue again after an update.
Chrome will tell users that "downloaded files are dangerous" if they are an unknown executable. So far I don't know any way around this warning, and users have to go to the full download page to override this. No idea how to get Chrome to trust this, maybe code signing helps here as well, but who knows.
And we're not even at false positives from anti-virus yet, those come on top of these problems.
Windows has done this since at least XP with any executable of remote origins (including other machines in LANs), regardless of digital signatures. Personally, I think this is fine so long as it is just a notification/warning and lets the user be on their way with a simple confirmation.
The protections are in place because most users can't be trusted to have enough self-control and intelligence to question that attachment called VerifyYourPassword.exe from youronlineaccount@totallyrealchasebank.com
I highly doubt that having a built in package manager starting in Windows 98 would have in any way shape or form affected how people interact with email attachments. They’re two completely different tasks and nothing about package management would really carry over. People are still going to want to read that super important attachment without a second thought even if they can install a package using Apt.
In fact, macOS has pretty much the exact same protections in the form of Gatekeeper, so it’s clearly not a Windows-only thing.
GPs point was that users are trained by having to run random executables in order to install anything. That they are now conditioned into casually running other programs that are not installers is the result.
> I highly doubt that having a built in package manager starting in Windows 98 would have in any way shape or form affected how people interact with email attachments. They’re two completely different tasks and nothing about package management would really carry over. People are still going to want to read that super important attachment without a second thought even if they can install a package using Apt.
This is an argument for making opening something and running something distinct actions in GUI programs (including your mail reader, browser downloads and file explorer) so that a user trying to open something does not execute it by accident, not for the current AV industry. It just so happens that that's how things work in many Linux desktop environments.
> In fact, macOS has pretty much the exact same protections in the form of Gatekeeper, so it’s clearly not a Windows-only thing.
Apple, like Microsoft, also profits from making developers codesign their applications. They also both want to profit even more by making developers sell their applications through the OS app store where they can take a cut. Both of them engaging in this "security" bs is hardly an argument that they are doing it to protect their users.
* lets not allow them to run some program because it is dangerous * maybe just remove all programs that are not signed * actually, only programs that are signed by approved by us devs * not even them, we decide which program should the user install * maybe dont allow them to read email because its dangerous * ... allow them to press only specific keys on the keyboard in case they start entering a credit card, we must read all keys they press * listen to what they say in case they start talking with a dangerous person on the phone we must block the phone call
Meanwhile their own products are basically spyware.
EV certs don't have that problem. Even for a new company or individual who has never distributed software to Windows before, user won't see any warnings. EV certs have a more thorough ID verification procedure, and keys have to be protected in hardware so you can't accidentally push them somewhere. Most CAs will physically mail you a USB dongle that you can use for signing.
Nonetheless, the unknown binary warnings will go away even if you use an OV cert as long as your early users are forgiving.
Every time I was using a mingw tool chain to either compile c++ directly, or using it as part of something like Nikita to distribute python junk. Windows defender just stopped execution, some of the enterprise endpoint junk deletes the file entirely.
We signed the exe with a standard code signing cert and the problems went away.
These days we use an EV code signing cert that have to have their private key in an HSM.
Fortunately, this problem has been cleared up.
These languages are almost always built statically so the stdlib and other dependencies are always included in the program binaries and could trigger a false positive.
My general feeling is that we're going to see many years of ML over-fitting for common cases, getting power users banned from various services, various oddball binaries flagged as malicious, etc.
Far more likely that some ML algorithm trained on malware found the same patterns in legit software, all without any particular knowledge of source language.
the amount of productivity lost to useless anti-virus software is incalculable
Only components packaged were Microsoft provided!
Don't know if it got better nowadays.
Sorry, but it's just the way of the world now.
The SmartScreen popup happens for all native executables downloaded from the internet, even when they are code signed with a 'regular' code signing certificate, it doesn't matter in which language those executables had been coded in. Only way around that popup reliably is to buy an expensive "EV certificate" (at least as far as I know) [0].
As far as I understand, SmartScreen assigns an intransparent "reputation score" to executable downloads. Popular downloads have a higher reputation score than propgrams with low download numbers. And programs signed with an "EV Certificate" have a higher reputation score then an unsigned program, or a program with a regular code signing certificate.
TL;DR: if you want to distribute software on Windows outside the Microsoft Store, you need to get an expensive EV code signing certificate.
[0] https://www.digicert.com/support/resources/faq/public-trust-...
I don't know much about Nim, but its website claims that it has two possible runtimes[1]. What they dub the "old runtime" and the "new runtime". What's the source of discrepancy here?
My parents still buys antiviruses for Windows, I told them to switch to Ubuntu long ago.
> My parents still buys antiviruses for Windows
If I may offer some advice, don't tell elderly people to change anything, especially about things they're not familiar with, like computers are for many of them. The more people grow old, the more they need familiarity with things. During the years, also thanks to the transition to become a grey beard myself, I've learned the lesson and adopted a different approach, both for relatives and customers: I offer to solve problems at minimum effort, that is, no more viruses, lost data due to OS or software crashes, licenses and their expiration, planned obsolescence and subsequent need to buy new hardware, etc. It goes like "I'm giving you something much better with all your data where you expect them to be; you use it for a while, then after some time if you don't feel comfortable I'll revert it back exactly like before, for free". The "free" part of course is needed outside of family and friends. It is important to keep technical data for ourselves because every term they don't understand would reinforce the perception that Linux can't be used by non technical people and they would fear it long before even having seen it in action. If they ask "what's Linux?" the answer should be like "something like Windows but less problematic" and nothing more. I've started to experience success stories in migrating Windows users to Linux the day I've stopped expecting they could understand what is a compiler, a kernel or the GNU philosophy.
Where does this belief come from? Sure it will be challenging for them to get up to speed in a new environment but i don't think there is any rule against learning new things at that age. I would argue that new and different can help improve their mind. Is there any recent science that has provided insight into this?
> I would argue that new and different can help improve their mind.
If it is something they want to learn, probably yes. If it is something forced upon them while they are trying to do something completely different, it can just as well make them even less receptive to learning new technology.
On the other hand, Microsoft is doing everything to appease their users. The Excel software have a bug to maintain backward compatibility. I won't recommend any Windows users to switch to Linux.
Last time I checked (could be very out of date) Linux doesn't have any way to enforce code signing requirements, even in the kernel.
I've found it very easy to do so. This statement seems like you didn't use the phone or the keyboard.
Cool. So we just all need to politely ask Microsoft to sign our binaries. What a bright future where Microsoft have the power to decide who lives and who dies.
I know that you'll answer that Apple also does it. Well, it's also an issue.
Who needs courts and laws when you have good corporations :)
This thread is about AV software, sadly the horrible headline ("on Windows") makes everyone who stopped with the headline comment about unrelated things.
There is your answer.
Granted, this is a debugger, which among other things contains code to inject threads into running processes - which, of course, trips any decent heuristic scanner. But there are many broadly legitimate patterns that are also useful to malware and so get falsely reported as such, e.g. https://github.com/nim-lang/Nim/pull/19767