11.07.2015 Views

Improving Web Application Security: Threats and - CGISecurity

Improving Web Application Security: Threats and - CGISecurity

Improving Web Application Security: Threats and - CGISecurity

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

200 Part III: Building Secure <strong>Web</strong> <strong>Application</strong>sCarefully consider before using a link dem<strong>and</strong> because it is easy to introduce securityvulnerabilities if you use them. If you do use link dem<strong>and</strong>s, consider the followingissues:● Luring attacks● Performance <strong>and</strong> link dem<strong>and</strong>s● Calling methods with link dem<strong>and</strong>s● Mixing class <strong>and</strong> method level link dem<strong>and</strong>s● Interfaces <strong>and</strong> link dem<strong>and</strong>s● Structures <strong>and</strong> link dem<strong>and</strong>s● Virtual methods <strong>and</strong> link dem<strong>and</strong>sLuring AttacksIf you protect code with a link dem<strong>and</strong>, it is vulnerable to luring attacks, wheremalicious code gains access to the resource or operation exposed by your codethrough a trusted intermediary as shown in Figure 8.5.Luring attackvia intermediaryA B CDCan’t accessXLink dem<strong>and</strong>protectedFigure 8.5An example of a luring attack with link dem<strong>and</strong>sIn figure 8.5, methods in assembly X, which access a secure resource,are protected with a link dem<strong>and</strong> for a specific public key (using aStrongNameIdentityPermission). Assemblies A, B, <strong>and</strong> C are signed with the privatekey that corresponds to the public key that assembly X trusts, <strong>and</strong> so these assembliescan call assembly X. Assemblies A, B, <strong>and</strong> C are subject to a luring attack if they donot check their callers for specific evidence before making calls to assembly X. Forexample, assembly D that is not signed with the same private key cannot callassembly X directly. It could, however, access assembly X through the trustedassembly A, if A does not check its callers, either with another link dem<strong>and</strong> orthrough a full dem<strong>and</strong>.

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

Saved successfully!

Ooh no, something went wrong!