【问题标题】:Arbitrary Code Execution error on underscore npm package下划线 npm 包上的任意代码执行错误
【发布时间】:2021-05-18 12:43:46
【问题描述】:

当我运行 npm install 时,它显示发现了 1596 个漏洞(20 个低、51 个中等、1525 个高) 运行npm audit fix 来修复它们,或者运行npm audit 了解详情

当我运行 npm audit 时,它会给我一个表列表,类似于:

┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Arbitrary Code Execution                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ underscore                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=1.12.1                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ @alch/alchemy-web3                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ @alch/alchemy-web3 > web3 > web3-shh > web3-net >            │
│               │ web3-core-method > underscore                                │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/1674                            │
└───────────────┴──────────────────────────────────────────────────────────────┘

┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ hosted-git-info                                              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=2.8.9 <3.0.0 || >=3.0.8                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ latest                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ latest > npm > npm-registry-client > normalize-package-data  │
│               │ > hosted-git-info                                            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/1677                            │
└───────────────┴──────────────────────────────────────────────────────────────┘

┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │ Remote Memory Exposure                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ request                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=2.68.0                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ version                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ version > request                                            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/309                             │
└───────────────┴──────────────────────────────────────────────────────────────┘

┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │ ReDoS                                                        │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ brace-expansion                                              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=1.1.7                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ latest                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ latest > npm > fs-vacuum > rimraf > glob > minimatch >       │
│               │ brace-expansion                                              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/338                             │
└───────────────┴──────────────────────────────────────────────────────────────┘

┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ hoek                                                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ > 4.2.0 < 5.0.0 || >= 5.0.3                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ latest                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ latest > npm > node-gyp > request > hawk > hoek              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/566                             │
└───────────────┴──────────────────────────────────────────────────────────────┘

┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Insecure Credential Storage                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ web3                                                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ @alch/alchemy-web3                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ @alch/alchemy-web3 > web3                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/877                             │
└───────────────┴──────────────────────────────────────────────────────────────┘

【问题讨论】:

  • 按照提到的补救措施here
  • 我尝试了同样的方法,但仍然遇到任意代码执行漏洞。还有其他解决方案吗?但我依赖环回而不是 @alch/alchemy-web3
  • 我删除了包锁并手动更改了 package.json 文件中的依赖项,然后点击-- npm install --。不知道这是否是正确的方法,但它奏效了。

标签: npm


【解决方案1】:

已将此问题提交给 Alchemy,因为他们的 @alch/alchemy-web3 最新软件包依赖项未升级为使用“Underscore”的修补版本。

他们进行了快速升级,截至 7 小时前,它已在 @alch/alchemy-web3 版本 "^1.0,3" 上修复;

请运行npm update @alch/alchemy-web3

【讨论】:

    猜你喜欢
    • 2011-01-27
    • 2013-10-29
    • 1970-01-01
    • 2020-01-17
    • 1970-01-01
    • 2014-02-02
    • 1970-01-01
    • 2013-08-21
    • 1970-01-01
    相关资源
    最近更新 更多