Skip to content

Commit

Permalink
New issue Don't reveal whether password is <20 or >20 characters in RPC
Browse files Browse the repository at this point in the history
From Bitcoin Pull #4728

It seems bad to base a decision to delay on the password length, as it leaks a tiny bit of information.

This doesn't change DoS potential as it is trivial to hold up all RPC threads in another way for someone in the rpcallowip list.
  • Loading branch information
whitj00 committed Aug 30, 2014
1 parent 6522864 commit ef119aa
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/rpcserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,11 +827,10 @@ void ServiceConnection(AcceptedConnection *conn)
if (!HTTPAuthorized(mapHeaders))
{
LogPrintf("ThreadRPCServer incorrect password attempt from %s\n", conn->peer_address_to_string());
/* Deter brute-forcing short passwords.
/* Deter brute-forcing
If this results in a DoS the user really
shouldn't have their RPC port exposed. */
if (mapArgs["-rpcpassword"].size() < 20)
MilliSleep(250);
MilliSleep(250);

conn->stream() << HTTPReply(HTTP_UNAUTHORIZED, "", false) << std::flush;
break;
Expand Down

0 comments on commit ef119aa

Please sign in to comment.