New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 852356 link

Starred by 3 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , iOS , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Infinite password storage requests

Project Member Reported by vasi...@chromium.org, Jun 13 2018

Issue description

Chrome Version: 69.0.3451.0
OS: all

Imagine there is an https page and a credential saved on http version of the site. User visits https version of the site. Here is what happens on page load:

- FormFetcherImpl requests credentials for https.
- None are returned. HttpPasswordStoreMigrator is created to process the http credentials.
- http credentials are found and copied (site doesn't use hsts bit). However, the format is wrong. signon_realm includes the whole URL instead of just the origin.
- The credential is filled but the store has incorrect one.

Next time the user visits the same page:

- FormFetcherImpl requests credentials for https.
- None are returned (Bug, because the format is incorrect). HttpPasswordStoreMigrator is created to process the http credentials.
- http credentials are found and copied (site doesn't use hsts bit).
- LoginDatabase::AddLogin is called. The SQL query fails because the row already exists in the table. But LoginDatabase::AddLogin is smart and knows that it should update the existing credential. It deletes the previous one and adds again. It generates 2 updates for password store observers - REMOVE and ADD.
- ManagePasswordsUIController reacts to the REMOVE operation and instructs all the PasswordFormManagers to refresh the credentials. This is a new fix (see  Issue 821763 ).
- FormFetcherImpl requests credentials for https. The whole cycle repeats infinite number of times.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d6242200d470ce49aae51175a1e7963dbf21a7d0

commit d6242200d470ce49aae51175a1e7963dbf21a7d0
Author: Vasilii Sukhanov <vasilii@chromium.org>
Date: Wed Jun 13 15:38:49 2018

Fix the format of signon_realm when migrating a credential HTTP -> HTTPS.

HttpPasswordStoreMigrator copies/moves http saved credentials to https. However, the format of the signon_realm was wrong. It should not contain the whole URL path. That is, instead of "https://google.com/something/" it should save "https://google.com/".

Bug: 852356
Change-Id: I25999f938a5ace9378c3ec0fb614491e28a71e88
Reviewed-on: https://chromium-review.googlesource.com/1098967
Reviewed-by: Vaclav Brozek <vabr@chromium.org>
Commit-Queue: Vasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566842}
[modify] https://crrev.com/d6242200d470ce49aae51175a1e7963dbf21a7d0/components/password_manager/core/browser/http_password_store_migrator.cc
[modify] https://crrev.com/d6242200d470ce49aae51175a1e7963dbf21a7d0/components/password_manager/core/browser/http_password_store_migrator_unittest.cc

Labels: Merge-Request-68
I want to merge r566842 back to M68. The fix is simple but the impact is big. Chrome can load 100% CPU under some common conditions.
Project Member

Comment 3 by sheriffbot@chromium.org, Jun 15 2018

Labels: -Merge-Request-68 Hotlist-Merge-Review Merge-Review-68
This bug requires manual review: M68 has already been promoted to the beta branch, so this requires manual review
Please contact the milestone owner if you have questions.
Owners: cmasso@(Android), kariahda@(iOS), bhthompson@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Is this well tested in canary?
Already yes.
Labels: -Merge-Review-68 Merge-Approved-68
Approving merge to M68. Branch:3440

Comment 7 by gov...@chromium.org, Jun 18 2018

Cc: abdulsyed@chromium.org
Pls merge you change to M68 branch 3440 ASAP so we can pick it up for this week Beta release. Merge has to happen latest by 1:00 PM PT tomorrow, Tuesday (06/19), so we can pick it up for Wednesday Beta release.




Project Member

Comment 8 by bugdroid1@chromium.org, Jun 19 2018

Labels: -merge-approved-68 merge-merged-3440
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d68de7f8c5937d04bdb3c77c85bcba441b6e137d

commit d68de7f8c5937d04bdb3c77c85bcba441b6e137d
Author: Vasilii Sukhanov <vasilii@chromium.org>
Date: Tue Jun 19 08:54:34 2018

Fix the format of signon_realm when migrating a credential HTTP -> HTTPS.

HttpPasswordStoreMigrator copies/moves http saved credentials to https. However, the format of the signon_realm was wrong. It should not contain the whole URL path. That is, instead of "https://google.com/something/" it should save "https://google.com/".

TBR=vasilii@chromium.org

(cherry picked from commit d6242200d470ce49aae51175a1e7963dbf21a7d0)

Bug: 852356
Change-Id: I25999f938a5ace9378c3ec0fb614491e28a71e88
Reviewed-on: https://chromium-review.googlesource.com/1098967
Reviewed-by: Vaclav Brozek <vabr@chromium.org>
Commit-Queue: Vasilii Sukhanov <vasilii@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#566842}
Reviewed-on: https://chromium-review.googlesource.com/1105765
Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/branch-heads/3440@{#441}
Cr-Branched-From: 010ddcfda246975d194964ccf20038ebbdec6084-refs/heads/master@{#561733}
[modify] https://crrev.com/d68de7f8c5937d04bdb3c77c85bcba441b6e137d/components/password_manager/core/browser/http_password_store_migrator.cc
[modify] https://crrev.com/d68de7f8c5937d04bdb3c77c85bcba441b6e137d/components/password_manager/core/browser/http_password_store_migrator_unittest.cc


Fixing signon_realm is working only for HTML credentials.

Let’s assume that the user has in Password Store only one form. The form origin is “http://httpbin.org/" and signon_realm is http://httpbin.org/". It can be a PasswordForm::scheme HTML or non-HTML with empty realm. Then:

1. User visit a website that has an HTTP auth form. Suppose the website is https://httpbin.org/something. The form created have origin = “https://httpbin.org/something" . Let’s suppose that auth realm is “realm”, so the  signon_realm will be “https://httpbin.org/realm”.
2. FormFetcherImpl requests credentials for https.
3. None are returned. HttpPasswordStoreMigrator is created to process the http credentials.
   It request credentials for
       PasswordForm::scheme = HTML,
       origin = “http://httpbin.org/something”,
       signon_realm = “http://httpbin.org/”.

   However, signon_realm should be “http://httpbin.org/realm”.

4. Credentials are found and they are copied (HSTS not enabled). New credentials have : 
   origin = “https://httpbin.org/something" 
   signon_realm = “https://httpbin.org/”,
   PasswordForm::scheme  the same as http credentials.

5. If http credentials from Password Store is HTML then https credentials doesn’t match because of different PasswordForm::scheme (PasswordFormManager::IsMatch).
   Even if the http credentials from Password Store has SCHEME_BASIC (the same as submitted form), the migrated https credentials doesn’t match because of different signon_realm (LoginModelObserver::OnAutofillDataAvailable):
   current signon_realm = “https://httpbin.org/realm”
   migrated HTTPS form has signon_realm = “https://httpbin.org/”. 

6. User visit https://httpbin.org/something again, steps 2-5 repeat.

Moreover, if password manager state is not inactive (ManagePasswordsState::ProcessLoginsChanged), infinite password store requests reported is not solved for the scenario described above.

In order not to migrate wrong credentials, FormFetcherImpl should create HttpPasswordStoreMigrator only if form is HTML.

Sign in to add a comment