Bug 2065685 (CVE-2021-44907)

Summary: CVE-2021-44907 qs: Insufficient sanitization of property in the gs.parse function
Product: [Other] Security Response Reporter: Pedro Sampaio <psampaio>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: adudiak, alcohan, amctagga, aos-bugs, aprice, bcoca, bdettelb, bmontgom, brking, bsmejkal, caswilli, cmeyers, davidn, dfreiber, dhalasz, dkuc, doconnor, drow, dwhatley, dymurray, eparis, fjansen, gblomqui, gparvin, haoli, hhorak, hkataria, ibolton, jachapma, jburrell, jcammara, jforrest, jhadvig, jhardy, jkoehler, jmatthew, jmitchel, jmontleo, jneedle, jobarker, jokerman, jorton, jramanat, jsamir, jwong, kaycoth, kegrant, kholdawa, koliveir, kshier, ldap-maint, lphiri, mabashia, micjohns, mpierce, mrunge, njean, nodejs-maint, nodejs-sig, notting, nstielau, orabin, osapryki, owatkins, pahickey, pbraun, pgaikwad, progier, psegedy, relrod, rfreiman, rhaigner, rjohnson, rpetrell, sdoran, sgallagh, shvarugh, simaishi, slucidi, smcdonal, spichugi, sponnaga, sseago, ssidhaye, stcannon, sthirugn, tbordaz, teagle, tfister, thavo, thrcka, tkasparek, tkuratom, tsasak, vashirov, vkrizan, vkumar, vmugicag, yguenane, zsvetlik
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
[REJECTED CVE] A Denial of Service (DoS) vulnerability was identified in QS due to insufficient sanitization of properties in the gs.parse function. The merge() function allows assigning properties to an array in a query, which could unexpectedly convert array values into objects. If the expected type is an array, and it's not checked with Array.isArray(), it can lead to unexpected behavior. An attacker could exploit this by manipulating query inputs, causing the application to crash or behave incorrectly.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-04-27 07:19:11 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: 2075666, 2076435    
Bug Blocks: 2065687    

Description Pedro Sampaio 2022-03-18 13:31:28 UTC
A Denial of Service vulnerability exists in qs up to 6.8.0 due to insufficient sanitization of property in the gs.parse function. The merge() function allows the assignment of properties on an array in the query. For any property being assigned, a value in the array is converted to an object containing these properties. Essentially, this means that the property whose expected type is Array always has to be checked with Array.isArray() by the user. This may not be obvious to the user and can cause unexpected behavior.

References:

https://jsfiddle.net/65jxksay/
https://jsfiddle.net/pb6an1dy/
https://github.com/ljharb/qs/blob/master/dist/qs.js#L670
https://github.com/ljharb/qs/issues/436