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

Issue 163843002: Fix check for user gesture on password autofill (Closed)

Created:
6 years, 10 months ago by vabr (Chromium)
Modified:
6 years, 10 months ago
CC:
chromium-reviews, benquan, jam, browser-components-watch_chromium.org, joi+watch-content_chromium.org, darin-cc_chromium.org, Dane Wallinga, dyu1, estade+watch_chromium.org, rouslan+autofillwatch_chromium.org, abarth-chromium, Garrett Casto
Visibility:
Public.

Description

Fix check for user gesture on password autofill The original security feature is: If passwords get autofilled on page load, do not make them accessible to JavaScript code until the user interacts with the page. Formerly, this was implemented as https://codereview.chromium.org/83023017 (Chromium) + https://codereview.chromium.org/82693006 (Blink). That implementation used the Blink user gesture support in a wrong way (https://codereview.chromium.org/82693006/#msg14), which resulted in http://crbug.com/337429. This Cl attempts to fix the problem by going through RenderWidget::OnHandleInputEvent. At that point we can see user events and filter them using WebInputEvent::isUserGestureEventType. Through RenderViewObserver, we then notify the corresponding PasswordAutofillAgent. Testing: This CL adds a test replicating the problem from http://crbug.com/337429. vabr checked that the new test fails without the new fix. All the tests put in place by https://codereview.chromium.org/83023017 are also relevant. vabr also manually checked with the browser, that the issue reported in http://crbug.com/337429 no longer reproduces with this CL. BUG=337429, 163072 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=252352

Patch Set 1 #

Total comments: 4

Patch Set 2 : Have 'user' in the gesture variable name #

Patch Set 3 : Fix PasswordManagerBrowserTest.VerifyPasswordGenerationUpload #

Total comments: 2

Patch Set 4 : Add test #

Patch Set 5 : Uploading a missing test file #

Patch Set 6 : New implementation using isUserGestureEventType #

Total comments: 16

Patch Set 7 : Ilya's comments addressed #

Patch Set 8 : Just rebased #

Patch Set 9 : Fix compilation #

Total comments: 6

Patch Set 10 : Rename ProcessingUserGestureEvent to NotifyAboutUserGesture #

Total comments: 4

Patch Set 11 : Use SimulateMouseClick & Rename NotifyAboutUserGesture -> WillProcessUserGesture #

Total comments: 2

Patch Set 12 : Correct comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+147 lines, -63 lines) Patch
M chrome/browser/password_manager/password_manager_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +58 lines, -2 lines 0 comments Download
A + chrome/test/data/password/form_and_link.html View 1 2 3 4 1 chunk +2 lines, -8 lines 0 comments Download
M components/autofill/content/renderer/password_autofill_agent.h View 1 2 3 4 5 6 7 8 9 10 4 chunks +22 lines, -14 lines 0 comments Download
M components/autofill/content/renderer/password_autofill_agent.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +49 lines, -39 lines 0 comments Download
M content/public/renderer/render_view_observer.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M content/renderer/render_view_impl.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +5 lines, -0 lines 0 comments Download
M content/renderer/render_widget.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -0 lines 0 comments Download
M content/renderer/render_widget.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 33 (0 generated)
vabr (Chromium)
Garrett: FYI. Joel, What do you say to this CL? I tested locally, and it ...
6 years, 10 months ago (2014-02-13 17:01:32 UTC) #1
jww
On 2014/02/13 17:01:32, vabr (Chromium) wrote: > Garrett: FYI. > > Joel, > > What ...
6 years, 10 months ago (2014-02-13 20:11:47 UTC) #2
Ilya Sherman
Drive-by: I don't know who initially added the UserGesture API in Blink, but please get ...
6 years, 10 months ago (2014-02-13 21:20:52 UTC) #3
jww
On 2014/02/13 21:20:52, Ilya Sherman wrote: > Drive-by: I don't know who initially added the ...
6 years, 10 months ago (2014-02-13 21:33:29 UTC) #4
jww
https://codereview.chromium.org/163843002/diff/1/components/autofill/content/renderer/password_autofill_agent.cc File components/autofill/content/renderer/password_autofill_agent.cc (right): https://codereview.chromium.org/163843002/diff/1/components/autofill/content/renderer/password_autofill_agent.cc#newcode510 components/autofill/content/renderer/password_autofill_agent.cc:510: void PasswordAutofillAgent::DidHandleKeyEvent() { To ask what I think is ...
6 years, 10 months ago (2014-02-13 21:33:59 UTC) #5
Ilya Sherman
On 2014/02/13 21:33:29, jww wrote: > On 2014/02/13 21:20:52, Ilya Sherman wrote: > > Drive-by: ...
6 years, 10 months ago (2014-02-13 21:36:07 UTC) #6
vabr (Chromium)
Thanks Joel and Ilya. I addressed Joel's comments. As for the tests -- indeed, the ...
6 years, 10 months ago (2014-02-14 08:13:12 UTC) #7
jochen (gone - plz use gerrit)
https://codereview.chromium.org/163843002/diff/210001/components/autofill/content/renderer/password_autofill_agent.h File components/autofill/content/renderer/password_autofill_agent.h (right): https://codereview.chromium.org/163843002/diff/210001/components/autofill/content/renderer/password_autofill_agent.h#newcode123 components/autofill/content/renderer/password_autofill_agent.h:123: virtual void DidHandleKeyEvent() OVERRIDE; did you verify that these ...
6 years, 10 months ago (2014-02-14 12:00:40 UTC) #8
vabr (Chromium)
https://codereview.chromium.org/163843002/diff/210001/components/autofill/content/renderer/password_autofill_agent.h File components/autofill/content/renderer/password_autofill_agent.h (right): https://codereview.chromium.org/163843002/diff/210001/components/autofill/content/renderer/password_autofill_agent.h#newcode123 components/autofill/content/renderer/password_autofill_agent.h:123: virtual void DidHandleKeyEvent() OVERRIDE; On 2014/02/14 12:00:41, jochen wrote: ...
6 years, 10 months ago (2014-02-14 12:07:43 UTC) #9
jochen (gone - plz use gerrit)
ok, the callbacks are all invoked from RenderWidget::OnHandleInputEvent. However, if the page handles the events, ...
6 years, 10 months ago (2014-02-14 12:42:15 UTC) #10
vabr (Chromium)
On 2014/02/14 12:42:15, jochen wrote: > ok, the callbacks are all invoked from RenderWidget::OnHandleInputEvent. > ...
6 years, 10 months ago (2014-02-14 13:12:47 UTC) #11
vabr (Chromium)
Welcome new reviewers on this CL :). The existing reviewers, please note that patch set ...
6 years, 10 months ago (2014-02-14 15:31:16 UTC) #12
Ilya Sherman
Thanks! //components/autofill/content/renderer/ LGTM with nits: https://codereview.chromium.org/163843002/diff/520001/components/autofill/content/renderer/password_autofill_agent.cc File components/autofill/content/renderer/password_autofill_agent.cc (right): https://codereview.chromium.org/163843002/diff/520001/components/autofill/content/renderer/password_autofill_agent.cc#newcode231 components/autofill/content/renderer/password_autofill_agent.cc:231: for (std::vector<blink::WebInputElement>::iterator iter = ...
6 years, 10 months ago (2014-02-14 23:07:33 UTC) #13
jamesr
It seems very odd to fire a notification to indicating that we're about to process ...
6 years, 10 months ago (2014-02-14 23:22:19 UTC) #14
jochen (gone - plz use gerrit)
On 2014/02/14 23:22:19, jamesr wrote: > It seems very odd to fire a notification to ...
6 years, 10 months ago (2014-02-17 14:16:59 UTC) #15
vabr (Chromium)
Thanks, Ilya, your comments are addressed. James, (sorry if I'm repeating what Jochen said in ...
6 years, 10 months ago (2014-02-17 14:24:55 UTC) #16
jww
https://codereview.chromium.org/163843002/diff/710001/chrome/browser/password_manager/password_manager_browsertest.cc File chrome/browser/password_manager/password_manager_browsertest.cc (right): https://codereview.chromium.org/163843002/diff/710001/chrome/browser/password_manager/password_manager_browsertest.cc#newcode183 chrome/browser/password_manager/password_manager_browsertest.cc:183: void SimulateClick(); There's already a SimulateElementClick() function that's used ...
6 years, 10 months ago (2014-02-18 20:19:55 UTC) #17
jamesr
On 2014/02/17 14:16:59, jochen wrote: > On 2014/02/14 23:22:19, jamesr wrote: > > It seems ...
6 years, 10 months ago (2014-02-18 22:43:53 UTC) #18
vabr (Chromium)
Joel, Thanks for the comments, please check my responses below. James, I'm afraid there is ...
6 years, 10 months ago (2014-02-19 07:56:39 UTC) #19
vabr (Chromium)
On 2014/02/19 07:56:39, vabr (Chromium) wrote: > My bad naming probably caused most of the ...
6 years, 10 months ago (2014-02-19 13:55:39 UTC) #20
jamesr
The security benefits of this seem extremely dubious to me. Did this pass any sort ...
6 years, 10 months ago (2014-02-19 20:00:06 UTC) #21
jww
On 2014/02/19 20:00:06, jamesr wrote: > The security benefits of this seem extremely dubious to ...
6 years, 10 months ago (2014-02-19 21:58:52 UTC) #22
jamesr
On 2014/02/19 21:58:52, jww wrote: > On 2014/02/19 20:00:06, jamesr wrote: > > The security ...
6 years, 10 months ago (2014-02-19 22:02:32 UTC) #23
jww
lgtm https://codereview.chromium.org/163843002/diff/1110001/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): https://codereview.chromium.org/163843002/diff/1110001/content/renderer/render_widget.cc#newcode1091 content/renderer/render_widget.cc:1091: if (WebInputEvent::isUserGestureEventType(input_event->type)) On 2014/02/19 20:00:07, jamesr wrote: > ...
6 years, 10 months ago (2014-02-19 22:04:48 UTC) #24
jww
On 2014/02/19 22:04:48, jww wrote: > lgtm > > https://codereview.chromium.org/163843002/diff/1110001/content/renderer/render_widget.cc > File content/renderer/render_widget.cc (right): > ...
6 years, 10 months ago (2014-02-19 22:07:33 UTC) #25
Ilya Sherman
https://codereview.chromium.org/163843002/diff/1110001/chrome/browser/password_manager/password_manager_browsertest.cc File chrome/browser/password_manager/password_manager_browsertest.cc (right): https://codereview.chromium.org/163843002/diff/1110001/chrome/browser/password_manager/password_manager_browsertest.cc#newcode208 chrome/browser/password_manager/password_manager_browsertest.cc:208: } Drive-by nit: Can you use SimulateMouseClick() from //content/public/test/browser_test_utils.h ...
6 years, 10 months ago (2014-02-19 23:54:57 UTC) #26
vabr (Chromium)
Hi all, Ilya's comment and James renaming suggestion addressed. James, Do you have any remaining ...
6 years, 10 months ago (2014-02-20 09:54:21 UTC) #27
jamesr
I don't think the analysis on the bug takes into account the fact that on ...
6 years, 10 months ago (2014-02-20 16:32:37 UTC) #28
vabr (Chromium)
Jói, Could you please have a look at content/public/renderer/render_view_observer.h ? James: Thanks! I understand what ...
6 years, 10 months ago (2014-02-20 16:43:19 UTC) #29
Jói
//content/public LGTM.
6 years, 10 months ago (2014-02-20 16:50:13 UTC) #30
vabr (Chromium)
The CQ bit was checked by vabr@chromium.org
6 years, 10 months ago (2014-02-20 17:16:35 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vabr@chromium.org/163843002/1390001
6 years, 10 months ago (2014-02-20 17:18:40 UTC) #32
commit-bot: I haz the power
6 years, 10 months ago (2014-02-20 19:41:46 UTC) #33
Message was sent while issue was closed.
Change committed as 252352

Powered by Google App Engine
This is Rietveld 408576698