Webpack version 4.46.0 introduces subtle but valuable refinements compared to its predecessor, 4.45.0. Both versions serve the core purpose of bundling JavaScript and other web assets for efficient browser delivery, supporting loaders for diverse file types like JSON, JSX, and CSS. Key dependencies like ajv, acorn, and tapable remain consistent, ensuring continued stability and compatibility. However, a noteworthy distinction lies in the enhanced-resolve dependency. Version 4.46.0 upgrades to enhanced-resolve version 4.5.0, whereas 4.45.0 uses version 4.3.0. This update likely incorporates bug fixes, performance enhancements, or new features related to module resolution. Developers should consult the enhanced-resolve changelog for specific details on the improvements. Also worth considering is the difference on "unpackedSize" with version 4.46.0 having an unpackedSize of 1476315 and version 4.45.0 having 1475334.
For developers considering an upgrade, the updated enhanced-resolve dependency is the primary focal point. Review its release notes to ascertain the impact on your project. The upgrade likely enhances module resolution capabilities, potentially resolving existing issues or unlocking new optimization opportunities. Besides this core dependency, the large list of "devDependencies" remains consistent on both versions which means no considerable updates for the tooling and the developing pipeline. Also developers should be aware on the fix in the size of the package that means probably a few code adjustments or perhaps a simple fix, it's important to consider it to evaluate any impact.
All the vulnerabilities related to the version 4.46.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.