npm / npm/cli

[BUG] npm audit - explain and show data send to the registry

Open
#2,779 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Priority 2 Release 7.x
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

Hey, according to the docs:

The audit command submits a description of the dependencies configured in your project to your default registry and asks for a report of known vulnerabilities. (...)

However, this does not state clearly the exact data sent to the registry.

This, along with a lack of an "offline mode" and the fact that some private npm registries may not support audit requests:

$ npm audit
npm ERR! code ENOAUDIT
npm ERR! audit Your configured registry (<some registry URL>) does not support audit requests

may end up with people using the --registry=https://registry.npmjs.org flag and sending potentially sensitive data to a public registry.

It would be great to:

  1. Extend the npm audit documentation so it clearly states what exact data is sent (package.json? package-lock.json? just list of dependencies with their versions?)
  2. Adding a --dry-run option to the npm audit command, so it shows the data that will be sent.
  3. Making npm audit fail if it gets an unrecognized option, so it does not send a request if someone mistakenly do npm audit --halp
  4. (Wishful thinking?) Have an --offline mode

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked npm audit documentation and the npm audit command behavior described in the issue. Determine which request data is sent, how unrecognized options are handled, and whether dry-run or offline behavior is feasible; done means the agreed scope is documented and verified without sending unintended data.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, documentation, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.