Webpack 4.45.0 is a minor release in the Webpack 4 series, building upon the stable foundation established by version 4.44.2. While both versions share the core functionality of a powerful module bundler for JavaScript applications, there are subtle differences that could be relevant for developers.
A primary objective of both versions is to enable developers to efficiently bundle JavaScript, CSS, and other assets for optimal browser delivery. They facilitate code splitting, allowing for on-demand loading of modules, which enhances initial page load times. Both support a rich ecosystem of loaders, enabling the preprocessing of various file types like JSON, JSX, and CSS, making them adaptable to diverse project requirements. The core dependencies and dev dependencies are mostly in line.
One notable difference is reflected in the release dates and the associated dist metadata. Version 4.45.0 was released on January 8, 2021, while 4.44.2 came out on September 17, 2020. The unpackedSize property indicates a marginal size increase in 4.45.0, suggesting potential minor feature additions, bug fixes, or internal optimizations. The newer version carries fixes and minor enhancements accumulated over the period between the releases. Developers should upgrade to version 4.45.0 primarily to benefit from these fixes, which aim to improve stability and performance. Always consult the official changelog for a comprehensive list of changes, even though these small version bumps generally signify bug fixes. Consider the upgrade a maintenance task more than a major feature addition.
All the vulnerabilities related to the version 4.45.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.