Expect version 24.6.0 introduces subtle yet impactful updates over its predecessor, version 24.5.0, primarily affecting its internal dependencies. Both versions serve the core purpose of providing the expect function, essential for writing assertions within Jest testing frameworks. Developers leveraging Jest for unit and integration testing will find Expect vital for validating expected outcomes. The description remains consistent, emphasizing the package's role and linking to Jest's official documentation for detailed usage guidance.
Examining the dependencies, the most notable changes reside in the updated versions of @jest/types, jest-message-util, and jest-matcher-utils, all shifting from 24.5.0 to 24.6.0. These internal packages likely contain bug fixes, performance improvements, or new matcher functionalities that enhance the overall testing experience. While the API for Expect itself may not drastically change, developers indirectly benefit from the refinements within these core utilities. The dist object also reflects these changes: the fileCount (42 -> 43) and unpackedSize (2773157 -> 2977825) are higher in 24.6.0, indicating additions or expansions within the package. Moreover, the release date highlights a more recent update for 24.6.0, offering access to the latest improvements and fixes. For developers, upgrading to version 24.6.0 ensures they're leveraging the most up-to-date and refined assertion capabilities within the Jest ecosystem.
All the vulnerabilities related to the version 24.6.0 of the package
Regular Expression Denial of Service (ReDoS) in micromatch
The NPM package micromatch
prior to version 4.0.8 is vulnerable to Regular Expression Denial of Service (ReDoS). The vulnerability occurs in micromatch.braces()
in index.js
because the pattern .*
will greedily match anything. By passing a malicious payload, the pattern matching will keep backtracking to the input while it doesn't find the closing bracket. As the input size increases, the consumption time will also increase until it causes the application to hang or slow down. There was a merged fix but further testing shows the issue persisted prior to https://github.com/micromatch/micromatch/pull/266. This issue should be mitigated by using a safe pattern that won't start backtracking the regular expression due to greedy matching.
Uncontrolled resource consumption in braces
The NPM package braces
fails to limit the number of characters it can handle, which could lead to Memory Exhaustion. In lib/parse.js,
if a malicious user sends "imbalanced braces" as input, the parsing will enter a loop, which will cause the program to start allocating heap memory without freeing it at any moment of the loop. Eventually, the JavaScript heap limit is reached, and the program will crash.