iOS autofill accesses iframes breaking same-origin policy
Reported by
came...@remitly.com,
Apr 6 2017
|
||||||||||
Issue description
Steps to reproduce the problem:
Load a webpage that loads an iframe on a different domain than the host with autofill enabled. (on an iOS device in Chrome)
What is the expected behavior?
No exceptions
What went wrong?
I get a SecurityError
SecurityError SecurityError (DOM Exception 18): Blocked a frame with origin "{my host}" from accessing a frame with origin "{other host}". Protocols, domains, and ports must match.
{url}:5:190 g
{url}:7:323 g
{url}:13:37 extractNewForms
{url}:8:381 extractForms
{url}:1:98 global code
Did this work before? No
Chrome version: 57.0.2987 Channel: stable
OS Version: iOS 10.3
Flash Version:
I think the resolution is that this code either handles security exceptions as thrown or doesn't traverse into iframes whose src's don't match the current host.
https://cs.chromium.org/chromium/src/components/autofill/ios/browser/resources/autofill_controller.js?q=extractNewForms+package:%5Echromium$&l=724
,
Apr 10 2017
Could you please provide an where this fails? And did this ever work?
,
Apr 10 2017
As far as I can tell, this happens when autofill is triggered. I don't know if this ever worked. It didn't recently start occurring.
,
Apr 10 2017
I wouldn't make this a release blocker if it's not a regression. Could please point us to an example page where this fails?
,
Apr 10 2017
I suspect it will fail on this page. http://s.codepen.io/boomerang/iFrameKey-299954da-48e6-0bf8-58d3-22882238bed7/index.html (see http://codepen.io/apexskier/pen/dvEegb).
,
Apr 11 2017
Facing the same issue on chrome ios. Doesn't matter autofill is enabled or disabled. See this comment :- https://bugs.chromium.org/p/chromium/issues/detail?id=590375#c12 It recursively tries to extract form fields in iframes without checking the origin which throws the error. Attached a simple html code which throws error in chrome for ios
,
May 1 2017
This just started showing up in our logs on April 5, so this looks like a regression. The following versions are throwing this error: Chrome 57.0.2987 Chrome 58.0.3029
,
May 2 2017
I just tried this in Chrome 47 and this error is not happening so I can confirm that this is a regression.
,
May 3 2017
CCing vabr in case this is from a passwords change
,
May 3 2017
I don't think this is a recent regression, and unlikely to come from a passwords change. Perhaps this is a dupe of bug 659173 , which I filed last year?
,
May 3 2017
After more digging through our logs I've found the following: Two additional Chrome version are affected: Chrome 52.0.2743 Chrome 56.0.2924 The only thing that is consistent with EVERY error in our log is that the version of iOS is 10.3 or 10.3.1 - 10.3 introduced a lot of WebKit security fixes: https://support.apple.com/en-us/HT207617 iOS 10.3 was released on 3/27, which is 9 days before it started showing up in our logs. Given that it takes a bit for people to first get the iOS system notification that a new version of iOS is available and then to update to the new version, the 9 day gap from release to first bug in our logs makes sense. Can you please investigate whether one of the security fixes in iOS 10.3 is the culprit?
,
May 11 2017
This happens with our client websites too. If this is of any help: Affected Chrome versions: 58.0.3029 57.0.2987 56.0.2924 55.0.2883 All on iOS 10.3.
,
Jun 12 2017
Still affected: Mozilla/5.0 (iPad; CPU OS 10_3_2 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) CriOS/59.0.3071.84 Mobile/14F89 Safari/602.1
,
Jun 29 2017
,
Jun 30 2017
I fixed a similar issue by changing the injected JavaScript: crbug.com/735634 . I'll send a patch soon and see if you like it.
,
Jun 30 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/051aedf5e9212a891d4c1886e4407e070d08ce09 commit 051aedf5e9212a891d4c1886e4407e070d08ce09 Author: Danyao Wang <danyao@google.com> Date: Fri Jun 30 14:34:19 2017 Skip cross-origin iframes for autofill. Previously we rely on document property being undefined in an iframe to detect cross-origin iframes. This triggers a SecurityError in iOS. Change the origin check to use only information available from the parent frame (i.e. src attribute of iframe element) to avoid triggering the error, which adds noise to console. Bug: 709132 Change-Id: I59a3a1f31a43f0db8099e964f1c56841e59ca8e3 Reviewed-on: https://chromium-review.googlesource.com/557421 Reviewed-by: Vaclav Brozek <vabr@chromium.org> Commit-Queue: Danyao Wang <danyao@chromium.org> Cr-Commit-Position: refs/heads/master@{#483700} [modify] https://crrev.com/051aedf5e9212a891d4c1886e4407e070d08ce09/components/autofill/ios/browser/resources/autofill_controller.js [modify] https://crrev.com/051aedf5e9212a891d4c1886e4407e070d08ce09/ios/chrome/browser/passwords/resources/password_controller.js
,
Jun 30 2017
,
Jun 30 2017
I'm not familiar with the relation between fixes and new releases, but I'm wondering when there will be a release for iOS Chrome where this fix is applied?
,
Jun 30 2017
Hello, this patch has landed in the M61 version slated for wide release in the fall (I think September?). Hope this answers your question.
,
Jun 30 2017
Sure, thanks :-) Den fre. 30. jun. 2017, 23:30 skrev ma… via monorail < monorail+v2.4273537821@chromium.org>:
,
Jul 23 2017
I seem to be getting a similar issue, but not to do with CORS. Can someone check in M61 that this is fixed otherwise I'll file a new bug. Steps to reproduce; Go to: https://robert-daly.com/temp/mw.php Focus an element, iOS keyboard will have autofill button Go to; https://robert-daly.com/temp/mw.php?frame=true Focus element, autofill buttons missing Only difference is that there is an GTM iframe on the page. iOS 10.3.2 Chrome 59.0.3071.102
,
Aug 30 2017
,
Dec 27 2017
Hi guys. Is this issue fixed? We still have a lot of 'Blocked frame' errors on Chrome Mobile iOS 61, Chrome Mobile iOS 63
,
Dec 27 2017
,
Dec 28 2017
iFrame exploration has been disabled for autofill until we have proper iframe support. I am not sure for password.
,
Jan 2 2018
+dvadym for keywords "ios", "iframe", and "password"
,
Jan 2 2018
PasswordManager processes forms from iframes that have the same origins as the main frame. sop...@debitoor.com: Don't you have examples of pages where 'Blocked frame' errors are seen?
,
Nov 29
|
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by olivierrobin@chromium.org
, Apr 7 2017Labels: M-58 ReleaseBlock-Stable
Owner: mahmadi@chromium.org
Status: Assigned (was: Unconfirmed)