Flex and crossdomain.xml
Asked Answered
A

5

7

I was wondering are there any security concerns with adding crossdomain.xml to the root of an application server? Can it be added to any other parts of the server and are you aware of any work arounds that dont require the server to have this file in place?

Thanks Damien

Artemisa answered 19/9, 2008 at 12:27 Comment(0)
F
10

By adding the crossdomain.xml, the main security concern is that flash applications can now connect to your server. So if someone logs into your site, and then browses over to another website with a malicious flash app, that flash app can connect back to your site. Since it's in a browser, cookies are shared to the flash app. This allows the flash app to hijack the user's session to do whatever it is your website does without the user knowing about it.

If your flex app is served from the same server, you don't need a crossdomain.xml

You can put it in a sub directory of your site and use System.security.loadSecurityPolicy()

http://livedocs.adobe.com/flex/2/langref/flash/system/Security.html

Applications would then be limited to that tree of your directory structure.

Foresheet answered 19/9, 2008 at 12:46 Comment(6)
Hi Marc Thanks for your comments. This sort of thing is worrying. Do you know if adobe are working on this or coming up with any more security features to fix this potential threat? Thanks DamienArtemisa
This is a "potential" threat by design, sometimes you need to be able to do crossdomain communication, that's why you need to explicitly allow connections using this file.Hexachlorophene
I don't quite understand this risk. If you put an "allow everything" crossdomain.xml at the root of your server, doesn't that just give Flash apps the same access as browsers already have? Javascript on a web page at xxx.com can't see cookies at yyy.com because the browser and Javascript security won't allow it. Can a flash file at xxx.com really access cookies at yyy.com (if yyy.com's crossdomain.xml is set to allow everything)?Choriocarcinoma
Damo - Crossdomain.xml IS the fix to the potential threat. Don't put one up if you don't want applications from other domains to hit your server.Foresheet
Skippy - Lets say BANK.COM has a page that lets you transfer money between accounts. Lets say it has an open crossdomain.xml file. Now, lets say user BOB logs into BANK.COM as usual. Next, BOB leaves BANK.COM and goes to EVIL.COM. On EVIL.COM is a malicious flash app. That app can make a request to BANK.COM. That request will come from the browser just like any other request. That means the app could silently hit that transfer-page. BANK.COM would see the user as already logged in because the request came from a browser that had correctly authenticated, and happily allow it to proceed.Foresheet
Marc's comment is to the point. You should not have an unrestricted crossdomain.xml unless all your data is public. Recent blog post on this topic: erlend.oftedal.no/blog/?blogid=101Construe
M
1

There are no workaround for the crossdomain file, it is required to support the crossdomain data access or crossdomain scripting. In the event of any cross-domain request, Flash will look for the crossdomain.xml file at the root of the domain. For example, if you are requesting an XML file from:

http://mysubdomain.mydomain.com/fu/bar/

Flash will check if a crossdomain.xml file exist at:

http://mysubdomin.mydomain.com/crossdomain.xml

You can place the crossdomain.xml file in other location. However, when you ever need to load a crossdomain.xml file from a different location, you have to do it via Security.loadPolicyFile . Bear in mind that the location of this crossdomain have any impact on the security access you have. Flash will only grant access to the folder that contains the crossdomain and its child folders.

You may also want to read up on the security changes in Flash Player 10.

Marybethmaryellen answered 20/10, 2008 at 6:32 Comment(1)
This isn't strictly true; the workaround for the crossdomain file is to proxy all network traffic through the same server hosting your Flash application.Bushore
C
0

You may configure a virtual host for your application. This way the file crossdomain.xml can be at the root of your application but not necessarily at the root of the server.

Cobbett answered 19/9, 2008 at 12:46 Comment(0)
O
0

Yes. Be very careful with crossdomain policy files:
http://www.jamesward.com/2009/11/08/how-bad-crossdomain-policies-expose-protected-data-to-malicious-applications/

My two general rules of thumb are:

  • Do not put a crossdomain policy file on a server that uses cookies
  • Do not put a crossdomain policy file on an internal server
Ondrea answered 23/6, 2010 at 12:39 Comment(0)
C
-1

crossdomain.xml is just a file that has meaning to the Flash runtime; you can restrict what HTTP requests get to see it. You can use web server (e.g. Apache) configuration control to allow read access to it (and only it) from the "root" directory (see previous answers).

You might filter by other headers in the request, etc.

Cheers

Casemate answered 19/10, 2008 at 19:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.