Earlier quoted context omitted.
Lockfiles use exact hashes, not versions/version ranges. Javascript projects use two files, a package file with version ranges (used when upgrading) and a lockfile with the exact version (used in general when installing in an existing project).
Sure, but a lockfile with a hash doesn’t mean that next time it will fail if it tries to install a version of the package without that hash. If your package.json specifies a semver range then it’ll pull the latest minor or patch version (which is what happened in this case with e.g. duckdb@1.3.3) and ignore any hash differences if the version has changed. Hence why I say you need to go out of your way to specify an e…
You too can run malware from NPM (I mean without consequences)
111–120 of 122 posts
Re: You too can run malware from NPM (I mean without consequences)
#112Earlier quoted context omitted.
Sure, but a lockfile with a hash doesn’t mean that next time it will fail if it tries to install a version of the package without that hash. If your package.json specifies a semver range then it’ll pull the latest minor or patch version (which is what happened in this case with e.g. duckdb@1.3.3) and ignore any hash differences if the version has changed. Hence why I say you need to go out of your way to specify an e…
I think at some point you would be better off vendoring them in.
When I’m hacking on a C project and it’s got a bunch of code ripped out of another project, I’m like “heh, look at these primordial dependency management practices.” But five years later that thing is gonna compile no problem…
Re: You too can run malware from NPM (I mean without consequences)
#113Earlier quoted context omitted.
> flag sketchy releases Because the malware writers will keep tweaking the code until it passes that check, just like virus writers submit their viruses to VirusTotal until they are undetected.
its Typical that the Virus Writer will use their own service, there is criminal virustotal-clones that run many AV in VM and return the Results, because virustotal will share all binaries, anything upload in Virustotal will be detteceted shortly if it is not.
Re: You too can run malware from NPM (I mean without consequences)
#114Earlier quoted context omitted.
A complexity per line check would have flagged it. Even a max line length check would have flagged it.
That would flag a huge percentage of JS packages that ship with minified code.
Re: You too can run malware from NPM (I mean without consequences)
#115Earlier quoted context omitted.
Sure, but a lockfile with a hash doesn’t mean that next time it will fail if it tries to install a version of the package without that hash. If your package.json specifies a semver range then it’ll pull the latest minor or patch version (which is what happened in this case with e.g. duckdb@1.3.3) and ignore any hash differences if the version has changed. Hence why I say you need to go out of your way to specify an e…
I think at some point you would be better off vendoring them in.
Re: You too can run malware from NPM (I mean without consequences)
#116Re: You too can run malware from NPM (I mean without consequences)
#117Earlier quoted context omitted.
A complexity per line check would have flagged it. Even a max line length check would have flagged it.
That would flag a huge percentage of JS packages that ship with minified code.
Re: You too can run malware from NPM (I mean without consequences)
#118Seems like people already forgot about Jia Tan. By the way why doesn't npm have already a system in place to flag sketchy releases where most of the code looks normal and there is a newly added obfuscated code with hexadecimal variable names and array lookups for execution...
Because nobody gives a fsck. Normally, after npm was filled with malware, people would avoid it. But it seems that nobody (distro maintainers) cares. People get what they asked for (malware).
Re: You too can run malware from NPM (I mean without consequences)
#119In July, packages were loading malicious DLLs (on Windows targets) [1]. It doesn't appear Lavamoat would help in that scenario. Is that right? If so, how do you mitigate this? Run everything in a container? [1] https://www.crowdstrike.com/en-us/blog/crowdstrike-falcon-pr...
1. Control lifecycle scripts with @lavamoat/allow-scripts 2. Do local dev with https://github.com/lavamoat/kipuka installed (I'm working on it) 3. If you don't permit the APIs used for loading DLLs they won't load themselves, so runtime protections are valid too. But I recall the DLLs were loaded in lifecycle script.
Re: You too can run malware from NPM (I mean without consequences)
#120In July, packages were loading malicious DLLs (on Windows targets) [1]. It doesn't appear Lavamoat would help in that scenario. Is that right? If so, how do you mitigate this? Run everything in a container? [1] https://www.crowdstrike.com/en-us/blog/crowdstrike-falcon-pr...
https://gitlab.com/grepular/safernode