Axios JavaScript library has been compromised with malware in supply chain attack (github.com)
from qaz@lemmy.world to selfhosted@lemmy.world on 31 Mar 04:15
https://lemmy.world/post/44969195

#selfhosted

threaded - newest

fizzle@quokk.au on 31 Mar 07:02 next collapse

Doesn’t seem to have been live for very long.

eskuero@lemmy.fromshado.ws on 31 Mar 08:53 next collapse

You can mitigate similar attacks by editing your .npmrc

min-release-age=7 # days
ignore-scripts=true
PetteriPano@lemmy.world on 31 Mar 08:58 collapse

It’s a good way to keep the exploit around for seven days, too, if you apply it right away.

taco_shale032@lemmy.ml on 31 Mar 09:18 next collapse

I agree, I think it would be better to use something like dependabot or renovatebot so you can know of and apply security updates right away.

eskuero@lemmy.fromshado.ws on 31 Mar 09:34 collapse

As long as the bot is not allowed to automatically merge minor version bumps in libraries…

magikmw@piefed.social on 31 Mar 13:33 collapse

Well yes, one can misuse any tool.

eskuero@lemmy.fromshado.ws on 31 Mar 19:21 collapse

How? If you got hit by this you are looking at restoring the system from a safe previous version.

And the compromised versions get pulled, not superseeded by a new release, so once you rebuild you would go back to a safe version…

TechnoCat@piefed.social on 31 Mar 13:57 collapse

I always advocate switching to pnpm where install scripts are disabled by default. It has plenty of security features to ward off most supply chain attacks.

techpeakedin1991@lemmy.ml on 31 Mar 14:47 collapse

Does disabling install scripts actually do anything though? The attack would still work if put in the code itself, no? The only difference I can see is that it would run when the project is run instead of when the package is installed.

TechnoCat@piefed.social on 31 Mar 19:58 next collapse

Minimum age would have prevented it in this case.

TechnoCat@piefed.social on 31 Mar 20:06 collapse

On closer inspection, preventing post-install would have fixed it too: “The attack exploited a transitive dependency, plain-crypto-js@4.2.1, which executed a postinstall script to deploy the RAT.”