Ts-loader version 5.3.1 is a minor patch release of the popular TypeScript loader for webpack, building upon the functionality offered in version 5.3.0. Both versions serve the same core purpose: enabling developers to seamlessly integrate TypeScript code into their webpack-based projects. They share identical dependencies, including crucial packages such as chalk for colorful console output, semver for version management, micromatch for flexible file matching, loader-utils for webpack loader utilities and enhanced-resolve for module resolution. Similarly, the development dependencies are the same, ensuring a consistent development and testing environment contributing to the stability of the package, packages like typescript to transpile the code, testing frameworks such as karma and mocha, and utilities like rimraf and mkdirp for file system operations.
The key difference resides in the bug fixes or minor improvements incorporated in the 5.3.1 release. This difference is reflected in the slightly increased unpacked size (323366 bytes vs 323206 bytes); this typically indicates small code adjustments or added resources. While the exact nature of these changes isn't explicitly detailed in provided data, patch releases often address specific issues reported by the community or introduce minor optimizations, improving stability and reliability. For developers, upgrading from 5.3.0 to 5.3.1 is recommended to benefit from these potential enhancements and maintain a more robust build process. The releaseDate confirms that 5.3.1 was released after 5.3.0, making the upgrade the natural path to follow.
All the vulnerabilities related to the version 5.3.1 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.