Skip to content
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

🟢 Recommending npm install --ignore-scripts might provide a false sense of security #320

Open
Tracked by #382 ...
Gaelan opened this issue Jun 22, 2023 · 1 comment
Labels
Engineering Task related to the Engineering Guide and/or pulled from the old Engineering Guide repo. enhancement New feature or request Guides Initiative 2 Tracks work for "Improving the Maintainability of the 18F Guides and Methods"

Comments

@Gaelan
Copy link

Gaelan commented Jun 22, 2023

The JavaScript guidelines recommend using npm install --ignore-scripts to install unknown or new packages. That's not bad advice, but I worry that the text overemphasizes the risk of malicious scripts in particular, while not mentioning the possibility of malicious code in the package itself, which in many cases would allow an attacker to do exactly the same things — it's not great to imply that a package can be made safe by solely checking or disabling the scripts.

It seems like the right advice to give involves a combination of technical measures like --ignore-scripts, popularity/reputational signals (extremely popular packages are likely safe as they have lots of eyes on them; packages from well-known organizations are unlikely to be malicious as long as they're actually from that organization), and old-fashioned code review*, including making the same assessment for all dependencies.

*of the code on npm — unless the package uses npm's new provenance feature, there's no guarantee what's on npm matches what's on GitHub.

@geekygirlsarah
Copy link
Contributor

Hi @Gaelan! You're right, we probably need to revise this a bit.

There's a small group of people working on guide maintenance right now and we could probably rewrite several dev guide pages. We will keep this issue around until we're ready to do the rewrites.

Thanks for bringing this up!

@geekygirlsarah geekygirlsarah added the enhancement New feature or request label Jun 23, 2023
@christophermather christophermather transferred this issue from 18F/development-guide Dec 20, 2023
@christophermather christophermather added the Engineering Task related to the Engineering Guide and/or pulled from the old Engineering Guide repo. label Dec 20, 2023
@christophermather christophermather added Initiative 2 Tracks work for "Improving the Maintainability of the 18F Guides and Methods" Guides labels Dec 22, 2023
@amymok amymok changed the title Recommending npm install --ignore-scripts might provide a false sense of security 🟢 Recommending npm install --ignore-scripts might provide a false sense of security Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering Task related to the Engineering Guide and/or pulled from the old Engineering Guide repo. enhancement New feature or request Guides Initiative 2 Tracks work for "Improving the Maintainability of the 18F Guides and Methods"
Projects
None yet
Development

No branches or pull requests

3 participants