CVE-2017-16034: Pidusage Command Injection Vulnerability
CRITICALCVE-2017-16034 is a CRITICAL command injection vulnerability (CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')) affecting Pidusage libraries in the npm ecosystem. The issue involves command injection in pidusage. Remediation is available by upgrading affected packages to version 1.1.5.
CVE-2017-16034 at a Glance
How to Fix CVE-2017-16034
To remediate this vulnerability, upgrade all affected Pidusage dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install pidusage@1.1.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls pidusage
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2017-16034, inspect your project dependencies using npm:
npm ls pidusage
Analyze the terminal output to locate any version of Pidusage in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.5), your application is affected.
Note: The npm ls pidusage command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), where 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. In Pidusage, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2017-16034 Affected Pidusage Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pidusage
|
npm |
< 1.1.5
|
1.1.5
|
References
Frequently Asked Questions
What is CVE-2017-16034?
Which Pidusage versions are affected?
What version fixes CVE-2017-16034?
Is pidusage affected?
What CWE is associated with CVE-2017-16034?
How can I check npm dependencies for CVE-2017-16034?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hfq9-rfpv-j8r8",
"modified" : "2021-09-23T21:42:30Z",
"published" : "2020-09-01T16:49:19Z",
"aliases" : [ "CVE-2017-16034" ],
"summary" : "Command Injection in pidusage",
"details" : "Affected versions of `pidusage` pass unsanitized input to `child_process.exec()`, resulting in arbitrary code execution in the `ps` method.\n \nThis package is vulnerable to this PoC on Darwin, SunOS, FreeBSD, and AIX.\n\nWindows and Linux are not vulnerable. \n\n## Proof of Concept\n```\nvar pid = require('pidusage');\npid.stat('1 && /usr/local/bin/python');\n```\n\n\n## Recommendation\n\nUpdate to version 1.1.5 or later.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "pidusage"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.1.5"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.1.4"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-16034"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/356"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-77" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2020-08-31T18:20:25Z",
"nvd_published_at" : null
}
}