19.09.2017 Views

the-web-application-hackers-handbook

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

One important difference between Silverlight and Flash is that Silverlight does<br />

not segregate origins based on protocol or port, so objects loaded via HTTP can<br />

interact with HTTPS URLs on <strong>the</strong> same domain.<br />

Silverlight uses its own cross-domain policy file, located at /clientaccesspolicy.xml.<br />

Here’s an example of <strong>the</strong> Silverlight policy file published by www.<br />

microsoft.com:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

The same considerations as already discussed for <strong>the</strong> Flash cross-domain<br />

policy file apply to Silverlight, with <strong>the</strong> exception that Silverlight does not allow<br />

an object to specify a nonstandard URL for <strong>the</strong> policy file.<br />

If <strong>the</strong> Silverlight policy file is not present on a server, <strong>the</strong> Silverlight browser<br />

extension attempts to load a valid Flash policy file from <strong>the</strong> default location. If<br />

<strong>the</strong> file is present, <strong>the</strong> extension processes that instead.<br />

The Same-Origin Policy and Java<br />

Java implements segregation between origins in a way that is largely based on<br />

<strong>the</strong> browser’s same-origin policy. As with o<strong>the</strong>r browser extensions, Java applets<br />

have <strong>the</strong>ir origin determined by <strong>the</strong> domain of <strong>the</strong> URL from which <strong>the</strong> applet<br />

is loaded, not <strong>the</strong> URL of <strong>the</strong> HTML page that loads <strong>the</strong> object.<br />

One important difference with <strong>the</strong> Java same-origin policy is that o<strong>the</strong>r<br />

domains that share <strong>the</strong> IP address of <strong>the</strong> originating domain are considered<br />

to be same-origin under some circumstances. This can lead to limited crossdomain<br />

interaction in some shared hosting situations.<br />

Java currently has no provision for a domain to publish a policy allowing<br />

interaction from o<strong>the</strong>r domains.

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

Saved successfully!

Ooh no, something went wrong!