19.09.2017 Views

the-web-application-hackers-handbook

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

526 Chapter 13 n Attacking Users: O<strong>the</strong>r Techniques<br />

HACK STEPS<br />

You should always check for <strong>the</strong> /crossdomain.xml file on any <strong>web</strong> <strong>application</strong><br />

you are testing. Even if <strong>the</strong> <strong>application</strong> itself does not use Flash, if permission<br />

is granted to ano<strong>the</strong>r domain, Flash objects issued by that domain are<br />

permitted to interact with <strong>the</strong> domain that publishes <strong>the</strong> policy.<br />

n If <strong>the</strong> <strong>application</strong> allows unrestricted access (by specifying ), any o<strong>the</strong>r site can perform two-way<br />

interaction, riding on <strong>the</strong> sessions of <strong>application</strong> users. This would allow<br />

all data to be retrieved, and any user actions to be performed, by any<br />

o<strong>the</strong>r domain.<br />

n If <strong>the</strong> <strong>application</strong> allows access to subdomains or o<strong>the</strong>r domains used by<br />

<strong>the</strong> same organization, two-way interaction is, of course, possible from<br />

those domains. This means that vulnerabilities such as XSS on those<br />

domains may be exploitable to compromise <strong>the</strong> domain that grants permission.<br />

Fur<strong>the</strong>rmore, if an attacker can purchase Flash-based advertising<br />

on any allowed domain, <strong>the</strong> Flash objects he deploys can be used to<br />

compromise <strong>the</strong> domain that grants permission.<br />

n Some policy files disclose intranet hostnames or o<strong>the</strong>r sensitive information<br />

that may be of use to an attacker.<br />

A fur<strong>the</strong>r point of note is that a Flash object may specify a URL on <strong>the</strong> target<br />

server from which <strong>the</strong> policy file should be downloaded. If a top-level policy<br />

file is not present in <strong>the</strong> default location, <strong>the</strong> Flash browser tries to download a<br />

policy from <strong>the</strong> specified URL. To be processed, <strong>the</strong> response to this URL must<br />

contain a validly formatted policy file and must specify an XML or text-based<br />

MIME type in <strong>the</strong> Content-Type header. Currently most domains on <strong>the</strong> <strong>web</strong> do<br />

not publish a Flash policy file at /crossdomain.xml, perhaps on <strong>the</strong> assumption<br />

that <strong>the</strong> default behavior with no policy is to disallow any cross-domain access.<br />

However, this overlooks <strong>the</strong> possibility of third-party Flash objects specifying<br />

a custom URL from which to download a policy. If an <strong>application</strong> contains any<br />

functionality that an attacker could leverage to place an arbitrary XML file into<br />

a URL on <strong>the</strong> <strong>application</strong>’s domain, it may be vulnerable to this attack.<br />

The Same-Origin Policy and Silverlight<br />

The same-origin policy for Silverlight is largely based on <strong>the</strong> policy that is<br />

implemented by Flash. Silverlight objects have <strong>the</strong>ir origin determined by <strong>the</strong><br />

domain of <strong>the</strong> URL from which <strong>the</strong> object is loaded, not <strong>the</strong> URL of <strong>the</strong> HTML<br />

page that loads <strong>the</strong> object.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!