Vulnerabilities > CVE-2017-17745 - Cross-site Scripting vulnerability in Tp-Link Tl-Sg108E Firmware 1.0.0

047910
CVSS 3.5 - LOW
Attack vector
NETWORK
Attack complexity
MEDIUM
Privileges required
SINGLE
Confidentiality impact
NONE
Integrity impact
PARTIAL
Availability impact
NONE

Summary

Cross-site scripting (XSS) vulnerability in system_name_set.cgi in TP-Link TL-SG108E 1.0.0 allows authenticated remote attackers to submit arbitrary java script via the 'sysName' parameter.

Vulnerable Configurations

Part Description Count
OS
Tp-Link
1
Hardware
Tp-Link
1

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Cross Site Scripting through Log Files
    An attacker may leverage a system weakness where logs are susceptible to log injection to insert scripts into the system's logs. If these logs are later viewed by an administrator through a thin administrative interface and the log data is not properly HTML encoded before being written to the page, the attackers' scripts stored in the log will be executed in the administrative interface with potentially serious consequences. This attack pattern is really a combination of two other attack patterns: log injection and stored cross site scripting.
  • Embedding Scripts in Non-Script Elements
    This attack is a form of Cross-Site Scripting (XSS) where malicious scripts are embedded in elements that are not expected to host scripts such as image tags (<img>), comments in XML documents (< !-CDATA->), etc. These tags may not be subject to the same input validation, output validation, and other content filtering and checking routines, so this can create an opportunity for an attacker to tunnel through the application's elements and launch a XSS attack through other elements. As with all remote attacks, it is important to differentiate the ability to launch an attack (such as probing an internal network for unpatched servers) and the ability of the remote attacker to collect and interpret the output of said attack.
  • Embedding Scripts within Scripts
    An attack of this type exploits a programs' vulnerabilities that are brought on by allowing remote hosts to execute scripts. The attacker leverages this capability to execute scripts to execute his/her own script by embedding it within other scripts that the target software is likely to execute. The attacker must have the ability to inject script into script that is likely to be executed. If this is done, then the attacker can potentially launch a variety of probes and attacks against the web server's local environment, in many cases the so-called DMZ, back end resources the web server can communicate with, and other hosts. With the proliferation of intermediaries, such as Web App Firewalls, network devices, and even printers having JVMs and Web servers, there are many locales where an attacker can inject malicious scripts. Since this attack pattern defines scripts within scripts, there are likely privileges to execute said attack on the host. Of course, these attacks are not solely limited to the server side, client side scripts like Ajax and client side JavaScript can contain malicious scripts as well. In general all that is required is for there to be sufficient privileges to execute a script, but not protected against writing.
  • Cross-Site Scripting in Error Pages
    An attacker distributes a link (or possibly some other query structure) with a request to a third party web server that is malformed and also contains a block of exploit code in order to have the exploit become live code in the resulting error page. When the third party web server receives the crafted request and notes the error it then creates an error message that echoes the malformed message, including the exploit. Doing this converts the exploit portion of the message into to valid language elements that are executed by the viewing browser. When a victim executes the query provided by the attacker the infected error message error message is returned including the exploit code which then runs in the victim's browser. XSS can result in execution of code as well as data leakage (e.g. session cookies can be sent to the attacker). This type of attack is especially dangerous since the exploit appears to come from the third party web server, who the victim may trust and hence be more vulnerable to deception.
  • Cross-Site Scripting Using Alternate Syntax
    The attacker uses alternate forms of keywords or commands that result in the same action as the primary form but which may not be caught by filters. For example, many keywords are processed in a case insensitive manner. If the site's web filtering algorithm does not convert all tags into a consistent case before the comparison with forbidden keywords it is possible to bypass filters (e.g., incomplete black lists) by using an alternate case structure. For example, the "script" tag using the alternate forms of "Script" or "ScRiPt" may bypass filters where "script" is the only form tested. Other variants using different syntax representations are also possible as well as using pollution meta-characters or entities that are eventually ignored by the rendering engine. The attack can result in the execution of otherwise prohibited functionality.

Packetstorm

data sourcehttps://packetstormsecurity.com/files/download/145503/tplinktlsg108e-xssaccess.txt
idPACKETSTORM:145503
last seen2017-12-20
published2017-12-20
reporterJames McLean
sourcehttps://packetstormsecurity.com/files/145503/TP-Link-TL-SG108E-XSS-Weak-Access-Control.html
titleTP-Link TL-SG108E XSS / Weak Access Control

Seebug

bulletinFamilyexploit
description### Overview Three vulnerabilities have been discovered in the TP-Link TL-SG108E, firmware 1.0.0 Build 20160722 Rel.50167: * CVE-2017-17745 - Cross Site Scripting (XSS) in system_name_set.cgi, sysName parameter * CVE-2017-17746 - Weak access control for user authentication * CVE-2017-17747 - Weak access control for user logout This is not an exhaustive list of vulnerabilities that may exist in the device firmware. ### Device Overview From http://www.tp-link.com.au/products/details/cat-41_TL-SG108E.html - "The TL-SG108E 8-Port Gigabit Easy Smart switch is an ideal upgrade from an unmanaged switch, designed for Small and Medium Business networks that require simple network management. Network administrators can effectively monitor traffic via Port Mirroring, Loop Prevention and Cable Diagnostics features." ### Affected Devices * Firmware Version: 1.0.0 Build 20160722 Rel.50167 * Hardware Version: TL-SG108E 3.0 * Older TL-SG108E devices may also be affected. ### Disclosure Timeline * September 08th, 2017 - Vulnerabilities discovered after purchasing the device. * September 10th, 2017 - Contacted TP-Link via tp-link.com.au * September 12th, 2017 - TP-Link responded, requesting further information * September 12th, 2017 - Responded to TP-Link with vulnerability specifics. Advised a 90 day disclosure timeline, with offer to increase deadline if TP-Link wishes. * September 12th -> October 16th - Emails back and forth discussing how to trigger the vulnerabilities. * October 16th, 2017 - TP-Link confirms XSS vulnerability (CVE-2017-17745), advises an updated firmware will be released. TP-Link advises two remaining vulnerabilities (CVE-2017-17746, CVE-2017-17747) will not be fixed. * December 18th, 2017 - Applied to Mitre for CVE numbers. * December 19th, 2017 - Mitre assigned CVE-2017-17745, CVE-2017-17746, CVE-2017-17747 * December 19th, 2017 - Public disclosure. As of this date (December 19th, 2017), no updated firmware has been offered for testing, or released to the public. ### Notes In all examples below, the TL-SG108E was configured with a LAN IP address of 192.168.1.6. Many thanks to Simon @ TP-Link for the prompt email responses. #### CVE-2017-17745 - Stored Cross Site Scripting (XSS) * Device is not validating input to the script system_name_set.cgi on the TL-SG108E or on output to screen. * Only the sysName variable in system_name_set.cgi was tested in this instance. Other fields in the management web-application may have similar problems, these were not tested. ##### Risks: * In some network configurations (such as behind a NAT router, as outlined in CVE-2017-17746) a malicious user could store XSS on the TL-SG108E and cause the administrator of the TL-SG108E to execute arbitrary javascript code in their browser. ##### Proof of Concept: * Authenticate to the device in a browser * Execute the following command from a terminal window: curl -vvvs -X 'GET' 'http://192.168.1.6/system_name_set.cgi?sysName=TL-SG"\]\};alert(1);</script>' * To trigger the XSS: Browse -> System -> System Info. Alert box containing '1' displays, indicating successful javascript execution. ##### Mitigation: * Set the device password to a strong password. * Restrict access to the device from approved administrator workstations until an updated firmware is available. #### CVE-2017-17746 - Weak access control * All information regarding authenticated sessions is stored on the TL-SG108E, no cookies are sent from the device to the client after successful authentication. ##### Risks: * Any other browser on a PC which has authenticated, is then also treated as authenticated (Example: Login in Chrome, then open Firefox and browse to the TL-SG108E, and the session is already authenticated) * If the TL-SG108E is on the other side of a NAT router, ALL clients behind the NAT are treated as authenticated. ##### Steps to reproduce: * Authenticate from any PC. * Any other browser on that system is then able to access the web-interface without entering authentication information. * By extension, guest VMs on that machine are then automatically authenticated. ##### Mitigation: * Restrict access to the device from approved administrator workstations until an updated firmware is available. * Prevent any access to the web interface from devices behind a NAT router. #### CVE-2017-17747 - Weak access control on Logout.htm * Logout.htm can be called from any IP address, ending any authenticated sessions on the device. ##### Risks: * A denial of service condition can be triggered by calling the logout script in a loop from any machine on the network regardless of their authentication status, effectively making it impossible to access the TL-SG108E management web-application. ##### Steps to reproduce: * Authenticate from any PC. * From another PC with a different IP address, access the logout page (http://192.168.1.6/Logout.htm) * The session on the first PC has been terminated. ##### Mitigation: * Restrict access to the device from approved administrator workstations until an updated firmware is available.
idSSV:97256
last seen2018-06-08
modified2018-04-28
published2018-04-28
reporterKnownsec
titleMultiple Vulnerabilities in TP-Link TL-SG108E(CVE-2017-17745, CVE-2017-17746, CVE-2017-17747)