Qs versions 2.2.5 and 2.2.4 are both querystring parsers designed for Node.js and browsers, excelling at handling nested objects and arrays within URL query strings. These versions provide developers with a robust solution for serializing and deserializing complex query parameters, a common requirement in web applications dealing with intricate data structures. The core functionality remains consistent between the two versions, focusing on parsing querystrings with customizable depth limits to prevent potential denial-of-service attacks from overly nested structures.
A notable difference lies in the metadata. Version 2.2.4 explicitly declares Nathan LaFreniere as the author, including both name and email, information absent in version 2.2.5. Both versions utilize lab as a development dependency, indicating its use in testing the library's functionality. The repository URL, pointing to the hapijs/qs GitHub repository, stays consistent, signifying that both versions originate from the same project source. Developers using qs can rely on its ability to parse and stringify querystrings according to various encoding strategies, making it ideal for applications needing fine-grained control over URL parameter handling. Importantly, the release dates illustrate that version 2.2.5 followed shortly after 2.2.4, implying a potential bug fix or minor adjustment between the releases, though specific details require deeper investigation into the commit history. Both packages are dependency-free, which simplifies integration into existing projects.
All the vulnerabilities related to the version 2.2.5 of the package
Prototype Pollution Protection Bypass in qs
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.
Upgrade to 6.0.4, 6.1.2, 6.2.3, 6.3.2 or later.
qs vulnerable to Prototype Pollution
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.