Gulp 4.0.1 and 4.0.0 represent significant milestones for this popular streaming build system. While both share the core purpose of automating development tasks, several key differences distinguish them. Gulp 4.0.1 arrives over a year after 4.0.0, incorporating updated dependencies that enhance functionality and potentially improve performance. Notably, gulp-cli advances from ^2.0.0 to ^2.2.0, undertaker moves from ^1.0.0 to ^1.2.1, and glob-watcher increments from ^5.0.0 to ^5.0.3. Developers should carefully review these dependency updates for compatibility with their existing projects. The update to the devDependencies reveals a shift in the tooling ecosystem of the project, moving away from jscs and istanbul, to nyc for coverage, and updating eslint.
Furthermore, these changes may indicate bug fixes, performance enhancements, or new features within those underlying modules. Developers considering an upgrade should also examine the releaseDate, emphasizing that 4.0.1 is a more recent release, likely benefiting from community feedback and addressing previously identified issues. Both versions are licensed under the MIT license, ensuring broad usability. Both depend on the same code repository, and are maintained by the same team, so developers can expect to receive similar documentation and support. Project size wise, the newer version is distributed as a tarball of 20KB approximately. Choosing between the two depends on individual project needs, balancing updated dependencies with any potential compatibility concerns.
All the vulnerabilities related to the version 4.0.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.