Node.js execFile():传递密码作为参数安全吗?

问题描述 投票:0回答:0

将密码作为用户输入传递给

execFile()
命令是否安全?

例子:

const process = await execFile(
  'somecommand',
  ['--password', passwordFromUser, '--username', userName],
);

我知道这不使用 shell (

sh
) 来执行命令,而是在引擎盖下使用
execve(2)
。但是提供的密码可以在某种历史表或类似的东西中看到吗?我想避免的是其他人仍然可以以某种方式在 Linux 中看到该密码。

在可能的情况下通过

options.env
对象传递密码是否更安全?

node.js linux security
© www.soinside.com 2019 - 2024. All rights reserved.