# Blocking malicious npm packages before and during installation

DevFeed: [Blocking malicious npm packages before and during installation](<https://devfeed.tech/articles/blocking-malicious-npm-packages-before-and-during-installation-112727.md>)

Original publisher: [Read original article](<https://vercel.com/changelog/blocking-malicious-npm-packages-before-and-during-installation>)

Author: Andrew Healey

Published: 2026-11-02T00:00:00Z

Content type: release

Language: en

Sources: [Vercel News](<https://devfeed.tech/sources/vercel-news.md>)

Topics: [npm security](<https://devfeed.tech/topics/npm-security.md>), [npm packages](<https://devfeed.tech/topics/npm-packages.md>), [malicious packages](<https://devfeed.tech/topics/malicious-packages.md>), [code security](<https://devfeed.tech/topics/code-security.md>), [npm](<https://devfeed.tech/topics/npm.md>)

Tags: [automatically](<https://devfeed.tech/tags/automatically.md>), [blocking](<https://devfeed.tech/tags/blocking.md>), [blocks](<https://devfeed.tech/tags/blocks.md>), [builds](<https://devfeed.tech/tags/builds.md>), [cache](<https://devfeed.tech/tags/cache.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [dependency](<https://devfeed.tech/tags/dependency.md>), [deployment](<https://devfeed.tech/tags/deployment.md>), [downloads](<https://devfeed.tech/tags/downloads.md>), [error](<https://devfeed.tech/tags/error.md>), [existing](<https://devfeed.tech/tags/existing.md>), [function](<https://devfeed.tech/tags/function.md>), [install](<https://devfeed.tech/tags/install.md>), [installation](<https://devfeed.tech/tags/installation.md>), [malicious](<https://devfeed.tech/tags/malicious.md>), [malware](<https://devfeed.tech/tags/malware.md>), [minutes](<https://devfeed.tech/tags/minutes.md>), [npm](<https://devfeed.tech/tags/npm.md>), [npm-packages](<https://devfeed.tech/tags/npm-packages.md>), [packages](<https://devfeed.tech/tags/packages.md>)

## AI overview

Vercel checks blocked npm package versions before and during dependency installation to help prevent malicious install scripts from running. Before installation, it scans supported lockfiles, including when dependencies come from the build cache; during installation, it blocks affected public npm downloads. Existing checks of installed dependencies and function outputs continue before deployment. Protections apply automatically to new builds on all plans. When a blocked package is found, Vercel fails the deployment, names the package and version, and attempts to invalidate the affected build cache. Update the dependency and lockfile to a safe version, then redeploy.

## Source excerpt

Vercel now checks for blocked npm packages before and during dependency installation in builds, helping prevent malicious install scripts from running. The checks use a blocklist of specific package versions selected for blocking because of malware or security vulnerabilities, with new rules typically reaching new builds within minutes. Before installation, Vercel checks supported lockfiles, including when dependencies are restored from the build cache. During installation, Vercel blocks affected public npm downloads. Existing checks of installed dependencies and function outputs continue before deployment. These protections apply automatically to new builds on all plans, with no configuration required. If a blocked dependency is detected, Vercel fails the deployment, identifies the package and version in the error, and attempts to invalidate the affected build cache. Update the dependency to a safe version and update the lockfile, then redeploy. Read more