TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

4 点作者 01walid超过 2 年前
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 ?

暂无评论

暂无评论