Expect 21.1.0 represents a minor version update over expect 21.0.2, both integral components within the Jest testing framework. Released on September 14, 2017, version 21.1.0 followed quickly after 21.0.2, suggesting a swift refinement process. The core license remains BSD-3-Clause, and the repository continues to be the official Jest GitHub repository. Both versions share a consistent dependency structure, relying on modules like ansi-styles, jest-get-type, jest-regex-util, jest-message-util, and jest-matcher-utils. While these dependencies are held in the older version at 21.0.2, in the newer one, dependencies like jest-diff, jest-regex-util, jest-message-util and jest-matcher-utils are upgraded to version 21.1.0, signaling enhancements or bug fixes within those specific modules. Developers integrating Expect should note these dependency upgrades when moving from 21.0.2 to 21.1.0, as they potentially introduce altered behaviors or improved features within the assertion mechanisms. The slight difference in the release date, approximately a week, implies that the changes might not be massive, and the upgrade should be relatively seamless, focusing on internal improvements and refinements within the Jest ecosystem. Always consult the Jest changelog for full details.
All the vulnerabilities related to the version 21.1.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.
Regular Expression Denial of Service (ReDoS) in braces
A vulnerability was found in Braces versions prior to 2.3.1. Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) attacks.
Regular Expression Denial of Service in braces
Versions of braces
prior to 2.3.1 are vulnerable to Regular Expression Denial of Service (ReDoS). Untrusted input may cause catastrophic backtracking while matching regular expressions. This can cause the application to be unresponsive leading to Denial of Service.
Upgrade to version 2.3.1 or higher.
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.