Body-parser is a crucial piece of middleware for Node.js applications built on frameworks like Express, simplifying the process of handling incoming request bodies. Versions 1.2.1 and 1.2.2 share core functionality, both focusing on parsing request bodies into usable formats. Both versions depend on essential modules such as qs for query string parsing, bytes for handling byte sizes, and type-is for content-type checking. Developers relying on body-parser will find these dependencies consistent across the two versions, suggesting a stable foundation for common parsing needs. Development dependencies like mocha, should, and supertest show the project's commitment to testing and quality assurance in functionality and performance.
The notable difference between version 1.2.1 and 1.2.2 lies in the dependency on raw-body: version 1.2.2 upgrades this to 1.1.6 from 1.1.4 suggesting bug fixes or performance improvements in raw body parsing. While seemingly minor, this update could address specific edge cases or security vulnerabilities identified in the earlier raw-body version. The release dates confirm that 1.2.2 followed shortly after 1.2.1. Developers are encouraged to upgrade to version 1.2.2 to benefit from any improvements or fixes provided by the updated raw-body dependency, thus ensuring a more secure and efficient request handling process in their Node.js applications.
All the vulnerabilities related to the version 1.2.2 of the package
body-parser vulnerable to denial of service when url encoding is enabled
body-parser <1.20.3 is vulnerable to denial of service when url encoding is enabled. A malicious actor using a specially crafted payload could flood the server with a large number of requests, resulting in denial of service.
this issue is patched in 1.20.3
Denial-of-Service Extended Event Loop Blocking in qs
Versions prior to 1.0.0 of qs
are affected by a denial of service vulnerability that results from excessive recursion in parsing a deeply nested JSON string.
Update to version 1.0.0 or later
Denial-of-Service Memory Exhaustion in qs
Versions prior to 1.0 of qs
are affected by a denial of service condition. This condition is triggered by parsing a crafted string that deserializes into very large sparse arrays, resulting in the process running out of memory and eventually crashing.
Update to version 1.0.0 or later.
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.
mime Regular Expression Denial of Service when MIME lookup performed on untrusted user input
Affected versions of mime
are vulnerable to regular expression denial of service when a mime lookup is performed on untrusted user input.
Update to version 2.0.3 or later.