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.

738 <strong>Improving</strong> <strong>Web</strong> <strong>Application</strong> <strong>Security</strong>: <strong>Threats</strong> <strong>and</strong> CountermeasuresThreadingCheck DescriptionResults of security checks are not cached.Impersonation tokens are considered when new threads are created (any existing threadtoken is not passed to the new thread).Threads are synchronized in static class constructors for multithreaded application code.Object implementation code is designed <strong>and</strong> built to be thread safe.Threads are synchronized in static class constructors.ReflectionCheck DescriptionCaller cannot influence dynamically generated code (for example, by passing assembly <strong>and</strong>type names as input arguments).Code dem<strong>and</strong>s permission for user authorization where assemblies are loaded dynamically.Unmanaged Code AccessCheck DescriptionInput <strong>and</strong> output strings that are passed between managed <strong>and</strong> unmanaged code areconstrained <strong>and</strong> validated.Array bounds are checked.File path lengths are checked <strong>and</strong> do not exceed MAX_PATH.Unmanaged code is compiled with the /GS switch.Use of “dangerous” APIs by unmanaged code is closely inspected. These includeLogonUser, RevertToSelf, CreateThread, Network APIs, <strong>and</strong> Sockets APIs.Naming conventions (safe, native, unsafe) are applied to unmanaged APIs.Assemblies that call unmanaged code specify unmanaged permission requirements usingdeclarative security (<strong>Security</strong>Action.RequestMinimum).Unmanaged API calls are s<strong>and</strong>boxed <strong>and</strong> isolated in a wrapper assembly.Use of SuppressUnmanagedCode<strong>Security</strong>Attribute is thoroughly reviewed <strong>and</strong> additionalsecurity checks are implemented.Types are not annotated with SuppressUnmanagedCode<strong>Security</strong>Attribute. (This attribute isused on specific P/Invoke method declarations instead.)Calling code is appropriately authorized using a full stack walk Dem<strong>and</strong> (using either a.NET Framework permission or custom permission).

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

Saved successfully!

Ooh no, something went wrong!