npm audit是如何工作的?

12

我正在尝试了解 npm audit 命令的工作原理。

它是通过什么算法定义存在问题的?

最重要的是,它如何区分级别: 低 / 中等 / 高 / 严重

在此输入图片描述

2个回答

13

没有算法,只有人。

npm audit所做的是查看您正在使用的软件包及其版本,并将其与npm的漏洞数据库进行比较。这是该数据库的网页界面

如果您单击任何“问题”,则会看到三个信息:问题描述、推荐解决方案和问题报告位置的链接。

至于npm如何确定问题的严重程度,它并没有确定。人们确定问题的严重性,几乎所有工作都由志愿者完成。这是开源的承诺之一:足够多的人审视您的非隐藏代码,即可发现漏洞。


3

npm audit是一个安全模块,用于查找npm软件包的漏洞, 漏洞数据库可在以下网站上找到: https://www.npmjs.com/advisories

漏洞格式如下:

    {
  "id": <vulnerability id>,
  "created_at": <creation date>,
  "updated_at": <update date>,
  "title": <vulnerability title>,
  "author": {
    "name": <contributor name>,
    "website": <contributor website>,
    "username": <contributor username>
  },
  "module_name": <product name>,
  "publish_date": <publication date>,
  "cves": [
    <cve name (if existing)>
  ],
  "vulnerable_versions": <vulnerable version(s)>,
  "patched_versions": <fix version(s)>,
  "overview": <vulnerability description>,
  "recommendation": <vendor advisory>,
  "references": [
    <source list>
  ],
  "cvss_vector": <CVSS vector in format AV:x/AC:x/PR:x/UI:x/S:x/C:x/I:x/A:x>,
  "cvss_score": <criticity score (between 0 and 10)>,
  "coordinating_vendor": <editor information>
}

npm审计将匹配软件包信息与所有漏洞相匹配,并返回匹配漏洞。

关于评分,使用了CVSS评分方法,您可以在此处找到文档: https://www.first.org/cvss/specification-document


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接