Lint-staged, a popular npm package for running linters on staged git files, released version 8.0.1 shortly after 8.0.0, both on October 29, 2018. A quick look reveals minimal differences in dependencies and devDependencies between the two versions. Both rely on a suite of tools including del, pify, chalk, execa, listr, lodash, and cosmiconfig for core functionality like file deletion, promise utilities, terminal styling, process execution, task management, utility functions, and configuration loading. Development dependencies for both include testing frameworks such as jest, linting tools like eslint and jsonlint, code formatting with prettier, and tooling for commit message standardization with commitizen.
The key difference lies in the "dist" section metadata. Version 8.0.1 has an unpacked size of 47028 bytes, slightly larger than version 8.0.0's 46832 bytes. The quick release and the small difference in unpacked size suggests that version 8.0.1 likely incorporates a minor bug fix or tweak to address an issue uncovered immediately after the 8.0.0 release. For developers using lint-staged, this implies upgrading to 8.0.1 is advisable to ensure a more stable and potentially bug-free experience. While the changelog (not provided) would offer definitive insight, the context suggests a quick patch. So, while both versions offer the same core linting capabilities, opting for 8.0.1 is a prudent choice for leveraging any improvements implemented post-initial 8.0.0 release.
All the vulnerabilities related to the version 8.0.1 of the package
Command injection in simple-git
The package simple-git before 3.3.0 is vulnerable to Command Injection via argument injection. When calling the .fetch(remote, branch, handlerFn) function, both the remote and branch parameters are passed to the git fetch subcommand. By injecting some git options, it was possible to get arbitrary command execution.
Command injection in simple-git
simple-git
(maintained as git-js named repository on GitHub) is a light weight interface for running git commands in any node.js application.The package simple-git before 3.5.0 are vulnerable to Command Injection due to an incomplete fix of CVE-2022-24433 which only patches against the git fetch attack vector. A similar use of the --upload-pack feature of git is also supported for git clone, which the prior fix didn't cover. A fix was released in simple-git@3.5.0.
simple-git vulnerable to Remote Code Execution when enabling the ext transport protocol
The package simple-git before 3.15.0 is vulnerable to Remote Code Execution (RCE) when enabling the ext
transport protocol, which makes it exploitable via clone()
method. This vulnerability exists due to an incomplete fix of CVE-2022-24066.
Remote code execution in simple-git
Versions of the package simple-git before 3.16.0 are vulnerable to Remote Code Execution (RCE) via the clone(), pull(), push() and listRemote() methods, due to improper input sanitization. This vulnerability exists due to an incomplete fix of CVE-2022-25912.
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.