History | Log In     View a printable version of the current page.  
Issue Details (XML)

Key: FP-561
Type: Bug Bug
Status: In Progress In Progress
Priority: None None
Assignee: mwobensm
Reporter: Kyle Simpson
Votes: 18
Watchers: 17
Operations

If you were logged in you would be able to see more operations.
Flash Player

"Location.toString" uncaught (security) exception caused by improper Flash plugin behavior

Created: 08/19/08 10:42 AM   Updated: 06/19/09 09:11 PM
Component/s: Browser Integration General
Security Level: Public (All JIRA Users )

Severity: Runtime Error
Reproducibility: Every Time
Discoverability: Medium
Found in Version: Flash Player 9 - 9_0_124_0
Milestone: Flash Player 9
Affected OS(s): All OS Platforms - All
Injection: No
Steps to Reproduce:
Steps to reproduce:
1. create an iframe on a page that has a different location (domain) than the parent page.
2. load *any* flash file (regardless of publish-version target, EI, javascript, etc) into the iframe
3. note the cryptic error in the Firefox Error Console
 
 Actual Results:
 An error that says "Location.toString" could not be called is thrown in the FF Error Console. This comes from *no* code in the SWF, it's just something the plugin does automatically. However, in a "cross-domain" situation, the call to the parent's "location" property is a security error, and therefore should not be done by the plugin.

This occurs in FF2 and FF3.

The "cryptic" nature of this error has been reported as a bug to Mozilla, here: https://bugzilla.mozilla.org/show_bug.cgi?id=434522

They note that they are really unable to provide anymore information, such as that it's coming from the flash plugin or which embedded SWF object triggered the uncaught exception. However, the fact that the error is cryptic is a separate issue from this bug, which is that the plugin should not be making this improper call.
 
 Expected Results:
 any need for the plugin to examine the page's location (domain) should reference "self.location" so as to make sure that the reference is on the current window/frame, and that way there's never a security error because of a cross-domain scenario.
 
 Workaround (if any):
 None. Ignore the cryptic error in the Error Console.
 
 
Language Found: English
Bugbase Id: none
Triaged: No
Participants: Blake Soley, Daniel Remeseiro, Edwin Wong, Jon Cino, JP Grace, Kyle Simpson, Mike Katchourine, mwobensm, Ray Simard and Sasha Rush
Browser: Firefox 2.x


 All   Comments      Sort Order:
mwobensm - [08/19/08 04:32 PM ]
Confirmed. The error is cosmetic. Exposes no functional or security issues.

Kyle Simpson - [08/20/08 09:18 AM ]
agreed, the error is in fact (mostly) cosmetic. But there's certainly got to be some reason the flash plugin is insisting on looking at the location of the parent/top window, as opposed to looking at it's own location ("self.location" for instance). I would hazard a guess that it's got something to do with the plugin's security context checking, possibly related to cross-domain communication and the crossdomain.xml? Or maybe it has to do with checking for LSO's ("flash cookies")? Or something along those lines.

The point should also be made that this behavior does *not* seem to occur in IE, because none of my JS error trapping/debugging tools pick up on it.

Also, as noted by my several notes in the referenced mozilla bug thread, the presence of this error (plugin at fault), along with it's ambiguous error message (FF at fault), can (and did) lead to some errant troubleshooting because it misguides in what it's about.

My issue specifically was that I had some code that was in fact doing an ExternalInterface call to "window.location.href.toString", and owing to the similar nature of this error message ("Location.toString"), I was certain that the two were related. It took 3 days of testing and debugging my code before I was able to confirm that my code had nothing to do with this error.

And then, there was no documentation available from Adobe as to why this should be happening. So I spent another several days assuming that maybe it was a Mozilla bug of some sort. So, more than a week later, and no closer to a resolution, I finally arrived at the conclusion that the plugin itself was spuriously attempting some call to the parent/top window/frame's location property, and failing to robustly call that with a try/catch of some sort to handle the case when the parent/top window/frame is in a different domain.

I guess my point is this: there's got to be some reason the plugin needs (or needed in the past) to make this call. And if it has any bearing on what happens when it cannot make this call (because of the cross-domain situation) then it might expose a logic problem more serious than just "cosmetic". But even if not, and it's just a totally spurious call... the fact that it's there and so cryptic is quite misleading to developers.

Kyle Simpson - [09/03/08 02:58 PM ]
apparently, this same issue also exists inside the new Google Chrome browser... which apparently reports the error much more generically and less specifically as something like:

"Unsafe JavaScript attempt to access frame with URL http://domain1.com/ from frame with URL http://domain2.com. Domains, protocols, and ports must match."

Jon Cino - [10/23/08 04:26 PM ]
Unable to replicate as of yet (need more details from users), but multiple reports of users having IFrame content blocked due to the error that is thrown. Seems to be triggering protective behavior from some pop-up blocking and security software. Possible revenue impact to online advertising firms.

Jon Cino - [10/23/08 04:38 PM ]
I should also add that this seems to be a bigger issue with Flash 10. Not sure if it is the third-party security applications or the (possibly) higher level of security in Flash 10.

Ray Simard - [11/08/08 04:03 AM ]
Can anyone check into the possibility that it's the SWF trying to send forbidden requests or headers?

Ref:

http://www.adobe.com/go/tn_14213

http://www.adobe.com/go/kb403185

And there are some unconditionally blocked headers:

http://www.adobe.com/go/kb403030



Kyle Simpson - [11/08/08 07:18 AM ]
It seems pretty clear that the error is indeed having the Flash plugin trying to access the top window's location property, and in cross-domain situations (ie, when flash is inside an iframe at a different location), this is a security error. I would doubt that flash was sending headers erroneously and yet the browsers were catching this and reporting it as unauthorized access of window.location.

It is true that headers could cause a similar problem, if flash were sending them automatically just because it loads. But as far as I can tell from my testing, it doesn't appear that the plugin is doing anything else automatically during its loading which causes security issues -- only trying to access a property in a frame outside its own.

It's understandable that Flash would want to know what domain it's running in -- In fact, I *REALLY* wish Flash would detect this and expose it through actionscript -- it only exposes the domain/URL of where the SWF came from, not the URL of the page it's running in. Right now, I have to make a javascript call through external interface to accomplish that task.

But, I think the point I've tried to make about this is that Flash should be trying to reference *only* the current frame's properties... so something like "self.location" instead of "window.top.location". That's the best way to avoid this type of problem. Or, alternatively, flash could wrap it's call in a try/catch so that at least if it fails, an uncaught exception doesn't get logged to the browser.

Sasha Rush - [12/15/08 09:46 PM ]
In both Facebook Platform and Facebook Connect, we make heavy use of IFrames and Flash, and this error causes innumerable problems. Not sure why you say it is a "cosmetic" error since it seems to cause javascript to throw exceptions. We've found that the only solution is to turn off Flash in Firefox and tell clients to avoid using flash within iframes in their applications.

Is there any workaround for this problem? I haven't been unable to figure out a solution.

Sasha Rush - [12/15/08 09:51 PM ]
This blog post describes the problem in depth and provides some examples.

http://blog.luckycal.com/?p=44

Daniel Remeseiro - [01/14/09 03:30 AM ]
Please. work on it! This is not a cosmetic bug! this bug is quietly awful!
We have a lot of problems with flash banners from third parties. And we are losing revenues for it.

its related with the new features about cross-site scripting as seen on this post:

http://willperone.net/Code/as3error.php

I will try to trace some data for you.

mwobensm - [02/09/09 06:07 PM ]
We are now aware of greater functional issues caused by this bug, so we'll be taking a closer look at how we can address it.

Kyle Simpson - [02/09/09 06:17 PM ]
hooray! best news i've heard today!

Sasha Rush - [02/09/09 06:55 PM ]
great to hear. keep us up to date.

JP Grace - [04/01/09 02:48 PM ]
Any word on this issues progress?

Blake Soley - [06/16/09 02:18 PM ]
I'd like to echo Sasha's comments from 6 months (!) ago, that this is really aggravating to deal with when developing for the Facebook Connect platform, which uses cross-domain requests for several important features.

Mike Katchourine - [06/19/09 09:11 PM ]
Wow, can't beleive adobe can't find either a workaround or a fix for one bug for 6 months. I just recently started seeing it in my facebook app after we started using FBJS to adjust the iframe size.

Fellow sufferers, does anyone know of a workaround short of, uh, not using flash?