(new) Adobe Flash Player security hole found, flXHR’s response

getify | Flash, flXHR | Monday, August 18th, 2008

Current Flash Player Security model

Let me first briefly explain the existing model, so that I can more easily point out the ‘hole’ and what flXHR does to address it.

For the purposes of this discussion, “local domain” will refer to the domain that a SWF file comes from (regardless of the URL of the page it’s sitting in), and “remote domain” will refer to the domain that a remote server sits on which the SWF will will attempt to communicate with.

The Flash Player intrinsically enforces a policy on any client-to-server communication (as well other special client-side operations) which says that a “local domain” SWF trying to contact a “remote domain” server must first examine a special policy file (“crossdomain.xml”) on the server which grants permission to the “local domain” (either specifically or through wildcards). Because the Flash Player itself takes care of the gory details, and exposes almost none of that process to the SWF’s scripting code, authors and users can be fairly secure in knowing that any cross-domain communication that is occuring, with or without their knowledge, is doing so with specific server-opt-in permissions granted.

There are of course lots of intricate details here about how the model works in more complicated terms, and is applied. For instance, Adobe’s most recent plugin release (9.0.124) introduces the idea that multiple policies may exist on a server in various locations, but that a single root policy must exist which grants permission to various other policies (the so called “policy on policies” or “meta-policy”). Also, the policies allow controlling not only the communication line itself, but the request-headers as well, as well as the protocol (http vs https).

The fine-grained control that the server policies provide has addressed a number of previous concerns about the security of the solution, but to be fair, author/administrator (mis)understanding and lack of buy-in of the available controls has caused some notably slow adoption and publicly negative abuses (either intentionally or unintentionally). Because it’s a complicated matter, there are certain to be some who are slow or absent in adopting the proper practices to ensure valid, authorized, and secure communication.

But, for the most part, the model as augmented by the 9.0.124 release is seen as a very stable evolution in cross-domain policy enforcement, and many reputable public service API’s have adopted policies to serve the needs of the web community (Flickr, YouTube, etc) based in whole or in part of what Adobe has built. And with Flash now installed on better than 99% of all computers, it’s a sure bet that somewhere along the way in your daily surfing activities, you are the beneficiary of such a system, whether you know it or not!

Bookmark and Share

5 Comments »

  1. You definitely raised an interesting point regarding Flash security. I wouldn’t call this a security hole though, but rather a missing security feature.
    It’s always up to developer to develop secure application according to the platform capabilities and limitation. A “good” developer can break the toughest security model in a sec :)

    Comment by guya — August 28, 2008 @ 10:47 am

  2. @guya- I think the reason I chose to use “hole” instead of “gap” or “missing feature” is because of point #2 in the page-1 summary — that the behavior is contrary to Adobe’s own security white paper (bottom of page 28) on the topic.

    But yes, I agree wholeheartedly that developers/authors need to be more diligent. That’s why I spent an entire month writing and testing (some fairly complex) code to “plug” the hole in the flXHR project so that flXHR can’t be abused (purposely or inadvertently).

    But, clearly, my code is not nearly as efficient as if Adobe would address the hole/feature with their native code. And my code doesn’t do much to help all the other flash .swf assets out there which may be vulnerable to such a thing (although the code I wrote *is* in its own class so it *could* be adapted to other projects somewhat straightforwardly).

    I guess that’s mostly what I am hoping will come of all this, so that eventually my code won’t be necessary, and other flash content developers won’t have to worry (as much) about this kind of feature-gap.

    Comment by Shade — August 28, 2008 @ 12:56 pm

  3. The problem is your underlying assumption is incorrect. You said:

    “The domain of the URL of the hosting HTML page is *not* considered, even though the SWF’s executable code (similar to any remotely loaded Javascript files) will in reality execute in the context of that page.”

    However, SWF is executed in the context of the SWF’s origin, not of the surrounding page and does not have access to the surrounding page (unless both SWF and HTML are from the same origin OR you enable cross-domain scripting explicitly with allowScriptAccess=always). So it is not the same as importing JavaScript via the SCRIPT tag.

    Comment by LDA — October 9, 2008 @ 3:29 pm

  4. I understand that the SWF logically operates in the originating domain security context. And I understand how SWF differs from JS, in that SWF provides this special ability to self-contain its execution to a remote security context (*unless* that barrier is intentionally taken down by the author).

    But physically, the SWF is operating inside of an HTML page on perhaps a different domain, and moreover, may be interacting with the javascript of that page on the different domain (if the author allowed it).

    In my opinion, what matters most here is the practical security context, which for flash on a webpage, can look a lot more like a mix between the page’s domain and the SWF domain, than *just* the SWF domain.

    I know there are access controls (‘allowscriptaccess’ and ‘allowdomain’) which are generally in place to help prevent (or allow) the swf from stepping out of its security context bounds when on a page from a different domain. However, there are plenty of times when a flash file (like flXHR for instance) must be granted permission to talk with the surrounding page regardless of the domain, to accomplish its tasks or goals.

    A stand-alone, totally security-sandboxed flash is fine for say a flash ad, but real interactive RIA type flash often needs to step outside it’s walls from time-to-time, and so authors must sometimes breach this defense.

    So, if you have such a flash file, which, internally published *and* through the HTML it’s hosted in, has granted this cross-domain access, then practically speaking, that SWF is now operating in a hybrid security context, a mixture of both the page domain and the originating domain.

    It is *this* use case which leads me to assert that both the page domain and the swf-domain would be proper to check in resolving cross-domain policies from a server.

    Think about it this way… if Adobe’s flash *did* do as I suggest, in most cases (where the page-domain and swf-domain are the same), the behavior wouldn’t be any different than it is right now. But in the set of cases where a SWF is operating in the hybrid context, the cross-domain policies *would be* more secure than they are now, assuming that only the swf-domain need be considered.

    I’m simply suggesting that giving developers the ability to breach the strict originating domain security context (ie, the “AllowDomain” actionscript call) but not having the policy file model also support this hybrid context is where the “hole” comes from. And try as I may, the implementation I put in place to protect flXHR from being exploited while in the hybrid zone is limited in its effectiveness — only a native solution from Adobe would fully plug this hole.

    Comment by Shade — October 9, 2008 @ 4:52 pm

  5. [...] was the class added to flXHR.swf in a previous alpha release to address the needs discussed in this blog on security model holes. However, it was discovered through further testing that IP addresses, single-word domains (like [...]

    Pingback by Changes and new features in flensed 1.0 | the Fresh! — December 5, 2008 @ 7:32 pm

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.