-
Notifications
You must be signed in to change notification settings - Fork 97
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
Version 1.2.9 contains malicious code #131
Comments
See also this RFC to disable npm scripts by default: npm/rfcs#80 |
Hello all, I've started a petition to try and get NPM to implement security measures to prevent publishing compromised packages. Please support our petition by signing and sharing, thank you! https://www.change.org/p/npm-please-secure-package-releasing |
Timestamps of the malicious packages' publication (via "npm show rc time"): Does anyone know when they were unpublished? |
https://twitter.com/npmjs/status/1456398505832976384 is a rough indication. |
Does anyone know if the malware is only targetting Windows or other operating systems as well? |
This one specifically was triggering the execution of a BAT file so, only Windows |
Are you sure because the ua-parser-js one also targeted windows (edit: I meant also Linux) and the file list looks similar. Is the code available somewhere? |
ua-parser-js had malware for Windows and Linux attached |
I still have the compromised package on my dev machine. Not sure how to share it though |
@magano Can you PM me on Twitter or on the e-mail listed on my profile? Happy to give instructions and I'd be interested on having a look. Thank you! |
@ccravens Be better off engaging Node (and your employer(s) about how you can contribute to a fund/project to acquire the funding to do so, rather than just have a petition for something they're well aware of. https://github.com/nodejs/nodejs.org/blob/main/CONTRIBUTING.md |
@magano can you upload the entire package to virustotal? |
1.2.9 has malware dominictarr/rc#131
@magano Can you please share with me the malicious package code on a twitter PM or send me a email on gntousakis@isc.tuc.gr ? I want to run some analysis on the source. Thank you very much! :-) :-) |
Does anybody know what's the exact timeframe of the availability of the malware? |
@chrisrocks please see the previous comments: |
In contrast to the I saw a lot of comments about them being basically the same payloads, but I wanted to confirm this somehow. I am especially interested if the behavior for Linux and Mac is the same, so it does not affect Linux and Mac at all. In this issue's description it mentions
|
That's because npm found it much faster and directly removed it shortly after it was published. |
@DanielRuf Do you know if we can find the malicious code somewhere so we can review it? |
In all cases (ua-parser-js, coa, rc) the payloads were: dll / exe for Windows (password stealer) + cprytominer for Windows / Linux, MacOS. A cryptominer is the smallest issue that you will have and mostly harmless.
See also #131 (comment)
So far npm was way faster to remove it so it looks like no one has a copy unless you were affected. Normally sonatype catches such things earlier but as npm was faster, not sure. See also https://blog.sonatype.com/npm-hijackers-at-it-again-popular-coa-and-rc-open-source-libraries-taken-over-to-spread-malware and https://www.bleepingcomputer.com/news/security/popular-coa-npm-library-hijacked-to-steal-user-passwords/
|
@DanielRuf That's not entirely true, I did not see a cryptominer shipped for Linux and MacOS in the
The preinstall line for
So if the |
It was at least the same threat actor according to the sources so the payloads were probably the same. rc and coa probably just shipped the stealer malware and not the cryptominer anymore. I did not check this in detail. I think the links contain the most information (for rc and coa it is probably safe to assume that it was the same payload). |
I uploaded the bat file to Virus Total which lead to this: And the js file lead to the following:
|
@magano thanks a lot! |
@magano could you please share with me the entire NPM package? My email address is cbershatsky@qualys.com - package is required for work |
1 - event-stream |
I'm maintaining a popular fork that is snyk-protected https://www.npmjs.com/package/run-con |
@volkancakil that isn’t what happened in either case, nor any other I’m aware of. |
You're right it absolutely is not. You can even see in the git history. Dom's npm keys must have been hacked |
Check if you have this version installed locally as it contains malicious code that runs on Windows
For a short period of time this version was available on the registry and it contained some malicious code!
If you have this version you should have 2 files:
And a preinstall script inside the package.json file
The text was updated successfully, but these errors were encountered: