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.

850 Chapter 21 n A Web Application Hacker’s Methodology<br />

and scripts contained within HTML pages (both static and dynamically<br />

generated).<br />

12.1.2 Identify all uses of <strong>the</strong> following APIs, which may be used to access<br />

DOM data that can be controlled via a crafted URL:<br />

document.location<br />

document.URL<br />

document.URLUnencoded<br />

document.referrer<br />

window.location<br />

12.1.3 Trace <strong>the</strong> relevant data through <strong>the</strong> code to identify what actions are<br />

performed with it. If <strong>the</strong> data (or a manipulated form of it) is passed to<br />

one of <strong>the</strong> following APIs, <strong>the</strong> <strong>application</strong> may be vulnerable to XSS:<br />

document.write()<br />

document.writeln()<br />

document.body.innerHtml<br />

eval()<br />

window.execScript()<br />

window.setInterval()<br />

window.setTimeout()<br />

12.1.4 If <strong>the</strong> data is passed to one of <strong>the</strong> following APIs, <strong>the</strong> <strong>application</strong> may<br />

be vulnerable to a redirection attack:<br />

document.location<br />

document.URL<br />

document.open()<br />

window.location.href<br />

window.navigate()<br />

window.open()<br />

12.2 Check for Local Privacy Vulnerabilities<br />

12.2.1 Review <strong>the</strong> logs created by your intercepting proxy to identify all <strong>the</strong><br />

Set-Cookie directives received from <strong>the</strong> <strong>application</strong> during your testing.<br />

If any of <strong>the</strong>se contains an expires attribute with a date that is in<br />

<strong>the</strong> future, <strong>the</strong> cookie will be stored by users’ browsers until that date.<br />

Review <strong>the</strong> contents of any persistent cookies for sensitive data.<br />

12.2.2 If a persistent cookie is set that contains any sensitive data, a local attacker<br />

may be able to capture this data. Even if <strong>the</strong> data is encrypted, an attacker<br />

who captures it will be able to resubmit <strong>the</strong> cookie to <strong>the</strong> <strong>application</strong><br />

and gain access to any data or functionality that this allows.<br />

12.2.3 If any <strong>application</strong> pages containing sensitive data are accessed over<br />

HTTP, look for any cache directives within <strong>the</strong> server’s responses. If any<br />

of <strong>the</strong> following directives do not exist (ei<strong>the</strong>r within <strong>the</strong> HTTP headers

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

Saved successfully!

Ooh no, something went wrong!