Skip to content

GHSA-hrpp-h998-j3pp CVE-2022-24999

qs vulnerable to Prototype Pollution

High npm
Severity
7.5 / 10
High · CVSS 3.1
Exploit chance (EPSS)
15.70%
Chance of exploitation in the next 30 days. Higher than 96.86% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-1321 Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Fix
6.10.3
Upgrade qs to this version or later

Description

qs before 6.10.3 allows attackers to cause a Node process hang because an __ proto__ key can be used. In many typical web framework use cases, an unauthenticated remote attacker can place the attack payload in the query string of the URL that is used to visit the application, such as a[__proto__]=b&a[__proto__]&a[length]=100000000. The fix was backported to qs 6.9.7, 6.8.3, 6.7.3, 6.6.1, 6.5.3, 6.4.1, 6.3.3, and 6.2.4.

Affected versions

npm

PackageVulnerableFixed in
qs
>= 6.10.0, < 6.10.3
6.10.3
qs
>= 6.9.0, < 6.9.7
6.9.7
qs
>= 6.8.0, < 6.8.3
6.8.3
qs
>= 6.7.0, < 6.7.3
6.7.3
qs
>= 6.6.0, < 6.6.1
6.6.1
qs
>= 6.5.0, < 6.5.3
6.5.3
qs
>= 6.4.0, < 6.4.1
6.4.1
qs
>= 6.3.0, < 6.3.3
6.3.3
qs
< 6.2.4
6.2.4

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

qs npm → 6.10.3

npm
npm install qs@6.10.3
yarn
yarn add qs@6.10.3
pnpm
pnpm add qs@6.10.3

Severity breakdown

CVSS 3.1 7.5

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Weakness

CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')

The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.

How to prevent it
  • Implementation: By freezing the object prototype first (for example, Object.freeze(Object.prototype)), modification of the prototype becomes impossible.
  • Architecture and Design: By blocking modifications of attributes that resolve to object prototype, such as proto or prototype, this weakness can be mitigated.
  • Implementation: When handling untrusted objects, validating using a schema can be used.
  • Implementation: By using an object without prototypes (via Object.create(null) ), adding object prototype attributes by accessing the prototype via the special attributes becomes impossible, mitigating this weakness.
  • Implementation: Map can be used instead of objects in most cases. If Map methods are used instead of object attributes, it is not possible to access the object prototype or modify it.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-6pq8-jhm2-2vcw
qs : qs.stringify with arrayFormat 'comma' throws an uncaught TypeError on array elements carrying a non-callable own toString (DoS)
Medium Also affects qs
GHSA-x5fp-wj9c-mxmx
qs array-limit bypass via bracket-key comma parsing
Medium Also affects qs
GHSA-4mjr-xmp4-gh2g
qs: Denial of Service via Attacker Controlled isBuffer
Medium Also affects qs
GHSA-q8mj-m7cp-5q26
qs has a remotely triggerable DoS: qs.stringify crashes with TypeError on null/undefined entries in comma-format arrays when encodeValuesOnly is set
Medium Also affects qs
GHSA-w7fw-mjwx-w883
qs's arrayLimit bypass in comma parsing allows denial of service
Medium Also affects qs
GHSA-6rw7-vpxm-498p
qs's arrayLimit bypass in its bracket notation allows DoS via memory exhaustion
Medium Also affects qs
GHSA-gqgv-6jq5-jjj9
Prototype Pollution Protection Bypass in qs
High Also affects qs
GHSA-f9cm-p3w6-xvr3
Denial-of-Service Extended Event Loop Blocking in qs
High Also affects qs
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor