| Title | Node.js jsforce 3.10.16 OS Command Injection |
|---|
| Description | [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. |
|---|
| Source | ⚠️ https://github.com/jsforce/jsforce/issues/1805 |
|---|
| User | wjm2 (UID 99050) |
|---|
| Submission | 06/16/2026 15:18 (1 month ago) |
|---|
| Moderation | 07/21/2026 17:54 (1 month later) |
|---|
| Status | Accepted |
|---|
| VulDB entry | 380946 [jsforce up to 3.10.16 SFDX Connection Registry lib/registry/sfdx.js _execCommand os command injection] |
|---|
| Points | 20 |
|---|