Problem
Third-party scripts (i.e. scripts from dependencies) run during installation can be used for supply-chain attacks, which have been increasingly common recently.
Feature request
To protect against this risk, Yarn should run no third-party scripts by default. The only code run by default during installation should be from Yarn itself, the project author directly (i.e. top-level install scripts), or foundational system dependencies (e.g. Node.js, Bash, etc.).
Instead of running by default, install scripts from dependencies can be selectively enabled using an allowlist. This allows the project author to accept the risks of install scripts on a case-by-case basis, giving them the opportunity to do whatever analysis/audit/risk assessment they deem necessary. It also protects against new unexpected or unwanted install scripts.