Webpack 4.47.0 represents a subtle evolution from its predecessor, webpack 4.46.0, offering refinements rather than radical changes. Both versions retain the core functionality that developers rely on for bundling JavaScript applications, supporting features like code splitting, loader-based file pre-processing (for handling JSON, JSX, CSS, and more), and a robust plugin ecosystem.
A primary difference lies in the release date: version 4.47.0 was published on September 6, 2023, a considerable time after version 4.46.0 (January 11, 2021). This indicates that 4.47.0 likely incorporates bug fixes, performance improvements, and potentially addresses security vulnerabilities discovered in the interim. While the dependency lists appear largely consistent, developers should scrutinize patch versions within those dependencies, as those can contain crucial updates.
For developers, upgrading to version 4.47.0 is generally recommended to benefit from any accumulated improvements and security patches. The dist metadata shows a slight increase in fileCount and unpackedSize, suggesting potential additions or modifications to the bundled files. While specific changes require deeper investigation, the upgrade should be relatively seamless for most projects, assuming adherence to webpack's established configuration patterns. Always consult the official webpack changelog for a comprehensive list of changes between versions, and conduct thorough testing after upgrading to ensure compatibility with your project's specific dependencies and build processes. Staying up-to-date with the latest stable releases allows you to leverage the most secure and performant version of Webpack for bundling your javascript projects.
All the vulnerabilities related to the version 4.47.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.