Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Security Fix for RCE on "mrgit" - huntr.dev #123

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/commands/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
'use strict';

const chalk = require( 'chalk' );
const shellescape = require('shell-escape');

module.exports = {
skipCounter: true,
Expand Down Expand Up @@ -41,7 +42,7 @@ module.exports = {
*/
execute( data ) {
const execCommand = require( './exec' );
const diffCommand = ( 'git diff --color ' + data.arguments.join( ' ' ) ).trim();
const diffCommand = ( 'git diff --color ' + shellescape(data.arguments) ).trim();

return execCommand.execute( getExecData( diffCommand ) )
.then( execResponse => {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"minimatch": "^3.0.4",
"minimist": "^1.2.0",
"minimist-options": "^4.0.1",
"shell-escape": "^0.2.0",
"shelljs": "^0.8.3",
"upath": "^1.1.2"
},
Expand Down