CVE-2017-1000048: Qs Prototype Pollution Protection Bypass Vulnerability

HIGH
Advisory Identifier: GHSA-gqgv-6jq5-jjj9
CVSS 7.5
CWE-20
Published
Advisory Summary

CVE-2017-1000048 is a HIGH (CVSS 7.5) prototype pollution protection bypass vulnerability (CWE-20: Improper Input Validation) affecting Qs libraries in the npm ecosystem. The issue involves prototype pollution protection bypass in qs. Remediation is available by upgrading affected packages to version 6.0.4, 6.1.2, 6.2.3, 6.3.2.

CVE-2017-1000048 at a Glance

CVE Identifier CVE-2017-1000048
GHSA Identifier GHSA-gqgv-6jq5-jjj9
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-20: Improper Input Validation
Affected Product Qs
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

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:N/I:N/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 None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2017-1000048

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

qs fixed: 6.0.4
npm install qs@6.0.4
qs fixed: 6.1.2
npm install qs@6.1.2
qs fixed: 6.2.3
npm install qs@6.2.3
qs fixed: 6.3.2
npm install qs@6.3.2
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 qs

How to Check if You Are Affected

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

npm ls qs

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

Note: The npm ls qs 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Qs, 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

Affected version of `qs` are vulnerable to Prototype Pollution because it is possible to bypass the protection. The `qs.parse` function fails to properly prevent an object's prototype to be altered when parsing arbitrary input. Input containing `[` or `]` may bypass the prototype pollution protection and alter the Object prototype. This allows attackers to override properties that will exist in all objects, which may lead to Denial of Service or Remote Code Execution in specific circumstances. ## Recommendation Upgrade to 6.0.4, 6.1.2, 6.2.3, 6.3.2 or later.

CVE-2017-1000048 Affected Qs Versions

4 component(s)
Fixed Versions:
6.0.46.1.26.2.36.3.2
Product / Package Ecosystem Affected Versions Fixed Version
qs
npm
< 6.0.4
6.0.4
qs
npm
≥ 6.1.0
< 6.1.2
6.1.2
qs
npm
≥ 6.2.0
< 6.2.3
6.2.3
qs
npm
≥ 6.3.0
< 6.3.2
6.3.2

References

Frequently Asked Questions

What is CVE-2017-1000048?
CVE-2017-1000048 is a security vulnerability in Qs involving Prototype Pollution Protection Bypass in qs under CWE-20: Improper Input Validation.
Which Qs versions are affected?
Affected versions include releases prior to 6.0.4, 6.1.2, 6.2.3, 6.3.2 across affected packages: qs.
What version fixes CVE-2017-1000048?
Upgrading to 6.0.4, 6.1.2, 6.2.3, 6.3.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is qs affected?
Yes, qs is affected in releases prior to 6.0.4, 6.1.2, 6.2.3, 6.3.2. Upgrade your dependency to 6.0.4, 6.1.2, 6.2.3, 6.3.2 or later.
What is the CVSS score of CVE-2017-1000048?
CVE-2017-1000048 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2017-1000048?
CVE-2017-1000048 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check npm dependencies for CVE-2017-1000048?
Run the dependency tree command: 'npm ls qs'. 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-gqgv-6jq5-jjj9",
  "modified" : "2021-08-25T21:03:56Z",
  "published" : "2020-04-30T17:16:47Z",
  "aliases" : [ "CVE-2017-1000048" ],
  "summary" : "Prototype Pollution Protection Bypass in qs",
  "details" : "Affected version of `qs` are vulnerable to Prototype Pollution because it is possible to bypass the protection. The `qs.parse` function fails to properly prevent an object's prototype to be altered when parsing arbitrary input. Input containing `[` or `]` may bypass the prototype pollution protection and alter the Object prototype. This allows attackers to override properties that will exist in all objects, which may lead to Denial of Service or Remote Code Execution in specific circumstances.\n\n\n## Recommendation\n\nUpgrade to 6.0.4, 6.1.2, 6.2.3, 6.3.2 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "qs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.0.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "qs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.1.0"
      }, {
        "fixed" : "6.1.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "qs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.2.0"
      }, {
        "fixed" : "6.2.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "qs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.3.0"
      }, {
        "fixed" : "6.3.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-1000048"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ljharb/qs/issues/200"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ljharb/qs/commit/beade029171b8cef9cee0d03ebe577e2dd84976d"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2017:2672"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ljharb/qs"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/npm:qs:20170213"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/1469"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-04-30T17:16:10Z",
    "nvd_published_at" : null
  }
}