hitoshura25/cvefixes huggingface dataset:
CVE-2014-4502 (C, published 2014-07-23T14:55Z)
Description: value: Multiple heap-based buffer overflows in the parse_notify function in sgminer before 4.2.2, cgminer before 4.3.5, and BFGMiner before 4.1.0 allow remote pool servers to have unspecified impact via a (1) large or (2) negative value in the Extranonc2_size parameter in a mining.subscribe response and a crafted mining.notify request.
Severity: HIGH (CVSS v3 base score: )
Weakness: CWE-119 \u2014 Improper Restriction of Operations within the Bounds of a Memory Buffer
The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.
Repository: https://github.com/ckolivas/cgminer
Files changed:
util.c
Commit message: Do some random sanity checking for stratum message parsing


Vulnerable code:
 * Copyright 2011-2013 Con Kolivas
	sprintf(url_address, "%.*s", url_len, url_begin);
	if (!job_id || !prev_hash || !coinbase1 || !coinbase2 || !bbversion || !nbit || !ntime) {
		if (job_id)
			free(job_id);
		if (coinbase1)
			free(coinbase1);
		if (coinbase2)
			free(coinbase2);
	sprintf(address, "%s:%s", url, port);
	if (!nonce1) {
		applog(LOG_INFO, "Failed to get nonce1 in initiate_stratum");
	if (!n2size) {
		applog(LOG_INFO, "Failed to get n2size in initiate_stratum");

Fixed code:
 * Copyright 2011-2014 Con Kolivas
static bool _valid_hex(char *s, const char *file, const char *func, const int line)
{
	bool ret = false;
	int i, len;

	if (unlikely(!s)) {
		applog(LOG_ERR, "Null string passed to valid_hex from"IN_FMT_FFL, file, func, line);
		return ret;
	}
	len = strlen(s);
	if (unlikely(!len)) {
		applog(LOG_ERR, "Zero length string passed to valid_hex from"IN_FMT_FFL, file, func, line);
		return ret;
	}
	for (i = 0; i < len; i++) {
		unsigned char idx = s[i];

		if (unlikely(hex2bin_tbl[idx] < 0)) {
			applog(LOG_ERR, "Invalid char %x passed to valid_hex from"IN_FMT_FFL, idx, file, func, line);
			return ret;
		}
	}
	ret = true;
	return ret;
}

#define valid_hex(s) _valid_hex(s, __FILE__, __func__, __LINE__)

	snprintf(url_address, 254, "%.*s", url_len, url_begin);
	if (!valid_hex(job_id) || !valid_hex(prev_hash) || !valid_hex(coinbase1) ||
	    !valid_hex(coinbase2) || !valid_hex(bbversion) || !valid_hex(nbit) ||
	    !valid_hex(ntime)) {
		free(job_id);
		free(coinbase1);
		free(coinbase2);
	snprintf(address, 254, "%s:%s", url, port);
	if (!valid_hex(nonce1)) {
		applog(LOG_INFO, "Failed to get valid nonce1 in initiate_stratum");
	if (n2size < 2 || n2size > 16) {
		applog(LOG_INFO, "Failed to get valid n2size in initiate_stratum");
CVE-2022-4867 (PHP, published 2022-12-31T09:15Z)
Description: value: Cross-Site Request Forgery (CSRF) in GitHub repository froxlor/froxlor prior to 2.0.0-beta1.
Severity: nan (CVSS v3 base score: 4.3)
Weakness: CWE-352 \u2014 Cross-Site Request Forgery (CSRF)
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.
Repository: https://github.com/froxlor/froxlor
Files changed:
admin_apcuinfo.php
admin_opcacheinfo.php
lng/de.lng.php
lng/en.lng.php
Commit message: fix csrf for clearing apcu/opcache cache

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>


Vulnerable code:
	apcu_clear_cache();
	$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "cleared APCu cache");
	header('Location: ' . $linker->getLink([
		]));
	exit();
	opcache_reset();
	$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "reset OPcache");
	header('Location: ' . $linker->getLink([
		]));
	exit();

Fixed code:
use Froxlor\UI\HTML;
	if ($_POST['send'] == 'send') {
		apcu_clear_cache();
		$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "cleared APCu cache");
		header('Location: ' . $linker->getLink([
				'section' => 'apcuinfo',
				'page' => 'showinfo'
			]));
		exit();
	} else {
		HTML::askYesNo('cache_reallydelete', $filename, [
			'page' => $page,
			'action' => 'delete',
		], '', [
		]);
	}
use Froxlor\UI\HTML;
	if ($_POST['send'] == 'send') {
		opcache_reset();
		$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "reset OPcache");
		header('Location: ' . $linker->getLink([
				'section' => 'opcacheinfo',
				'page' => 'showinfo'
			]));
		exit();
	} else {
		HTML::askYesNo('cache_reallydelete', $filename, [
			'page' => $page,
			'action' => 'reset',
		], '', [
		]);
	}
		'cache_reallydelete' => 'Wollen Sie den Cache wirklich leeren?',
		'cache_reallydelete' => 'Do you really want to clear the cache?',
CVE-2022-4868 (PHP, published 2022-12-31T10:15Z)
Description: value: Improper Authorization in GitHub repository froxlor/froxlor prior to 2.0.0-beta1.
Severity: nan (CVSS v3 base score: 4.3)
Weakness: CWE-285 \u2014 Improper Authorization
The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.
Repository: https://github.com/froxlor/froxlor
Files changed:
admin_cronjobs.php
admin_ipsandports.php
admin_mysqlserver.php
lib/Froxlor/Api/Commands/IpsAndPorts.php
Commit message: dont show page content for resellers withouth required permissions to actually do something

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>


Vulnerable code:
if ($page == 'cronjobs' || $page == 'overview') {
if ($page == 'ipsandports' || $page == 'overview') {
if ($page == 'mysqlserver' || $page == 'overview') {
		if ($this->isAdmin() && ($this->getUserDetail('change_serversettings') || !empty($this->getUserDetail('ip')))) {

Fixed code:
if (($page == 'cronjobs' || $page == 'overview') && $userinfo['change_serversettings'] == '1') {
if (($page == 'ipsandports' || $page == 'overview') && $userinfo['change_serversettings'] == '1') {
if (($page == 'mysqlserver' || $page == 'overview') && $userinfo['change_serversettings'] == '1') {
		if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) {
CVE-2023-0315 (PHP, published 2023-01-16T01:15Z)
Description: value: Command Injection in GitHub repository froxlor/froxlor prior to 2.0.8.
Severity: nan (CVSS v3 base score: 8.8)
Weakness: CWE-77 \u2014 Improper Neutralization of Special Elements used in a Command ('Command Injection')
The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.
Repository: https://github.com/froxlor/froxlor
Files changed:
install/froxlor.sql.php
install/updates/froxlor/update_2.x.inc.php
lib/Froxlor/Froxlor.php
lib/Froxlor/FroxlorLogger.php
lib/configfiles/bionic.xml
lng/de.lng.php
lng/en.lng.php
Commit message: set file-log (if enabled) to be in froxlor/logs/ folder; fix ssl param directive for dovecot in Ubuntu Bionic; set version to 2.0.8

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>


Vulnerable code:
	('system', 'update_notify_last', '2.0.7'),
	('panel', 'version', '2.0.7'),
	const VERSION = '2.0.7';
						$logger_logfile = Settings::Get('logger.logfile');
							Settings::Set('logger.logfile', '/tmp/froxlor.log');
# SSL DH parameters
# Generate new params with `openssl dhparam -out /etc/dovecot/dh.pem 4096`
# Or migrate from old ssl-parameters.dat file with the command dovecot
# gives on startup when ssl_dh is unset.
ssl_dh = </usr/share/dovecot/dh.pem
			'logfile' => 'Log-Datei Pfad inklusive Dateinamen',
			'logfile' => 'Logfile path including filename',

Fixed code:
	('system', 'update_notify_last', '2.0.8'),
	('panel', 'version', '2.0.8'),

if (Froxlor::isFroxlorVersion('2.0.7')) {
	Update::showUpdateStep("Updating from 2.0.7 to 2.0.8", false);

	// adjust file-logging to be set to froxlor/logs/
	$logtypes = explode(',', Settings::Get('logger.logtypes'));
	if (in_array('file', $logtypes)) {
		Update::showUpdateStep("Adjusting froxlor logfile for system-logging to be stored in logs/froxlor.log");
		Settings::Set('logger.logfile', 'froxlor.log');
		Update::lastStepStatus(0);
	}

	Froxlor::updateToVersion('2.0.8');
}
	const VERSION = '2.0.8';
						$logger_logfile = FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/logs/' . Settings::Get('logger.logfile'));
							Settings::Set('logger.logfile', 'froxlor.log');
							$logger_logfile = FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/logs/froxlor.log');
							@touch($logger_logfile);
							if (empty($logger_logfile) || !is_writable($logger_logfile)) {
								// not writable in our own directory? Skip
								break;
							}
ssl_dh_parameters_length = 2048
			'logfile' => [
				'title' => 'Dateiname der Logdatei',
				'description' => 'Wird nur verwendet, wenn die Log-Art "file" ausgewählt ist. Diese Datei wird unter froxlor/logs/ geschrieben. Dieser Ordner ist vor Webzugriff geschützt.',
			],
			'logfile' => [
				'title' => 'Filename for log',
				'description' => 'Only used if log-type includes "file". This file will be created in froxlor/logs/. This folder is protected against public access.',
			],
CVE-2023-0316 (PHP, published 2023-01-16T01:15Z)
Description: value: Path Traversal: '\..\filename' in GitHub repository froxlor/froxlor prior to 2.0.0.
Severity: nan (CVSS v3 base score: 5.5)
Weakness: CWE-29 \u2014 Path Traversal: '\..\filename'
The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '\..\filename' (leading backslash dot dot) sequences that can resolve to a location that is outside of that directory.
Repository: https://github.com/froxlor/froxlor
Files changed:
lib/Froxlor/SImExporter.php
Commit message: validate image data/filename when importing

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>


Vulnerable code:
					file_put_contents(Froxlor::getInstallDir() . '/' . explode('?', $_data[$index_split[0] . '.' . $index_split[1]], 2)[0], base64_decode($value));

Fixed code:
					$img_data = base64_decode($value);
					$img_filename = Froxlor::getInstallDir() . '/' . str_replace('../', '', explode('?', $_data[$index_split[0] . '.' . $index_split[1]], 2)[0]);

					file_put_contents($img_filename, $img_data);

					if (function_exists('finfo_open')) {
						$finfo = finfo_open(FILEINFO_MIME_TYPE);
						$mimetype = finfo_file($finfo, $img_filename);
						finfo_close($finfo);
					} else {
						$mimetype = mime_content_type($img_filename);
					}
					if (empty($mimetype)) {
						$mimetype = 'application/octet-stream';
					}
					if (!in_array($mimetype, ['image/jpeg', 'image/jpg', 'image/png', 'image/gif'])) {
						@unlink($img_filename);
						throw new Exception("Uploaded file is not a valid image");
					}

					$spl = explode('.', $img_filename);
					$file_extension = strtolower(array_pop($spl));
					unset($spl);

					if (!in_array($file_extension, [
						'jpeg',
						'jpg',
						'png',
						'gif'
					])) {
						@unlink($img_filename);
						throw new Exception("Invalid file-extension, use one of: jpeg, jpg, png, gif");
					}
CVE-2023-0564 (PHP, published 2023-01-29T01:15Z)
Description: value: Weak Password Requirements in GitHub repository froxlor/froxlor prior to 2.0.10.


Severity: nan (CVSS v3 base score: 7.5)
Weakness: CWE-521 \u2014 Weak Password Requirements
The product does not require that users should have strong passwords, which makes it easier for attackers to compromise user accounts.
Repository: https://github.com/froxlor/froxlor
Files changed:
lib/Froxlor/Api/Commands/DirProtections.php
Commit message: enforce password requirements set in settings for directory-protection

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>


Vulnerable code:
		Validate::validate($password, 'password', '', '', [], true);
		Validate::validate($password, 'password', '', '', [], true);

Fixed code:
		$password = Validate::validate($password, 'password', '', '', [], true);
		$password = Crypt::validatePassword($password, true);
		$password = Validate::validate($password, 'password', '', '', [], true);
		$password = Crypt::validatePassword($password, true);
CVE-2023-0565 (PHP, published 2023-01-29T22:15Z)
Description: value: Business Logic Errors in GitHub repository froxlor/froxlor prior to 2.0.10.


Severity: nan (CVSS v3 base score: 4.9)
Weakness: CWE-840 \u2014 Business Logic Errors
Weaknesses in this category identify some of the underlying problems that commonly allow attackers to manipulate the business logic of an application. Errors in business logic can be devastating to an entire application. They can be difficult to find automatically, since they typically involve legitimate use of the application's functionality. However, many business logic errors can exhibit patterns that are similar to well-understood implementation and design weaknesses.
Repository: https://github.com/froxlor/froxlor
Files changed:
admin_templates.php
lng/de.lng.php
lng/en.lng.php
Commit message: validate existence of language in admin-templates

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>


Vulnerable code:

Fixed code:
		if (!array_key_exists($language, $languages)) {
			Response::standardError('templatelanguageinvalid');
		}
		if (!array_key_exists($language, $languages)) {
			Response::standardError('templatelanguageinvalid');
		}
		'templatelanguageinvalid' => 'Die gewählte Sprache existiert nicht',
		'templatelanguageinvalid' => 'The selected language does not exist',
CVE-2023-0566 (PHP, published 2023-01-29T22:15Z)
Description: value: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in froxlor/froxlor prior to 2.0.10.


Severity: nan (CVSS v3 base score: 4.8)
Weakness: CWE-79 \u2014 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
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.
Repository: https://github.com/froxlor/froxlor
Files changed:
lib/Froxlor/Api/Commands/Cronjobs.php
lng/de.lng.php
lng/en.lng.php
Commit message: verify cronjob interval is one of the fixed available values

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>


Vulnerable code:

Fixed code:
use Froxlor\UI\Response;
	private array $allowed_intervals = [
		'MINUTE',
		'HOUR',
		'DAY',
		'WEEK',
		'MONTH'
	];

			if (!in_array(strtoupper($interval_interval), $this->allowed_intervals)) {
				Response::standardError('invalidcronjobintervalvalue', implode(", ", $this->allowed_intervals), true);
			}

		'invalidcronjobintervalvalue' => 'Cronjob Intervall muss einer der folgenden Werte sein: %s',
		'invalidcronjobintervalvalue' => 'Cronjob interval must be one of: %s',
CVE-2023-0572 (PHP, published 2023-01-29T23:15Z)
Description: value: Unchecked Error Condition in GitHub repository froxlor/froxlor prior to 2.0.10.


Severity: nan (CVSS v3 base score: 5.3)
Weakness: CWE-754 \u2014 Improper Check for Unusual or Exceptional Conditions
The product does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the product.
Repository: https://github.com/froxlor/froxlor
Files changed:
error_report.php
Commit message: add missing use statement for error-reporting to include the dbms version

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>


Vulnerable code:

Fixed code:
use Froxlor\Database\Database;
CVE-2023-1033 (PHP, published 2023-02-25T01:15Z)
Description: value: Cross-Site Request Forgery (CSRF) in GitHub repository froxlor/froxlor prior to 2.0.11.
Severity: nan (CVSS v3 base score: 8.8)
Weakness: CWE-352 \u2014 Cross-Site Request Forgery (CSRF)
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.
Repository: https://github.com/froxlor/froxlor
Files changed:
lib/Froxlor/Ajax/Ajax.php
lib/Froxlor/UI/Listing.php
lib/tablelisting/admin/tablelisting.domains.php
lib/tablelisting/customer/tablelisting.htaccess.php
lib/tablelisting/customer/tablelisting.mysqls.php
lib/tablelisting/tablelisting.dns.php
Commit message: check for existing fields when setting/updating tablelisting-columns

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>


Vulnerable code:
		foreach ((Request::any('columns') ?? []) as $value) {
			Listing::storeColumnListingForUser([Request::any('listing') => $columns]);
		Listing::deleteColumnListingForUser([Request::any('listing') => []]);
	 * @return bool
	public static function storeColumnListingForUser(array $tabellisting): bool
		return true;
		'empty_msg' => $customerCollection->count() == 0 ? lng('admin.domain_nocustomeraddingavailable') : '',

Fixed code:
		foreach ((Request::post('columns') ?? []) as $value) {
			$columns = Listing::storeColumnListingForUser([Request::post('listing') => $columns]);
		Listing::deleteColumnListingForUser([Request::post('listing') => []]);
use Froxlor\Froxlor;
	 * @return array
	public static function storeColumnListingForUser(array $tabellisting): array
		// include all possible tablelisting-definitions to check for the right section
		foreach(glob(Froxlor::getInstallDir().'lib/tablelisting/{,*/}*.php', GLOB_BRACE) as $tbl_file) {
			$table_listings = include $tbl_file;
			if (!isset($table_listings[$section])) {
				continue;
			} else {
				break;
			}
		}
		$columns_available = array_keys($table_listings[$section]['columns']);
		// filter out unknown columns
		foreach ($tabellisting[$section] as $index => $column_changed) {
			if (!in_array($column_changed, $columns_available)) {
				unset($tabellisting[$section][$index]);
			}
		}
		return $tabellisting[$section];
// used outside scope variables
$customerCollectionCount = !is_null($customerCollection ?? null) ? $customerCollection->count() : 0;

		'empty_msg' => $customerCollectionCount == 0 ? lng('admin.domain_nocustomeraddingavailable') : '',
// used outside scope variables
$cperlenabled = $cperlenabled ?? false;

// used outside scope variables
$multiple_mysqlservers = $multiple_mysqlservers ?? false;

// used outside scope variables
$domain = $domain ?? '';
$domain_id = $domain_id ?? '';
CVE-2023-1307 (PHP, published 2023-03-10T01:15Z)
Description: value: Authentication Bypass by Primary Weakness in GitHub repository froxlor/froxlor prior to 2.0.13.
Severity: nan (CVSS v3 base score: 9.8)
Weakness: CWE-305 \u2014 Authentication Bypass by Primary Weakness
The authentication algorithm is sound, but the implemented mechanism can be bypassed as the result of a separate weakness that is primary to the authentication error.
Repository: https://github.com/froxlor/froxlor
Files changed:
lib/Froxlor/System/Crypt.php
Commit message: type-safe comparsion of md5-compatibility hash-validation

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>


Vulnerable code:
		if ($pwd_hash == $pwd_check || password_verify($password, $pwd_hash)) {

Fixed code:
		if ($pwd_hash === $pwd_check || password_verify($password, $pwd_hash)) {
CVE-2023-3172 (PHP, published 2023-06-09T01:15Z)
Description: value: Path Traversal in GitHub repository froxlor/froxlor prior to 2.0.20.
Severity: nan (CVSS v3 base score: 7.2)
Weakness: CWE-22 \u2014 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
Repository: https://github.com/froxlor/froxlor
Files changed:
admin_autoupdate.php
Commit message: secure filename of local-archive in webupdate

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>


Vulnerable code:
use Froxlor\Http\HttpClient;
		$localArchive = Froxlor::getInstallDir() . '/updates/' . $toExtract;
		$localArchive = Froxlor::getInstallDir() . '/updates/' . $toExtract;

Fixed code:
use Froxlor\FileDir;
		$localArchive = FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/updates/' . $toExtract);
		$localArchive = FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/updates/' . $toExtract);
CVE-2023-3192 (PHP, published 2023-06-11T11:15Z)
Description: value: Session Fixation in GitHub repository froxlor/froxlor prior to 2.1.0.
Severity: nan (CVSS v3 base score: 5.4)
Weakness: CWE-384 \u2014 Session Fixation
Authenticating a user, or otherwise establishing a new user session, without invalidating any existing session identifier gives an attacker the opportunity to steal authenticated sessions.
Repository: https://github.com/froxlor/froxlor
Files changed:
admin_customers.php
admin_index.php
index.php
Commit message: regenerate session-id after login / su-action

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>


Vulnerable code:

Fixed code:
			session_regenerate_id();
		session_regenerate_id();
		session_regenerate_id();
CVE-2023-3668 (PHP, published 2023-07-14T01:15Z)
Description: value: Improper Encoding or Escaping of Output in GitHub repository froxlor/froxlor prior to 2.0.21.
Severity: nan (CVSS v3 base score: 7.2)
Weakness: CWE-116 \u2014 Improper Encoding or Escaping of Output
The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.
Repository: https://github.com/froxlor/froxlor
Files changed:
admin_configfiles.php
Commit message: validate generated config-json parameter string

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>


Vulnerable code:

Fixed code:
use Froxlor\Validate\Validate;
		$valid_keys = ['http', 'dns', 'smtp', 'mail', 'ftp', 'system', 'distro'];
		// validate params
		foreach ($params as $key => $value) {
			if (!in_array($key, $valid_keys)) {
				unset($params[$key]);
				continue;
			}
			if (!is_array($value)) {
				$params[$key] = Validate::validate($value, $key);
			} else {
				foreach ($value as $subkey => $subvalue) {
					$params[$key][$subkey] = Validate::validate($subvalue, $key.'.'.$subkey);
				}
			}
		}