Ts-loader is a TypeScript loader for webpack, enabling developers to seamlessly integrate TypeScript code into their webpack-based projects. Comparing versions 5.0.0 and 4.5.0 reveals subtle yet noteworthy differences. The core dependencies, including "chalk," "semver," "micromatch," "loader-utils," and "enhanced-resolve," remain consistent, indicating a stable foundation for core functionality. However, a key distinction lies in the "dist" object, which details the package's distribution. Version 5.0.0 exhibits a slightly larger "unpackedSize" (386782 bytes) compared to version 4.5.0 (386575 bytes), hinting at possible code additions or modifications. This size difference, although minimal, suggests potential enhancements or bug fixes in the newer version.
Developers considering an upgrade from 4.5.0 to 5.0.0 should evaluate whether these subtle changes address specific issues they might be encountering. While the listed devDependencies are substantially the same, indicating a unified testing and development environment, any internal adjustments contributing to the size variation might impact performance or compatibility. If performance is a priority, benchmarking both versions in a project-specific context is advisable. The release dates also provide a temporal reference: version 5.0.0 was released on September 3, 2018, approximately two weeks after version 4.5.0 (August 17, 2018) indicating a relatively quick follow up, likely driven by bug fixes or minor enhancements discovered post-release of 4.5.0. Always refer to the official changelog for comprehensive details on specific changes between versions.
All the vulnerabilities related to the version 5.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.