Ts-loader version 4.0.0 introduces some key updates compared to the previous stable version, 3.5.0, primarily concerning its dependencies. Most notably, enhanced-resolve has been bumped from version 3.0.0 to version 4.0.0. This resolves path resolution for webpack.
Several development dependencies have also seen updates. Webpack itself has been upgraded from version 3.6.0 to version 4.0.0, providing developers with latest and greatest Webpack functionality. Husky, a tool that enables Git hooks, is a new addition as a dev dependency upgrading the developer experience. The typescript version that ts-loader uses for testing remains consistent at 2.7.1.
The author information differs slightly between the two versions. While both identify the package as maintained by the TypeStrong organization, version 4.0.0 lists John Reilly as the author, while version 3.5.0 lists James Brantly. Therefore, it is important to find the package's true author to get effective support.
The unpacked size of the package has increased from 261670 bytes in version 3.5.0 to 316481 bytes in version 4.0.0, suggesting possible addition of features or tests. Both versions maintain the same MIT license.
Developers upgrading to version 4.0.0 should pay close attention to the breaking changes introduced by Webpack 4 and enhanced-resolve version 4. Be sure to test your configurations and scripts and update all dependencies.
All the vulnerabilities related to the version 4.0.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.