Skip to content

Commit b40755d

Browse files
author
Evan Duffield
committed
masternode: fix dseep DoS
When a dseep message with an invalid signature is received, the lastDseep timestamp is updated to sigTime, but the message rejected. Further messages with a sigTime before lastDseep will not be processed, meaning the LastSeen timestamp will not get updated. By disabling dseep processing for more than 65 minutes an attacker can cause a master node to time out. Only update the lastDseep stamp if the message is signed with the correct key. Signed-off-by: Patrick McHardy <[email protected]>
1 parent 38749b0 commit b40755d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/clientversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#define CLIENT_VERSION_MAJOR 0
1010
#define CLIENT_VERSION_MINOR 10
1111
#define CLIENT_VERSION_REVISION 17
12-
#define CLIENT_VERSION_BUILD 22
12+
#define CLIENT_VERSION_BUILD 23
1313

1414
// Set to true for release, false for prerelease or test build
1515
#define CLIENT_VERSION_IS_RELEASE true

src/masternode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,6 @@ void ProcessMessageMasternode(CNode* pfrom, std::string& strCommand, CDataStream
210210
if(mn.vin.prevout == vin.prevout) {
211211
// take this only if it's newer
212212
if(mn.lastDseep < sigTime){
213-
mn.lastDseep = sigTime;
214-
215213
std::string strMessage = mn.addr.ToString() + boost::lexical_cast<std::string>(sigTime) + boost::lexical_cast<std::string>(stop);
216214

217215
std::string errorMessage = "";
@@ -221,6 +219,8 @@ void ProcessMessageMasternode(CNode* pfrom, std::string& strCommand, CDataStream
221219
return;
222220
}
223221

222+
mn.lastDseep = sigTime;
223+
224224
if(!mn.UpdatedWithin(MASTERNODE_MIN_DSEEP_SECONDS)){
225225
mn.UpdateLastSeen();
226226
if(stop) {

0 commit comments

Comments
 (0)