CVE-2016-8901 (published 2019-05-23T18:29Z)

b2evolution 6.7.6 suffer from an Object Injection vulnerability in /htsrv/call_plugin.php.

Severity: HIGH
CVSS v2 base score: 7.5 (AV:N/AC:L/Au:N/C:P/I:P/A:P)
CVSS v3 base score: 9.8, CRITICAL (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-74
cwe_name: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
description: The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
extended_description: Software or other automated logic has certain assumptions about what constitutes data and control respectively. It is the lack of verification of these assumptions for user-controlled input that leads to injection problems. Injection problems encompass a wide variety of issues -- all mitigated in very different ways and usually attempted in order to alter the control flow of the process. For this reason, the most effective way to discuss these weaknesses is to note the distinct features that classify them as injection weaknesses. The most important issue to note is that all injection problems share one thing in common -- i.e., they allow for the injection of control plane data into the user-controlled data plane. This means that the execution of the process may be altered by sending code in through legitimate data channels, using no other mechanism. While buffer overflows, and many other flaws, involve the use of some further issue to gain execution, injection problems need only for the data to be parsed.
         

Fix information:
repo_url: https://github.com/b2evolution/b2evolution
commit_details: repo_url: https://github.com/b2evolution/b2evolution
author: yurabakhtin
author_date: 2016-10-03 10:40:07+03:00
msg: Fix object injection vulnerability
repository: repo_url: https://github.com/b2evolution/b2evolution
repo_name: b2evolution/b2evolution
description: b2evolution CMS: Multiblog/CMS content publishing + forums + email marketing + social network + more... b2evolution includes everything you need to run and maintain a modern website. Optimized for low maintenance with easy upgrades and effective antispam. Full RWD & bootstrap support.
repo_language: PHP
owner: b2evolution
file_changes: filename: call_plugin.php
change_type: ModificationType.MODIFY
diff: @@ -36,7 +36,7 @@ if( is_null( $params ) )
 }
 else
 {	// Params given:
-	if( ( substr( $params, 0, 2 ) == 'a:' ) && ( ! preg_match( '/(;|{|})O:\+?[0-9]+:"/', $params ) ) )
+	if( ( substr( $params, 0, 2 ) == 'a:' ) && ( ! preg_match( '/(s:\d+:"[^"]*"|i:\d+)(;|{|})O:\+?[0-9]+:"/', $params ) ) )
 	{	// Allow to unserialize only arrays + check there is no Object in the array (We NEVER want to unserialize an object)
 		// (This may result in "false", but this means that unserializing failed)
 		$params = @unserialize( $params );

programming_language: PHP
repo_url: https://github.com/b2evolution/b2evolution
commit_details: repo_url: https://github.com/b2evolution/b2evolution
author: yurabakhtin
author_date: 2016-09-28 07:23:33+03:00
msg: Fix object injection vulnerability
repository: repo_url: https://github.com/b2evolution/b2evolution
repo_name: b2evolution/b2evolution
description: b2evolution CMS: Multiblog/CMS content publishing + forums + email marketing + social network + more... b2evolution includes everything you need to run and maintain a modern website. Optimized for low maintenance with easy upgrades and effective antispam. Full RWD & bootstrap support.
repo_language: PHP
owner: b2evolution
file_changes: filename: call_plugin.php
change_type: ModificationType.MODIFY
diff: @@ -30,13 +30,21 @@ param( 'plugin_ID', 'integer', true );
 param( 'method', 'string', '' );
 param( 'params', 'string', null ); // serialized
 
-if( is_null($params) )
-{ // Default:
+if( is_null( $params ) )
+{	// Use empty array by default if params are not sent by request:
 	$params = array();
 }
 else
-{ // params given. This may result in "false", but this means that unserializing failed.
-	$params = @unserialize($params);
+{	// Params given:
+	if( substr( $params, 0, 2 ) == 'a:' )
+	{	// Allow to unserialize only arrays, to avoid object injection vulnerability:
+		// (This may result in "false", but this means that unserializing failed)
+		$params = @unserialize( $params );
+	}
+	else
+	{	// Restrict all non array params to empty array:
+		$params = array();
+	}
 }
 
 

programming_language: PHP