Vercel now automatically blocks malicious npm packages before and during dependency installation in builds. Vercel says the checks help stop harmful install scripts, which are commands a package runs automatically when it is installed, from executing.
The checks rely on a blocklist of specific package versions flagged for malware or security vulnerabilities. Vercel says new rules typically reach new builds within minutes. Before installation, Vercel checks supported lockfiles, the files that record exact dependency versions, including when dependencies are restored from the build cache. During installation, it blocks affected downloads from the public npm registry. Existing checks of installed dependencies and function outputs continue before deployment.
The protections apply automatically to new builds on all plans, with no configuration required. When Vercel detects a blocked dependency, it fails the deployment and names the package and version in the error. It also attempts to invalidate the affected build cache. Vercel directs users to update the dependency to a safe version, update the lockfile, and redeploy.
Source: Blocking malicious npm packages before and during installation – Vercel.