npm / npm/cli

[FEATURE]: ignore file for npm audit

Open
#8,886 1 comment 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

npm audit doesnt have a mechanism to ignore invalid security advisories.

This leads to A) spending time upgrading, testing new libraries simply to silence the audit or B) moving to other audit libraries that can have overrides like https://github.com/IBM/audit-ci.

For example https://github.com/advisories/GHSA-f8cm-6447-x5h2 is a flagged as a 'critical' vulnerability by npm audit. For frontend-only codebases, this is totally invalid since it's a path traversal issues that only affect backend node.js systems.

Proposal: adopt the audit-ci's configuration file format or something similar in npm audit:

// audit-ci.jsonc
{
  // $schema provides code completion hints to IDEs.
  "$schema": "https://github.com/IBM/audit-ci/raw/main/docs/schema.json",
  "moderate": true,
  "allowlist": [
    // Axios denial of service https://github.com/advisories/GHSA-42xw-2xvc-qx8m
    "GHSA-42xw-2xvc-qx8m",
    // The following are for the latest create-react-app
    // https://github.com/advisories/GHSA-rp65-9cf3-cjxr
    // Alternatively, allowlist "GHSA-rp65-9cf3-cjxr" to suppress this nth-check advisory across all paths
    // or "*|react-scripts>*" to suppress advisories for all transitive dependencies of "react-scripts".
    "GHSA-rp65-9cf3-cjxr|react-scripts>@svgr/webpack>@svgr/plugin-svgo>svgo>css-select>nth-check",
  ],
}

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 by reviewing npm audit's existing advisory handling and the audit-ci configuration format linked in the issue. Done means npm audit can read an ignore or allowlist configuration that suppresses specified advisories, including the shown advisory and dependency-path patterns.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.