Lint-staged is a popular npm package that automatically lints files that are staged in Git, ensuring code quality and consistency before commits. Comparing versions 8.1.2 and 8.1.1, developers will find subtle differences primarily focused on internal improvements and bug fixes rather than significant feature additions. Both versions share identical dependencies and devDependencies, indicating a focus on stabilizing existing functionality rather than introducing new integrations. This means upgrading from 8.1.1 to 8.1.2 should be a seamless transition for most users, with minimal risk of breaking changes.
The core functionality of lint-staged remains consistent: automatically running linters and formatters against staged files, preventing commits with code that doesn't adhere to project standards. Developers can configure lint-staged via a configuration file, specifying which linters to run for different file types. This automated process helps maintain a clean codebase and enforces coding standards across teams.
While there are no major differences in dependencies, the dist object reveals a slightly larger unpacked size for version 8.1.2 (50073 bytes compared to 49975 bytes), suggesting minor code updates or optimizations. More importantly, version 8.1.2 was released more recently, on February 2, 2019, compared to January 28, 2019, for version 8.1.1. This provides users with increased confidence about the tool's support. Developers relying on lint-staged for pre-commit hooks should upgrade to the latest patch version in the 8.1 series to benefit from stability and bug fixes made after the previous release.
All the vulnerabilities related to the version 8.1.2 of the package
Prototype Pollution in property-expr
The package property-expr before 2.0.3 are vulnerable to Prototype Pollution via the setter function.
Babel has inefficient RegExp complexity in generated code with .replace when transpiling named capturing groups
When using Babel to compile regular expression named capturing groups, Babel will generate a polyfill for the .replace
method that has quadratic complexity on some specific replacement pattern strings (i.e. the second argument passed to .replace
).
Your generated code is vulnerable if all the following conditions are true:
.replace
method on a regular expression that contains named capturing groups.replace
If you are using @babel/preset-env
with the targets
option, the transform that injects the vulnerable code is automatically enabled if:
You can verify what transforms @babel/preset-env
is using by enabling the debug
option.
This problem has been fixed in @babel/helpers
and @babel/runtime
7.26.10 and 8.0.0-alpha.17, please upgrade. It's likely that you do not directly depend on @babel/helpers
, and instead you depend on @babel/core
(which itself depends on @babel/helpers
). Upgrading to @babel/core
7.26.10 is not required, but it guarantees that you are on a new enough @babel/helpers
version.
Please note that just updating your Babel dependencies is not enough: you will also need to re-compile your code.
If you are passing user-provided strings as the second argument of .replace
on regular expressions that contain named capturing groups, validate the input and make sure it does not contain the substring $<
if it's then not followed by >
(possibly with other characters in between).
This vulnerability was reported and fixed in https://github.com/babel/babel/pull/17173.
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.