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

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

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

Chapter 7: Building Secure Assemblies 149CountermeasuresCountermeasures that you can use to prevent information disclosure include:● Solid input validation● Structured exception h<strong>and</strong>ling <strong>and</strong> returning generic errors to the client● Not storing secrets in code● Obfuscation tools to foil decompilers <strong>and</strong> protect intellectual propertyTamperingThe risk with tampering is that your assembly is modified by altering the MSILinstructions in the binary DLL or EXE assembly file.VulnerabilitiesThe primary vulnerability that makes your assembly vulnerable to tampering is thelack of a strong name signature.AttacksCommon attacks include:● Direct manipulation of MSIL instructions● Reverse engineering MSIL instructionsCountermeasuresTo counter the tampering threat, use a strong name to sign the assembly with aprivate key. When a signed assembly is loaded, the common language runtimedetects if the assembly has been modified in any way <strong>and</strong> will not load the assemblyif it has been altered.Privileged CodeWhen you design <strong>and</strong> build secure assemblies, be able to identify privileged code.This has important implications for code access security. Privileged code is managedcode that accesses secured resources or performs other security sensitive operationssuch as calling unmanaged code, using serialization, or using reflection. It is referredto as privileged code because it must be granted permission by code access securitypolicy to be able to function. Non-privileged code only requires the permission toexecute.

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

Saved successfully!

Ooh no, something went wrong!