Awesome Typescript Loader version 5.2.0 is a minor update to the popular webpack loader, following closely after version 5.1.1. Both versions remain consistent in their core purpose: providing a smooth and efficient way to integrate TypeScript compilation into webpack workflows. Developers familiar with version 5.1.1 will find the transition to 5.2.0 seamless, as the dependency structure is largely unchanged. Key dependencies like chalk, enhanced-resolve, loader-utils, lodash, micromatch, mkdirp, source-map-support, and webpack-log remain at the same versions, ensuring compatibility and predictable behavior. Similarly, the devDependencies used for development, testing, and building the package are identical, which suggests a focus on maintaining the existing codebase rather than introducing major new features. The peer dependency remains typescript@^2.7, so the supported TypeScript versions have not changed.
The most discernible difference lies in the dist metadata. Version 5.2.0 has a fileCount of 90 and an unpackedSize of 407925 bytes, compared to 89 files and 405568 bytes in version 5.1.1. This slight increase in file count and unpacked size likely indicates minor bug fixes, documentation updates, or small enhancements within the existing feature set. Ultimately, developers can upgrade with confidence, anticipating improved stability and potentially minor performance tweaks without any breaking changes. The release date for 5.2.0 is June 21, 2018, a couple of days after version 5.1.1, released on June 19, 2018.
All the vulnerabilities related to the version 5.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.