CVE-2017-14920 (published 2017-09-30T01:29Z)

Stored XSS vulnerability in eGroupware Community Edition before 16.1.20170922 allows an unauthenticated remote attacker to inject JavaScript via the User-Agent HTTP header, which is mishandled during rendering by the application administrator.

Severity: MEDIUM
CVSS v2 base score: 4.3 (AV:N/AC:M/Au:N/C:N/I:P/A:N)
CVSS v3 base score: 6.1, MEDIUM (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N)

Weakness information:
cwe_id: CWE-79
cwe_name: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
description: The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
extended_description: 
            Cross-site scripting (XSS) vulnerabilities occur when:
            
               Untrusted data enters a web application, typically from a web request.
               The web application dynamically generates a web page that contains this untrusted data.
               During page generation, the application does not prevent the data from containing content that is executable by a web browser, such as JavaScript, HTML tags, HTML attributes, mouse events, Flash, ActiveX, etc.
               A victim visits the generated web page through a web browser, which contains malicious script that was injected using the untrusted data.
               Since the script comes from a web page that was sent by the web server, the victim's web browser executes the malicious script in the context of the web server's domain.
               This effectively violates the intention of the web browser's same-origin policy, which states that scripts in one domain should not be able to access resources or run code in a different domain.
            
            There are three main kinds of XSS:
            
               
                  Type 1: Reflected XSS (or Non-Persistent) - 
         			The server reads data directly from the HTTP request and reflects it back in the HTTP response. Reflected XSS exploits occur when an attacker causes a victim to supply dangerous content to a vulnerable web application, which is then reflected back to the victim and executed by the web browser. The most common mechanism for delivering malicious content is to include it as a parameter in a URL that is posted publicly or e-mailed directly to the victim. URLs constructed in this manner constitute the core of many phishing schemes, whereby an attacker convinces a victim to visit a URL that refers to a vulnerable site. After the site reflects the attacker's content back to the victim, the content is executed by the victim's browser.
               
                  Type 2: Stored XSS (or Persistent) - 
               The application stores dangerous data in a database, message forum, visitor log, or other trusted data store. At a later time, the dangerous data is subsequently read back into the application and included in dynamic content. From an attacker's perspective, the optimal place to inject malicious content is in an area that is displayed to either many users or particularly interesting users. Interesting users typically have elevated privileges in the application or interact with sensitive data that is valuable to the attacker. If one of these users executes malicious content, the attacker may be able to perform privileged operations on behalf of the user or gain access to sensitive data belonging to the user. For example, the attacker might inject XSS into a log message, which might not be handled properly when an administrator views the logs.
            
               
                  Type 0: DOM-Based XSS - 
               In DOM-based XSS, the client performs the injection of XSS into the page; in the other types, the server performs the injection. DOM-based XSS generally involves server-controlled, trusted script that is sent to the client, such as Javascript that performs sanity checks on a form before the user submits it. If the server-supplied script processes user-supplied data and then injects it back into the web page (such as with dynamic HTML), then DOM-based XSS is possible.
            
            
            Once the malicious script is injected, the attacker can perform a variety of malicious activities. The attacker could transfer private information, such as cookies that may include session information, from the victim's machine to the attacker. The attacker could send malicious requests to a web site on behalf of the victim, which could be especially dangerous to the site if the victim has administrator privileges to manage that site. Phishing attacks could be used to emulate trusted web sites and trick the victim into entering a password, allowing the attacker to compromise the victim's account on that web site. Finally, the script could exploit a vulnerability in the web browser itself possibly taking over the victim's machine, sometimes referred to as "drive-by hacking."
            In many cases, the attack can be launched without the victim even being aware of it. Even with careful users, attackers frequently use a variety of methods to encode the malicious portion of the attack, such as URL encoding or Unicode, so the request looks less suspicious.
         
         

Fix information:
repo_url: https://github.com/EGroupware/egroupware
commit_details: repo_url: https://github.com/EGroupware/egroupware
author: Hadi Nategh
author_date: 2017-09-05 19:04:45+02:00
msg: Set statustext value as text by default
- Introduce new boolean attribute called statustext_html in case we want
explicitly statustext gets rendered as html
- Fix Calendar tooltip with new statustext_html attribute
repository: repo_url: https://github.com/EGroupware/egroupware
repo_name: EGroupware/egroupware
description: Web based groupware server written in PHP, forum at https://help.egroupware.org/
repo_language: PHP
owner: EGroupware
file_changes: filename: et2_core_baseWidget.js
change_type: ModificationType.MODIFY
diff: @@ -32,6 +32,12 @@ var et2_baseWidget = (function(){ "use strict"; return et2_DOMWidget.extend(et2_
 			"description": "Tooltip which is shown for this element",
 			"translate": true
 		},
+		"statustext_html": {
+			"name": "Tooltip is html",
+			"type": "boolean",
+			"description": "Flag to allow html content in tooltip",
+			"default": false
+		},
 		"align": {
 			"name": "Align",
 			"type": "string",
@@ -277,7 +283,7 @@ var et2_baseWidget = (function(){ "use strict"; return et2_DOMWidget.extend(et2_
 
 			if (_value && _value != '')
 			{
-				this.egw().tooltipBind(elem, _value);
+				this.egw().tooltipBind(elem, _value, this.options.statustext_html);
 				this._tooltipElem = elem;
 			}
 		}

programming_language: JavaScript
filename: egw_tooltip.js
change_type: ModificationType.MODIFY
diff: @@ -106,8 +106,9 @@ egw.extend('tooltip', egw.MODULE_WND_LOCAL, function(_app, _wnd)
 	 * Creates the tooltip_div with the given text.
 	 *
 	 * @param {string} _html
+	 * @param {boolean} _isHtml if set to true content gets appended as html
 	 */
-	function prepare(_html)
+	function prepare(_html, _isHtml)
 	{
 		// Free and null the old tooltip_div
 		hide();
@@ -115,7 +116,14 @@ egw.extend('tooltip', egw.MODULE_WND_LOCAL, function(_app, _wnd)
 		//Generate the tooltip div, set it's text and append it to the body tag
 		tooltip_div = jQuery(_wnd.document.createElement('div'));
 		tooltip_div.hide();
-		tooltip_div.append(_html);
+		if (_isHtml)
+		{
+			tooltip_div.append(_html);
+		}
+		else
+		{
+			tooltip_div.text(_html)
+		}
 		tooltip_div.addClass("egw_tooltip");
 		jQuery(_wnd.document.body).append(tooltip_div);
 
@@ -156,14 +164,14 @@ egw.extend('tooltip', egw.MODULE_WND_LOCAL, function(_app, _wnd)
 		 * 	has to be a jQuery node.
 		 * @param _html is the html code which should be shown as tooltip.
 		 */
-		tooltipBind: function(_elem, _html) {
+		tooltipBind: function(_elem, _html, _isHtml) {
 			if (_html != '')
 			{
 				_elem.bind('mouseenter.tooltip', function(e) {
 					if (_elem != current_elem)
 					{
 						//Prepare the tooltip
-						prepare(_html);
+						prepare(_html, _isHtml);
 
 						// Set the current element the mouse is over and
 						// initialize the position variables

programming_language: JavaScript
filename: et2_widget_event.js
change_type: ModificationType.MODIFY
diff: @@ -79,6 +79,7 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
 				// Tooltip
 				if(!event._tooltipElem)
 				{
+					event.options.statustext_html = true;
 					event.set_statustext(event._tooltip());
 					return event.div.trigger('mouseenter');
 				}
@@ -209,7 +210,7 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
 			{
 				parent._out_of_view();
 			}
-			
+
 			// This should now cease to exist, as new events have been created
 			this.free();
 			return;
@@ -521,7 +522,7 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
 				'<span class="calendar_calEventTitle">'+egw.htmlspecialchars(this.options.value.title)+'</span><br>'+
 				egw.htmlspecialchars(this.options.value.description)+'</p>'+
 				'<p style="margin: 2px 0px;">'+times+'</p>'+
-				(this.options.value.location ? '<p><span class="calendar_calEventLabel">'+this.egw().lang('Location') + '</span>:' + 
+				(this.options.value.location ? '<p><span class="calendar_calEventLabel">'+this.egw().lang('Location') + '</span>:' +
 				egw.htmlspecialchars(this.options.value.location)+'</p>' : '')+
 				(cat_label ? '<p><span class="calendar_calEventLabel">'+this.egw().lang('Category') + '</span>:' + cat_label +'</p>' : '')+
 				'<p><span class="calendar_calEventLabel">'+this.egw().lang('Participants')+'</span>:<br />'+
@@ -541,7 +542,7 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
 		{
 			return '';
 		}
-		
+
 		var participant_status = {A: 0, R: 0, T: 0, U: 0, D: 0};
 		var status_label = {A: 'accepted', R: 'rejected', T: 'tentative', U: 'unknown', D: 'delegated'};
 		var participant_summary = Object.keys(this.options.value.participants).length + ' ' + this.egw().lang('Participants')+': ';
@@ -914,7 +915,7 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
 			}
 		}
 	},
-	
+
 	/**
 	 * Link the actions to the DOM nodes / widget bits.
 	 *

programming_language: JavaScript
filename: conflicts.xet
change_type: ModificationType.MODIFY
diff: @@ -14,10 +14,10 @@
 				</columns>
 				<rows>
 					<row valign="top">
-						<image src="conflicts[$row][icon_participants]" statustext="@conflicts[$row][tooltip_participants]" no_lang="1"/>
+						<image src="conflicts[$row][icon_participants]" statustext_html="true" statustext="@conflicts[$row][tooltip_participants]" no_lang="1"/>
 						<image src="conflicts[$row][icon_recur]" label="@conflicts[$row][text_recur]" no_lang="1"/>
 						<description id="conflicts[$row][time]" no_lang="1"/>
-						<vbox statustext="conflict[$row][tooltip]" orient=",0,0">
+						<vbox statustext="conflict[$row][tooltip]" statustext_html="true" orient=",0,0">
 							<description id="conflicts[$row][title]" no_lang="1" options="b"/>
 							<description id="conflicts[$row][conflicting_participants]" no_lang="1"/>
 						</vbox>

programming_language: HTML