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 12: Building Secure <strong>Web</strong> Services 339For more information, see the “Specifying the Parts of a SOAP Message that areSigned or Encrypted” section in the WSE documentation.Parameter ManipulationParameter manipulation in relation to <strong>Web</strong> services refers to the threat of an attackeraltering the message payload in some way while the message request or response isin transit between the consumer <strong>and</strong> service.To address this threat, you can digitally sign a SOAP message to allow the messagerecipient to cryptographically verify that the message has not been altered since itwas signed. For more information, see the “Digitally Signing a SOAP Message”section in the WSE documentation.Exception ManagementException details returned to the consumer should only contain minimal levels ofinformation <strong>and</strong> not expose any internal implementation details. For example,consider the following system exception that has been allowed to propagate to theconsumer.System.Exception: User not in managers roleat EmployeeService.employee.GiveBonus(Int32 empID, Int32 percentage) inc:\inetpub\wwwroot\employeesystem\employee.asmx.cs:line 207The exception details shown above reveal directory structure <strong>and</strong> other details to theservice consumer. This information can be used by a malicious user to footprint thevirtual directory path <strong>and</strong> can assist with further attacks.<strong>Web</strong> Services can throw three types of exceptions:● SoapException objects.These can be generated by the CLR or by your <strong>Web</strong> method implementation code.● SoapHeaderException objectsThese are generated automatically when the consumer sends a SOAP request thatthe service fails to process correctly.● Exception objectsA <strong>Web</strong> service can throw a custom exception type that derives fromSystem.Exception. The precise exception type is specific to the error condition. Forexample, it might be one of the st<strong>and</strong>ard .NET Framework exception types such asDivideByZeroException, or ArgumentOutOfRangeException <strong>and</strong> so on.

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

Saved successfully!

Ooh no, something went wrong!