Skip to content

Commit

Permalink
Fixed duplicate share vulnerability with the nonce
Browse files Browse the repository at this point in the history
zone117x fix
  • Loading branch information
pmitchev committed Sep 30, 2014
1 parent cd36f84 commit 780b525
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,11 @@ function handleMinerMethod(method, params, ip, portData, sendReply, pushMessage)
return;
}

params.nonce = params.nonce.substr(0, 8).toLowerCase();

if (job.submissions.indexOf(params.nonce) !== -1){
var minerText = miner ? (' ' + miner.login + '@' + miner.ip) : '';
log('warn', logSystem, 'Duplicate share: ' + JSON.stringify(params) + ' from ' + minerText);
sendReply('Duplicate share');
return;
}
Expand Down

0 comments on commit 780b525

Please sign in to comment.