Bug 1427872 (CVE-2017-1000048)

Summary: CVE-2017-1000048 nodejs-qs: Prototype override protection bypass
Product: [Other] Security Response Reporter: Andrej Nemec <anemec>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: avibelli, bdettelb, bleanhar, cbuissar, ccoleman, dedgar, dmcphers, drusso, gsterlin, hhorak, jbalunas, jgoulding, jkeck, jmadigan, jmrazek, joelsmith, jorton, jshepherd, kpiwko, lgriffin, ngough, pbraun, pwright, rrajasek, tchollingsworth, tdawson, thrcka, tkirby, tomckay, zsvetlik
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: nodejs-qs 6.4.0, nodejs-qs 6.3.2, nodejs-qs 6.2.3, nodejs-qs 6.1.2, nodejs-qs 6.0.4 Doc Type: If docs needed, set a value
Doc Text:
It was found that ljharb's qs module for Node.js did not properly parse query strings. An attacker could send a specially crafted query that overwrites the resulting object's prototype properties (such as toString() or hasOwnProperty()), resulting in a denial of service when the overwritten function would be executed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-08 03:08:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1427876, 1427874, 1427875, 1470072, 1485934, 1485935    
Bug Blocks: 1427873    

Description Andrej Nemec 2017-03-01 12:49:13 UTC
By default qs protects against attacks that attempt to overwrite an object's existing prototype properties, such as toString(), hasOwnProperty(),etc.

Overwriting these properties can impact application logic, potentially allowing attackers to work around security controls, modify data, make the application unstable and more.

In versions of the package affected by this vulnerability, it is possible to circumvent this protection and overwrite prototype properties and functions by prefixing the name of the parameter with [ or ]. e.g. qs.parse("]=toString") will return {toString = true}, as a result, calling toString() on the object will throw an exception.

References:

https://snyk.io/vuln/npm:qs:20170213

Upstream patches:

https://github.com/ljharb/qs/commit/beade029171b8cef9cee0d03ebe577e2dd84976d
https://github.com/ljharb/qs/commit/12152db9

Comment 1 Andrej Nemec 2017-03-01 12:52:35 UTC
Created nodejs-qs tracking bugs for this issue:

Affects: epel-6 [bug 1427875]
Affects: epel-7 [bug 1427876]
Affects: fedora-all [bug 1427874]

Comment 4 Cedric Buissart 2017-08-28 11:57:11 UTC
rh-nodejs4-nodejs-qs is based on nodejs-qs-1.2.2, which does not have support for the allowPrototypes options, and is thus not affected by this.

Comment 5 Cedric Buissart 2017-08-28 12:59:12 UTC
External References:

https://snyk.io/vuln/npm:qs:20170213

Comment 9 errata-xmlrpc 2017-09-07 14:30:57 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.3 EUS

Via RHSA-2017:2672 https://access.redhat.com/errata/RHSA-2017:2672

Comment 11 Jason Shepherd 2021-03-28 22:29:45 UTC
Statement:

Red Hat Quay include nodejs-qs as a build time dependency. Nodejs-qs is used by protractor for testing as build time, and is not included as runtime.