GHSL-2020-112: Command injection in systeminformation - CVE-2020-26300
The si.services method in the systeminformation library passed its argument into a shell command without sanitising it, so shell metacharacters in the input were executed. An attacker who could influence that argument could run arbitrary commands on the host.
Originally disclosed on GitHub Security Lab
The si.services method has a command injection vulnerability. Clients of the systeminformation library are unlikely to be aware of this, so they might unwittingly write code that contains a vulnerability.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the library built a shell command string by concatenating the caller-supplied service name without escaping or validating it, so shell metacharacters were interpreted by the shell.
Impact
This issue may lead to remote code execution if a client of the library calls the vulnerable method with untrusted input.
What the attacker needed
Library used with untrusted input; attacker controls the service name argument
The fix
The maintainer published a fix commit and a security advisory for the library.
How it was found
- Install the systeminformation package with npm.
- Write a small Node.js script that calls si.services with a crafted argument.
- Run the script with node.
- Observe that a file named exploit has been created, showing the injected command ran.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This library lets a Node.js program ask the operating system about running services. To do that it runs a shell command, and it pasted the caller's text straight into that command. If that text contains shell special characters, the shell treats them as extra commands, so whoever controls the text can run their own commands on the machine.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.