Polycom Web Management Interface O.S. Command Injection

Neste post reproduzimos um advisory (nota técnica) detalhando uma vulnerabilidade que descobrimos na interface web de gerenciamento em um dos produtos de teleconferência da Polycom. A vulnerabilidade viabiliza a execução remota de comandos privilegiados no ativo afetado.

O advisory (em inglês) contendo os detalhes completos dessa vulnerabilidade está listado a seguir:

=====[ Tempest Security Intelligence - Advisory #02 / 2012 ]==================
     Polycom Web Management Interface O.S. Command Injection

    - Joao Paulo Caldas Campello:
        - @jpcampello
	- http://linkedin.com/in/jpcampello
        - < joao.paulo[at]tempest[dot]com[dot]br >
    - Heyder Andrade:
        - @heyderandrade
	- http://linkedin.com/in/heyderandrade
        - < heyder.andrade[at]tempest[dot]com[dot]br >

    Tempest Security Intelligence - Recife, Pernambuco - Brazil

=====[ Table of Contents ]====================================================
 1. Overview
 2. Detailed description
 3. Aggravating factors
 4. Further attack scenarios
 5. Affected versions & Solutions
 6. Timeline of disclosure
 7. Thanks & Acknowledgements
 8. References

=====[ Overview ]=============================================================
 * System affected  : Polycom Web Management Interface
 * Model            : G3/HDX 8000 HD
 * Software Version : Durango 2.6.0 Release - build #4740
 * Embedded Linux   : Polycom Linux Development Platform v2.14.g3

                      Other versions or models may also be affected.
 * Impact           : Successful exploitation of this vulnerability may
                      allow an attacker to execute arbitrary commands on
                      Polycom operating system.

The Polycom HDX 8000 series [1] is a well-known video and audio 
conference device running an embedded Linux PPC system.

This advisory is also available at:

 - http://www.tempest.com.br/advisories/tsi-adv-1202/
=====[ Detailed description ]=================================================

The web management interface on the Polycom device allows users to execute
troubleshooting network tests by sending an ICMP echo request to user
supplied hosts. This feature is available through the following menus:

    Diagnostics --> Network --> PING

This feature receives user supplied input and uses it as a parameter to the
'ping' command, returning the average round-trip time. For example: if the
user inserts the value '' in the form, the system will execute
the command "ping -c 1" followed by an stdout redirection to
a random generated filename on /tmp directory.

The Command Injection vulnerability occurs due to lack of proper input
validation on user supplied data.

UNIX based systems provide the possibility to execute multiple commands by
using the semi-colon (;) character (causing the system to run all commands
consecutively), thus allowing the attacker to submit a specially crafted
parameter to run arbitrary commands on the underlying operating system.

The stdout redirection can be easily bypassed by adding a comment (#) symbol
after the trailling command submitted by the attacker, as shown in the
following example: ; ps -ef > /tmp/command_injection.txt #

The above parameter will result in the execution of two commands:

    (#1) ping -c 1
    (#2) ps -ef > /tmp/command_injection.txt # <...>

Any command inserted by Polycom's web management interface after user supplied
input will be disabled by the comment symbol, thus allowing the attacker to
precisely control what she wants to execute and where its output will be

To fix this vulnerability, Polycom Web Management Interface should perform
proper input validation, sanitizing all user supplied data before it's used
elsewhere on the web application or in the underlying operating system.

Also, Polycom Web Management Interface should not allow itself to be accessed
without proper configuration of a strong administrative password.

=====[ Aggravating factors ]==================================================

During system lab testing the following aggravating factors were observed:

    01. The default administrative password of Polycom Web Management
        Interface was empty.

    02. The embedded web server (lighttpd) was running with superuser
        privileges, leading to the execution of all injected commands as root.

    03. The vulnerability "Path Traversal on Polycom Web Management Interface"
        can be used to avoid doing blind command injection.

        Its explotation enables the attacker to view the result of all injected
        commands inside the files to where stdout/stderr were redirected.

=====[ Further attack scenarios ]=============================================

As depicted by the abovementioned factors, an attacker could easily run
arbitrary commands, even to overwrite system configuration files.

For instance, the Internet Super-Server (inetd) configuration file
"/etc/inetd.conf" could be modified, aiming to execute the telnet daemon bound
to an arbitrary tcp port that would be reachable through corporate firewalls.

To achieve this scenario an attacker would only need to submit three

    (#1) ; echo "isdnlog stream tcp6 nowait root /usr/sbin/telnetd \
                           telnetd" >> /etc/inetd.conf #

    (#2) ; ps -ef > /tmp/command_injection.txt #

    (#3) ; kill -HUP <inetd_PID> #

The former parameter would add a line to "/etc/inetd.conf", enabling telnet
daemon to listen on 'isdnlog' port (20011/tcp). The latter would instruct the 
inetd daemon to reload its configuration file.

The process number of inetd could be identified by reading the file
"/tmp/command_injection.txt" through exploitation of vulnerability
"Path Traversal on Polycom Web Management Interface".

=====[ Affected versions & Solutions ]========================================

According to vendor's response, Polycom will publish Technical Bulletin 94332
to its costumers, reporting their official solution and mitigation information.

They have also informed that this vulnerability affects the following

- Polycom HDX Video End Points running commercial software versions earlier
  than 3.0.4;
- UC APL customers running software versions earlier than 2.7.1.J.

Still according to Polycom, customers will be able to download version 3.0.4 by
the end of March, 2012, at the link provided below:

- http://support.polycom.com/PolycomService/support/us/support/video/hdx_series/

UC APL customers can upgrade to version 2.7.1.J to avoid this vulnerability.

Until version 3.0.4 is released -- and for customers who cannot update to
version 3.0.4 -- Polycom recommends sysadmins to disable the option for web
management on HDX units running older versions.

=====[ Timeline of disclosure  ]==============================================

 - Dec/02/2011: Vendor contacted by e-mail on < security[at]polycom[dot]com >.

 - Dec/02/2011: Vendor first response.

 - Dec/28/2011: We have sent another e-mail asking for information.

 - Feb/15/2012: As vendor did not reply to our previous message, we
                have sent another e-mail telling we were going to
                disclose the advisories.

 - Feb/15/2012: Vendor responded asking for some more time to verify
                appropriate fixes and mitigations to vulnerabilities.

                We have agreed on releasing the advisories on two weeks.

 - Feb/29/2012: Vendor sent an email reporting the technical bulletins
		which describe their official solution and mitigation
                information they were going to provide to their costumers.

 - Mar/01/2012: Tempest and Polycom have coordinated publication date on
                March 05.

 - Mar/05/2012: Public disclosure of advisories.

=====[ Thanks & Acknowledgements ]============================================
 - Tempest Security Intelligence / Tempest's Pentest Team [2]
 - Evandro Hora < evandro[at]tempest[dot]com[dot].br >
 - Joaquim Brasil < joaquim.brasil[at]tempest[dot]com[dot].br >
 - Ricardo Ulisses < ricardo[at]tempest[dot]com[dot].br >
=====[ References ]===========================================================
 [1] http://www.polycom.com/
 [2] http://www.tempest.com.br/

Aceita-se formatação à la TWiki. HTML e scripts são filtrados. Máximo 15KiB.

Enviando... por favor aguarde...
Comentário enviado com suceso -- obrigado.
Ele aparecerá quando os moderadores o aprovarem.
Houve uma falha no envio do formulário!
Deixei uma nota para os admins verificarem o problema.
Perdoe-nos o transtorno. Por favor tente novamente mais tarde.