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.

54 Part I: Introduction to <strong>Threats</strong> <strong>and</strong> CountermeasuresIdentify Entry PointsThe entry points of your application also serve as entry points for attacks. Entrypoints might include the front-end <strong>Web</strong> application listening for HTTP requests. Thisentry point is intended to be exposed to clients. Other entry points, such as internalentry points exposed by subcomponents across the tiers of your application, mayonly exist to support internal communication with other components. However, youshould know where these are, <strong>and</strong> what types of input they receive in case anattacker manages to bypass the front door of the application <strong>and</strong> directly attack aninternal entry point.For each entry point, you should be able to determine the types of gatekeepers thatprovide authorization <strong>and</strong> the degree of validation.Logical application entry points include user interfaces provide by <strong>Web</strong> pages,service interfaces provided by <strong>Web</strong> services, serviced components, <strong>and</strong> .NETRemoting components <strong>and</strong> message queues that provide asynchronous entry points.Physical or platform entry points include ports <strong>and</strong> sockets.Identify Privileged CodePrivileged code accesses specific types of secure resources <strong>and</strong> performs otherprivileged operations. Secure resource types include DNS servers, directory services,environment variables, event logs, file systems, message queues, performancecounters, printers, the registry, sockets, <strong>and</strong> <strong>Web</strong> services. Secure operations includeunmanaged code calls, reflection, serialization, code access security permissions, <strong>and</strong>manipulation of code access security policy, including evidence.Privileged code must be granted the appropriate code access security permissions bycode access security policy. Privileged code must ensure that the resources <strong>and</strong>operations that it encapsulates are not exposed to untrusted <strong>and</strong> potentially maliciouscode. .NET Framework code access security verifies the permissions granted tocalling code by performing stack walks. However, it is sometimes necessary tooverride this behavior <strong>and</strong> short-circuit the full stack walk, for example, when youwant to restrict privileged code with a s<strong>and</strong>box or otherwise isolate privileged code.Doing so opens your code up to luring attacks, where malicious code calls your codethrough trusted intermediary code.Whenever you override the default security behavior provided by code accesssecurity, do it diligently <strong>and</strong> with the appropriate safeguards. For more informationabout reviewing code for security flaws, see Chapter 21, “Code Review.” For moreinformation about code access security, see Chapter 8, “Code Access <strong>Security</strong> inPractice” <strong>and</strong> Chapter 9, “Using Code Access <strong>Security</strong> with ASP.NET.”

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

Saved successfully!

Ooh no, something went wrong!