ts-loader 3.4.0 is a minor release following version 3.3.1 of this popular TypeScript loader for webpack. Both versions share core functionalities, providing seamless integration of TypeScript compilation within webpack workflows. They both depend on the same key libraries such as chalk, semver, micromatch, loader-utils and enhanced-resolve ensuring consistent core functionality related to console output styling, version management, file matching, webpack loader utilities and enhanced module resolution.
The primary distinction between versions lies in the release date; 3.4.0 was published on January 30, 2018, a week after 3.3.1 released on January 23, 2018. While the provided metadata doesn't explicitly detail functional changes, bug fixes, or performance improvements between these versions, the short interval suggests that 3.4.0 likely includes minor bug fixes, dependency updates, or small enhancements. Developers using ts-loader should consider upgrading to the latest version (3.4.0 at described), as it likely provides the most stable and refined experience within the 3.x series.
Both versions include a suite of development dependencies used for testing and building the library, such as webpack, typescript, karma, mocha, babel and associated plugins. The TypeScript version is set to 2.7.0-dev.20180120, suggesting the ts-loader is kept up-to-date with latest Typescript features. If you are already using version 3.3.1, upgrading to 3.4.0 should be straightforward, as the core dependencies remain consistent. A close look into the changelog or diff between the two versions in the project's repository is suggested to understand the specific improvements and fixes bundled with the update.
All the vulnerabilities related to the version 3.4.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.