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

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

Security Hole Summary

First, a brief summary of the two main “use case” conclusions of this article regarding the impact of the security hole found:

1. If a page is hosting a SWF from a different domain than the page… In this case, Adobe’s model will *only* check the SWF’s domain for cross-domain policy permission. Since a SWF has to be made publicly available through HTTP/S just like images do, *anyone* can link to your SWF and use it in their page… any server who your SWF can contact would probably want to allow access not just based on where the SWF is coming from, but also from the page context it’s running in, but they cannot control the page-domain access. This is especially true if you as the creator of the SWF had to make the SWF more open/flexible in its capabilities for arbitrary communication (such as flXHR or other RIA communication widgets), because it’s more susceptible to “abuse” by a malicious page and its javascript.

2. The more limited, niche-case is if you want to host a SWF on your server, but do not want that SWF to be able to contact your server… you *cannot* control that, because the flash player will grant “auto-trust” to the SWF to talk to *any* part of your public server’s access points. Ideally, it would seem like most server admins/authors would want to be able to publish a policy on their own server which controlled access by *any* SWF, not just any remote SWF. It seems pretty clumsy and dangerous that a host’er of a SWF cannot control that SWF’s communication back to the same hosting server with a server policy… and moreover, *this* case is actually contradictory to what Adobe’s own whitepaper says (bottom of page 28 of this PDF).

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.