- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.2k
Fix potential DoS vector for masternode payments #2071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| // Avoid processing same vote multiple times | ||
| if(!res.second) { | ||
| // Avoid processing same vote multiple times if it was already verified earlier | ||
| if(!res.second && res.first->second.IsVerified()) { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't actually solve the problem. If an attacker uses a bad signature it will pass and add to mapMasternodePaymentVotes yet vchsig will be non-empty and this check is just a NOP. Don't you need to move this under the sig check like I did in my initial PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh I see so vchsig will be cleared anyway and this will basically reprocess if it was a bad vote that was stored and for a good vote vchsig would have been filled later so it returns right away, makes sense thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
* Skip only already verified mn payments vote duplicates * Update mn payment vote stats only if mn payment vote sig is ok
* Skip only already verified mn payments vote duplicates * Update mn payment vote stats only if mn payment vote sig is ok
* Skip only already verified mn payments vote duplicates * Update mn payment vote stats only if mn payment vote sig is ok
A less invasive alternative (logic-wise) to #2070