Webpack 4.39.0 represents a small but important step in the evolution of the popular JavaScript module bundler. Released shortly after version 4.38.0, the newer iteration brings a handful of dependency updates and internal enhancements to the table making it a worthwhile consideration for developers seeking stability and the latest compatible tooling.
Specifically, in the dependencies section, noticeable updates include ajv updated from ^6.1.0 to ^6.10.2, acorn from ^6.2.0 to ^6.2.1, mkdirp from ~0.5.0 to ^0.5.1, tapable from ^1.1.0 to ^1.1.3, neo-async from ^2.5.0 to ^2.6.1, watchpack from ^1.5.0 to ^1.6.0, micromatch from ^3.1.8 to ^3.1.10, and loader-utils from ^1.1.0 to ^1.2.3. These dependency bumps likely incorporate bug fixes, performance improvements, or security patches within those respective packages, ultimately contributing to a more robust and secure build process for webpack users. Terser webpack plugin has also been updated from ^1.1.0 to ^1.4.1.
Notably, the devDependencies remains relatively similar. The package size also increased a little, from 1435004 to 1441130 unpacked size and from 354 to 356 fileCount, which might reflect the new dependencies and improved features.
For developers, upgrading to webpack 4.39.0 offers the advantage of leveraging these updated dependencies. While not a revolutionary release, it demonstrably brings stability and incorporates the latest fixes and enhancements from its dependency ecosystem. Given the incremental nature of the changes, most webpack configurations should migrate smoothly, positioning 4.39.0 as a recommended upgrade for projects already using webpack 4, promising a generally more secure and efficient experience.
All the vulnerabilities related to the version 4.39.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.