GHSA-hrpp-h998-j3pp CVE-2022-24999
qs vulnerable to Prototype Pollution
- 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
| Package | Vulnerable | Fixed 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
Advisories
Packages
Other links
- github.com/ljharb/qs/pull/428
- github.com/ljharb/qs/commit/4310742efbd8c03f6495f07906b45213da0a32ec
- github.com/ljharb/qs/commit/727ef5d34605108acb3513f72d5435972ed15b68
- github.com/ljharb/qs/commit/73205259936317b40f447c5cdb71c5b341848e1b
- github.com/ljharb/qs/commit/8b4cc14cda94a5c89341b77e5fe435ec6c41be2d
- github.com/ljharb/qs/commit/ba24e74dd17931f825adb52f5633e48293b584e1
- github.com/ljharb/qs/commit/e799ba57e573a30c14b67c1889c7c04d508b9105
- github.com/ljharb/qs/commit/ed0f5dcbef4b168a8ae299d78b1e4a2e9b1baf1f
- github.com/ljharb/qs/commit/f945393cfe442fe8c6e62b4156fd35452c0686ee
- github.com/ljharb/qs/commit/fc3682776670524a42e19709ec4a8138d0d7afda
- github.com/expressjs/express/releases/tag/4.17.3
- github.com/n8tz/CVE-2022-24999
- lists.debian.org/debian-lts-announce/2023/01/msg00039.html
- security.netapp.com/advisory/ntap-20230908-0005
- security.netapp.com/advisory/ntap-20230908-0005
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why 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 |
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