Ts-loader version 4.2.0 represents a modest update over its predecessor, version 4.1.0, offering subtle refinements beneficial to developers utilizing TypeScript within their webpack workflows. Both versions share the same core dependencies, including chalk, semver, micromatch, loader-utils, and enhanced-resolve, ensuring a consistent foundation for TypeScript compilation. However, differences emerge in the devDependencies, highlighting the evolving testing and development landscape.
Notably, webpack is upgraded from version 4.0.0 to 4.5.0, potentially bringing performance improvements and new features that ts-loader can leverage. Prettier, the code formatter, jumps from 1.10.2 to 1.11.1, incorporating updated formatting rules. The html-webpack-plugin also sees an upgrade, moving from 3.0.6 to 3.2.0, which might include new functionalities related to HTML generation within the webpack pipeline.
The @types/node dependency is bumped from 9.4.0 to 9.6.2, aligning with updated typings for Node.js APIs. While seemingly minor, these dependency version updates contribute to a more polished and potentially more efficient development experience. The unpacked size also sees a slight increase from 548364 to 554781, possibly reflecting these various updates, small improvements or new features. Overall, version 4.2.0 offers incremental enhancements, ensuring ongoing compatibility and potentially improved performance when integrating TypeScript into webpack-based projects.
All the vulnerabilities related to the version 4.2.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.