【问题标题】:loader-utils is vulnerable to Regular Expression Denial of Service (ReDoS)loader-utils 容易受到正则表达式拒绝服务 (ReDoS) 攻击
【发布时间】:2023-01-06 22:52:31
【问题描述】:

我的 Angular 应用程序中的 VSCode 终端出现了一些错误:

loader-utils  3.0.0 - 3.2.0
Severity: high
loader-utils is vulnerable to Regular Expression Denial of Service (ReDoS) via url variable - https://github.com/advisories/GHSA-3rfm-jhwj-7488
loader-utils is vulnerable to Regular Expression Denial of Service (ReDoS) - https://github.com/advisories/GHSA-hhq3-ff78-jv3g
fix available via `npm audit fix`
node_modules/@angular-devkit/build-angular/node_modules/loader-utils
  @angular-devkit/build-angular  13.0.0-next.0 - 13.3.9 || 14.0.0-next.0 - 14.2.9 || 15.0.0-next.0 - 15.0.0-rc.5
  Depends on vulnerable versions of loader-utils
  node_modules/@angular-devkit/build-angular

2 high severity vulnerabilities

我尝试使用npm audit fix 但没有帮助。

如何安全地修复它(我是 Angular 的新手)?

我附上终端的截图。

谢谢你的帮助!

【问题讨论】:

    标签: node.js angular npm-vulnerabilities


    【解决方案1】:

    在您的 package-lock.json 文件中,将 loader-utils 版本更改为 3.2.1。此问题已在版本 1.4.2、2.0.4 和 3.2.1 中修补,对于使用 3.2.1 的 Angular

    "loader-utils": "3.2.0", ==> "loader-utils": "3.2.1",

    【讨论】:

    • 感谢您的回复,我已经按照您建议的方式完成了,但是遇到了另一个问题,忘记了关闭这个问题。
    • 在 package-lock.json 中更改它后我应该做些什么吗?我做到了,但它仍然发生
    【解决方案2】:

    对我有用的是:

    如 Stefan Nagirniak 所述,将 package-lock.json 更改为 loader-utils 版本 3.2.1:

    "loader-utils": "3.2.0", ==> "loader-utils": "3.2.1", 保存更改

    然后再次在 CLI 中运行 npm audit fix:

    npm audit fix

    (抱歉,没有足够的代表回复对 Stefan Nagirniak 回答的评论)

    【讨论】:

      猜你喜欢
      • 2022-01-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-05
      • 2012-06-16
      • 1970-01-01
      相关资源
      最近更新 更多