CVE-2021-26541: Command injection in gitlog
Summary
CVE-2021-26541: Command injection in gitlog. Affects gitlog versions < 4.0.4. Fixed in 4.0.4. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The gitlog package is an npm package that provides a command-line interface (CLI) tool for retrieving git commit history. It allows users to fetch commit logs and related information from a Git repository. The package is widely used by developers to analyze and track changes in their codebase.
Vulnerability Detail
The gitlog package before version 4.0.4 is affected by a command injection vulnerability. This vulnerability allows an attacker to execute arbitrary commands on the host system by injecting malicious input into the gitlog function. An attacker can exploit this vulnerability by crafting a specially crafted input that includes shell commands. If successfully exploited, this could lead to unauthorized access, data loss, or remote code execution on the affected system.
How To Fix
Latest published version: 5.1.0 as of 23 Oct 2026
npm install gitlog@5.1.0
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
4.0.4
This is the first release that contains the fix.
npm install gitlog@4.0.4
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is strongly recommended to upgrade to the latest version of gitlog to mitigate the risk.
Conclusion
The gitlog package before version 4.0.4 is affected by a critical command injection vulnerability. To mitigate the risk, it is strongly advised to upgrade to the latest version of gitlog (4.0.4 or later). This will ensure the security of your application and protect it from potential unauthorized access, data loss, or remote code execution. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for gitlog →
FAQ
If exploited, this vulnerability can allow an attacker to execute arbitrary commands on the host system, potentially leading to unauthorized access, data loss, or remote code execution.
There is no known public exploit for this vulnerability at the time of this report. However, it is important to apply the recommended fix to prevent any potential exploitation.
No, only versions before 4.0.4 are affected by this vulnerability. It is recommended to upgrade to the latest version to ensure the security of your application.
Yes, this vulnerability can be exploited remotely if the affected application is exposed to the internet and the attacker can send malicious requests to the vulnerable endpoint.
There is no evidence of active exploitation of this vulnerability at the time of this report. However, it is always recommended to apply security patches and updates as soon as they are available.