owasp forum web services security

15
Copyright 2009 © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP Foundation OWASP http://www.owasp.org OWASP Top Ten Web Services Vulnerabilities Marco Morana OWASP Chapter Lead [email protected] Based upon Gunnar Peterson Presentation OWASP T10 Web Services Proposal OWASP USA 08 NYC Appsec Conference Cincinnati Chapter August 2009 Meeting

Upload: marco-morana

Post on 23-Jan-2015

6.075 views

Category:

Education


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Owasp Forum Web Services Security

Copyright 2009 © The OWASP FoundationPermission is granted to copy, distribute and/or modify this document under the terms of the OWASP License.

The OWASP Foundation

OWASP

http://www.owasp.org

OWASP Top Ten Web Services Vulnerabilities

Marco MoranaOWASP Chapter [email protected]

Based upon Gunnar Peterson PresentationOWASP T10 Web Services ProposalOWASP USA 08 NYC Appsec Conference

Cincinnati ChapterAugust 2009 Meeting

Page 2: Owasp Forum Web Services Security

OWASP

Meeting Agenda

Video Presentation: Web Services OWASP Top Ten Proposal by from Gunnar Petersonhttp://video.google.com/videoplay?

docid=5680040858618100893

Discussion ForumSummary Of OWASP Top Ten For Web Services

Web Services Security Highlights OWASP T10 Vulnerabilities

– Issues– Countermeasures

Discussion Points: Q&AOWASP References

2

Page 3: Owasp Forum Web Services Security

OWASP

Web Services Security Highlights The security of web services and distributed architecture

represents several challenges:Security of the perimeter is not enoughData segregation does not separate good from evilSecurity goal cannot be limited to CIA attributes Location independence: authenticate in one place and authorize in

another place Interoperability across systems and technologiesConsistent policy enforcementSecure email vs. tiered architectureSecurity of the delivery channel and the intermediaries

Design-time activity aimed at pointing out common security pitfalls and proper ways to implement security within design patterns

Originally a white paper – donated to OWASP by Security Compass

3

Page 4: Owasp Forum Web Services Security

OWASP

Web Services OWASP T1 Vulnerability

Injection Attacks Issue highlights:

Larger attack surface and new targets for injection flaws: SQL injection, LDAP and XPATH/XQUERY, XSLT, HTML, XML, OS command injection

WS as gateway to inject data in backend services: mainframes, MQs, ESB, SAP

More attack vector opportunities: decoupling between web service requester and provider

Countermeasures: Determine the application attack surface and the entry points Validate at each trust boundary (front end, middleware,

backend) Input validation strategy: encoding, sanitization ,

canonicalization

4

Page 5: Owasp Forum Web Services Security

OWASP

Web Services OWASP T2 Vulnerability

Malicious file execution Issue highlights:

Web service processing can take un-trusted input to inject system and backend commands and exploit it for remote command execution, upload malware or cause a denial/degradation of service

DOS via file upload and SOAP interface can be abused to cause denial or degradation of services (overload the XML parser)

Countermeasures: Do not trust client supplied parameters for remote

command execution, when uploading files, validate server side the file upload size, name, file path and the file extension/parameters

Validate XML size and XSD schema before processing

5

Page 6: Owasp Forum Web Services Security

OWASP

Web Services OWASP T3 Vulnerability

Insecure Object Reference Issue highlights:

Abuse of object references lead to remote code execution

Failure to check data reference and URL parameters lead to remote root kit installation and compromise: Some cases banking applications use ACC# as PK that can be misused for SQL injection if is not validated

Countermeasures: Use encryption and signatures to prevent tampering of

SOAP messages, validate references on the server side Beware of REST: some IDE add a REST call in form of a

GET that can be called without authorization: this need to be turned off.

6

Page 7: Owasp Forum Web Services Security

OWASP

Web Services OWASP T4 Vulnerability

Information Leakage Issue highlight:

Too much WS configuration information such as application type and methods used via WSDL readable to public, access to XSD and XML let the attacker know the data and the values to attack, the UDDI (the registry) can leak information such as addressing routing structure or behavior

Countermeasures: Remove WSDL files from web server Disable the documentation protocols to prevent

dynamic generation of WSDL Capture exceptions that return minimal information to

the users

7

Page 8: Owasp Forum Web Services Security

OWASP

Web Services OWASP T5 Vulnerability

Broken Authentication And Weak Tokens Issue highlights:

Tokens non protected as well as assertions, flaws allow to hijack user admin accounts, bypass authorizations and allow for reply attacks.

Claim based (SAML) access control vs. RBAC exposes the application to new vulnerabilities

Countermeasures: Authentication via password digest, SAML and Kerberos

tickets ,X509 certificates, Username and password in plaintext SSL and message payload encryption for transit protection Unique message ID, data stamp and nonce with each request

to prevent message replay Digital signature to prevent tampering

8

Page 9: Owasp Forum Web Services Security

OWASP

Web Services OWASP T6 Vulnerability

Insecure Crypto Usage Issue highlights:

Not encrypting secrets and protecting keys Use of weak crypto and non standard algorithms such

as MD5 and RC3 and RC4 Hard-coding keys Misuse of XML encryption: signature tag with no signature

value, homegrown encryption algorithms

Countermeasures: Protect secrets with encryption use secure key storage Use standard secure cryptographic algorithms Do not hardcode secrets Do not use homegrown encryption implementations/schemes Test your crypto implementation

9

Page 10: Owasp Forum Web Services Security

OWASP

Web Services OWASP T7 Vulnerability

Insecure communications Issues highlights:

Not using SSL exposes authentication, sensitive and session data and sensitive info.

Sniffing attacks: WS and SAML tokens can be sniffed in transit with no SSL that protects them

Timing and replay attacks are possible for unprotected session data

Countermeasures: Protect data in transit: SSL/IPsec Protect XML documents/sections with XML encryption\

Validate signatures properly (presence and who trusted it)

10

Page 11: Owasp Forum Web Services Security

OWASP

Web Services OWASP T8 Vulnerability

Failure to restrict access Issue highlights:

Failure to enforce WS method authentication Some web service methods use MQ listeners

with no authentication to call them, attackers can exploit the gateway to mainframes and messaging systems (e.g. ESB)

Countermeasures: Server to server and trusted authentication (SAML)

across systems Message level authentication (usr/pwd, kerberos,

X509, SAML) Application level auth (role-based authorization for

methods)

11

Page 12: Owasp Forum Web Services Security

OWASP

Web Services OWASP T9 Vulnerability(New proposal)

Broken XML Issue highlights:

WS rely on XML document binding based upon data parameters encoded and parsed that can be injected

Failure to validate parameters and well formed XML and XSD can lead to DOS

Recursive XMLs (DTD based) can lead to DOS Injected CDATA elements (not interpreted) can fail the

parser

Countermeasures: Specify the XML size and schema via DTD for old SOAP (do

not use DTD not allowed in current spec!) and XSD Do not use old Xerces parser (prone to DOS) Validate all input and encode output

12

Page 13: Owasp Forum Web Services Security

OWASP

Web Services OWASP T10 Vulnerability (New proposal)

Identity Misuse Issue highlights:

The WS identity is the basis for WS claims and assertions for routing decisions ( to pass to different back end services), business logic and access control (authentication)

A mis-configured identity claim can be misused: A malicious service provider can have access to different services used by Google (token sent back was valid for any Google service) and other identity providers.

Countermeasures: Protect the identity for misuse Map identity to resources used for access control decisions Enforce SAML SCOPE assertions

13

Page 14: Owasp Forum Web Services Security

OWASP

Discussion Forum: Q & A

Are web services based architectures (SOA, SaaS) used in your organization? Which assessment processes, guidelines, testing

tools are being deployed for securing web services?

Which challenges you faced in deploying web services for your organization? Integration with backend services: MQ/ESB ? Trusted authentication: Kerberos-SSO, SAML ?

Can cloud computing and web services be made secure? Do WS-Security, SAML buy security?

14

Page 15: Owasp Forum Web Services Security

OWASP

Further OWASP Web Services References

Guide to Building Secure Web Applications and Web Services (Development Guide)http://www.owasp.org/index.php/

Category:OWASP_Guide_Project Web Services Portal

http://www.owasp.org/index.php/Web_Services Web Services Security Project

http://www.owasp.org/index.php/Category:OWASP_Web_Services_Security_Project

Testing Guide Web Service Security Test Caseshttp://www.owasp.org/index.php/

Testing_for_Web_Services

15