CVE-2021-38290 (published 2021-08-09T11:15Z)

A host header attack vulnerability exists in FUEL CMS 1.5.0 through fuel/modules/fuel/config/fuel_constants.php and fuel/modules/fuel/libraries/Asset.php. An attacker can use a man in the middle attack such as phishing.

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.1, HIGH (CVSS:3.1/AV:N/AC:H/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/daylightstudio/FUEL-CMS
commit_details: repo_url: https://github.com/daylightstudio/FUEL-CMS
author: David McReynolds
author_date: 2021-08-06 11:21:48-07:00
msg: fix: issue #580 using $_SERVER[‘HTTP_HOST’]
repository: repo_url: https://github.com/daylightstudio/FUEL-CMS
repo_name: daylightstudio/FUEL-CMS
description: A CodeIgniter Content Management System
repo_language: PHP
owner: daylightstudio
file_changes: filename: fuel_constants.php
change_type: ModificationType.MODIFY
diff: @@ -70,7 +70,7 @@ foreach ($config['modules_allowed'] as $module)
 
 if ( ! defined('BASE_URL'))
 {
-	$_base_path = $_SERVER['HTTP_HOST'].str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
+	$_base_path = $_SERVER['SERVER_NAME'].str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
 
 	if ( ! empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' OR $_SERVER['SERVER_PORT'] == 443)
 	{

programming_language: PHP
filename: Asset.php
change_type: ModificationType.MODIFY
diff: @@ -501,7 +501,7 @@ class Asset {
 		if ($absolute)
 		{
 			$protocol = ($_SERVER["SERVER_PORT"] == 443) ? "https://" : "http://";
-			$path = $protocol.$_SERVER['HTTP_HOST'].$path;
+			$path = $protocol.$_SERVER['SERVER_NAME'].$path;
 		}
 		return $path;
 	}

programming_language: PHP
filename: index.php
change_type: ModificationType.MODIFY
diff: @@ -110,7 +110,7 @@ else
 				$path = str_replace(array(':any', '*'), '.*', str_replace(':num', '[0-9]+', $path));
 
 				// Does the RegEx match?
-				if (!empty($_SERVER['HTTP_HOST']) AND preg_match('#^'.$path.'$#', $_SERVER['HTTP_HOST']))
+				if (!empty($_SERVER['SERVER_NAME']) AND preg_match('#^'.$path.'$#', $_SERVER['SERVER_NAME']))
 				{
 					define('ENVIRONMENT', $env);
 					break 2;

programming_language: PHP