报错信息:Shelljs 0.8.3 及之前的版本易受命令注入攻击

Error message: Shelljs 0.8.3 and before are vulnerable to Command Injection

将我的项目更新到 angular 8.0.3 后,我在 github 警报中收到此错误。

这是一个没有修复的漏洞。

没有可用的补丁版本。

Shelljs 0.8.3 and before are vulnerable to Command Injection.
Commands can be invoked from shell.exec(),
those commands will include input from external sources,
to be passed as arguments to system executables
and allowing an attacker to inject arbitrary commands.

有人有这方面的信息吗?

根据this thread,可能是误报。五月是关键词。您不能将用户输入传递给 shell 模块。很多人这样做,然后这是一个大问题。只要您从不将用户输入传递给 exec,就可以使用 GitHub 工具来禁用此警告。

我是 ShellJS 的维护者。详情在this comment,但总结一下:

  • 这不是 ShellJS 中的漏洞
  • 可能会以不安全的方式滥用 shell.exec()child_process.exec(),因此直接依赖项应咨询我们的 security guidelines
  • 传递使用 ShellJS 的模块应该信任它们的依赖关系来验证正确的使用(上一个要点)或者通过它们的依赖关系树来验证这些依赖关系
    • 使用ShellJS查找包是不够的,因为child_process.exec()同样有被误用的可能性(而且是核心节点API,所以没有出现在package-lock 个文件)

之前的回答说这是 "may be" 一个漏洞,但我已经在 Github 线程上澄清了这是 不是 一个漏洞 在我们的模块中,直接依赖需要确保他们安全可靠地使用我们的模块。