Vulnerabilities > CVE-2017-6927 - Cross-site Scripting vulnerability in multiple products
Attack vector
NETWORK Attack complexity
LOW Privileges required
NONE Confidentiality impact
LOW Integrity impact
LOW Availability impact
NONE Summary
Drupal 8.4.x versions before 8.4.5 and Drupal 7.x versions before 7.57 has a Drupal.checkPlain() JavaScript function which is used to escape potentially dangerous text before outputting it to HTML (as JavaScript output does not typically go through Twig autoescaping). This function does not correctly handle all methods of injecting malicious HTML, leading to a cross-site scripting vulnerability under certain circumstances. The PHP functions which Drupal provides for HTML escaping are not affected.
Vulnerable Configurations
Common Weakness Enumeration (CWE)
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.
Nessus
NASL family CGI abuses NASL id DRUPAL_8_4_5.NASL description According to its self-reported version, the instance of Drupal running on the remote web server is 8.x prior to 8.4.5. It is, therefore, affected by multiple vulnerabilities : - A flaw exists with the Comment Reply Form. An authenticated remote attacker could add or view comments that they do not have access to. (CVE-2017-6926) - A flaw exists with the Drupal.checkPlain() function due to improper handling of HTML injection. A remote attacker, with a specially crafted request, could potentially execute arbitrary script code within the trust relationship between the browser and server. (CVE-2017-6927) - A flaw exists with node access controls with a multilingual site due to defaulting to the untranslated version as a fallback. A remote attacker could potentially bypass access restrictions. (CVE-2017-6930) - A flaw exists with the Settings Tray module. A remote attacker could update data the do not have permission for. (CVE-2017-6931) Note that Nessus has not tested for these issues but has instead relied only on the application last seen 2020-06-01 modified 2020-06-02 plugin id 107089 published 2018-03-01 reporter This script is Copyright (C) 2018-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/107089 title Drupal 8.x < 8.4.5 Multiple Vulnerabilities (SA-CORE-2018-001) NASL family CGI abuses NASL id DRUPAL_7_57.NASL description According to its self-reported version, the instance of Drupal running on the remote web server is 7.x prior to 7.57. It is, therefore, affected by multiple vulnerabilities : - A flaw exists with the Drupal.checkPlain() function due to improper handling of HTML injection. A remote attacker, with a specially crafted request, could potentially execute arbitrary script code within the trust relationship between the browser and server. (CVE-2017-6927) - A flaw exists with the private file system due to improper checking of permissions when modules provided conflicting access. A remote attacker could potentially access sensitive files. (CVE-2017-6928) - A flaw exists with the bundled jQuery due to improper handling of Ajax requests. A remote attacker, with a specially crafted request, could potentially execute arbitrary script code within the trust relationship between the browser and server. (CVE-2017-6929) - A flaw exists with the language switcher block due to improper validation of user input. A context-dependent attacker, with a specially crafted link, could redirect a user to a malicious site. (CVE-2017-6932) Note that Nessus has not tested for these issues but has instead relied only on the application last seen 2020-06-01 modified 2020-06-02 plugin id 107088 published 2018-03-01 reporter This script is Copyright (C) 2018-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/107088 title Drupal 7.x < 7.57 Multiple Vulnerabilities (SA-CORE-2018-001) NASL family Fedora Local Security Checks NASL id FEDORA_2018-906BA26B4D.NASL description - [8.4.6](https://www.drupal.org/project/drupal/releases/8 .4.6) - [SA-CORE-2018-002 (CVE-2018-7600)](https://www.drupal.org/SA-CORE-2018-002 ) - [8.4.5](https://www.drupal.org/project/drupal/releases/8 .4.5) - [SA-CORE-2018-001 (CVE-2017-6926 / CVE-2017-6927 / CVE-2017-6930 / CVE-2017-6931)](https://www.drupal.org/SA-CORE-2018-001) - [8.4.4](https://www.drupal.org/project/drupal/releases/8 .4.4) - [8.4.3](https://www.drupal.org/project/drupal/releases/8 .4.3) - [8.4.2](https://www.drupal.org/project/drupal/releases/8 .4.2) - [8.4.1](https://www.drupal.org/project/drupal/releases/8 .4.1) - [8.4.0](https://www.drupal.org/project/drupal/releases/8 .4.0) - [8.4.0-rc2](https://www.drupal.org/project/drupal/releas es/8.4.0-rc2) - [8.4.0-rc1](https://www.drupal.org/project/drupal/releas es/8.4.0-rc1) - [8.4.0-beta1](https://www.drupal.org/project/drupal/rele ases/8.4.0-beta1) - [8.4.0-alpha1](https://www.drupal.org/project/drupal/rel eases/8.4.0-alpha1) Note that Tenable Network Security has extracted the preceding description block directly from the Fedora update system website. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues. last seen 2020-06-05 modified 2019-01-03 plugin id 120615 published 2019-01-03 reporter This script is Copyright (C) 2019-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/120615 title Fedora 28 : drupal8 (2018-906ba26b4d) (Drupalgeddon 2) NASL family FreeBSD Local Security Checks NASL id FREEBSD_PKG_57580FCC1A6111E897E000E04C1EA73D.NASL description Drupal Security Team reports : CVE-2017-6926: Comment reply form allows access to restricted content CVE-2017-6927: JavaScript cross-site scripting prevention is incomplete CVE-2017-6928: Private file access bypass - Moderately Critical CVE-2017-6929: jQuery vulnerability with untrusted domains - Moderately Critical CVE-2017-6930: Language fallback can be incorrect on multilingual sites with node access restrictions CVE-2017-6931: Settings Tray access bypass CVE-2017-6932: External link injection on 404 pages when linking to the current page last seen 2020-06-01 modified 2020-06-02 plugin id 106994 published 2018-02-26 reporter This script is Copyright (C) 2018 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/106994 title FreeBSD : drupal -- Drupal Core - Multiple Vulnerabilities (57580fcc-1a61-11e8-97e0-00e04c1ea73d) NASL family Debian Local Security Checks NASL id DEBIAN_DSA-4123.NASL description Multiple vulnerabilities have been found in the Drupal content management framework. For additional information, please refer to the upstream advisory at https://www.drupal.org/sa-core-2018-001 last seen 2020-06-01 modified 2020-06-02 plugin id 106986 published 2018-02-26 reporter This script is Copyright (C) 2018 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/106986 title Debian DSA-4123-1 : drupal7 - security update NASL family Fedora Local Security Checks NASL id FEDORA_2018-922CC2FBAA.NASL description - [8.3.9](https://www.drupal.org/project/drupal/releases/8 .3.9) - [SA-CORE-2018-002 (CVE-2018-7600)](https://www.drupal.org/SA-CORE-2018-002 ) - [8.3.8](https://www.drupal.org/project/drupal/releases/8 .3.8) - [SA-CORE-2018-001 (CVE-2017-6926 / CVE-2017-6927 / CVE-2017-6930 / CVE-2017-6931)](https://www.drupal.org/SA-CORE-2018-001) Note that Tenable Network Security has extracted the preceding description block directly from the Fedora update system website. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues. last seen 2020-06-05 modified 2018-04-24 plugin id 109288 published 2018-04-24 reporter This script is Copyright (C) 2018-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/109288 title Fedora 26 : drupal8 (2018-922cc2fbaa) (Drupalgeddon 2) NASL family Debian Local Security Checks NASL id DEBIAN_DLA-1295.NASL description Multiple vulnerabilities have been found in the Drupal content management framework. For additional information, please refer to the upstream advisory at https://www.drupal.org/sa-core-2018-001. For Debian 7 last seen 2020-03-17 modified 2018-03-01 plugin id 107076 published 2018-03-01 reporter This script is Copyright (C) 2018-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/107076 title Debian DLA-1295-1 : drupal7 security update