Skip to content
Business logic Write-up Beginner

Package Planting: Are You [Unknowingly] Maintaining Poisoned Packages?

npm allowed any user to add other users as maintainers of a package without their consent or notification. An attacker could create a malicious package and add trusted maintainers to make it appear legitimate, potentially tricking developers into installing it.

Yakir Kadkoda Follow

Published on blog.aquasec.com

Aqua’s Team Nautilus found a logical flaw in npm that allows threat actors to masquerade a malicious package as legitimate and trick unsuspecting developers into installing it. Up until recently, npm allowed adding anyone as a maintainer of the package without notifying these users or getting their consent.

Yakir Kadkoda, on blog.aquasec.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the lack of a confirmation step when adding a new maintainer to an npm package, allowing arbitrary users to be assigned without consent.

Impact

An attacker could make a malicious package appear legitimate by adding trusted maintainers, potentially tricking developers into installing it; the text also notes a defamation scenario where added developers could be reported and banned.

What the attacker needed

An npm account; ability to publish a package

The fix

npm fixed the flaw by adding a confirmation mechanism: new maintainers must accept an email invitation before being added.

How it was found

  1. Create and publish an npm package with a chosen name.
  2. Add the users you wish to incriminate as owners.
  3. Remove yourself from the package.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

In npm, the main package manager for JavaScript, a package can have multiple maintainers. The bug was that you could add someone as a maintainer without them agreeing. This let attackers make a bad package look trustworthy by putting famous developers' names on it.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by Yakir Kadkoda

View all

3 more disclosed reports, best first.

More from GitHub

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.