CVE-2021-27885 (published 2021-03-02T19:15Z)

usersettings.php in e107 through 2.3.0 lacks a certain e_TOKEN protection mechanism.

Severity: MEDIUM
CVSS v2 base score: 6.8 (AV:N/AC:M/Au:N/C:P/I:P/A:P)
CVSS v3 base score: 8.8, HIGH (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-352
cwe_name: Cross-Site Request Forgery (CSRF)
description: The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
extended_description: When a web server is designed to receive a request from a client without any mechanism for verifying that it was intentionally sent, then it might be possible for an attacker to trick a client into making an unintentional request to the web server which will be treated as an authentic request. This can be done via a URL, image load, XMLHttpRequest, etc. and can result in exposure of data or unintended code execution.
         

Fix information:
repo_url: https://github.com/e107inc/e107
commit_details: repo_url: https://github.com/e107inc/e107
author: Cameron
author_date: 2021-03-01 16:41:09-08:00
msg: e_TOKEN added.
repository: repo_url: https://github.com/e107inc/e107
repo_name: e107inc/e107
description: e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107 
repo_language: PHP
owner: e107inc
file_changes: filename: usersettings.php
change_type: ModificationType.MODIFY
diff: @@ -21,7 +21,10 @@ Admin log events:
 USET_01 - admin changed user data
 */
 
-
+if(!empty($_POST) && !isset($_POST['e-token']))
+{
+	$_POST['e-token'] = '';
+}
 require_once ('class2.php');
 
 // TODO - Remove all the adminEdit stuff. 
@@ -1032,6 +1035,7 @@ class usersettings_front // Begin Usersettings rewrite.
 				<input type='hidden' name='updated_key' value='{$validation_key}' />
 				<input type='hidden' name='updated_extended' value='{$updated_extended}' />
 				<input type='hidden' name='extended_key' value='{$extended_key}' />
+				<input type='hidden' name='e-token' value='".defset('e_TOKEN')."' />
 				</td></tr>
 				<tr><td>&nbsp;</td></tr>
 				<tr><td style='text-align:center'>
@@ -1085,8 +1089,6 @@ class usersettings_front // Begin Usersettings rewrite.
 
 		$text = '<form method="post" action="'.$target.'" id="dataform" class="usersettings-form form-horizontal"  enctype="multipart/form-data" autocomplete="off">';
 
-		//$text = (is_numeric($_uid) ? $rs->form_open("post", e_SELF."?".e_QUERY, "dataform", "", " class='form-horizontal' role='form' enctype='multipart/form-data'") : $rs->form_open("post", e_SELF, "dataform", "", " class='form-horizontal' role='form' enctype='multipart/form-data'"));
-
 		if (e_QUERY == "update")
 		{
 			$text .= "<div class='fborder' style='text-align:center'><br />".str_replace("*", "<span class='required'>*</span>", LAN_USET_9)."<br />".LAN_USET_10."<br /><br /></div>";
@@ -1102,6 +1104,7 @@ class usersettings_front // Begin Usersettings rewrite.
 
 
 		$text .= "<div><input type='hidden' name='_uid' value='{$uuid}' /></div>
+				<input type='hidden' name='e-token' value='".defset('e_TOKEN')."' />
 		</form>
 		";
 
@@ -1110,9 +1113,6 @@ class usersettings_front // Begin Usersettings rewrite.
 		$ns->tablerender($caption, $text);
 
 
-
-
-
 	}
 
 

programming_language: PHP