Vulnerabilities > CVE-2017-15656 - Insufficiently Protected Credentials vulnerability in Asus Asuswrt 3.0.0.4.378/3.0.0.4.380.7743
Attack vector
NETWORK Attack complexity
LOW Privileges required
LOW Confidentiality impact
HIGH Integrity impact
HIGH Availability impact
HIGH Summary
Password are stored in plaintext in nvram in the HTTPd server in all current versions (<= 3.0.0.4.380.7743) of Asus asuswrt.
Vulnerable Configurations
Part | Description | Count |
---|---|---|
OS | 3 |
Common Weakness Enumeration (CWE)
Common Attack Pattern Enumeration and Classification (CAPEC)
- Session Sidejacking Session sidejacking takes advantage of an unencrypted communication channel between a victim and target system. The attacker sniffs traffic on a network looking for session tokens in unencrypted traffic. Once a session token is captured, the attacker performs malicious actions by using the stolen token with the targeted application to impersonate the victim. This attack is a specific method of session hijacking, which is exploiting a valid session token to gain unauthorized access to a target system or information. Other methods to perform a session hijacking are session fixation, cross-site scripting, or compromising a user or server machine and stealing the session token.
- Lifting credential(s)/key material embedded in client distributions (thick or thin) An attacker examines a target application's code or configuration files to find credential or key material that has been embedded within the application or its files. Many services require authentication with their users for the various purposes including billing, access control or attribution. Some client applications store the user's authentication credentials or keys to accelerate the login process. Some clients may have built-in keys or credentials (in which case the server is authenticating with the client, rather than the user). If the attacker is able to locate where this information is stored, they may be able to retrieve these credentials. The attacker could then use these stolen credentials to impersonate the user or client, respectively, in interactions with the service or use stolen keys to eavesdrop on nominally secure communications between the client and server.
- Password Recovery Exploitation An attacker may take advantage of the application feature to help users recover their forgotten passwords in order to gain access into the system with the same privileges as the original user. Generally password recovery schemes tend to be weak and insecure. Most of them use only one security question . For instance, mother's maiden name tends to be a fairly popular one. Unfortunately in many cases this information is not very hard to find, especially if the attacker knows the legitimate user. These generic security questions are also re-used across many applications, thus making them even more insecure. An attacker could for instance overhear a coworker talking to a bank representative at the work place and supplying their mother's maiden name for verification purposes. An attacker can then try to log in into one of the victim's accounts, click on "forgot password" and there is a good chance that the security question there will be to provide mother's maiden name. A weak password recovery scheme totally undermines the effectiveness of a strong password scheme.
Seebug
bulletinFamily | exploit |
description | ### 1 ASUSWRT <= 3.0.0.4.382.18495 >3.0.0.4.376 - multiple vulnerabilities in httpd server (all versions of AsusWRT at the time of report to vendor, for previous 376 version see next section) #### 1. Highly predictable session tokens The session token is generated for an authenticated user using stdlib rand function. The token generation code looks as follows: ``` ┌──── │ char *generate_token(void){ │ int a=0, b=0, c=0, d=0; │ //char create_token[32]={0}; │ memset(gen_token,0,sizeof(gen_token)); │ srand (time(NULL)); //VULNERABLE │ a=rand(); │ b=rand(); │ c=rand(); │ d=rand(); │ snprintf(gen_token, sizeof(gen_token),"%d%d%d%d", a, b, c, d); │ return gen_token; │ } └──── ``` The code initializes the random number generator each time a token is generated with router epoch time. An attacker can guess a token knowing more or less the time the administrator has logged in. CVE: CVE-2017-15654 Suggested CVSS v3: 8.3 AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H (Attacker needs administrator interaction and a way to overcome administrator IP check - see next point) Timeline: • 17.09.2017 - vendor notified • 07.11.2017 - vendor releases a fixed version 3.0.0.4.382.18495 #### 2. Not sufficient logged user IP validation An attacker who knows the session token can walkaround the IP verification mechanism by sending requests with a special useragent. The following PoC will download current router configuration even if issued from a different than the logged user IP address: ``` curl "http://ROUTERADDRESS/s.CFG"; -H "Cookie: asus_token=TOKEN" -H 'User-Agent: asusrouter-asusrouter-asusrouter-asusrouter' ``` CVE: CVE-2017-15653 Suggested CVSS v3: 8.3 AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H (Attacker needs the session token to execute any action without IP check - see point above) Timeline: • 17.09.2017 - vendor notified • 07.11.2017 - vendor releases a fixed version 3.0.0.4.382.18495 Note to vendor/mitre: for clarity please assign separate CVE to this vulnerability #### 3. Password stored in plain text Asus routers store password in plain text in NVRAM memory. Executing nvram show, or downloading the backup file and decoding it allows anyone to read the administrator password. Having access to telnet (shell) one can execute: ``` nvram show ``` For reading password from backup file see the exploit below. CVE: CVE-2017-15656 Timeline: • 17.09.2017 - vendor notified • 03.01.2018 - vendor stated that the NVRAM will be crypted in February this year #### 4. Logged-in information disclousure An unauthenticated attacker can retrieve information about a logged-in session (if and who [IP address] is currently logged in). This itself is not a vulnerability but together with the two previous it allows for a easy exploit. ``` curl "http://ROUTERADDRESS/Nologin.asp"; ``` Taking all the four together it is easy to gain router access by waiting for an administrator login and retrieving the login/password using his token. Finally it is possible to download the backup file and read the administrator login and password. A ready script is attached to this message. Suggested CVSS v3 for all three (1-3): 9.6 AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H ### 2 ASUSWRT <=3.0.0.4.376.* This vulnerability affects new Asus routers with not up-to-date firmware, as well as some older end-of-life routers (e.g. RT-N65R, RT-N65U) #### 1. Heap buffer overflow in multiple HTTP headers allows for an unauthenticated remote code execution. Multiple buffer overflow vulnerabilities in HTTPd server in Asus asuswrt version <=3.0.0.4.376.X. All have been fixed in version 3.0.0.4.378, but this vulnerability was not previously disclosed. Some end-of-life routers have this version as the newest so are vulnerable at this time. This vulnerability allows for RCE with administrator rights when the administrator visits serveral pages. For example the "Host:" header is vulnerable and allows to override the SystemCmd variable which then allows for RCE when the administrator visits serveral pages (for example the network tools router tab). PoC (after running this script, when the administrator visists one of several pages which trigger commands e.g. the network tools tab, the script is being run and outputs the contents of nvram to a css file which can be retrived without authentication) ``` curl 'http://routerIP:8080' -H "Host: xxxxxxxxxxxxxx $(for i in $(seq 1 9700); do echo -n " "; done) \$(nvram show > /www/user/nvram.css )" ``` CVE: CVE-2017-15655 Suggested CVSS v3: 9.6 AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H (Administrator needs to login and visit certain page at the router website) Timeline: • 17.09.2017 - vendor notified • 18.09.2017 - vendor REFUSED to fix the vulnerability as the routers using the vulnerable firmware are already EOL ALERT: Users having routers not upgradable from 3.0.0.4.376.* or less should CLOSE the http from WAN and should restrict the access to management port from LAN as well! |
id | SSV:97086 |
last seen | 2018-01-18 |
modified | 2018-01-17 |
published | 2018-01-17 |
reporter | Root |
title | Multiple vulnerabilities in all versions of ASUS routers |
References
- http://packetstormsecurity.com/files/145921/ASUSWRT-3.0.0.4.382.18495-Session-Hijacking-Information-Disclosure.html
- http://packetstormsecurity.com/files/145921/ASUSWRT-3.0.0.4.382.18495-Session-Hijacking-Information-Disclosure.html
- http://seclists.org/fulldisclosure/2018/Jan/63
- http://seclists.org/fulldisclosure/2018/Jan/63