Skip to content

Commit

Permalink
Fixed command injection through the revertTo revision string
Browse files Browse the repository at this point in the history
  • Loading branch information
ferretwithaberet committed Apr 4, 2020
1 parent 551bd45 commit 15d7bbe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/vizion.js
Expand Up @@ -45,6 +45,9 @@ vizion.revertTo = function(argv, cb) {
var revision = (argv.revision) ? argv.revision : false;
var _folder = (argv.folder != undefined) ? argv.folder : '.';

if (revision && !/^[A-Za-z0-9]+$/.test(revision))
return cb('Error vizion::revertTo() received an invalid revision: ' + revision);

if (!revision)
return cb({msg: 'Cannot revert to an invalid commit revision', path: _folder});

Expand Down

0 comments on commit 15d7bbe

Please sign in to comment.