Glossary

Malicious Package.

Also called malicious packages, poisoned package, malicious dependency, malicious npm package

In Short

A malicious package is a software package that has been made or changed to carry harmful code, then shared through a package source that developers trust. Developers who add it as a dependency can pull that code into their own software.

Last updated October 23, 2026
Profile MapGlossary Term
  1. Also Called4other namesmalicious packages · poisoned package · malicious dependency
  2. Related Terms3linked entriesSupply chain attack · Typosquatting

What Is a Malicious Package?

A package is a bundle of reusable code that developers add to their projects. Open-source packages are shared through public registries, and the tools that fetch them include npm and pip. A malicious package carries harmful code. The harmful code may come from a package made to look useful, or from a real package that an attacker altered.

MITRE ATT&CK describes this under compromising software dependencies and development tools. It says adversaries may manipulate software dependencies and development tools before the user receives them. It lists compromising popular open-source packages, typosquatting, and targeting CI/CD pipelines such as GitHub Actions. CI/CD pipelines are the automated steps that build and deliver software.

How Do Poisoned Packages Reach Developers?

MITRE describes dependency poisoning of widely used packages in registries such as npm and pip. It also describes re-registering removed or abandoned packages to distribute malware, and using names similar to legitimate libraries to deceive developers.

For detection, MITRE points to suspicious package manager activity, such as unexpected file writes to dependency directories and unusual network connections to unfamiliar registries after install lifecycle hooks run. Lifecycle hooks are scripts that run automatically around an install.

What Does a Real Case Look Like?

CISA published an alert about a self-replicating worm in the npm ecosystem that compromised over 500 packages. CISA says the malware scanned environments for sensitive credentials, including GitHub personal access tokens and API keys for AWS, GCP and Microsoft Azure. It says the worm used an automated process to spread by authenticating to the npm registry as the compromised developer and injecting code into other packages.

How Does a Poisoned Package Spread?

This flow follows the npm worm that CISA described in its September 2025 alert. Other cases can differ. See also the Shai-Hulud incident page and valid accounts, since stolen tokens act as logins.

How the npm Worm in the CISA Alert Spread
  1. Tainted package runsAfter the worm gains access, it starts scanning the environment.
  2. Credential scanIt looks for GitHub personal access tokens and AWS, GCP and Azure API keys.
  3. Credentials leaveCISA says they go to an attacker endpoint and to a public GitHub repository named Shai-Hulud.
  4. Spread to othersIt logs in to npm as the developer, injects code into other packages and publishes them.Technique T1195.001 (MITRE ATT&CK, opens in a new tab)
  5. Clean upCISA advises pinning to versions before 16 September 2025 and rotating developer credentials.

Why Does a Trusted Channel Make It Worse?

A malicious package arrives through a channel developers already trust, so it may not look like an attack. One package can be a dependency of many applications, so a single change can reach many users. In the case CISA described, the stolen credentials were also used to spread the code further. This is a reason to treat dependencies as part of your attack surface.

How Do You Pin and Audit Dependencies?

These steps come from MITRE and CISA.

  • Lock dependencies to specific versions instead of pulling the latest release, and pin GitHub Actions to a specific commit hash rather than a tag or branch.
  • Require developers to pull from internal repositories of verified and approved packages rather than external ones.
  • Keep software updated and monitor vulnerability sources, with automated code review tools.
  • Audit dependencies through lock files, rotate developer credentials and enforce phishing-resistant multifactor authentication on developer accounts, as CISA advised in the npm alert.

Is a Malicious Package the Same as a Vulnerable Package?

No. A vulnerable package has an honest flaw that could be abused. A malicious package has been built or changed to cause harm.

Is It the Same as a Supply Chain Attack?

Not exactly. A supply chain attack is the wider idea of attacking through a supplier or a component. A malicious package is one common way it can happen. Related terms are supply chain attack, typosquatting and SBOM.

Sources

  • MITRE ATT&CK: MITRE ATT&CK says adversaries may manipulate dependencies and development tools before users receive them, including open-source packages, typosquatting and CI/CD pipelines.
  • CISA: CISA alert on a self-replicating npm worm that harvested credentials and injected code into other packages, with recommendations to pin versions, rotate credentials and require phishing-resistant MFA.

Also Called.

  • Namemalicious packages
  • Namepoisoned package
  • Namemalicious dependency
  • Namemalicious npm package

Questions.

  • What is a malicious package?

    A malicious package is a software package that has been made or changed to carry harmful code, then shared through a package source that developers trust. Developers who add it as a dependency can pull that code into their own software.

  • How do malicious packages get into software?

    MITRE describes dependency poisoning of widely used packages in registries such as npm and pip, re-registering removed or abandoned packages, and using names similar to legitimate libraries to deceive developers.

  • How can you detect a malicious package?

    MITRE points to suspicious package manager activity, such as unexpected file writes to dependency directories and unusual network connections to unfamiliar registries after install lifecycle hooks run.

In Our Research

  1. 1 Node.js Ecosystem Roundup: Node-RED Exploitation Reported, Cisco’s Brotli List and the 11 November Release November 2026
  2. 2 Hugging Face Malware Campaign: 31 Rigged Models and One Risky Flag October 2026
  3. 3 AGENTS.md in Downloads: How a Dropped File Hijacks Coding Agents October 2026
  4. 4 LiteLLM 1.107.0 Supply Chain Attack: Timeline, Stolen Data and a Response Checklist October 2026
  5. 5 Nx Console and GitHub: dev tools as an entry path October 2026
  6. 6 Cyber incidents of 2026: lessons from official reports October 2026