|
|
|
|
|
by inbx0
1693 days ago
|
|
Reminder that people should seriously consider disabling the install-scripts. Personal system-wide config: npm/yarn config set ignore-scripts true -g
and add & commit a .npmrc/.yarnrc file with ignore-scripts true
Yes, this will cause headaches in some (increasingly rare) cases where some package actually needs those scripts. You can fix this with custom install scripts that take care of running install for those specific packages.And yes yes, as people love to point out, this isn't exactly a bulletproof solution either. The attacker could just put the malicious code inside the package's code and wait for it to be actually executed. But again and again, they don't, they choose to use the package's install scripts as the place to do their dirty work. So in practice this policy would've alrady protected you from who knows how many of these attacks, and my guess is that it'll continue to do so. |
|