提交 #860031: Node.js jsforce 3.10.16 OS Command Injection信息

标题Node.js jsforce 3.10.16 OS Command Injection
描述[email protected] appears to have a command injection issue in the CLI when the SFDX connection registry is enabled. The public jsforce CLI exposes -c, --connection [connection] as a connection name stored in the connection registry. When JSFORCE_CONNECTION_REGISTRY=sfdx is set, the CLI uses SfdxRegistry. The connection name is passed as the -u option to the Salesforce CLI command, but it is concatenated into a shell command string without escaping. Affected path: bin/jsforce -> lib/cli/cli.js -> registry.getConnectionConfig(options.connection) -> lib/registry/sfdx.js -> child_process.exec(cmd) Relevant code in lib/registry/sfdx.js: _createCommand(command, options = {}, args = []) { return `${this._cliPath ? this._cliPath + '/' : ''}sfdx ${command} ${Object.keys(options) .map((option) => `${option.length > 1 ? '--' : '-'}${option}${options[option] != null ? ' ' + options[option] : ''}`) .join(' ')} --json ${args.join(' ')}`; } async _execCommand(command, options = {}, args = []) { const cmd = this._createCommand(command, options, args); child_process.exec(cmd, ...); } When a crafted connection name is supplied, the generated command becomes similar to: sfdx force:org:display -u x;touch /tmp/jsforce-pwn;# --json The shell interprets ;touch /tmp/jsforce-pwn;# as an additional command.
来源⚠️ https://github.com/jsforce/jsforce/issues/1805
用户
 wjm2 (UID 99050)
提交2026-06-16 15時18分 (1 月前)
管理2026-07-21 17時54分 (1 month later)
状态已接受
VulDB条目380946 [jsforce 直到 3.10.16 SFDX Connection Registry lib/registry/sfdx.js _execCommand 权限提升]
积分20

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!