CVE-2017-1000219: Windows cpu Command Execution Vulnerability

CRITICAL
Advisory Identifier: GHSA-63m4-fhf2-cmf7
CVSS 9.8
CWE-78
Published
Advisory Summary

CVE-2017-1000219 is a CRITICAL (CVSS 9.8) command execution vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Windows cpu libraries in the npm ecosystem. The issue involves command execution in windows-cpu. Remediation is available by upgrading affected packages to version 0.1.5.

CVE-2017-1000219 at a Glance

CVE Identifier CVE-2017-1000219
GHSA Identifier GHSA-63m4-fhf2-cmf7
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Windows cpu
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2017-1000219

To remediate this vulnerability, upgrade all affected Windows cpu dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

windows-cpu fixed: 0.1.5
npm install windows-cpu@0.1.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls windows-cpu

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2017-1000219, inspect your project dependencies using npm:

npm ls windows-cpu

Analyze the terminal output to locate any version of Windows cpu in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.1.5), your application is affected.

Note: The npm ls windows-cpu 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-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Windows cpu, 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

Version of `windows-cpu` before 0.1.5 will execute arbitrary code passed into the first argument of the `findLoad` method, resulting in remote code execution. ## Proof of Concept ```js var win = require('windows-cpu'); wind.findLoad('foo & calc.exe'); ``` ## Recommendation Update to version 0.1.5 or later.

CVE-2017-1000219 Affected Windows cpu Versions

1 component(s)
Fixed Versions:
0.1.5
Product / Package Ecosystem Affected Versions Fixed Version
windows-cpu
npm
< 0.1.5
0.1.5

References

Frequently Asked Questions

What is CVE-2017-1000219?
CVE-2017-1000219 is a security vulnerability in Windows cpu involving Command Execution in windows-cpu under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Windows cpu versions are affected?
Affected versions include releases prior to 0.1.5 across affected packages: windows-cpu.
What version fixes CVE-2017-1000219?
Upgrading to 0.1.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is windows-cpu affected?
Yes, windows-cpu is affected in releases prior to 0.1.5. Upgrade your dependency to 0.1.5 or later.
What is the CVSS score of CVE-2017-1000219?
CVE-2017-1000219 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2017-1000219?
CVE-2017-1000219 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check npm dependencies for CVE-2017-1000219?
Run the dependency tree command: 'npm ls windows-cpu'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-63m4-fhf2-cmf7",
  "modified" : "2023-09-08T18:52:10Z",
  "published" : "2020-09-01T16:43:55Z",
  "aliases" : [ "CVE-2017-1000219" ],
  "summary" : "Command Execution in windows-cpu",
  "details" : "Version of `windows-cpu` before 0.1.5 will execute arbitrary code passed into the first argument of the `findLoad` method, resulting in remote code execution.\n\n## Proof of Concept\n\n```js\nvar win = require('windows-cpu');\nwind.findLoad('foo & calc.exe');\n```\n\n\n## Recommendation\n\nUpdate to version 0.1.5 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "windows-cpu"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.1.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-1000219"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/KyleRoss/windows-cpu/commit/b75e19aa2f7459a9506bceb577ba2341fe273117"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/KyleRoss/windows-cpu"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/KyleRoss/windows-cpu/blob/master/index.js#L81"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/336"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-08-31T18:19:44Z",
    "nvd_published_at" : null
  }
}