Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Issue 205583011: [Draft] Fix canceling pin prompt causes host overload (Closed)

Created:
6 years, 9 months ago by kelvinp
Modified:
6 years, 8 months ago
CC:
chromoting-reviews_chromium.org
Visibility:
Public.

Description

Cause: To prevent a malicious client from guessing the PIN by spamming the host with bogus logins, the chromoting host can throttle incoming requests after too many unsuccessful login attempts. In the current implementation, every time when there is an incoming request, we start incrementing the bad login counter, regardless of whether the host has actually starts authenticating. Fix: This change adds an extra flag on the authenticator to indicate whether authentication has started. The JingleSession checks the flag and progagates the message back all the way up to the host through the callback Session::OnSessionAuthenticationBegin BUG=350208 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=262228

Patch Set 1 #

Patch Set 2 : Removing .gitIngore #

Total comments: 18

Patch Set 3 : Address feedbacks from sergey #

Total comments: 22

Patch Set 4 : Fix Unittests and also reject connections upon authenticating #

Total comments: 13

Patch Set 5 : Add unittest to chromoting_host and jingle_session #

Total comments: 7

Patch Set 6 : Last round of feedbacks #

Unified diffs Side-by-side diffs Delta from patch set Stats (+332 lines, -49 lines) Patch
M remoting/host/chromoting_host.h View 1 chunk +1 line, -0 lines 0 comments Download
M remoting/host/chromoting_host.cc View 1 2 3 4 5 2 chunks +16 lines, -6 lines 0 comments Download
M remoting/host/chromoting_host_unittest.cc View 1 2 3 4 5 10 chunks +69 lines, -15 lines 0 comments Download
M remoting/host/client_session.h View 2 chunks +5 lines, -0 lines 0 comments Download
M remoting/host/client_session.cc View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M remoting/host/host_mock_objects.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M remoting/host/pam_authorization_factory_posix.cc View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M remoting/protocol/authenticator.h View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M remoting/protocol/authenticator_test_base.h View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M remoting/protocol/authenticator_test_base.cc View 1 2 3 2 chunks +27 lines, -5 lines 0 comments Download
M remoting/protocol/connection_to_client.h View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M remoting/protocol/connection_to_client.cc View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M remoting/protocol/connection_to_host.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M remoting/protocol/fake_authenticator.h View 1 2 3 4 5 4 chunks +12 lines, -1 line 0 comments Download
M remoting/protocol/fake_authenticator.cc View 1 2 3 4 5 4 chunks +19 lines, -4 lines 0 comments Download
M remoting/protocol/jingle_session.h View 1 2 3 4 3 chunks +9 lines, -0 lines 0 comments Download
M remoting/protocol/jingle_session.cc View 1 2 3 4 9 chunks +31 lines, -9 lines 0 comments Download
M remoting/protocol/jingle_session_unittest.cc View 1 2 3 4 5 7 chunks +72 lines, -2 lines 0 comments Download
M remoting/protocol/me2me_host_authenticator_factory.cc View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M remoting/protocol/negotiating_authenticator_base.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M remoting/protocol/negotiating_authenticator_base.cc View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M remoting/protocol/pairing_authenticator_base.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M remoting/protocol/pairing_authenticator_base.cc View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M remoting/protocol/protocol_mock_objects.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M remoting/protocol/session.h View 1 2 3 2 chunks +5 lines, -2 lines 0 comments Download
M remoting/protocol/third_party_authenticator_base.h View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M remoting/protocol/third_party_authenticator_base.cc View 1 2 2 chunks +8 lines, -2 lines 0 comments Download
M remoting/protocol/v2_authenticator.h View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M remoting/protocol/v2_authenticator.cc View 1 2 3 4 chunks +6 lines, -1 line 0 comments Download

Messages

Total messages: 16 (0 generated)
kelvinp
Hi Sergey, Can you help me to take a look and see if you have ...
6 years, 9 months ago (2014-03-21 22:27:40 UTC) #1
kelvinp
Hi Sergey, Can you help me to take a look and see if you have ...
6 years, 9 months ago (2014-03-21 22:32:05 UTC) #2
Sergey Ulanov
Looks mostly good. I suggest adding a state in protocol::Session instead of another callback method. ...
6 years, 9 months ago (2014-03-24 18:42:36 UTC) #3
kelvinp
Addressed all of Sergey's feedback. I agreed that having another state makes the code cleaner. ...
6 years, 9 months ago (2014-03-24 23:11:38 UTC) #4
Sergey Ulanov
Looks good. I'd like to have unittests coverage for the new state before we land ...
6 years, 9 months ago (2014-03-26 01:49:15 UTC) #5
rmsousa
This generally looks very good, just a couple of comments. (feel free to commit once ...
6 years, 9 months ago (2014-03-26 21:37:34 UTC) #6
Sergey Ulanov
https://codereview.chromium.org/205583011/diff/40001/remoting/host/chromoting_host.cc File remoting/host/chromoting_host.cc (right): https://codereview.chromium.org/205583011/diff/40001/remoting/host/chromoting_host.cc#newcode174 remoting/host/chromoting_host.cc:174: void ChromotingHost::OnSessionAuthenticating(ClientSession* client) { Looking more at this code ...
6 years, 9 months ago (2014-03-27 00:00:03 UTC) #7
kelvinp
Fix UT Check for backoff during session authenticating and disconnect the client is back off ...
6 years, 9 months ago (2014-03-27 03:23:20 UTC) #8
Sergey Ulanov
https://codereview.chromium.org/205583011/diff/90001/remoting/host/chromoting_host.cc File remoting/host/chromoting_host.cc (right): https://codereview.chromium.org/205583011/diff/90001/remoting/host/chromoting_host.cc#newcode180 remoting/host/chromoting_host.cc:180: client->DisconnectSession(); return here. We don't want to increment backoff ...
6 years, 9 months ago (2014-03-27 19:06:55 UTC) #9
kelvinp
https://codereview.chromium.org/205583011/diff/90001/remoting/host/chromoting_host.cc File remoting/host/chromoting_host.cc (right): https://codereview.chromium.org/205583011/diff/90001/remoting/host/chromoting_host.cc#newcode180 remoting/host/chromoting_host.cc:180: client->DisconnectSession(); On 2014/03/27 19:06:55, Sergey Ulanov wrote: > return ...
6 years, 8 months ago (2014-04-01 21:23:49 UTC) #10
Sergey Ulanov
lgtm when my comments are addressed https://codereview.chromium.org/205583011/diff/130001/remoting/host/chromoting_host.cc File remoting/host/chromoting_host.cc (right): https://codereview.chromium.org/205583011/diff/130001/remoting/host/chromoting_host.cc#newcode283 remoting/host/chromoting_host.cc:283: " an overload ...
6 years, 8 months ago (2014-04-02 19:49:26 UTC) #11
kelvinp
https://codereview.chromium.org/205583011/diff/130001/remoting/host/chromoting_host.cc File remoting/host/chromoting_host.cc (right): https://codereview.chromium.org/205583011/diff/130001/remoting/host/chromoting_host.cc#newcode283 remoting/host/chromoting_host.cc:283: " an overload of failed login attempts."; On 2014/04/02 ...
6 years, 8 months ago (2014-04-07 18:48:01 UTC) #12
kelvinp
6 years, 8 months ago (2014-04-07 18:48:04 UTC) #13
kelvinp
The CQ bit was checked by kelvinp@chromium.org
6 years, 8 months ago (2014-04-07 18:48:13 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kelvinp@chromium.org/205583011/170001
6 years, 8 months ago (2014-04-07 18:49:00 UTC) #15
commit-bot: I haz the power
6 years, 8 months ago (2014-04-07 22:33:30 UTC) #16
Message was sent while issue was closed.
Change committed as 262228

Powered by Google App Engine
This is Rietveld 408576698