TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Package.json needs an allowList for the deps that can run postinstall

4 pointsby 01walidover 2 years ago
The fact that any dependency can run a postinstall script is a supply chain attack risk!<p>I believe package managers (npm, pnpm, yarn ..) need to account for a `allowList`-like implementation to give more granularity to what dependency can run a postinstall, as opposed to the all-in or not `--ignore-scripts` option.<p>It can be made backward-compatible, where it&#x27;s allowed by default if there&#x27;s no allowList, else, only the allowed deps if present.<p>An empty array would be equivalant to `--ignore-scripts` by default.<p>Orgs&#x2F;teams can define their own allowList and have it enforced as a policy or a recommendation.<p>I know this is not enough to fully mitigate suply chain attacks, but it&#x27;d be a postive step forward.<p>I&#x27;m not sure where to post such a proposal? npm ?

no comments

no comments