【发布时间】:2016-10-17 10:36:10
【问题描述】:
我刚刚在服务器中安装了 nodejs,基本的npm install 显示了很多这样的消息:
$ npm install
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated graceful-fs@2.0.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN prefer global node-gyp@3.4.0 should be installed with -g
注意出现在右侧的消息:
npm WARN ... or higher to avoid a RegExp DoS issue
^^^^^^^^^^^^^^^^^^^^^^^^^^^
在我的本地服务器中,我已经在使用 minimatch 3.0.3。但是,由于服务器没有使用最新版本的节点,这对我来说是新的并开始调查:
npm's github 报告了此问题,并在其他问题中提及。一般来说,通过将minimatch的版本升级到至少3.0.2来解决。
但是,我想知道这个 RegExp DoS 问题是什么?是否有任何特定的正则表达式允许通过 minimatch 进行 DoS 攻击?我无法想象这是怎么发生的,也不想重现它,但我找不到更多文档,minimatch's Github list of issues 没有任何痕迹。
从releases pages 我看到the only commit for the 3.0.2 release,其中基本上封装了正则表达式语法(我对JavaScript 不够熟悉,无法将其全部跟踪到最后一个小细节)。
【问题讨论】:
-
问题记录在here。
标签: javascript node.js npm minimatch