react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

Avast - "We've moved TSLocationManager to your Virus Chest because it was infected with MacOS:Pirrit-CS [PUP]"

Open edgarbonillag opened this issue 6 years ago • 20 comments

Your Environment

  • Plugin version: -> 3.9.3
  • Platform: iOS or Android -> Both
  • OS version: 10.15.7 MacOS Catalina
  • Device manufacturer / model: Apple MacBook Pro 15-inch mid-2015
  • React Native version (react-native -v): 0.61.5
  • Plugin config
Not necessary to put as it is not relevant.

Expected Behavior

yarn add [email protected] Package should install

Actual Behavior

yarn add [email protected] Package installation gets interrupted and the Avast window appears showing the message: "We've moved TSLocationManager to your Virus Chest because it was infected with MacOS:Pirrit-CS [PUP]"

Steps to Reproduce

  1. Have Avast installed.
  2. Execute yarn add [email protected]

Context

Debug logs

Logs
From Avast:

Threat name: MacOS:Pirrit.CS [PUP]
Severity: (2 out of 3)
File name: TSLocationManager
File path: /Users/username/Library/Caches/Yarn/v6/npm-react-native-background-geolocation-3.9.3-7bab17653c852e3b54fa2765a85f1ae3d6bf548a-integrity/node_modules/react-native-background-geolocation/ios/RNBackgroundGeolocation/TSLocationManager.framework/TSLocationManager
Process: /usr/local/Cellar/node@10/10.21.0/bin/node
Detected by: File Shield
Status: Threat blocked

edgarbonillag avatar Nov 25 '20 00:11 edgarbonillag

This may be infected in your cache, not the original distribution.

Here's the file as you pull it from github: https://github.com/transistorsoft/react-native-background-geolocation/blob/f8b75ad73f9e3fe3d3bc534940a0d757da99b1e0/ios/RNBackgroundGeolocation/TSLocationManager.framework/TSLocationManager

Not sure how exactly to run a test detection against it, but if you download that file directly and have your Avast scan it, the result could be interesting. Note there are reports of false positives of this one, as well as virus packages with false negatives, so any result is just a result until corroborated.

mikehardy avatar Nov 25 '20 02:11 mikehardy

Likely a false positive. A virus inserting itself into a compiled Obj-c framework doesn't seem plausible.

christocracy avatar Nov 25 '20 03:11 christocracy

This may be infected in your cache, not the original distribution.

Here's the file as you pull it from github: https://github.com/transistorsoft/react-native-background-geolocation/blob/f8b75ad73f9e3fe3d3bc534940a0d757da99b1e0/ios/RNBackgroundGeolocation/TSLocationManager.framework/TSLocationManager

Not sure how exactly to run a test detection against it, but if you download that file directly and have your Avast scan it, the result could be interesting. Note there are reports of false positives of this one, as well as virus packages with false negatives, so any result is just a result until corroborated.

Hi @mikehardy and @christocracy , thank you for your answers. I did what it's mentioned above and Avast marks the file downloaded directly from the repo as a threat. So, maybe it can be a false positive. But just in case, can you double-check that file and if you determine it is indeed a false positive, please close the issue and let me know.

Thank you very much.

edgarbonillag avatar Nov 25 '20 04:11 edgarbonillag

MalwareBytes says all is good on my machine:

christocracy avatar Nov 25 '20 14:11 christocracy

Not trying to be a pain, but it appears malwarebytes is false negative for at least some versions of this one

https://www.virustotal.com/gui/file/96b5ab22505da91c50369b64ecee36279ee507c8c986a4b3d5aa2cc8c966653b/detection

I wish there was just a byte string (or strings) we could grep for rather than relying on opaque malware detection engines. I've got no special knowledge here unfortunately

mikehardy avatar Nov 25 '20 14:11 mikehardy

For the record, I also think infection is implausible, I'm 99% this is false positive, but paranoia pays (to a certain extend) in security, so just trying to pin down that last %

mikehardy avatar Nov 25 '20 14:11 mikehardy

Ran Avast on my machine:

Someone on private Cordova repo reported this too, which references *Process: FileProvider.framework`, which is an iOS System library.

christocracy avatar Nov 25 '20 21:11 christocracy

Ran Avast on my machine:

Someone on private Cordova repo reported this too, which references *Process: FileProvider.framework`, which is an iOS System library.

this is file system because its extracting from zip npm install from git url git blocked git clone fails git blocked download repo in zip and extract git the above image

mohamedsharaf avatar Nov 26 '20 07:11 mohamedsharaf

Using https://virustotal.com and uploading different versions of TSLocationManager starting with 3.0.0, I've found the exact version where this starts being detected. I had a hunch it would be when I introduced the new Config.encrypt feature (with RNCryptor) and I was right.

The exact version where this starts being detected is 3.4.0

christocracy avatar Nov 26 '20 14:11 christocracy

Removing RNCryptor from the library cleans it up.

I'm going to throw the Config.encrypt feature in the garbage.

christocracy avatar Nov 26 '20 14:11 christocracy

@christocracy

I think its because you are using the old version of RNCryptor which is known to have vulnerabilities try the new version and i think it will work fine

regards

mohamedsharaf avatar Nov 26 '20 14:11 mohamedsharaf

@mohamedsharaf Reference?

christocracy avatar Nov 26 '20 14:11 christocracy

https://robnapier.net/rncryptor-hmac-vulnerability https://seclists.org/fulldisclosure/2015/Jun/28

hope this help

mohamedsharaf avatar Nov 26 '20 15:11 mohamedsharaf

  • Your first reference is from year 2012.
  • Your second link is from year 2015.

Config.encrypt was introduced a year ago (2019) using what is still the latest version of RNCRyptor 5.1.0

christocracy avatar Nov 26 '20 15:11 christocracy

Config.encrypt feature is removed in branch release-3.10.0. Go ahead and analyze TSLocationManager from that branch.

christocracy avatar Nov 26 '20 16:11 christocracy

its clean now can u update cordova version

mohamedsharaf avatar Nov 26 '20 16:11 mohamedsharaf

All 3 plugin versions (react-native, cordova and flutter) have been pushed..

christocracy avatar Nov 26 '20 16:11 christocracy

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.

stale[bot] avatar Feb 02 '21 04:02 stale[bot]

Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.

stale[bot] avatar Feb 16 '21 07:02 stale[bot]

Latest 3.10.0 released today has removed Config.encrypt.

christocracy avatar Feb 17 '21 22:02 christocracy