CVE-2021-44684: Command injection in github-todos
Summary
CVE-2021-44684: Command injection in github-todos. Affects github-todos versions < 3.1.0. No fix is published. 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
github-todos is an npm package that provides a command-line interface for managing GitHub issues as todos. It allows users to interact with their GitHub repositories and perform various operations related to issue management. Unfortunately, version 3.1.0 of github-todos is vulnerable to command injection.
Vulnerability Detail
The vulnerability in github-todos arises from the lack of validation on the range argument used in the _hook subcommand. This argument is directly concatenated and passed to the exec function without proper sanitization. As a result, an attacker can inject arbitrary commands into the range argument, leading to command execution on the host system. This can have severe consequences, such as unauthorized access, data leakage, or even complete compromise of the affected system.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, users can avoid using the _hook subcommand or refrain from passing user-controlled input to the range argument. By carefully validating and sanitizing any input provided to the range argument, the risk of command injection can be mitigated. Here is an example of how to validate the range argument in a Node.js application:
const range = validateRange(userInput);
function validateRange(input) {
// Implement your validation logic here
}
Conclusion
In conclusion, github-todos version 3.1.0 is vulnerable to command injection, which can result in unauthorized access, data leakage, or system compromise. Users are advised to update to a patched version of the package and apply proper input validation to mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for github-todos →
FAQ
This vulnerability allows an attacker to execute arbitrary commands on the host system. Depending on the privileges of the user running the vulnerable application, this can lead to unauthorized access, data leakage, or complete compromise of the system.
The vulnerability affects github-todos version 3.1.0. Earlier versions may also be affected, but this has not been confirmed.
At the time of this advisory, there is no known public exploit for this vulnerability. However, it is important to apply the recommended fixes and updates to mitigate the risk.
Users can mitigate the risk by updating to a patched version of github-todos. Additionally, validating and sanitizing any user-controlled input passed to the range argument can help prevent command injection.
For more information about this vulnerability, you can refer to the GitHub Security Advisory GHSA-792j-9wj3-j634.