Babel-jest is a crucial plugin for developers using Jest, enabling seamless integration of Babel for transforming JavaScript code during testing. This allows developers to write modern JavaScript, utilizing features like ES6+ syntax, and ensure compatibility with older environments through Babel's transpilation process. The core functionality remains consistent between versions 24.7.0 and 24.7.1, both providing the same core capabilities of transforming code. Dependencies like chalk, slash, @jest/types, babel-preset-jest, @types/babel__core, and babel-plugin-istanbul remain largely the same, and the peer dependency on @babel/core stays at ^7.0.0, ensuring stability and compatibility with existing Babel configurations.
The primary notable difference lies in the @jest/transform dependency. Version 24.7.1 upgrades this dependency to ^24.7.1 from ^24.7.0 in the prior version. While seemingly minor, this change in a dependency within the Jest ecosystem could include bug fixes, performance improvements, or new features within Jest's transformation pipeline. For developers, this update signifies a potential refinement in how Jest handles code transformations, possibly leading to faster test execution or more accurate code coverage reporting. The updated version was released just one day after the previous one, suggesting it might have been a rapid reaction to fix bugs in the previous release or include a change. Developers should review the changelog for @jest/transform to understand the specific changes introduced by this update.
All the vulnerabilities related to the version 24.7.1 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.